Files
Obosky_Ronghua/serve/tf/static/js/chunk-6a5b4dbe.21157920.js
2023-10-17 09:15:30 +08:00

116 lines
3.6 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6a5b4dbe"],{"0052":function(t,e,n){"use strict";function r(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach((function(e){e&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t}function i(t){return Object.prototype.toString.call(t)}function o(t){return"[object String]"===i(t)}function a(t){return"[object Object]"===i(t)}function s(t){return"[object RegExp]"===i(t)}function l(t){return"[object Function]"===i(t)}function c(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var u={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function d(t){return Object.keys(t||{}).reduce((function(t,e){return t||u.hasOwnProperty(e)}),!1)}var h={"http:":{validate:function(t,e,n){var r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){var r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&":"===t[e-3]||e>=3&&"/"===t[e-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){var r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},p="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",f="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function g(t){t.__index__=-1,t.__text_cache__=""}function m(t){return function(e,n){var r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function v(){return function(t,e){e.normalize(t)}}function b(t){var e=t.re=n("e15d")(t.__opts__),r=t.__tlds__.slice();function i(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||r.push(p),r.push(e.src_xn),e.src_tlds=r.join("|"),e.email_fuzzy=RegExp(i(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(i(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(i(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(i(e.tpl_host_fuzzy_test),"i");var u=[];function d(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach((function(e){var n=t.__schemas__[e];if(null!==n){var r={validate:null,link:null};if(t.__compiled__[e]=r,a(n))return s(n.validate)?r.validate=m(n.validate):l(n.validate)?r.validate=n.validate:d(e,n),void(l(n.normalize)?r.normalize=n.normalize:n.normalize?d(e,n):r.normalize=v());o(n)?u.push(e):d(e,n)}})),u.forEach((function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)})),t.__compiled__[""]={validate:null,normalize:v()};var h=Object.keys(t.__compiled__).filter((function(e){return e.length>0&&t.__compiled__[e]})).map(c).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><]|"+e.src_ZPCc+"))("+h+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><]|"+e.src_ZPCc+"))("+h+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),g(t)}function y(t,e){var n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function w(t,e){var n=new y(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function x(t,e){if(!(this instanceof x))return new x(t,e);e||d(t)&&(e=t,t={}),this.__opts__=r({},u,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},h,t),this.__compiled__={},this.__tlds__=f,this.__tlds_replaced__=!1,this.re={},b(this)}x.prototype.add=function(t,e){return this.__schemas__[t]=e,b(this),this},x.prototype.set=function(t){return this.__opts__=r(this.__opts__,t),this},x.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,n,r,i,o,a,s,l,c;if(this.re.schema_test.test(t)){s=this.re.schema_search,s.lastIndex=0;while(null!==(e=s.exec(t)))if(i=this.testSchemaAt(t,e[2],s.lastIndex),i){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&null!==(n=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=n.index+n[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=t.indexOf("@"),c>=0&&null!==(r=t.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0},x.prototype.pretest=function(t){return this.re.pretest.test(t)},x.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},x.prototype.match=function(t){var e=0,n=[];this.__index__>=0&&this.__text_cache__===t&&(n.push(w(this,e)),e=this.__last_index__);var r=e?t.slice(e):t;while(this.test(r))n.push(w(this,e)),r=r.slice(this.__last_index__),e+=this.__last_index__;return n.length?n:null},x.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;var e=this.re.schema_at_start.exec(t);if(!e)return null;var n=this.testSchemaAt(t,e[2],e[0].length);return n?(this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+n,w(this,0)):null},x.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter((function(t,e,n){return t!==n[e-1]})).reverse(),b(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,b(this),this)},x.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},x.prototype.onCompile=function(){},t.exports=x},"0094":function(t,e,n){"use strict";var r,i=n("da84"),o=n("e330"),a=n("6964"),s=n("f183"),l=n("6d61"),c=n("acac"),u=n("861d"),d=n("4fad"),h=n("69f3").enforce,p=n("cdce"),f=!i.ActiveXObject&&"ActiveXObject"in i,g=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},m=l("WeakMap",g,c);if(p&&f){r=c.getConstructor(g,"WeakMap",!0),s.enable();var v=m.prototype,b=o(v["delete"]),y=o(v.has),w=o(v.get),x=o(v.set);a(v,{delete:function(t){if(u(t)&&!d(t)){var e=h(this);return e.frozen||(e.frozen=new r),b(this,t)||e.frozen["delete"](t)}return b(this,t)},has:function(t){if(u(t)&&!d(t)){var e=h(this);return e.frozen||(e.frozen=new r),y(this,t)||e.frozen.has(t)}return y(this,t)},get:function(t){if(u(t)&&!d(t)){var e=h(this);return e.frozen||(e.frozen=new r),y(this,t)?w(this,t):e.frozen.get(t)}return w(this,t)},set:function(t,e){if(u(t)&&!d(t)){var n=h(this);n.frozen||(n.frozen=new r),y(this,t)?x(this,t,e):n.frozen.set(t,e)}else x(this,t,e);return this}})}},"0381":function(t,e,n){"use strict";var r=n("7ec2").default,i=n("7037").default;n("b64b"),n("a4d3"),n("4de4"),n("d3b7"),n("e439"),n("159b"),n("dbb4"),n("d9e2"),n("131a"),n("3410"),n("f8c9"),n("4ae1"),n("5d41"),n("b0c0"),n("99af"),n("7db0"),n("ac1f"),n("1276"),n("498a"),n("a15b"),n("5319"),n("25f0"),n("b680"),n("2cfe"),Object.defineProperty(e,"__esModule",{value:!0});var o=n("a57f");function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){p(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){l(o,r,i,a,s,"next",t)}function s(t){l(o,r,i,a,s,"throw",t)}a(void 0)}))}}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function h(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function p(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(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}function m(t,e){return m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},m(t,e)}function v(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function b(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(t,e){if(e&&("object"===i(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return b(t)}function w(t){var e=v();return function(){var n,r=g(t);if(e){var i=g(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return y(this,n)}}function x(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=g(t),null===t)break;return t}function C(){return C="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=x(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},C.apply(this,arguments)}function k(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var A='[data-card-key="audio"] {\n outline: 1px solid #ddd;\n border-radius: 54px;\n}\n .data-audio-content {\n position: relative;\n height: 54px;\n background: #f7f7f7;\n }\n .data-audio-content audio {\n width: 100%;\n outline: none;\n }\n .data-audio-uploading,\n .data-audio-uploaded,\n .data-audio-error {\n border: 1px solid #e6e6e6;\n border-radius: 54px;\n background: #f6f6f6;\n }\n .data-audio-done {\n height: auto;\n border: none;\n background: none;\n line-height: 0;\n }\n .data-audio-active {\n outline: 1px solid #d9d9d9;\n border-radius: 54px;\n }\n .data-audio-center {\n position: absolute;\n top: 50%;\n margin-top: -48px;\n width: 100%;\n height: 96px;\n }\n .data-audio-center .data-audio-icon,\n .data-audio-center .data-audio-name,\n .data-audio-center .data-audio-message,\n .data-audio-center .data-audio-progress,\n .data-audio-center .data-audio-transcoding {\n text-align: center;\n }\n .data-audio-center .data-audio-icon {\n font-size: 24px;\n color: #BFBFBF;\n margin-bottom: 12px;\n }\n .data-audio-center .data-audio-name {\n color: #595959;\n margin-bottom: 12px;\n }\n .data-audio-center .data-audio-message {\n color: #595959;\n }\n .data-audio-center .data-audio-anticon {\n display: inline-block;\n font-style: normal;\n vertical-align: -0.125em;\n text-align: center;\n text-transform: none;\n line-height: 0;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n margin-right: 5px;\n }\n .data-audio-center .data-audio-anticon .data-audio-anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n }\n .data-audio-center .data-error-icon {\n width: 16px;\n height: 16px;\n display: inline-block;\n background: #F5222D;\n text-align: center;\n font-size: 12px;\n color: #ffffff;\n padding: 1px 0 0 0;\n line-height: 16px;\n border-radius: 100%;\n vertical-align: middle;\n margin: -2px 5px 0 0;\n }';k(A);var S=function(t){f(n,t);var e=w(n);function n(){var t;return u(this,n),t=e.apply(this,arguments),t.onBeforeRender=function(e,n){var r=t.editor.plugin.components["audio"];if(r){var i=r["options"]||{},o=i.onBeforeRender;if(o)return o(e,n)}return n},t.downloadFile=function(){var e=t.getValue();(null===e||void 0===e?void 0:e.download)&&window.open(o.sanitizeUrl(t.onBeforeRender("download",e.url)))},t}return h(n,[{key:"getLocales",value:function(){return this.editor.language.get("audio")}},{key:"renderTemplate",value:function(t){var e=t.name,n=t.status,r=t.size,i=t.message,a=t.percent,s=this.getLocales(),l={audio:'<div class="data-audio-icon">\n <svg width="32px" height="24px" viewBox="0 0 32 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.25"><g transform="translate(-704.000000, -550.000000)" fill="#000000" fill-rule="nonzero"> <g transform="translate(704.000000, 550.000000)"> <g> <path d="M13.09375,17.30625 L20.65625,12.375 C20.95,12.16875 20.95,11.809375 20.65625,11.603125 L13.09375,6.696875 C12.66875,6.4 12,6.6375 12,7.084375 L12,16.921875 C12,17.365625 12.671875,17.603125 13.09375,17.30625 Z" id="Path"></path> <path d="M30,0 L2,0 C0.896875,0 0,0.896875 0,2 L0,22 C0,23.103125 0.896875,24 2,24 L30,24 C31.103125,24 32,23.103125 32,22 L32,2 C32,0.896875 31.103125,0 30,0 Z M5.25,21.25 C5.25,21.525 5.025,21.75 4.75,21.75 L2.5,21.75 C2.225,21.75 2,21.525 2,21.25 L2,18.5 C2,18.225 2.225,18 2.5,18 L4.75,18 C5.025,18 5.25,18.225 5.25,18.5 L5.25,21.25 Z M5.25,13.375 C5.25,13.65 5.025,13.875 4.75,13.875 L2.5,13.875 C2.225,13.875 2,13.65 2,13.375 L2,10.625 C2,10.35 2.225,10.125 2.5,10.125 L4.75,10.125 C5.025,10.125 5.25,10.35 5.25,10.625 L5.25,13.375 Z M5.25,5.5 C5.25,5.775 5.025,6 4.75,6 L2.5,6 C2.225,6 2,5.775 2,5.5 L2,2.75 C2,2.475 2.225,2.25 2.5,2.25 L4.75,2.25 C5.025,2.25 5.25,2.475 5.25,2.75 L5.25,5.5 Z M24.75,21.75 L7.25,21.75 L7.25,2.25 L24.75,2.25 L24.75,21.75 Z M30,21.25 C30,21.525 29.775,21.75 29.5,21.75 L27.25,21.75 C26.975,21.75 26.75,21.525 26.75,21.25 L26.75,18.5 C26.75,18.225 26.975,18 27.25,18 L29.5,18 C29.775,18 30,18.225 30,18.5 L30,21.25 Z M30,13.375 C30,13.65 29.775,13.875 29.5,13.875 L27.25,13.875 C26.975,13.875 26.75,13.65 26.75,13.375 L26.75,10.625 C26.75,10.35 26.975,10.125 27.25,10.125 L29.5,10.125 C29.775,10.125 30,10.35 30,10.625 L30,13.375 Z M30,5.5 C30,5.775 29.775,6 29.5,6 L27.25,6 C26.975,6 26.75,5.775 26.75,5.5 L26.75,2.75 C26.75,2.475 26.975,2.25 27.25,2.25 L29.5,2.25 C29.775,2.25 30,2.475 30,2.75 L30,5.5 Z" id="Shape"></path> </g> </g></g> </g></svg></div>',spin:'<i class="data-audio-anticon"><svg viewBox="0 0 1024 1024" class="data-audio-anticon-spin" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"> <path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></i>',warn:'<div class="data-audio-icon"><svg width="41px" height="29px" viewBox="0 0 41 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-704.000000, -550.000000)"> <g id="Group-2" transform="translate(704.000000, 550.000000)"> <g id="audio" fill="#000000" fill-rule="nonzero" opacity="0.449999988"> <path d="M13.09375,17.30625 C12.671875,17.603125 12,17.365625 12,16.921875 L12,7.084375 C12,6.6375 12.66875,6.4 13.09375,6.696875 L20.65625,11.603125 C20.95,11.809375 20.95,12.16875 20.65625,12.375 L13.09375,17.30625 Z M30,0 C31.103125,0 32,0.896875 32,2 L32,22 C32,23.103125 31.103125,24 30,24 L2,24 C0.896875,24 0,23.103125 0,22 L0,2 C0,0.896875 0.896875,0 2,0 L30,0 Z M5.25,21.25 L5.25,18.5 C5.25,18.225 5.025,18 4.75,18 L2.5,18 C2.225,18 2,18.225 2,18.5 L2,21.25 C2,21.525 2.225,21.75 2.5,21.75 L4.75,21.75 C5.025,21.75 5.25,21.525 5.25,21.25 Z M5.25,13.375 L5.25,10.625 C5.25,10.35 5.025,10.125 4.75,10.125 L2.5,10.125 C2.225,10.125 2,10.35 2,10.625 L2,13.375 C2,13.65 2.225,13.875 2.5,13.875 L4.75,13.875 C5.025,13.875 5.25,13.65 5.25,13.375 Z M5.25,5.5 L5.25,2.75 C5.25,2.475 5.025,2.25 4.75,2.25 L2.5,2.25 C2.225,2.25 2,2.475 2,2.75 L2,5.5 C2,5.775 2.225,6 2.5,6 L4.75,6 C5.025,6 5.25,5.775 5.25,5.5 Z M24.75,21.75 L24.75,2.25 L7.25,2.25 L7.25,21.75 L24.75,21.75 Z M30,21.25 L30,18.5 C30,18.225 29.775,18 29.5,18 L27.25,18 C26.975,18 26.75,18.225 26.75,18.5 L26.75,21.25 C26.75,21.525 26.975,21.75 27.25,21.75 L29.5,21.75 C29.775,21.75 30,21.525 30,21.25 Z M30,13.375 L30,10.625 C30,10.35 29.775,10.125 29.5,10.125 L27.25,10.125 C26.975,10.125 26.75,10.35 26.75,10.625 L26.75,13.375 C26.75,13.65 26.975,13.875 27.25,13.875 L29.5,13.875 C29.775,13.875 30,13.65 30,13.375 Z M30,5.5 L30,2.75 C30,2.475 29.775,2.25 29.5,2.25 L27.25,2.25 C26.975,2.25 26.75,2.475 26.75,2.75 L26.75,5.5 C26.75,5.775 26.975,6 27.25,6 L29.5,6 C29.775,6 30,5.775 30,5.5 Z" id="Combined-Shape"></path> </g> <g id="error-fill" transform="translate(21.000000, 10.000000)"> <rect id="Rectangle" fill="#000000" opacity="0" x="0" y="0" width="20" height="20"></rect> <path d="M19.0267927,16.510301 L19.0272631,16.5111171 C19.4269215,17.2064579 18.9263267,18.0729167 18.125,18.0729167 L1.875,18.0729167 C1.07367326,18.0729167 0.573078461,17.2064579 0.973207261,16.510301 L9.0970084,2.44988987 C9.28650026,2.11750251 9.63068515,1.92708333 10,1.92708333 C10.368224,1.92708333 10.7098796,2.11659543 10.9017927,2.447801 L19.0267927,16.510301 Z" id="Path" stroke="#FFFFFF" stroke-width="0.833333333" fill="#FFFFFF"></path> <path d="M18.6660156,16.71875 L10.5410156,2.65625 C10.4199219,2.44726562 10.2109375,2.34375 10,2.34375 C9.7890625,2.34375 9.578125,2.44726562 9.45898438,2.65625 L1.33398438,16.71875 C1.09375,17.1367188 1.39453125,17.65625 1.875,17.65625 L18.125,17.65625 C18.6054688,17.65625 18.90625,17.1367188 18.6660156,16.71875 Z M9.375,8.125 C9.375,8.0390625 9.4453125,7.96875 9.53125,7.96875 L10.46875,7.96875 C10.5546875,7.96875 10.625,8.0390625 10.625,8.125 L10.625,11.71875 C10.625,11.8046875 10.5546875,11.875 10.46875,11.875 L9.53125,11.875 C9.4453125,11.875 9.375,11.8046875 9.375,11.71875 L9.375,8.125 Z M10,15 C9.48242188,15 9.0625,14.5800781 9.0625,14.0625 C9.0625,13.5449219 9.48242188,13.125 10,13.125 C10.5175781,13.125 10.9375,13.5449219 10.9375,14.0625 C10.9375,14.5800781 10.5175781,15 10,15 Z" id="Shape" fill="#FAAD14" fill-rule="nonzero"></path></g></g></g> </g></svg></div>',error:'<span class="data-error-icon">X</span>'};if("error"===n)return'\n <div class="data-audio">\n <div class="data-audio-content data-audio-error">\n <div class="data-audio-center">\n <div class="data-audio-name">'.concat(o.escape(e),'</div>\n <div class="data-audio-message">\n ').concat(l.error,"\n ").concat(i||s["loadError"],"\n </div>\n </div>\n </div>\n </div>");var c=r?o.getFileSize(r):"";if("uploading"===n)return'\n <div class="data-audio">\n <div class="data-audio-content data-audio-uploading">\n <div class="data-audio-center">\n '.concat(l.audio,'\n <div class="data-audio-name">\n ').concat(o.escape(e)," (").concat(o.escape(c),')\n </div>\n <div class="data-audio-progress">\n ').concat(l.spin,'\n <span class="percent">').concat(a||0,"%<span>\n </div>\n </div>\n </div>\n </div>");var u="undefined"===typeof n;return"transcoding"===n||u?'\n <div class="data-audio">\n <div class="data-audio-content data-audio-uploaded">\n <div class="data-audio-center">\n '.concat(l.audio,'\n <div class="data-audio-name">\n ').concat(o.escape(e)," (").concat(o.escape(c),')\n </div>\n <div class="data-audio-transcoding">\n ').concat(l.spin,'\n <span class="transcoding">').concat(u?s["loading"]:s["transcoding"],"%<span>\n </div>\n </div>\n </div>\n </div>\n "):'\n <div class="data-audio">\n <div class="data-audio-content data-audio-done"></div>\n </div>\n '}},{key:"initPlayer",value:function(){var t,e=this,n=this.getValue();if(n){var r=o.sanitizeUrl(this.onBeforeRender("query",n.url)),i=document.createElement("div"),a=document.createElement("audio");if(i.className="audio_box",a.preload="auto",a.setAttribute("src",window.$fileLinkTransfer(r)),a.setAttribute("webkit-playsinline","webkit-playsinline"),a.setAttribute("playsinline","playsinline"),i.append(a),this.editor._readonly){var s=document.createElement("span");s.innerHTML=n.name,i.append(s),null===(t=this.container)||void 0===t||t.find(".data-audio-content").append(i)}else{var l=document.createElement("input");l.value=n.name,l.onblur=function(t){n.name=l.value,e.setValue(n)},null===(t=this.container)||void 0===t||t.find(".data-audio-content").append(i),i.append(l)}a.oncontextmenu=function(){return!1},setTimeout((function(){a.controls=!0}),0)}}},{key:"toolbar",value:function(){var t=[],e=this.getValue();if(!e)return t;var n=e.status,r=e.download,i=this.getLocales();return"done"===n&&(r&&t.push({type:"button",content:'<span class="data-icon data-icon-download" />',title:i.download,onClick:this.downloadFile}),o.isEngine(this.editor)&&!this.editor.readonly&&(t.push({type:"copy"}),t.push({type:"separator"}))),o.isEngine(this.editor)&&!this.editor.readonly&&t.push({type:"delete"}),t}},{key:"setProgressPercent",value:function(t){var e;null===(e=this.container)||void 0===e||e.find(".percent").html("".concat(t,"%"))}},{key:"onActivate",value:function(t){var e,n;t?null===(e=this.container)||void 0===e||e.addClass("data-audio-active"):null===(n=this.container)||void 0===n||n.removeClass("data-audio-active")}},{key:"checker",value:function(t,e,n){var r=this.editor.command,i=function i(){r.executeMethod("audio-uploader","query",t,(function(t){t&&"done"!==t.status?setTimeout(i,3e3):e(t)}),(function(t){n(t)}))};i()}},{key:"render",value:function(){var t=this,e=this.getValue();if(e){var n=this.getCenter();n.empty();var r=this.editor,i=r.command,a=r.plugin,l=e.audio_id,c=e.status,u=this.getLocales();if(o.isEngine(this.editor)){if("transcoding"===c){if(this.container=o.$(this.renderTemplate(e)),!l)throw"audio id is undefined";return this.checker(l,(function(r){var i=s(s({},e),{},{url:(null===r||void 0===r?void 0:r.url)?r.url:e.url,name:(null===r||void 0===r?void 0:r.name)?r.name:e.name,download:(null===r||void 0===r?void 0:r.download)?r.download:e.download,status:"done"});t.setValue(i),t.container=o.$(t.renderTemplate(i)),n.empty(),n.append(t.container),t.initPlayer()}),(function(r){var i=s(s({},e),{},{status:"error",message:r||u["loadError"]});t.setValue(i),t.container=o.$(t.renderTemplate(i)),n.empty(),n.append(t.container)})),this.container}return"done"===c?(this.container=o.$(this.renderTemplate(s(s({},e),{},{status:void 0}))),i.executeMethod("audio-uploader","query",l,(function(r){var i=s(s({},e),{},{url:(null===r||void 0===r?void 0:r.url)?r.url:e.url,name:(null===r||void 0===r?void 0:r.name)?r.name:e.name,download:(null===r||void 0===r?void 0:r.download)?r.download:e.download});t.container=o.$(t.renderTemplate(i)),n.empty(),n.append(t.container),t.initPlayer()}),(function(r){t.container=o.$(t.renderTemplate(s(s({},e),{},{status:"error",message:r||u["loadError"]}))),n.empty(),n.append(t.container)})),this.container):o.$(this.renderTemplate(e))}if("done"===c){this.container=o.$(this.renderTemplate(s(s({},e),{},{status:void 0})));var d=function(r){var i=s(s({},e),{},{url:(null===r||void 0===r?void 0:r.url)?r.url:e.url,name:(null===r||void 0===r?void 0:r.name)?r.name:e.name,download:(null===r||void 0===r?void 0:r.download)?r.download:e.download});t.container=o.$(t.renderTemplate(i)),n.empty(),n.append(t.container),t.initPlayer()};return a.components["audio-uploader"]?i.executeMethod("audio-uploader","query",l,(function(t){d(t)}),(function(r){t.container=o.$(t.renderTemplate(s(s({},e),{},{status:"error",message:r||u["loadError"]}))),n.empty(),n.append(t.container)})):d(),this.container}return"error"===c?o.$(this.renderTemplate(s(s({},e),{},{message:e.message||u["loadError"]}))):void 0}}},{key:"didRender",value:function(){var t,e=this;C(g(n.prototype),"didRender",this).call(this),null===(t=this.container)||void 0===t||t.on(o.isMobile?"touchstart":"click",(function(){o.isEngine(e.editor)&&!e.activated&&e.editor.card.activate(e.root)}))}}],[{key:"cardName",get:function(){return"audio"}},{key:"cardType",get:function(){return o.CardType.BLOCK}},{key:"autoSelected",get:function(){return!1}}]),n}(o.Card),E=function(t){f(n,t);var e=w(n);function n(){var t;return u(this,n),t=e.apply(this,arguments),t.cardComponents={},t.extensionNames=["mp3"],t}return h(n,[{key:"init",value:function(){var t=this;o.isEngine(this.editor)&&(this.editor.on("drop:files",(function(e){return t.dropFiles(e)})),this.editor.on("paste:event",(function(e){var n=e.files;return t.pasteFiles(n)})),this.editor.on("paste:each",(function(e){return t.pasteEach(e)})));var e=this.options.accept,n=[];"string"===typeof e&&(e=e.split(",")),(e||[]).forEach((function(t){t=t.trim();var e=t.split(".").pop();e&&n.push(e)})),n.length>0&&(this.extensionNames=n)}},{key:"isAudio",value:function(t){var e=o.getExtensionName(t);return this.extensionNames.indexOf(e)>=0}},{key:"execute",value:function(){var t=c(r().mark((function t(e){var n,i,a,l,c,u,d,h,p,f,g,m,v,b,y,w=this,x=arguments;return r().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if("string"!==typeof e){t.next=6;break}t.t0=e,t.next="query"===t.t0?4:5;break;case 4:return t.abrupt("return",this.query(x.length<=1?void 0:x[1],x.length<=2?void 0:x[2],x.length<=3?void 0:x[3]));case 5:return t.abrupt("return");case 6:if(n=this.editor,i=n.request,a=n.card,l=n.language,c=this.options,u=c.action,d=c.data,h=c.type,p=c.contentType,f=c.multiple,g=c.crossOrigin,m=c.headers,v=c.name,b=this.options.parse,y=this.options.limitSize||5242880,Array.isArray(e)){t.next=14;break}return t.next=13,i.getFiles({event:e,accept:o.isAndroid?"audio/*":this.extensionNames.length>0?"."+this.extensionNames.join(",."):"",multiple:f});case 13:e=t.sent;case 14:if(0!==e.length){t.next=16;break}return t.abrupt("return");case 16:return i.upload({url:u,data:d,type:h,contentType:p,crossOrigin:g,headers:"function"===typeof m?m():m,onBefore:function(t){return!(t.size>y)||(w.editor.messageError(l.get("audio","uploadLimitError").toString().replace("$size",(y/1024/1024).toFixed(0)+"M")),!1)},onReady:function(t){if(o.isEngine(w.editor)&&!w.cardComponents[t.uid]){var e=a.insert("audio",{status:"uploading",name:t.name,size:t.size});w.cardComponents[t.uid]=e}},onUploading:function(t,e){var n=e.percent,r=w.cardComponents[t.uid||""];r&&r.setProgressPercent(n)},onSuccess:function(t,e){var n=w.cardComponents[e.uid||""];if(n){var r=t.id||t.data&&t.data.id,i=t.url||t.data&&t.data.url,o=t.cover||t.data&&t.data.cover,l=t.download||t.data&&t.data.download,c=t.status||t.data&&t.data.status;c="transcoding"===c?"transcoding":"done";var u={result:!0,data:{audio_id:r,url:i,cover:o,download:l,status:c}};if(b){var d=b(t);if(d.result){var h=u.data;"string"===typeof d.data?u.data=s(s({},h),{},{url:d.data}):(h.url=d.data.url,void 0!==d.data.status&&(h=s(s({},h),{},{status:d.data.status})),void 0!==d.data.id&&(h=s(s({},h),{},{audio_id:d.data.id})),u.data=s({},h))}else u={result:!1,data:d.data.toString()}}else i||(u={result:!1,data:t.data});u.result?w.editor.card.update(n.id,"string"===typeof u.data?{url:u.data}:s({},u.data)):a.update(n.id,{status:"error",message:u.data||w.editor.language.get("audio","uploadError")}),delete w.cardComponents[e.uid||""]}},onError:function(t,e){var n=w.cardComponents[e.uid||""];n&&(a.update(n.id,{status:"error",message:t.message||w.editor.language.get("audio","uploadError")}),delete w.cardComponents[e.uid||""])}},e,v),t.abrupt("return");case 18:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"query",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=this.editor.request,o=this.options,a=o.query,l=o.parse;if(!a||!t)return e();var c=a.action,u=a.type,d=a.contentType,h=a.data;i.ajax({url:c,contentType:d||"",type:void 0===u?"json":u,data:s(s({},h),{},{id:t}),success:function(t){var i=t.result,o=t.data;if(i){var a=l?l(t):t;!1===a.result?r(a.data||n.editor.language.get("audio","loadError")):e(s(s({},a.data),{},{status:"transcoding"!==a.data.status?"done":"transcoding"}))}else r(o)},error:function(t){r(t.message||n.editor.language.get("audio","loadError"))},method:"GET"})}},{key:"dropFiles",value:function(t){var e=this;if(o.isEngine(this.editor)&&(t=t.filter((function(t){return e.isAudio(t)})),0!==t.length))return this.editor.command.execute("audio-uploader",t),!1}},{key:"pasteFiles",value:function(t){var e=this;if(o.isEngine(this.editor)&&(t=t.filter((function(t){return e.isAudio(t)})),0!==t.length))return this.editor.command.execute("audio-uploader",t.filter((function(t){return e.isAudio(t)})),t),!1}},{key:"pasteEach",value:function(t){if(t.isCard()&&t.attributes(o.READY_CARD_KEY)){if("audio"!==t.attributes(o.READY_CARD_KEY))return;var e=o.decodeCardValue(t.attributes(o.CARD_VALUE_KEY));return e&&e.url?void("uploading"===e.status&&(e.percent=0,t.attributes(o.CARD_VALUE_KEY,o.encodeCardValue(s(s({},e),{},{status:"done"}))))):void t.remove()}}}],[{key:"pluginName",get:function(){return"audio-uploader"}}]),n}(o.Plugin),O={audio:{errorMessageCopy:"Copy error message",loadError:"The audio failed to load!",uploadError:"The audio failed to upload!",uploadLimitError:"Upload audio size is limited to $size",download:"Download",preview:"Preview",loading:"Loading...",transcoding:"Transcoding..."}},T={audio:{errorMessageCopy:"复制错误信息",loadError:"音频加载失败!",uploadError:"上传音频失败!",uploadLimitError:"上传音频大小限制为 $size",download:"下载",preview:"预览",loading:"加载中...",transcoding:"转码中..."}},_={"en-US":O,"zh-CN":T},M=function(t){f(n,t);var e=w(n);function n(){return u(this,n),e.apply(this,arguments)}return h(n,[{key:"init",value:function(){var t=this;this.editor.language.add(_),o.isEngine(this.editor)&&(this.editor.on("parse:html",(function(e){return t.parseHtml(e)})),this.editor.on("paste:each",(function(e){return t.pasteHtml(e)})),this.editor.on("paste:schema",(function(e){return t.pasteSchema(e)})))}},{key:"execute",value:function(t,e,n,r,i,o){var a={status:t,audio_id:r,url:e,name:n||e,size:i,download:o};"error"===t&&(a.url="",a.message=e),this.editor.card.insert("audio",a)}},{key:"waiting",value:function(){var t=c(r().mark((function t(e){var n,i,o,a,s=this;return r().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=this.editor.card,i=function(t){var e;return t.root.inEditor()&&t.constructor.cardName===S.cardName&&"uploading"===(null===(e=t.getValue())||void 0===e?void 0:e.status)},o=function(){return n.components.find(i)},a=function(t){var n=6e4;return new Promise((function(r,o){if(e){var a=e(s.constructor.pluginName,t);if(!1===a)return o({name:s.constructor.pluginName,card:t});"number"===typeof a&&(n=a)}var l=(new Date).getTime(),c=(new Date).getTime(),u=function e(){if(c-l>=n)return r();setTimeout((function(){i(t)?e():r()}),10)};u()}))},t.abrupt("return",new Promise((function(t,e){var n=o(),r=function n(r){a(r).then((function(){var e=o();e?n(e):t()})).catch(e)};n?r(n):t()})));case 5:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"pasteSchema",value:function(t){t.add({type:"block",name:"div",attributes:{"data-value":"*","data-type":{required:!0,value:S.cardName}}})}},{key:"pasteHtml",value:function(t){if(o.isEngine(this.editor)){if(t.isElement()){var e=t.attributes("data-type");if(e===S.cardName){var n=t.attributes("data-value"),r=o.decodeCardValue(n);if(!r.url)return;return this.editor.card.replaceNode(t,S.cardName,r),t.remove(),!1}}return!0}}},{key:"parseHtml",value:function(t){var e=this;t.find("[".concat(o.CARD_KEY,"=").concat(S.cardName)).each((function(t){var n=o.$(t),r=e.editor.card.find(n),i=null===r||void 0===r?void 0:r.getValue();if((null===i||void 0===i?void 0:i.url)&&"done"===i.status){var a=e.options.onBeforeRender,s=i.url,l='<div data-type="'.concat(S.cardName,'" data-value="').concat(o.encodeCardValue(i),'"><audio controls src="').concat(o.sanitizeUrl(a?a("query",window.$fileLinkTransfer(s)):window.$fileLinkTransfer(s)),'" webkit-playsinline="webkit-playsinline" playsinline="playsinline" style="outline:none;" /></div>');n.empty(),n.replaceWith(o.$(l))}else n.remove()}))}}],[{key:"pluginName",get:function(){return"audio"}}]),n}(o.Plugin);e.AudioComponent=S,e.AudioUploader=E,e["default"]=M},"0538":function(t,e,n){"use strict";var r=n("e330"),i=n("59ed"),o=n("861d"),a=n("1a2d"),s=n("f36a"),l=n("40d5"),c=Function,u=r([].concat),d=r([].join),h={},p=function(t,e,n){if(!a(h,e)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";h[e]=c("C,a","return new C("+d(r,",")+")")}return h[e](t,n)};t.exports=l?c.bind:function(t){var e=i(this),n=e.prototype,r=s(arguments,1),a=function(){var n=u(r,s(arguments));return this instanceof a?p(e,n.length,n):e.apply(t,n)};return o(n)&&(a.prototype=n),a}},"0610":function(t,e,n){"use strict";n("6368")},"0b25":function(t,e,n){var r=n("5926"),i=n("50c4"),o=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw o("Wrong length or index");return n}},"0b6c":function(t,e,n){(function(t){t(n("56b3"),n("b933"),n("2aed"))})((function(t){"use strict";function e(t,e){return"string"==typeof t?t=new RegExp(t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),e?"gi":"g"):t.global||(t=new RegExp(t.source,t.ignoreCase?"gi":"g")),{token:function(e){t.lastIndex=e.pos;var n=t.exec(e.string);if(n&&n.index==e.pos)return e.pos+=n[0].length||1,"searching";n?e.pos=n.index:e.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(t){return t.state.search||(t.state.search=new n)}function i(t){return"string"==typeof t&&t==t.toLowerCase()}function o(t,e,n){return t.getSearchCursor(e,n,{caseFold:i(e),multiline:!0})}function a(t,e,n,r,i){t.openDialog(e,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){f(t)},onKeyDown:i,bottom:t.options.search.bottom})}function s(t,e,n,r,i){t.openDialog?t.openDialog(e,i,{value:r,selectValueOnOpen:!0,bottom:t.options.search.bottom}):i(prompt(n,r))}function l(t,e,n,r){t.openConfirm?t.openConfirm(e,r):confirm(n)&&r[0]()}function c(t){return t.replace(/\\([nrt\\])/g,(function(t,e){return"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\"==e?"\\":t}))}function u(t){var e=t.match(/^\/(.*)\/([a-z]*)$/);if(e)try{t=new RegExp(e[1],-1==e[2].indexOf("i")?"":"i")}catch(n){}else t=c(t);return("string"==typeof t?""==t:t.test(""))&&(t=/x^/),t}function d(t,n,r){n.queryText=r,n.query=u(r),t.removeOverlay(n.overlay,i(n.query)),n.overlay=e(n.query,i(n.query)),t.addOverlay(n.overlay),t.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=t.showMatchesOnScrollbar(n.query,i(n.query)))}function h(e,n,i,o){var l=r(e);if(l.query)return p(e,n);var c=e.getSelection()||l.lastQuery;if(c instanceof RegExp&&"x^"==c.source&&(c=null),i&&e.openDialog){var u=null,h=function(n,r){t.e_stop(r),n&&(n!=l.queryText&&(d(e,l,n),l.posFrom=l.posTo=e.getCursor()),u&&(u.style.opacity=1),p(e,r.shiftKey,(function(t,n){var r;n.line<3&&document.querySelector&&(r=e.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>e.cursorCoords(n,"window").top&&((u=r).style.opacity=.4)})))};a(e,m(e),c,h,(function(n,i){var o=t.keyName(n),a=e.getOption("extraKeys"),s=a&&a[o]||t.keyMap[e.getOption("keyMap")][o];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(t.e_stop(n),d(e,r(e),i),e.execCommand(s)):"find"!=s&&"findPersistent"!=s||(t.e_stop(n),h(i,n))})),o&&c&&(d(e,l,c),p(e,n))}else s(e,m(e),"Search for:",c,(function(t){t&&!l.query&&e.operation((function(){d(e,l,t),l.posFrom=l.posTo=e.getCursor(),p(e,n)}))}))}function p(e,n,i){e.operation((function(){var a=r(e),s=o(e,a.query,n?a.posFrom:a.posTo);(s.find(n)||(s=o(e,a.query,n?t.Pos(e.lastLine()):t.Pos(e.firstLine(),0)),s.find(n)))&&(e.setSelection(s.from(),s.to()),e.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))}))}function f(t){t.operation((function(){var e=r(t);e.lastQuery=e.query,e.query&&(e.query=e.queryText=null,t.removeOverlay(e.overlay),e.annotate&&(e.annotate.clear(),e.annotate=null))}))}function g(t,e){var n=t?document.createElement(t):document.createDocumentFragment();for(var r in e)n[r]=e[r];for(var i=2;i<arguments.length;i++){var o=arguments[i];n.appendChild("string"==typeof o?document.createTextNode(o):o)}return n}function m(t){var e=g("label",{className:"CodeMirror-search-label"},t.phrase("Search:"),g("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return e.setAttribute("for","CodeMirror-search-field"),g("",null,e," ",g("span",{style:"color: #666",className:"CodeMirror-search-hint"},t.phrase("(Use /re/ syntax for regexp search)")))}function v(t){return g("",null," ",g("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",g("span",{style:"color: #666",className:"CodeMirror-search-hint"},t.phrase("(Use /re/ syntax for regexp search)")))}function b(t){return g("",null,g("span",{className:"CodeMirror-search-label"},t.phrase("With:"))," ",g("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function y(t){return g("",null,g("span",{className:"CodeMirror-search-label"},t.phrase("Replace?"))," ",g("button",{},t.phrase("Yes"))," ",g("button",{},t.phrase("No"))," ",g("button",{},t.phrase("All"))," ",g("button",{},t.phrase("Stop")))}function w(t,e,n){t.operation((function(){for(var r=o(t,e);r.findNext();)if("string"!=typeof e){var i=t.getRange(r.from(),r.to()).match(e);r.replace(n.replace(/\$(\d)/g,(function(t,e){return i[e]})))}else r.replace(n)}))}function x(t,e){if(!t.getOption("readOnly")){var n=t.getSelection()||r(t).lastQuery,i=e?t.phrase("Replace all:"):t.phrase("Replace:"),a=g("",null,g("span",{className:"CodeMirror-search-label"},i),v(t));s(t,a,i,n,(function(n){n&&(n=u(n),s(t,b(t),t.phrase("Replace with:"),"",(function(r){if(r=c(r),e)w(t,n,r);else{f(t);var i=o(t,n,t.getCursor("from")),a=function(){var e,c=i.from();!(e=i.findNext())&&(i=o(t,n),!(e=i.findNext())||c&&i.from().line==c.line&&i.from().ch==c.ch)||(t.setSelection(i.from(),i.to()),t.scrollIntoView({from:i.from(),to:i.to()}),l(t,y(t),t.phrase("Replace?"),[function(){s(e)},a,function(){w(t,n,r)}]))},s=function(t){i.replace("string"==typeof n?r:r.replace(/\$(\d)/g,(function(e,n){return t[n]}))),a()};a()}})))}))}}t.defineOption("search",{bottom:!1}),t.commands.find=function(t){f(t),h(t)},t.commands.findPersistent=function(t){f(t),h(t,!1,!0)},t.commands.findPersistentNext=function(t){h(t,!1,!0,!0)},t.commands.findPersistentPrev=function(t){h(t,!0,!0,!0)},t.commands.findNext=h,t.commands.findPrev=function(t){h(t,!0)},t.commands.clearSearch=f,t.commands.replace=x,t.commands.replaceAll=function(t){x(t,!0)}}))},"0eb6":function(t,e,n){"use strict";var r=n("23e7"),i=n("7c37"),o=n("d066"),a=n("d039"),s=n("7c73"),l=n("5c6c"),c=n("9bf2").f,u=n("cb2d"),d=n("edd0"),h=n("1a2d"),p=n("19aa"),f=n("825a"),g=n("aa1f"),m=n("e391"),v=n("cf98"),b=n("0d26"),y=n("69f3"),w=n("83ab"),x=n("c430"),C="DOMException",k="DATA_CLONE_ERR",A=o("Error"),S=o(C)||function(){try{var t=o("MessageChannel")||i("worker_threads").MessageChannel;(new t).port1.postMessage(new WeakMap)}catch(e){if(e.name==k&&25==e.code)return e.constructor}}(),E=S&&S.prototype,O=A.prototype,T=y.set,_=y.getterFor(C),M="stack"in A(C),N=function(t){return h(v,t)&&v[t].m?v[t].c:0},P=function(){p(this,L);var t=arguments.length,e=m(t<1?void 0:arguments[0]),n=m(t<2?void 0:arguments[1],"Error"),r=N(n);if(T(this,{type:C,name:n,message:e,code:r}),w||(this.name=n,this.message=e,this.code=r),M){var i=A(e);i.name=C,c(this,"stack",l(1,b(i.stack,1)))}},L=P.prototype=s(O),D=function(t){return{enumerable:!0,configurable:!0,get:t}},j=function(t){return D((function(){return _(this)[t]}))};w&&(d(L,"code",j("code")),d(L,"message",j("message")),d(L,"name",j("name"))),c(L,"constructor",l(1,P));var I=a((function(){return!(new S instanceof A)})),R=I||a((function(){return O.toString!==g||"2: 1"!==String(new S(1,2))})),F=I||a((function(){return 25!==new S(1,"DataCloneError").code})),B=I||25!==S[k]||25!==E[k],z=x?R||F||B:I;r({global:!0,constructor:!0,forced:z},{DOMException:z?P:S});var H=o(C),V=H.prototype;for(var q in R&&(x||S===H)&&u(V,"toString",g),F&&w&&S===H&&d(V,"code",D((function(){return N(f(this).name)}))),v)if(h(v,q)){var U=v[q],W=U.s,$=l(6,U.c);h(H,W)||c(H,W,$),h(V,W)||c(V,W,$)}},1:function(t,e){},"10d1":function(t,e,n){n("0094")},1148:function(t,e,n){"use strict";var r=n("5926"),i=n("577e"),o=n("1d80"),a=RangeError;t.exports=function(t){var e=i(o(this)),n="",s=r(t);if(s<0||s==1/0)throw a("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(e+=e))1&s&&(n+=e);return n}},1157:function(t,e,n){var r,i;
/*!
* jQuery JavaScript Library v3.6.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2022-08-26T17:52Z
*/(function(e,n){"use strict";"object"===typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)})("undefined"!==typeof window?window:this,(function(n,o){"use strict";var a=[],s=Object.getPrototypeOf,l=a.slice,c=a.flat?function(t){return a.flat.call(t)}:function(t){return a.concat.apply([],t)},u=a.push,d=a.indexOf,h={},p=h.toString,f=h.hasOwnProperty,g=f.toString,m=g.call(Object),v={},b=function(t){return"function"===typeof t&&"number"!==typeof t.nodeType&&"function"!==typeof t.item},y=function(t){return null!=t&&t===t.window},w=n.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function C(t,e,n){n=n||w;var r,i,o=n.createElement("script");if(o.text=t,e)for(r in x)i=e[r]||e.getAttribute&&e.getAttribute(r),i&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function k(t){return null==t?t+"":"object"===typeof t||"function"===typeof t?h[p.call(t)]||"object":typeof t}var A="3.6.1",S=function(t,e){return new S.fn.init(t,e)};function E(t){var e=!!t&&"length"in t&&t.length,n=k(t);return!b(t)&&!y(t)&&("array"===n||0===e||"number"===typeof e&&e>0&&e-1 in t)}S.fn=S.prototype={jquery:A,constructor:S,length:0,toArray:function(){return l.call(this)},get:function(t){return null==t?l.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:a.sort,splice:a.splice},S.extend=S.fn.extend=function(){var t,e,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"===typeof a&&(c=a,a=arguments[s]||{},s++),"object"===typeof a||b(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(t=arguments[s]))for(e in t)r=t[e],"__proto__"!==e&&a!==r&&(c&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[e],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[e]=S.extend(c,o,r)):void 0!==r&&(a[e]=r));return a},S.extend({expando:"jQuery"+(A+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]"!==p.call(t))&&(e=s(t),!e||(n=f.call(e,"constructor")&&e.constructor,"function"===typeof n&&g.call(n)===m))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){C(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(E(t)){for(n=t.length;r<n;r++)if(!1===e.call(t[r],r,t[r]))break}else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(E(Object(t))?S.merge(n,"string"===typeof t?[t]:t):u.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:d.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;r<n;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r,i=[],o=0,a=t.length,s=!n;o<a;o++)r=!e(t[o],o),r!==s&&i.push(t[o]);return i},map:function(t,e,n){var r,i,o=0,a=[];if(E(t))for(r=t.length;o<r;o++)i=e(t[o],o,n),null!=i&&a.push(i);else for(o in t)i=e(t[o],o,n),null!=i&&a.push(i);return c(a)},guid:1,support:v}),"function"===typeof Symbol&&(S.fn[Symbol.iterator]=a[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){h["[object "+e+"]"]=e.toLowerCase()}));var O=
/*!
* Sizzle CSS Selector Engine v2.3.6
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2021-02-16
*/
function(t){var e,n,r,i,o,a,s,l,c,u,d,h,p,f,g,m,v,b,y,w="sizzle"+1*new Date,x=t.document,C=0,k=0,A=lt(),S=lt(),E=lt(),O=lt(),T=function(t,e){return t===e&&(d=!0),0},_={}.hasOwnProperty,M=[],N=M.pop,P=M.push,L=M.push,D=M.slice,j=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},I="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+R+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",B="\\["+R+"*("+F+")(?:"+R+"*([*^$|!~]?=)"+R+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+R+"*\\]",z=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+B+")*)|.*)\\)|)",H=new RegExp(R+"+","g"),V=new RegExp("^"+R+"+|((?:^|[^\\\\])(?:\\\\.)*)"+R+"+$","g"),q=new RegExp("^"+R+"*,"+R+"*"),U=new RegExp("^"+R+"*([>+~]|"+R+")"+R+"*"),W=new RegExp(R+"|>"),$=new RegExp(z),G=new RegExp("^"+F+"$"),Y={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+R+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"<22>":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){h()},at=wt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{L.apply(M=D.call(x.childNodes),x.childNodes),M[x.childNodes.length].nodeType}catch(Ot){L={apply:M.length?function(t,e){P.apply(t,D.call(e))}:function(t,e){var n=t.length,r=0;while(t[n++]=e[r++]);t.length=n-1}}}function st(t,e,r,i){var o,s,c,u,d,f,v,b=e&&e.ownerDocument,x=e?e.nodeType:9;if(r=r||[],"string"!==typeof t||!t||1!==x&&9!==x&&11!==x)return r;if(!i&&(h(e),e=e||p,g)){if(11!==x&&(d=Q.exec(t)))if(o=d[1]){if(9===x){if(!(c=e.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(b&&(c=b.getElementById(o))&&y(e,c)&&c.id===o)return r.push(c),r}else{if(d[2])return L.apply(r,e.getElementsByTagName(t)),r;if((o=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return L.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!O[t+" "]&&(!m||!m.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(v=t,b=e,1===x&&(W.test(t)||U.test(t))){b=tt.test(t)&&vt(e.parentNode)||e,b===e&&n.scope||((u=e.getAttribute("id"))?u=u.replace(rt,it):e.setAttribute("id",u=w)),f=a(t),s=f.length;while(s--)f[s]=(u?"#"+u:":scope")+" "+yt(f[s]);v=f.join(",")}try{return L.apply(r,b.querySelectorAll(v)),r}catch(C){O(t,!0)}finally{u===w&&e.removeAttribute("id")}}}return l(t.replace(V,"$1"),e,r,i)}function lt(){var t=[];function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}return e}function ct(t){return t[w]=!0,t}function ut(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(Ot){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function dt(t,e){var n=t.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=e}function ht(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function gt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function mt(t){return ct((function(e){return e=+e,ct((function(n,r){var i,o=t([],n.length,e),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function vt(t){return t&&"undefined"!==typeof t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!X.test(e||n&&n.nodeName||"HTML")},h=st.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:x;return a!=p&&9===a.nodeType&&a.documentElement?(p=a,f=p.documentElement,g=!o(p),x!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.scope=ut((function(t){return f.appendChild(t).appendChild(p.createElement("div")),"undefined"!==typeof t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ut((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ut((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(p.getElementsByClassName),n.getById=ut((function(t){return f.appendChild(t).id=w,!p.getElementsByName||!p.getElementsByName(w).length})),n.getById?(r.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find["ID"]=function(t,e){if("undefined"!==typeof e.getElementById&&g){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){var n="undefined"!==typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find["ID"]=function(t,e){if("undefined"!==typeof e.getElementById&&g){var n,r,i,o=e.getElementById(t);if(o){if(n=o.getAttributeNode("id"),n&&n.value===t)return[o];i=e.getElementsByName(t),r=0;while(o=i[r++])if(n=o.getAttributeNode("id"),n&&n.value===t)return[o]}return[]}}),r.find["TAG"]=n.getElementsByTagName?function(t,e){return"undefined"!==typeof e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find["CLASS"]=n.getElementsByClassName&&function(t,e){if("undefined"!==typeof e.getElementsByClassName&&g)return e.getElementsByClassName(t)},v=[],m=[],(n.qsa=J.test(p.querySelectorAll))&&(ut((function(t){var e;f.appendChild(t).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+R+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+R+"*(?:value|"+I+")"),t.querySelectorAll("[id~="+w+"-]").length||m.push("~="),e=p.createElement("input"),e.setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+R+"*name"+R+"*="+R+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]")})),ut((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+R+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=J.test(b=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut((function(t){n.disconnectedMatch=b.call(t,"*"),b.call(t,"[s!='']:x"),v.push("!=",z)})),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),e=J.test(f.compareDocumentPosition),y=e||J.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)while(e=e.parentNode)if(e===t)return!0;return!1},T=e?function(t,e){if(t===e)return d=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&r||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==p||t.ownerDocument==x&&y(x,t)?-1:e==p||e.ownerDocument==x&&y(x,e)?1:u?j(u,t)-j(u,e):0:4&r?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t==p?-1:e==p?1:i?-1:o?1:u?j(u,t)-j(u,e):0;if(i===o)return ht(t,e);n=t;while(n=n.parentNode)a.unshift(n);n=e;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ht(a[r],s[r]):a[r]==x?-1:s[r]==x?1:0},p):p},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if(h(t),n.matchesSelector&&g&&!O[e+" "]&&(!v||!v.test(e))&&(!m||!m.test(e)))try{var r=b.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(Ot){O(e,!0)}return st(e,p,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!=p&&h(t),y(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!=p&&h(t);var i=r.attrHandle[e.toLowerCase()],o=i&&_.call(r.attrHandle,e.toLowerCase())?i(t,e,!g):void 0;return void 0!==o?o:n.attributes||!g?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(rt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,r=[],i=0,o=0;if(d=!n.detectDuplicates,u=!n.sortStable&&t.slice(0),t.sort(T),d){while(e=t[o++])e===t[o]&&(i=r.push(o));while(i--)t.splice(r[i],1)}return u=null,t},i=st.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"===typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else while(e=t[r++])n+=i(e);return n},r=st.selectors={cacheLength:50,createPseudo:ct,match:Y,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(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===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]||st.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]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y["CHILD"].test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&$.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(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=A[t+" "];return e||(e=new RegExp("(^|"+R+")"+t+"("+R+"|$)"))&&A(t,(function(t){return e.test("string"===typeof t.className&&t.className||"undefined"!==typeof t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=st.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(H," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var c,u,d,h,p,f,g=o!==a?"nextSibling":"previousSibling",m=e.parentNode,v=s&&e.nodeName.toLowerCase(),b=!l&&!s,y=!1;if(m){if(o){while(g){h=e;while(h=h[g])if(s?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;f=g="only"===t&&!f&&"nextSibling"}return!0}if(f=[a?m.firstChild:m.lastChild],a&&b){h=m,d=h[w]||(h[w]={}),u=d[h.uniqueID]||(d[h.uniqueID]={}),c=u[t]||[],p=c[0]===C&&c[1],y=p&&c[2],h=p&&m.childNodes[p];while(h=++p&&h&&h[g]||(y=p=0)||f.pop())if(1===h.nodeType&&++y&&h===e){u[t]=[C,p,y];break}}else if(b&&(h=e,d=h[w]||(h[w]={}),u=d[h.uniqueID]||(d[h.uniqueID]={}),c=u[t]||[],p=c[0]===C&&c[1],y=p),!1===y)while(h=++p&&h&&h[g]||(y=p=0)||f.pop())if((s?h.nodeName.toLowerCase()===v:1===h.nodeType)&&++y&&(b&&(d=h[w]||(h[w]={}),u=d[h.uniqueID]||(d[h.uniqueID]={}),u[t]=[C,y]),h===e))break;return y-=i,y===r||y%r===0&&y/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[w]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,n){var r,o=i(t,e),a=o.length;while(a--)r=j(t,o[a]),t[r]=!(n[r]=o[a])})):function(t){return i(t,0,n)}):i}},pseudos:{not:ct((function(t){var e=[],n=[],r=s(t.replace(V,"$1"));return r[w]?ct((function(t,e,n,i){var o,a=r(t,null,i,[]),s=t.length;while(s--)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:ct((function(t){return function(e){return st(t,e).length>0}})),contains:ct((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:ct((function(t){return G.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=g?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:gt(!1),disabled:gt(!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!r.pseudos["empty"](t)},header:function(t){return Z.test(t.nodeName)},input:function(t){return K.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:mt((function(){return[0]})),last:mt((function(t,e){return[e-1]})),eq:mt((function(t,e,n){return[n<0?n+e:n]})),even:mt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:mt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:mt((function(t,e,n){for(var r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t})),gt:mt((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}},r.pseudos["nth"]=r.pseudos["eq"],{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[e]=pt(e);for(e in{submit:!0,reset:!0})r.pseudos[e]=ft(e);function bt(){}function yt(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function wt(t,e,n){var r=e.dir,i=e.next,o=i||r,a=n&&"parentNode"===o,s=k++;return e.first?function(e,n,i){while(e=e[r])if(1===e.nodeType||a)return t(e,n,i);return!1}:function(e,n,l){var c,u,d,h=[C,s];if(l){while(e=e[r])if((1===e.nodeType||a)&&t(e,n,l))return!0}else while(e=e[r])if(1===e.nodeType||a)if(d=e[w]||(e[w]={}),u=d[e.uniqueID]||(d[e.uniqueID]={}),i&&i===e.nodeName.toLowerCase())e=e[r]||e;else{if((c=u[o])&&c[0]===C&&c[1]===s)return h[2]=c[2];if(u[o]=h,h[2]=t(e,n,l))return!0}return!1}}function xt(t){return t.length>1?function(e,n,r){var i=t.length;while(i--)if(!t[i](e,n,r))return!1;return!0}:t[0]}function Ct(t,e,n){for(var r=0,i=e.length;r<i;r++)st(t,e[r],n);return n}function kt(t,e,n,r,i){for(var o,a=[],s=0,l=t.length,c=null!=e;s<l;s++)(o=t[s])&&(n&&!n(o,r,i)||(a.push(o),c&&e.push(s)));return a}function At(t,e,n,r,i,o){return r&&!r[w]&&(r=At(r)),i&&!i[w]&&(i=At(i,o)),ct((function(o,a,s,l){var c,u,d,h=[],p=[],f=a.length,g=o||Ct(e||"*",s.nodeType?[s]:s,[]),m=!t||!o&&e?g:kt(g,h,t,s,l),v=n?i||(o?t:f||r)?[]:a:m;if(n&&n(m,v,s,l),r){c=kt(v,p),r(c,[],s,l),u=c.length;while(u--)(d=c[u])&&(v[p[u]]=!(m[p[u]]=d))}if(o){if(i||t){if(i){c=[],u=v.length;while(u--)(d=v[u])&&c.push(m[u]=d);i(null,v=[],c,l)}u=v.length;while(u--)(d=v[u])&&(c=i?j(o,d):h[u])>-1&&(o[c]=!(a[c]=d))}}else v=kt(v===a?v.splice(f,v.length):v),i?i(null,a,v,l):L.apply(a,v)}))}function St(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],l=a?1:0,u=wt((function(t){return t===e}),s,!0),d=wt((function(t){return j(e,t)>-1}),s,!0),h=[function(t,n,r){var i=!a&&(r||n!==c)||((e=n).nodeType?u(t,n,r):d(t,n,r));return e=null,i}];l<o;l++)if(n=r.relative[t[l].type])h=[wt(xt(h),n)];else{if(n=r.filter[t[l].type].apply(null,t[l].matches),n[w]){for(i=++l;i<o;i++)if(r.relative[t[i].type])break;return At(l>1&&xt(h),l>1&&yt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(V,"$1"),n,l<i&&St(t.slice(l,i)),i<o&&St(t=t.slice(i)),i<o&&yt(t))}h.push(n)}return xt(h)}function Et(t,e){var n=e.length>0,i=t.length>0,o=function(o,a,s,l,u){var d,f,m,v=0,b="0",y=o&&[],w=[],x=c,k=o||i&&r.find["TAG"]("*",u),A=C+=null==x?1:Math.random()||.1,S=k.length;for(u&&(c=a==p||a||u);b!==S&&null!=(d=k[b]);b++){if(i&&d){f=0,a||d.ownerDocument==p||(h(d),s=!g);while(m=t[f++])if(m(d,a||p,s)){l.push(d);break}u&&(C=A)}n&&((d=!m&&d)&&v--,o&&y.push(d))}if(v+=b,n&&b!==v){f=0;while(m=e[f++])m(y,w,a,s);if(o){if(v>0)while(b--)y[b]||w[b]||(w[b]=N.call(l));w=kt(w)}L.apply(l,w),u&&!o&&w.length>0&&v+e.length>1&&st.uniqueSort(l)}return u&&(C=A,c=x),y};return n?ct(o):o}return bt.prototype=r.filters=r.pseudos,r.setFilters=new bt,a=st.tokenize=function(t,e){var n,i,o,a,s,l,c,u=S[t+" "];if(u)return e?0:u.slice(0);s=t,l=[],c=r.preFilter;while(s){for(a in n&&!(i=q.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),n=!1,(i=U.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(V," ")}),s=s.slice(n.length)),r.filter)!(i=Y[a].exec(s))||c[a]&&!(i=c[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return e?s.length:s?st.error(t):S(t,l).slice(0)},s=st.compile=function(t,e){var n,r=[],i=[],o=E[t+" "];if(!o){e||(e=a(t)),n=e.length;while(n--)o=St(e[n]),o[w]?r.push(o):i.push(o);o=E(t,Et(i,r)),o.selector=t}return o},l=st.select=function(t,e,n,i){var o,l,c,u,d,h="function"===typeof t&&t,p=!i&&a(t=h.selector||t);if(n=n||[],1===p.length){if(l=p[0]=p[0].slice(0),l.length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&g&&r.relative[l[1].type]){if(e=(r.find["ID"](c.matches[0].replace(et,nt),e)||[])[0],!e)return n;h&&(e=e.parentNode),t=t.slice(l.shift().value.length)}o=Y["needsContext"].test(t)?0:l.length;while(o--){if(c=l[o],r.relative[u=c.type])break;if((d=r.find[u])&&(i=d(c.matches[0].replace(et,nt),tt.test(l[0].type)&&vt(e.parentNode)||e))){if(l.splice(o,1),t=i.length&&yt(l),!t)return L.apply(n,i),n;break}}}return(h||s(t,p))(i,e,!g,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=w.split("").sort(T).join("")===w,n.detectDuplicates=!!d,h(),n.sortDetached=ut((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),ut((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||dt("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ut((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||dt("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ut((function(t){return null==t.getAttribute("disabled")}))||dt(I,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),st}(n);S.find=O,S.expr=O.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=O.uniqueSort,S.text=O.getText,S.isXMLDoc=O.isXML,S.contains=O.contains,S.escapeSelector=O.escape;var T=function(t,e,n){var r=[],i=void 0!==n;while((t=t[e])&&9!==t.nodeType)if(1===t.nodeType){if(i&&S(t).is(n))break;r.push(t)}return r},_=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},M=S.expr.match.needsContext;function N(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var P=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(t,e,n){return b(e)?S.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?S.grep(t,(function(t){return t===e!==n})):"string"!==typeof e?S.grep(t,(function(t){return d.call(e,t)>-1!==n})):S.filter(e,t,n)}S.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?S.find.matchesSelector(r,t)?[r]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!==typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e<r;e++)if(S.contains(i[e],this))return!0})));for(n=this.pushStack([]),e=0;e<r;e++)S.find(t,i[e],n);return r>1?S.uniqueSort(n):n},filter:function(t){return this.pushStack(L(this,t||[],!1))},not:function(t){return this.pushStack(L(this,t||[],!0))},is:function(t){return!!L(this,"string"===typeof t&&M.test(t)?S(t):t||[],!1).length}});var D,j=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,I=S.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||D,"string"===typeof t){if(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:j.exec(t),!r||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:w,!0)),P.test(r[1])&&S.isPlainObject(e))for(r in e)b(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return i=w.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):b(t)?void 0!==n.ready?n.ready(t):t(S):S.makeArray(t,this)};I.prototype=S.fn,D=S(w);var R=/^(?:parents|prev(?:Until|All))/,F={children:!0,contents:!0,next:!0,prev:!0};function B(t,e){while((t=t[e])&&1!==t.nodeType);return t}S.fn.extend({has:function(t){var e=S(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(S.contains(this,e[t]))return!0}))},closest:function(t,e){var n,r=0,i=this.length,o=[],a="string"!==typeof t&&S(t);if(!M.test(t))for(;r<i;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(t){return t?"string"===typeof t?d.call(S(t),this[0]):d.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return T(t,"parentNode")},parentsUntil:function(t,e,n){return T(t,"parentNode",n)},next:function(t){return B(t,"nextSibling")},prev:function(t){return B(t,"previousSibling")},nextAll:function(t){return T(t,"nextSibling")},prevAll:function(t){return T(t,"previousSibling")},nextUntil:function(t,e,n){return T(t,"nextSibling",n)},prevUntil:function(t,e,n){return T(t,"previousSibling",n)},siblings:function(t){return _((t.parentNode||{}).firstChild,t)},children:function(t){return _(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(N(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(n,r){var i=S.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"===typeof r&&(i=S.filter(r,i)),this.length>1&&(F[t]||S.uniqueSort(i),R.test(t)&&i.reverse()),this.pushStack(i)}}));var z=/[^\x20\t\r\n\f]+/g;function H(t){var e={};return S.each(t.match(z)||[],(function(t,n){e[n]=!0})),e}function V(t){return t}function q(t){throw t}function U(t,e,n,r){var i;try{t&&b(i=t.promise)?i.call(t).done(e).fail(n):t&&b(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}S.Callbacks=function(t){t="string"===typeof t?H(t):S.extend({},t);var e,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||t.once,r=e=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&t.stopOnFalse&&(s=o.length,n=!1)}t.memory||(n=!1),e=!1,i&&(o=n?[]:"")},c={add:function(){return o&&(n&&!e&&(s=o.length-1,a.push(n)),function e(n){S.each(n,(function(n,r){b(r)?t.unique&&c.has(r)||o.push(r):r&&r.length&&"string"!==k(r)&&e(r)}))}(arguments),n&&!e&&l()),this},remove:function(){return S.each(arguments,(function(t,e){var n;while((n=S.inArray(e,o,n))>-1)o.splice(n,1),n<=s&&s--})),this},has:function(t){return t?S.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=n||[],n=[t,n.slice?n.slice():n],a.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(n){S.each(e,(function(e,r){var i=b(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&b(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,l=arguments,c=function(){var n,c;if(!(t<o)){if(n=r.apply(s,l),n===e.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"===typeof n||"function"===typeof n)&&n.then,b(c)?i?c.call(n,a(o,e,V,i),a(o,e,q,i)):(o++,c.call(n,a(o,e,V,i),a(o,e,q,i),a(o,e,V,e.notifyWith))):(r!==V&&(s=void 0,l=[n]),(i||e.resolveWith)(s,l))}},u=i?c:function(){try{c()}catch(n){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(n,u.stackTrace),t+1>=o&&(r!==q&&(s=void 0,l=[n]),e.rejectWith(s,l))}};t?u():(S.Deferred.getStackHook&&(u.stackTrace=S.Deferred.getStackHook()),n.setTimeout(u))}}return S.Deferred((function(n){e[0][3].add(a(0,n,b(i)?i:V,n.notifyWith)),e[1][3].add(a(0,n,b(t)?t:V)),e[2][3].add(a(0,n,b(r)?r:q))})).promise()},promise:function(t){return null!=t?S.extend(t,i):i}},o={};return S.each(e,(function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=l.call(arguments),o=S.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?l.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(U(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||b(i[n]&&i[n].then)))return o.then();while(n--)U(i[n],a(n),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&W.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){n.setTimeout((function(){throw t}))};var $=S.Deferred();function G(){w.removeEventListener("DOMContentLoaded",G),n.removeEventListener("load",G),S.ready()}S.fn.ready=function(t){return $.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||$.resolveWith(w,[S]))}}),S.ready.then=$.then,"complete"===w.readyState||"loading"!==w.readyState&&!w.documentElement.doScroll?n.setTimeout(S.ready):(w.addEventListener("DOMContentLoaded",G),n.addEventListener("load",G));var Y=function(t,e,n,r,i,o,a){var s=0,l=t.length,c=null==n;if("object"===k(n))for(s in i=!0,n)Y(t,e,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,b(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(S(t),n)})),e))for(;s<l;s++)e(t[s],n,a?r:r.call(t[s],s,e(t[s],n)));return i?t:c?e.call(t):l?e(t[0],n):o},X=/^-ms-/,K=/-([a-z])/g;function Z(t,e){return e.toUpperCase()}function J(t){return t.replace(X,"ms-").replace(K,Z)}var Q=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function tt(){this.expando=S.expando+tt.uid++}tt.uid=1,tt.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Q(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,i=this.cache(t);if("string"===typeof e)i[J(e)]=n;else for(r in e)i[J(r)]=e[r];return i},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][J(e)]},access:function(t,e,n){return void 0===e||e&&"string"===typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){Array.isArray(e)?e=e.map(J):(e=J(e),e=e in r?[e]:e.match(z)||[]),n=e.length;while(n--)delete r[e[n]]}(void 0===e||S.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!S.isEmptyObject(e)}};var et=new tt,nt=new tt,rt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,it=/[A-Z]/g;function ot(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:rt.test(t)?JSON.parse(t):t)}function at(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(it,"-$&").toLowerCase(),n=t.getAttribute(r),"string"===typeof n){try{n=ot(n)}catch(i){}nt.set(t,e,n)}else n=void 0;return n}S.extend({hasData:function(t){return nt.hasData(t)||et.hasData(t)},data:function(t,e,n){return nt.access(t,e,n)},removeData:function(t,e){nt.remove(t,e)},_data:function(t,e,n){return et.access(t,e,n)},_removeData:function(t,e){et.remove(t,e)}}),S.fn.extend({data:function(t,e){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length&&(i=nt.get(o),1===o.nodeType&&!et.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=J(r.slice(5)),at(o,r,i[r])));et.set(o,"hasDataAttrs",!0)}return i}return"object"===typeof t?this.each((function(){nt.set(this,t)})):Y(this,(function(e){var n;if(o&&void 0===e)return n=nt.get(o,t),void 0!==n?n:(n=at(o,t),void 0!==n?n:void 0);this.each((function(){nt.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){nt.remove(this,t)}))}}),S.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=et.get(t,e),n&&(!r||Array.isArray(n)?r=et.access(t,e,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=S.queue(t,e),r=n.length,i=n.shift(),o=S._queueHooks(t,e),a=function(){S.dequeue(t,e)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return et.get(t,n)||et.access(t,n,{empty:S.Callbacks("once memory").add((function(){et.remove(t,[e+"queue",n])}))})}}),S.fn.extend({queue:function(t,e){var n=2;return"string"!==typeof t&&(e=t,t="fx",n--),arguments.length<n?S.queue(this[0],t):void 0===e?this:this.each((function(){var n=S.queue(this,t,e);S._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&S.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){S.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!==typeof t&&(e=t,t=void 0),t=t||"fx";while(a--)n=et.get(o[a],t+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(e)}});var st=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=new RegExp("^(?:([+-])=|)("+st+")([a-z%]*)$","i"),ct=["Top","Right","Bottom","Left"],ut=w.documentElement,dt=function(t){return S.contains(t.ownerDocument,t)},ht={composed:!0};ut.getRootNode&&(dt=function(t){return S.contains(t.ownerDocument,t)||t.getRootNode(ht)===t.ownerDocument});var pt=function(t,e){return t=e||t,"none"===t.style.display||""===t.style.display&&dt(t)&&"none"===S.css(t,"display")};function ft(t,e,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(t,e,"")},l=s(),c=n&&n[3]||(S.cssNumber[e]?"":"px"),u=t.nodeType&&(S.cssNumber[e]||"px"!==c&&+l)&&lt.exec(S.css(t,e));if(u&&u[3]!==c){l/=2,c=c||u[3],u=+l||1;while(a--)S.style(t,e,u+c),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),u/=o;u*=2,S.style(t,e,u+c),n=n||[]}return n&&(u=+u||+l||0,i=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=i)),i}var gt={};function mt(t){var e,n=t.ownerDocument,r=t.nodeName,i=gt[r];return i||(e=n.body.appendChild(n.createElement(r)),i=S.css(e,"display"),e.parentNode.removeChild(e),"none"===i&&(i="block"),gt[r]=i,i)}function vt(t,e){for(var n,r,i=[],o=0,a=t.length;o<a;o++)r=t[o],r.style&&(n=r.style.display,e?("none"===n&&(i[o]=et.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&pt(r)&&(i[o]=mt(r))):"none"!==n&&(i[o]="none",et.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(t[o].style.display=i[o]);return t}S.fn.extend({show:function(){return vt(this,!0)},hide:function(){return vt(this)},toggle:function(t){return"boolean"===typeof t?t?this.show():this.hide():this.each((function(){pt(this)?S(this).show():S(this).hide()}))}});var bt=/^(?:checkbox|radio)$/i,yt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,wt=/^$|^module$|\/(?:java|ecma)script/i;(function(){var t=w.createDocumentFragment(),e=t.appendChild(w.createElement("div")),n=w.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),v.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,e.innerHTML="<option></option>",v.option=!!e.lastChild})();var xt={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,"",""]};function Ct(t,e){var n;return n="undefined"!==typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!==typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&N(t,e)?S.merge([t],n):n}function kt(t,e){for(var n=0,r=t.length;n<r;n++)et.set(t[n],"globalEval",!e||et.get(e[n],"globalEval"))}xt.tbody=xt.tfoot=xt.colgroup=xt.caption=xt.thead,xt.th=xt.td,v.option||(xt.optgroup=xt.option=[1,"<select multiple='multiple'>","</select>"]);var At=/<|&#?\w+;/;function St(t,e,n,r,i){for(var o,a,s,l,c,u,d=e.createDocumentFragment(),h=[],p=0,f=t.length;p<f;p++)if(o=t[p],o||0===o)if("object"===k(o))S.merge(h,o.nodeType?[o]:o);else if(At.test(o)){a=a||d.appendChild(e.createElement("div")),s=(yt.exec(o)||["",""])[1].toLowerCase(),l=xt[s]||xt._default,a.innerHTML=l[1]+S.htmlPrefilter(o)+l[2],u=l[0];while(u--)a=a.lastChild;S.merge(h,a.childNodes),a=d.firstChild,a.textContent=""}else h.push(e.createTextNode(o));d.textContent="",p=0;while(o=h[p++])if(r&&S.inArray(o,r)>-1)i&&i.push(o);else if(c=dt(o),a=Ct(d.appendChild(o),"script"),c&&kt(a),n){u=0;while(o=a[u++])wt.test(o.type||"")&&n.push(o)}return d}var Et=/^([^.]*)(?:\.(.+)|)/;function Ot(){return!0}function Tt(){return!1}function _t(t,e){return t===Mt()===("focus"===e)}function Mt(){try{return w.activeElement}catch(t){}}function Nt(t,e,n,r,i,o){var a,s;if("object"===typeof e){for(s in"string"!==typeof n&&(r=r||n,n=void 0),e)Nt(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"===typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Tt;else if(!i)return t;return 1===o&&(a=i,i=function(t){return S().off(t),a.apply(this,arguments)},i.guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,i,r,n)}))}function Pt(t,e,n){n?(et.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var r,i,o=et.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=l.call(arguments),et.set(this,e,o),r=n(this,e),this[e](),i=et.get(this,e),o!==i||r?et.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i&&i.value}else o.length&&(et.set(this,e,{value:S.event.trigger(S.extend(o[0],S.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===et.get(t,e)&&S.event.add(t,e,Ot)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,l,c,u,d,h,p,f,g,m=et.get(t);if(Q(t)){n.handler&&(o=n,n=o.handler,i=o.selector),i&&S.find.matchesSelector(ut,i),n.guid||(n.guid=S.guid++),(l=m.events)||(l=m.events=Object.create(null)),(a=m.handle)||(a=m.handle=function(e){return"undefined"!==typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(z)||[""],c=e.length;while(c--)s=Et.exec(e[c])||[],p=g=s[1],f=(s[2]||"").split(".").sort(),p&&(d=S.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=S.event.special[p]||{},u=S.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:f.join(".")},o),(h=l[p])||(h=l[p]=[],h.delegateCount=0,d.setup&&!1!==d.setup.call(t,r,f,a)||t.addEventListener&&t.addEventListener(p,a)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,u):h.push(u),S.event.global[p]=!0)}},remove:function(t,e,n,r,i){var o,a,s,l,c,u,d,h,p,f,g,m=et.hasData(t)&&et.get(t);if(m&&(l=m.events)){e=(e||"").match(z)||[""],c=e.length;while(c--)if(s=Et.exec(e[c])||[],p=g=s[1],f=(s[2]||"").split(".").sort(),p){d=S.event.special[p]||{},p=(r?d.delegateType:d.bindType)||p,h=l[p]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;while(o--)u=h[o],!i&&g!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(h.splice(o,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(t,u));a&&!h.length&&(d.teardown&&!1!==d.teardown.call(t,f,m.handle)||S.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[c],n,r,!0);S.isEmptyObject(l)&&et.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=new Array(arguments.length),l=S.event.fix(t),c=(et.get(this,"events")||Object.create(null))[l.type]||[],u=S.event.special[l.type]||{};for(s[0]=l,e=1;e<arguments.length;e++)s[e]=arguments[e];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){a=S.event.handlers.call(this,l,c),e=0;while((i=a[e++])&&!l.isPropagationStopped()){l.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!l.isImmediatePropagationStopped())l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()))}return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,r,i,o,a,s=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],a={},n=0;n<l;n++)r=e[n],i=r.selector+" ",void 0===a[i]&&(a[i]=r.needsContext?S(i,this).index(c)>-1:S.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,l<e.length&&s.push({elem:c,handlers:e.slice(l)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:b(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[S.expando]?t:new S.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return bt.test(e.type)&&e.click&&N(e,"input")&&Pt(e,"click",Ot),!1},trigger:function(t){var e=this||t;return bt.test(e.type)&&e.click&&N(e,"input")&&Pt(e,"click"),!0},_default:function(t){var e=t.target;return bt.test(e.type)&&e.click&&N(e,"input")&&et.get(e,"click")||N(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},S.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},S.Event=function(t,e){if(!(this instanceof S.Event))return new S.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Ot:Tt,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&&S.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Tt,isPropagationStopped:Tt,isImmediatePropagationStopped:Tt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Ot,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Ot,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Ot,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},S.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:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(t,e){S.event.special[t]={setup:function(){return Pt(this,t,_t),!1},trigger:function(){return Pt(this,t),!0},_default:function(e){return et.get(e.target,t)},delegateType:e}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){S.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;return i&&(i===r||S.contains(r,i))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}})),S.fn.extend({on:function(t,e,n,r){return Nt(this,t,e,n,r)},one:function(t,e,n,r){return Nt(this,t,e,n,r,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,S(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"===typeof t){for(i in t)this.off(i,e,t[i]);return this}return!1!==e&&"function"!==typeof e||(n=e,e=void 0),!1===n&&(n=Tt),this.each((function(){S.event.remove(this,t,n,e)}))}});var Lt=/<script|<style|<link/i,Dt=/checked\s*(?:[^=]|=\s*.checked.)/i,jt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function It(t,e){return N(t,"table")&&N(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Rt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ft(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Bt(t,e){var n,r,i,o,a,s,l;if(1===e.nodeType){if(et.hasData(t)&&(o=et.get(t),l=o.events,l))for(i in et.remove(e,"handle events"),l)for(n=0,r=l[i].length;n<r;n++)S.event.add(e,i,l[i][n]);nt.hasData(t)&&(a=nt.access(t),s=S.extend({},a),nt.set(e,s))}}function zt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&bt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Ht(t,e,n,r){e=c(e);var i,o,a,s,l,u,d=0,h=t.length,p=h-1,f=e[0],g=b(f);if(g||h>1&&"string"===typeof f&&!v.checkClone&&Dt.test(f))return t.each((function(i){var o=t.eq(i);g&&(e[0]=f.call(this,i,o.html())),Ht(o,e,n,r)}));if(h&&(i=St(e,t[0].ownerDocument,!1,t,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=S.map(Ct(i,"script"),Rt),s=a.length;d<h;d++)l=i,d!==p&&(l=S.clone(l,!0,!0),s&&S.merge(a,Ct(l,"script"))),n.call(t[d],l,d);if(s)for(u=a[a.length-1].ownerDocument,S.map(a,Ft),d=0;d<s;d++)l=a[d],wt.test(l.type||"")&&!et.access(l,"globalEval")&&S.contains(u,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?S._evalUrl&&!l.noModule&&S._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},u):C(l.textContent.replace(jt,""),l,u))}return t}function Vt(t,e,n){for(var r,i=e?S.filter(e,t):t,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(Ct(r)),r.parentNode&&(n&&dt(r)&&kt(Ct(r,"script")),r.parentNode.removeChild(r));return t}S.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,i,o,a,s=t.cloneNode(!0),l=dt(t);if(!v.noCloneChecked&&(1===t.nodeType||11===t.nodeType)&&!S.isXMLDoc(t))for(a=Ct(s),o=Ct(t),r=0,i=o.length;r<i;r++)zt(o[r],a[r]);if(e)if(n)for(o=o||Ct(t),a=a||Ct(s),r=0,i=o.length;r<i;r++)Bt(o[r],a[r]);else Bt(t,s);return a=Ct(s,"script"),a.length>0&&kt(a,!l&&Ct(t,"script")),s},cleanData:function(t){for(var e,n,r,i=S.event.special,o=0;void 0!==(n=t[o]);o++)if(Q(n)){if(e=n[et.expando]){if(e.events)for(r in e.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,e.handle);n[et.expando]=void 0}n[nt.expando]&&(n[nt.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Vt(this,t,!0)},remove:function(t){return Vt(this,t)},text:function(t){return Y(this,(function(t){return void 0===t?S.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 Ht(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=It(this,t);e.appendChild(t)}}))},prepend:function(){return Ht(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=It(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Ht(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Ht(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&&(S.cleanData(Ct(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return Y(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"===typeof t&&!Lt.test(t)&&!xt[(yt.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;n<r;n++)e=this[n]||{},1===e.nodeType&&(S.cleanData(Ct(e,!1)),e.innerHTML=t);e=0}catch(i){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Ht(this,arguments,(function(e){var n=this.parentNode;S.inArray(this,t)<0&&(S.cleanData(Ct(this)),n&&n.replaceChild(e,this))}),t)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){S.fn[t]=function(t){for(var n,r=[],i=S(t),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),S(i[a])[e](n),u.apply(r,n.get());return this.pushStack(r)}}));var qt=new RegExp("^("+st+")(?!px)[a-z%]+$","i"),Ut=/^--/,Wt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},$t=function(t,e,n){var r,i,o={};for(i in e)o[i]=t.style[i],t.style[i]=e[i];for(i in r=n.call(t),e)t.style[i]=o[i];return r},Gt=new RegExp(ct.join("|"),"i"),Yt="[\\x20\\t\\r\\n\\f]",Xt=new RegExp("^"+Yt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Yt+"+$","g");function Kt(t,e,n){var r,i,o,a,s=Ut.test(e),l=t.style;return n=n||Wt(t),n&&(a=n.getPropertyValue(e)||n[e],s&&(a=a.replace(Xt,"$1")),""!==a||dt(t)||(a=S.style(t,e)),!v.pixelBoxStyles()&&qt.test(a)&&Gt.test(e)&&(r=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=n.width,l.width=r,l.minWidth=i,l.maxWidth=o)),void 0!==a?a+"":a}function Zt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}(function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ut.appendChild(c).appendChild(u);var t=n.getComputedStyle(u);r="1%"!==t.top,l=12===e(t.marginLeft),u.style.right="60%",a=36===e(t.right),i=36===e(t.width),u.style.position="absolute",o=12===e(u.offsetWidth/3),ut.removeChild(c),u=null}}function e(t){return Math.round(parseFloat(t))}var r,i,o,a,s,l,c=w.createElement("div"),u=w.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===u.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,e,r,i;return null==s&&(t=w.createElement("table"),e=w.createElement("tr"),r=w.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",r.style.height="9px",r.style.display="block",ut.appendChild(t).appendChild(e).appendChild(r),i=n.getComputedStyle(e),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===e.offsetHeight,ut.removeChild(t)),s}}))})();var Jt=["Webkit","Moz","ms"],Qt=w.createElement("div").style,te={};function ee(t){var e=t[0].toUpperCase()+t.slice(1),n=Jt.length;while(n--)if(t=Jt[n]+e,t in Qt)return t}function ne(t){var e=S.cssProps[t]||te[t];return e||(t in Qt?t:te[t]=ee(t)||t)}var re=/^(none|table(?!-c[ea]).+)/,ie={position:"absolute",visibility:"hidden",display:"block"},oe={letterSpacing:"0",fontWeight:"400"};function ae(t,e,n){var r=lt.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function se(t,e,n,r,i,o){var a="width"===e?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=S.css(t,n+ct[a],!0,i)),r?("content"===n&&(l-=S.css(t,"padding"+ct[a],!0,i)),"margin"!==n&&(l-=S.css(t,"border"+ct[a]+"Width",!0,i))):(l+=S.css(t,"padding"+ct[a],!0,i),"padding"!==n?l+=S.css(t,"border"+ct[a]+"Width",!0,i):s+=S.css(t,"border"+ct[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-s-.5))||0),l}function le(t,e,n){var r=Wt(t),i=!v.boxSizingReliable()||n,o=i&&"border-box"===S.css(t,"boxSizing",!1,r),a=o,s=Kt(t,e,r),l="offset"+e[0].toUpperCase()+e.slice(1);if(qt.test(s)){if(!n)return s;s="auto"}return(!v.boxSizingReliable()&&o||!v.reliableTrDimensions()&&N(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===S.css(t,"display",!1,r))&&t.getClientRects().length&&(o="border-box"===S.css(t,"boxSizing",!1,r),a=l in t,a&&(s=t[l])),s=parseFloat(s)||0,s+se(t,e,n||(o?"border":"content"),a,r,s)+"px"}function ce(t,e,n,r,i){return new ce.prototype.init(t,e,n,r,i)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Kt(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,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=J(e),l=Ut.test(e),c=t.style;if(l||(e=ne(s)),a=S.cssHooks[e]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:c[e];o=typeof n,"string"===o&&(i=lt.exec(n))&&i[1]&&(n=ft(t,e,i),o="number"),null!=n&&n===n&&("number"!==o||l||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var i,o,a,s=J(e),l=Ut.test(e);return l||(e=ne(s)),a=S.cssHooks[e]||S.cssHooks[s],a&&"get"in a&&(i=a.get(t,!0,n)),void 0===i&&(i=Kt(t,e,r)),"normal"===i&&e in oe&&(i=oe[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,n,r){if(n)return!re.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?le(t,e,r):$t(t,ie,(function(){return le(t,e,r)}))},set:function(t,n,r){var i,o=Wt(t),a=!v.scrollboxSize()&&"absolute"===o.position,s=a||r,l=s&&"border-box"===S.css(t,"boxSizing",!1,o),c=r?se(t,e,r,l,o):0;return l&&a&&(c-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-se(t,e,"border",!1,o)-.5)),c&&(i=lt.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=S.css(t,e)),ae(t,n,c)}}})),S.cssHooks.marginLeft=Zt(v.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Kt(t,"marginLeft"))||t.getBoundingClientRect().left-$t(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"===typeof n?n.split(" "):[n];r<4;r++)i[t+ct[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(S.cssHooks[t+e].set=ae)})),S.fn.extend({css:function(t,e){return Y(this,(function(t,e,n){var r,i,o={},a=0;if(Array.isArray(e)){for(r=Wt(t),i=e.length;a<i;a++)o[e[a]]=S.css(t,e[a],!1,r);return o}return void 0!==n?S.style(t,e,n):S.css(t,e)}),t,e,arguments.length>1)}}),S.Tween=ce,ce.prototype={constructor:ce,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var t=ce.propHooks[this.prop];return t&&t.get?t.get(this):ce.propHooks._default.get(this)},run:function(t){var e,n=ce.propHooks[this.prop];return this.options.duration?this.pos=e=S.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):ce.propHooks._default.set(this),this}},ce.prototype.init.prototype=ce.prototype,ce.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=S.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[ne(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},ce.propHooks.scrollTop=ce.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=ce.prototype.init,S.fx.step={};var ue,de,he=/^(?:toggle|show|hide)$/,pe=/queueHooks$/;function fe(){de&&(!1===w.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(fe):n.setTimeout(fe,S.fx.interval),S.fx.tick())}function ge(){return n.setTimeout((function(){ue=void 0})),ue=Date.now()}function me(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)n=ct[r],i["margin"+n]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function ve(t,e,n){for(var r,i=(we.tweeners[e]||[]).concat(we.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,e,t))return r}function be(t,e,n){var r,i,o,a,s,l,c,u,d="width"in e||"height"in e,h=this,p={},f=t.style,g=t.nodeType&&pt(t),m=et.get(t,"fxshow");for(r in n.queue||(a=S._queueHooks(t,"fx"),null==a.unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,h.always((function(){h.always((function(){a.unqueued--,S.queue(t,"fx").length||a.empty.fire()}))}))),e)if(i=e[r],he.test(i)){if(delete e[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}p[r]=m&&m[r]||S.style(t,r)}if(l=!S.isEmptyObject(e),l||!S.isEmptyObject(p))for(r in d&&1===t.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],c=m&&m.display,null==c&&(c=et.get(t,"display")),u=S.css(t,"display"),"none"===u&&(c?u=c:(vt([t],!0),c=t.style.display||c,u=S.css(t,"display"),vt([t]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===S.css(t,"float")&&(l||(h.done((function(){f.display=c})),null==c&&(u=f.display,c="none"===u?"":u)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",h.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),l=!1,p)l||(m?"hidden"in m&&(g=m.hidden):m=et.access(t,"fxshow",{display:c}),o&&(m.hidden=!g),g&&vt([t],!0),h.done((function(){for(r in g||vt([t]),et.remove(t,"fxshow"),p)S.style(t,r,p[r])}))),l=ve(g?m[r]:0,r,h),r in m||(m[r]=l.start,g&&(l.end=l.start,l.start=0))}function ye(t,e){var n,r,i,o,a;for(n in t)if(r=J(n),i=e[r],o=t[n],Array.isArray(o)&&(i=o[1],o=t[n]=o[0]),n!==r&&(t[r]=o,delete t[n]),a=S.cssHooks[r],a&&"expand"in a)for(n in o=a.expand(o),delete t[r],o)n in t||(t[n]=o[n],e[n]=i);else e[r]=i}function we(t,e,n){var r,i,o=0,a=we.prefilters.length,s=S.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var e=ue||ge(),n=Math.max(0,c.startTime+c.duration-e),r=n/c.duration||0,o=1-r,a=0,l=c.tweens.length;a<l;a++)c.tweens[a].run(o);return s.notifyWith(t,[c,o,n]),o<1&&l?n:(l||s.notifyWith(t,[c,1,0]),s.resolveWith(t,[c]),!1)},c=s.promise({elem:t,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:e,originalOptions:n,startTime:ue||ge(),duration:n.duration,tweens:[],createTween:function(e,n){var r=S.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(r),r},stop:function(e){var n=0,r=e?c.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)c.tweens[n].run(1);return e?(s.notifyWith(t,[c,1,0]),s.resolveWith(t,[c,e])):s.rejectWith(t,[c,e]),this}}),u=c.props;for(ye(u,c.opts.specialEasing);o<a;o++)if(r=we.prefilters[o].call(c,t,u,c.opts),r)return b(r.stop)&&(S._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return S.map(u,ve,c),b(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),S.fx.timer(S.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}S.Animation=S.extend(we,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return ft(n.elem,t,lt.exec(e),n),n}]},tweener:function(t,e){b(t)?(e=t,t=["*"]):t=t.match(z);for(var n,r=0,i=t.length;r<i;r++)n=t[r],we.tweeners[n]=we.tweeners[n]||[],we.tweeners[n].unshift(e)},prefilters:[be],prefilter:function(t,e){e?we.prefilters.unshift(t):we.prefilters.push(t)}}),S.speed=function(t,e,n){var r=t&&"object"===typeof t?S.extend({},t):{complete:n||!n&&e||b(t)&&t,duration:t,easing:n&&e||e&&!b(e)&&e};return S.fx.off?r.duration=0:"number"!==typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){b(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(t,e,n,r){return this.filter(pt).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=we(this,S.extend({},t),o);(i||et.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!==typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,i=null!=t&&t+"queueHooks",o=S.timers,a=et.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&pe.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=t&&o[i].queue!==t||(o[i].anim.stop(n),e=!1,o.splice(i,1));!e&&n||S.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=et.get(this),r=n[t+"queue"],i=n[t+"queueHooks"],o=S.timers,a=r?r.length:0;for(n.finish=!0,S.queue(this,t,[]),i&&i.stop&&i.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<a;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish}))}}),S.each(["toggle","show","hide"],(function(t,e){var n=S.fn[e];S.fn[e]=function(t,r,i){return null==t||"boolean"===typeof t?n.apply(this,arguments):this.animate(me(e,!0),t,r,i)}})),S.each({slideDown:me("show"),slideUp:me("hide"),slideToggle:me("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){S.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}})),S.timers=[],S.fx.tick=function(){var t,e=0,n=S.timers;for(ue=Date.now();e<n.length;e++)t=n[e],t()||n[e]!==t||n.splice(e--,1);n.length||S.fx.stop(),ue=void 0},S.fx.timer=function(t){S.timers.push(t),S.fx.start()},S.fx.interval=13,S.fx.start=function(){de||(de=!0,fe())},S.fx.stop=function(){de=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,e){return t=S.fx&&S.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,r){var i=n.setTimeout(e,t);r.stop=function(){n.clearTimeout(i)}}))},function(){var t=w.createElement("input"),e=w.createElement("select"),n=e.appendChild(w.createElement("option"));t.type="checkbox",v.checkOn=""!==t.value,v.optSelected=n.selected,t=w.createElement("input"),t.value="t",t.type="radio",v.radioValue="t"===t.value}();var xe,Ce=S.expr.attrHandle;S.fn.extend({attr:function(t,e){return Y(this,S.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"===typeof t.getAttribute?S.prop(t,e,n):(1===o&&S.isXMLDoc(t)||(i=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?xe:void 0)),void 0!==n?null===n?void S.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:(r=S.find.attr(t,e),null==r?void 0:r))},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&N(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(z);if(i&&1===t.nodeType)while(n=i[r++])t.removeAttribute(n)}}),xe={set:function(t,e,n){return!1===e?S.removeAttr(t,n):t.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=Ce[e]||S.find.attr;Ce[e]=function(t,e,r){var i,o,a=e.toLowerCase();return r||(o=Ce[a],Ce[a]=i,i=null!=n(t,e,r)?a:null,Ce[a]=o),i}}));var ke=/^(?:input|select|textarea|button)$/i,Ae=/^(?:a|area)$/i;function Se(t){var e=t.match(z)||[];return e.join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function Oe(t){return Array.isArray(t)?t:"string"===typeof t&&t.match(z)||[]}S.fn.extend({prop:function(t,e){return Y(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(t)||(e=S.propFix[e]||e,i=S.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):ke.test(t.nodeName)||Ae.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(S.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)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,n,r,i,o,a;return b(t)?this.each((function(e){S(this).addClass(t.call(this,e,Ee(this)))})):(e=Oe(t),e.length?this.each((function(){if(r=Ee(this),n=1===this.nodeType&&" "+Se(r)+" ",n){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Se(n),r!==a&&this.setAttribute("class",a)}})):this)},removeClass:function(t){var e,n,r,i,o,a;return b(t)?this.each((function(e){S(this).removeClass(t.call(this,e,Ee(this)))})):arguments.length?(e=Oe(t),e.length?this.each((function(){if(r=Ee(this),n=1===this.nodeType&&" "+Se(r)+" ",n){for(o=0;o<e.length;o++){i=e[o];while(n.indexOf(" "+i+" ")>-1)n=n.replace(" "+i+" "," ")}a=Se(n),r!==a&&this.setAttribute("class",a)}})):this):this.attr("class","")},toggleClass:function(t,e){var n,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return b(t)?this.each((function(n){S(this).toggleClass(t.call(this,n,Ee(this),e),e)})):"boolean"===typeof e&&s?e?this.addClass(t):this.removeClass(t):(n=Oe(t),this.each((function(){if(s)for(o=S(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||(r=Ee(this),r&&et.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":et.get(this,"__className__")||""))})))},hasClass:function(t){var e,n,r=0;e=" "+t+" ";while(n=this[r++])if(1===n.nodeType&&(" "+Se(Ee(n))+" ").indexOf(e)>-1)return!0;return!1}});var Te=/\r/g;S.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=b(t),this.each((function(n){var i;1===this.nodeType&&(i=r?t.call(this,n,S(this).val()):t,null==i?i="":"number"===typeof i?i+="":Array.isArray(i)&&(i=S.map(i,(function(t){return null==t?"":t+""}))),e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:(n=i.value,"string"===typeof n?n.replace(Te,""):null==n?"":n)):void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:Se(S.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r<l;r++)if(n=i[r],(n.selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!N(n.parentNode,"optgroup"))){if(e=S(n).val(),a)return e;s.push(e)}return s},set:function(t,e){var n,r,i=t.options,o=S.makeArray(e),a=i.length;while(a--)r=i[a],(r.selected=S.inArray(S.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},v.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),v.focusin="onfocusin"in n;var _e=/^(?:focusinfocus|focusoutblur)$/,Me=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,r,i){var o,a,s,l,c,u,d,h,p=[r||w],g=f.call(t,"type")?t.type:t,m=f.call(t,"namespace")?t.namespace.split("."):[];if(a=h=s=r=r||w,3!==r.nodeType&&8!==r.nodeType&&!_e.test(g+S.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),c=g.indexOf(":")<0&&"on"+g,t=t[S.expando]?t:new S.Event(g,"object"===typeof t&&t),t.isTrigger=i?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:S.makeArray(e,[t]),d=S.event.special[g]||{},i||!d.trigger||!1!==d.trigger.apply(r,e))){if(!i&&!d.noBubble&&!y(r)){for(l=d.delegateType||g,_e.test(l+g)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||w)&&p.push(s.defaultView||s.parentWindow||n)}o=0;while((a=p[o++])&&!t.isPropagationStopped())h=a,t.type=o>1?l:d.bindType||g,u=(et.get(a,"events")||Object.create(null))[t.type]&&et.get(a,"handle"),u&&u.apply(a,e),u=c&&a[c],u&&u.apply&&Q(a)&&(t.result=u.apply(a,e),!1===t.result&&t.preventDefault());return t.type=g,i||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),e)||!Q(r)||c&&b(r[g])&&!y(r)&&(s=r[c],s&&(r[c]=null),S.event.triggered=g,t.isPropagationStopped()&&h.addEventListener(g,Me),r[g](),t.isPropagationStopped()&&h.removeEventListener(g,Me),S.event.triggered=void 0,s&&(r[c]=s)),t.result}},simulate:function(t,e,n){var r=S.extend(new S.Event,n,{type:t,isSimulated:!0});S.event.trigger(r,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return S.event.trigger(t,e,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){S.event.simulate(e,t.target,S.event.fix(t))};S.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=et.access(r,e);i||r.addEventListener(t,n,!0),et.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=et.access(r,e)-1;i?et.access(r,e,i):(r.removeEventListener(t,n,!0),et.remove(r,e))}}}));var Ne=n.location,Pe={guid:Date.now()},Le=/\?/;S.parseXML=function(t){var e,r;if(!t||"string"!==typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(i){}return r=e&&e.getElementsByTagName("parsererror")[0],e&&!r||S.error("Invalid XML: "+(r?S.map(r.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var De=/\[\]$/,je=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,Re=/^(?:input|select|textarea|keygen)/i;function Fe(t,e,n,r){var i;if(Array.isArray(e))S.each(e,(function(e,i){n||De.test(t)?r(t,i):Fe(t+"["+("object"===typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==k(e))r(t,e);else for(i in e)Fe(t+"["+i+"]",e[i],n,r)}S.param=function(t,e){var n,r=[],i=function(t,e){var n=b(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){i(this.name,this.value)}));else for(n in t)Fe(n,t[n],e,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&Re.test(this.nodeName)&&!Ie.test(t)&&(this.checked||!bt.test(t))})).map((function(t,e){var n=S(this).val();return null==n?null:Array.isArray(n)?S.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 Be=/%20/g,ze=/#.*$/,He=/([?&])_=[^&]*/,Ve=/^(.*?):[ \t]*([^\r\n]*)$/gm,qe=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ue=/^(?:GET|HEAD)$/,We=/^\/\//,$e={},Ge={},Ye="*/".concat("*"),Xe=w.createElement("a");function Ke(t){return function(e,n){"string"!==typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(z)||[];if(b(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Ze(t,e,n,r){var i={},o=t===Ge;function a(s){var l;return i[s]=!0,S.each(t[s]||[],(function(t,s){var c=s(e,n,r);return"string"!==typeof c||o||i[c]?o?!(l=c):void 0:(e.dataTypes.unshift(c),a(c),!1)})),l}return a(e.dataTypes[0])||!i["*"]&&a("*")}function Je(t,e){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&S.extend(!0,t,r),t}function Qe(t,e,n){var r,i,o,a,s=t.contents,l=t.dataTypes;while("*"===l[0])l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||t.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}function tn(t,e,n,r){var i,o,a,s,l,c={},u=t.dataTypes.slice();if(u[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];o=u.shift();while(o)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=u.shift(),o)if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=c[l+" "+o]||c["* "+o],!a)for(i in c)if(s=i.split(" "),s[1]===o&&(a=c[l+" "+s[0]]||c["* "+s[0]],a)){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(d){return{state:"parsererror",error:a?d:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}Xe.href=Ne.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ne.href,type:"GET",isLocal:qe.test(Ne.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ye,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":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Je(Je(t,S.ajaxSettings),e):Je(S.ajaxSettings,t)},ajaxPrefilter:Ke($e),ajaxTransport:Ke(Ge),ajax:function(t,e){"object"===typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,a,s,l,c,u,d,h,p=S.ajaxSetup({},e),f=p.context||p,g=p.context&&(f.nodeType||f.jquery)?S(f):S.event,m=S.Deferred(),v=S.Callbacks("once memory"),b=p.statusCode||{},y={},x={},C="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a){a={};while(e=Ve.exec(o))a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2])}e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,y[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)k.always(t[k.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||C;return r&&r.abort(e),A(0,e),this}};if(m.promise(k),p.url=((t||p.url||Ne.href)+"").replace(We,Ne.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(z)||[""],null==p.crossDomain){l=w.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Xe.protocol+"//"+Xe.host!==l.protocol+"//"+l.host}catch(E){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!==typeof p.data&&(p.data=S.param(p.data,p.traditional)),Ze($e,p,e,k),c)return k;for(d in u=S.event&&p.global,u&&0===S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ue.test(p.type),i=p.url.replace(ze,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Be,"+")):(h=p.url.slice(i.length),p.data&&(p.processData||"string"===typeof p.data)&&(i+=(Le.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(He,"$1"),h=(Le.test(i)?"&":"?")+"_="+Pe.guid+++h),p.url=i+h),p.ifModified&&(S.lastModified[i]&&k.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&k.setRequestHeader("If-None-Match",S.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ye+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(f,k,p)||c))return k.abort();if(C="abort",v.add(p.complete),k.done(p.success),k.fail(p.error),r=Ze(Ge,p,e,k),r){if(k.readyState=1,u&&g.trigger("ajaxSend",[k,p]),c)return k;p.async&&p.timeout>0&&(s=n.setTimeout((function(){k.abort("timeout")}),p.timeout));try{c=!1,r.send(y,A)}catch(E){if(c)throw E;A(-1,E)}}else A(-1,"No Transport");function A(t,e,a,l){var d,h,y,w,x,C=e;c||(c=!0,s&&n.clearTimeout(s),r=void 0,o=l||"",k.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(w=Qe(p,k,a)),!d&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=tn(p,w,k,d),d?(p.ifModified&&(x=k.getResponseHeader("Last-Modified"),x&&(S.lastModified[i]=x),x=k.getResponseHeader("etag"),x&&(S.etag[i]=x)),204===t||"HEAD"===p.type?C="nocontent":304===t?C="notmodified":(C=w.state,h=w.data,y=w.error,d=!y)):(y=C,!t&&C||(C="error",t<0&&(t=0))),k.status=t,k.statusText=(e||C)+"",d?m.resolveWith(f,[h,C,k]):m.rejectWith(f,[k,C,y]),k.statusCode(b),b=void 0,u&&g.trigger(d?"ajaxSuccess":"ajaxError",[k,p,d?h:y]),v.fireWith(f,[k,C]),u&&(g.trigger("ajaxComplete",[k,p]),--S.active||S.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,n){return S.get(t,e,n,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,n,r,i){return b(n)&&(i=i||r,r=n,n=void 0),S.ajax(S.extend({url:t,type:e,dataType:i,data:n,success:r},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,n){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,n)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(b(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){var t=this;while(t.firstElementChild)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return b(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=b(t);return this.each((function(n){S(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var en={0:200,1223:204},nn=S.ajaxSettings.xhr();v.cors=!!nn&&"withCredentials"in nn,v.ajax=nn=!!nn,S.ajaxTransport((function(t){var e,r;if(v.cors||nn&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);e=function(t){return function(){e&&(e=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!==typeof s.status?o(0,"error"):o(s.status,s.statusText):o(en[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!==typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),r=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){e&&r()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(l){if(e)throw l}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.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 S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=S("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),w.head.appendChild(e[0])},abort:function(){n&&n()}}}));var rn=[],on=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=rn.pop()||S.expando+"_"+Pe.guid++;return this[t]=!0,t}}),S.ajaxPrefilter("json jsonp",(function(t,e,r){var i,o,a,s=!1!==t.jsonp&&(on.test(t.url)?"url":"string"===typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&on.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=b(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(on,"$1"+i):!1!==t.jsonp&&(t.url+=(Le.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||S.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=n[i],n[i]=function(){a=arguments},r.always((function(){void 0===o?S(n).removeProp(i):n[i]=o,t[i]&&(t.jsonpCallback=e.jsonpCallback,rn.push(i)),a&&b(o)&&o(a[0]),a=o=void 0})),"script"})),v.createHTMLDocument=function(){var t=w.implementation.createHTMLDocument("").body;return t.innerHTML="<form></form><form></form>",2===t.childNodes.length}(),S.parseHTML=function(t,e,n){return"string"!==typeof t?[]:("boolean"===typeof e&&(n=e,e=!1),e||(v.createHTMLDocument?(e=w.implementation.createHTMLDocument(""),r=e.createElement("base"),r.href=w.location.href,e.head.appendChild(r)):e=w),i=P.exec(t),o=!n&&[],i?[e.createElement(i[1])]:(i=St([t],e,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(t,e,n){var r,i,o,a=this,s=t.indexOf(" ");return s>-1&&(r=Se(t.slice(s)),t=t.slice(0,s)),b(e)?(n=e,e=void 0):e&&"object"===typeof e&&(i="POST"),a.length>0&&S.ajax({url:t,type:i||"GET",dataType:"html",data:e}).done((function(t){o=arguments,a.html(r?S("<div>").append(S.parseHTML(t)).find(r):t)})).always(n&&function(t,e){a.each((function(){n.apply(this,o||[t.responseText,e,t])}))}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,(function(e){return t===e.elem})).length},S.offset={setOffset:function(t,e,n){var r,i,o,a,s,l,c,u=S.css(t,"position"),d=S(t),h={};"static"===u&&(t.style.position="relative"),s=d.offset(),o=S.css(t,"top"),l=S.css(t,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),b(e)&&(e=e.call(t,n,S.extend({},s))),null!=e.top&&(h.top=e.top-s.top+a),null!=e.left&&(h.left=e.left-s.left+i),"using"in e?e.using.call(t,h):d.css(h)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){S.offset.setOffset(this,t,e)}));var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))e=r.getBoundingClientRect();else{e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;while(t&&(t===n.body||t===n.documentElement)&&"static"===S.css(t,"position"))t=t.parentNode;t&&t!==r&&1===t.nodeType&&(i=S(t).offset(),i.top+=S.css(t,"borderTopWidth",!0),i.left+=S.css(t,"borderLeftWidth",!0))}return{top:e.top-i.top-S.css(r,"marginTop",!0),left:e.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){var t=this.offsetParent;while(t&&"static"===S.css(t,"position"))t=t.offsetParent;return t||ut}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;S.fn[t]=function(r){return Y(this,(function(t,r,i){var o;if(y(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===i)return o?o[e]:t[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):t[r]=i}),t,r,arguments.length)}})),S.each(["top","left"],(function(t,e){S.cssHooks[e]=Zt(v.pixelPosition,(function(t,n){if(n)return n=Kt(t,e),qt.test(n)?S(t).position()[e]+"px":n}))})),S.each({Height:"height",Width:"width"},(function(t,e){S.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,r){S.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!==typeof i),s=n||(!0===i||!0===o?"margin":"border");return Y(this,(function(e,n,i){var o;return y(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===i?S.css(e,n,s):S.style(e,n,i,s)}),e,a?i:void 0,a)}}))})),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){S.fn[e]=function(t){return this.on(e,t)}})),S.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,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),S.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,e){S.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var an=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(t,e){var n,r,i;if("string"===typeof e&&(n=t[e],e=t,t=n),b(t))return r=l.call(arguments,2),i=function(){return t.apply(e||this,r.concat(l.call(arguments)))},i.guid=t.guid=t.guid||S.guid++,i},S.holdReady=function(t){t?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=N,S.isFunction=b,S.isWindow=y,S.camelCase=J,S.type=k,S.now=Date.now,S.isNumeric=function(t){var e=S.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},S.trim=function(t){return null==t?"":(t+"").replace(an,"$1")},r=[],i=function(){return S}.apply(e,r),void 0===i||(t.exports=i);var sn=n.jQuery,ln=n.$;return S.noConflict=function(t){return n.$===S&&(n.$=ln),t&&n.jQuery===S&&(n.jQuery=sn),S},"undefined"===typeof o&&(n.jQuery=n.$=S),S}))},"129e":function(t,e,n){},"129f":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},"13d5":function(t,e,n){"use strict";var r=n("23e7"),i=n("d58f").left,o=n("a640"),a=n("2d00"),s=n("605d"),l=o("reduce"),c=!s&&a>79&&a<83;r({target:"Array",proto:!0,forced:!l||c},{reduce:function(t){var e=arguments.length;return i(this,t,e,e>1?arguments[1]:void 0)}})},"13d9":function(t,e){t.exports=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,n=[],r=0;r<t.rangeCount;r++)n.push(t.getRangeAt(r));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return t.removeAllRanges(),function(){"Caret"===t.type&&t.removeAllRanges(),t.rangeCount||n.forEach((function(e){t.addRange(e)})),e&&e.focus()}}},1448:function(t,e,n){var r=n("dfb9"),i=n("b6b7");t.exports=function(t,e){return r(i(t),e)}},"145e":function(t,e,n){"use strict";var r=n("7b0b"),i=n("23cb"),o=n("07fa"),a=n("083a"),s=Math.min;t.exports=[].copyWithin||function(t,e){var n=r(this),l=o(n),c=i(t,l),u=i(e,l),d=arguments.length>2?arguments[2]:void 0,h=s((void 0===d?l:i(d,l))-u,l-c),p=1;u<c&&c<u+h&&(p=-1,u+=h-1,c+=h-1);while(h-- >0)u in n?n[c]=n[u]:a(n,c),c+=p,u+=p;return n}},"164b":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";t.registerGlobalHelper("fold","comment",(function(t){return t.blockCommentStart&&t.blockCommentEnd}),(function(e,n){var r=e.getModeAt(n),i=r.blockCommentStart,o=r.blockCommentEnd;if(i&&o){for(var a,s=n.line,l=e.getLine(s),c=n.ch,u=0;;){var d=c<=0?-1:l.lastIndexOf(i,c-1);if(-1!=d){if(1==u&&d<n.ch)return;if(/comment/.test(e.getTokenTypeAt(t.Pos(s,d+1)))&&(0==d||l.slice(d-o.length,d)==o||!/comment/.test(e.getTokenTypeAt(t.Pos(s,d))))){a=d+i.length;break}c=d-1}else{if(1==u)return;u=1,c=l.length}}var h,p,f=1,g=e.lastLine();t:for(var m=s;m<=g;++m)for(var v=e.getLine(m),b=m==s?a:0;;){var y=v.indexOf(i,b),w=v.indexOf(o,b);if(y<0&&(y=v.length),w<0&&(w=v.length),b=Math.min(y,w),b==v.length)break;if(b==y)++f;else if(!--f){h=m,p=b;break t}++b}if(null!=h&&(s!=h||p!=a))return{from:t.Pos(s,a),to:t.Pos(h,p)}}}))}))},1659:function(t,e,n){"use strict";n("d88e")},"16ef":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Angle=void 0,function(t){function e(t){return 180*t/Math.PI%360}function n(t){return t%360+(t<0?360:0)}t.toDeg=e,t.toRad=function(t,e){void 0===e&&(e=!1);var n=e?t:t%360;return n*Math.PI/180},t.normalize=n}(e.Angle||(e.Angle={}))},"170b":function(t,e,n){"use strict";var r=n("ebb5"),i=n("50c4"),o=n("23cb"),a=n("b6b7"),s=r.aTypedArray,l=r.exportTypedArrayMethod;l("subarray",(function(t,e){var n=s(this),r=n.length,l=o(t,r),c=a(n);return new c(n.buffer,n.byteOffset+l*n.BYTES_PER_ELEMENT,i((void 0===e?r:o(e,r))-l))}))},1723:function(t,e,n){},"182d":function(t,e,n){var r=n("f8cd"),i=RangeError;t.exports=function(t,e){var n=r(t);if(n%e)throw i("Wrong offset");return n}},1913:function(t,e,n){"use strict";var r=n("23e7"),i=n("857a"),o=n("af03");r({target:"String",proto:!0,forced:o("fontsize")},{fontsize:function(t){return i(this,"font","size",t)}})},1985:function(t,e,n){(function(t,r){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof r&&r;a.global!==a&&a.window!==a&&a.self;var s,l=2147483647,c=36,u=1,d=26,h=38,p=700,f=72,g=128,m="-",v=/^xn--/,b=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=c-u,C=Math.floor,k=String.fromCharCode;function A(t){throw new RangeError(w[t])}function S(t,e){var n=t.length,r=[];while(n--)r[n]=e(t[n]);return r}function E(t,e){var n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(y,".");var i=t.split("."),o=S(i,e).join(".");return r+o}function O(t){var e,n,r=[],i=0,o=t.length;while(i<o)e=t.charCodeAt(i++),e>=55296&&e<=56319&&i<o?(n=t.charCodeAt(i++),56320==(64512&n)?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--)):r.push(e);return r}function T(t){return S(t,(function(t){var e="";return t>65535&&(t-=65536,e+=k(t>>>10&1023|55296),t=56320|1023&t),e+=k(t),e})).join("")}function _(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:c}function M(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function N(t,e,n){var r=0;for(t=n?C(t/p):t>>1,t+=C(t/e);t>x*d>>1;r+=c)t=C(t/x);return C(r+(x+1)*t/(t+h))}function P(t){var e,n,r,i,o,a,s,h,p,v,b=[],y=t.length,w=0,x=g,k=f;for(n=t.lastIndexOf(m),n<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&A("not-basic"),b.push(t.charCodeAt(r));for(i=n>0?n+1:0;i<y;){for(o=w,a=1,s=c;;s+=c){if(i>=y&&A("invalid-input"),h=_(t.charCodeAt(i++)),(h>=c||h>C((l-w)/a))&&A("overflow"),w+=h*a,p=s<=k?u:s>=k+d?d:s-k,h<p)break;v=c-p,a>C(l/v)&&A("overflow"),a*=v}e=b.length+1,k=N(w-o,e,0==o),C(w/e)>l-x&&A("overflow"),x+=C(w/e),w%=e,b.splice(w++,0,x)}return T(b)}function L(t){var e,n,r,i,o,a,s,h,p,v,b,y,w,x,S,E=[];for(t=O(t),y=t.length,e=g,n=0,o=f,a=0;a<y;++a)b=t[a],b<128&&E.push(k(b));r=i=E.length,i&&E.push(m);while(r<y){for(s=l,a=0;a<y;++a)b=t[a],b>=e&&b<s&&(s=b);for(w=r+1,s-e>C((l-n)/w)&&A("overflow"),n+=(s-e)*w,e=s,a=0;a<y;++a)if(b=t[a],b<e&&++n>l&&A("overflow"),b==e){for(h=n,p=c;;p+=c){if(v=p<=o?u:p>=o+d?d:p-o,h<v)break;S=h-v,x=c-v,E.push(k(M(v+S%x,0))),h=C(S/x)}E.push(k(M(h,0))),o=N(n,w,r==i),n=0,++r}++n,++e}return E.join("")}function D(t){return E(t,(function(t){return v.test(t)?P(t.slice(4).toLowerCase()):t}))}function j(t){return E(t,(function(t){return b.test(t)?"xn--"+L(t):t}))}s={version:"1.4.1",ucs2:{decode:O,encode:T},decode:P,encode:L,toASCII:j,toUnicode:D},i=function(){return s}.call(e,n,e,t),void 0===i||(t.exports=i)})()}).call(this,n("62e4")(t),n("c8ba"))},"19b4":function(t,e,n){},"1aef":function(t,e){var n=[],r=[],i="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function o(t,e){if(e=e||{},void 0===t)throw new Error(i);var o,s=!0===e.prepend?"prepend":"append",l=void 0!==e.container?e.container:document.querySelector("head"),c=n.indexOf(l);return-1===c&&(c=n.push(l)-1,r[c]={}),void 0!==r[c]&&void 0!==r[c][s]?o=r[c][s]:(o=r[c][s]=a(),"prepend"===s?l.insertBefore(o,l.childNodes[0]):l.appendChild(o)),65279===t.charCodeAt(0)&&(t=t.substr(1,t.length)),o.styleSheet?o.styleSheet.cssText+=t:o.textContent+=t,o}function a(){var t=document.createElement("style");return t.setAttribute("type","text/css"),t}t.exports=o,t.exports.insertCss=o},"1b15":function(t,e,n){"use strict";var r=n("7037").default;n("d9e2"),n("131a"),n("3410"),n("d3b7"),n("f8c9"),n("4ae1"),n("99af"),n("8a794"),n("4de4"),n("159b"),n("ac1f");var i=n("a57f");function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function h(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(t,e){if(e&&("object"===r(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return p(t)}function g(t){var e=h();return function(){var n,r=u(t);if(e){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}var m=0;function v(t){return"__private_"+m+++"_"+t}function b(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var y="paste:each",w=v("styleName"),x=function(t){c(n,t);var e=g(n);function n(){var t;o(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return t=e.call.apply(e,[this].concat(i)),Object.defineProperty(p(t),w,{writable:!0,value:"line-height"}),t.pasteEach=function(e){var n=t.editor;if(!e.isCard()&&n.node.isBlock(e)){var r=e.css(b(p(t),w)[w]);if(!r)return;var i=t.convertToPX(r);r.endsWith("pt")&&e.css(b(p(t),w)[w],i);var o=t.options.filter;if(o){var a=o(i);!1===a?e.css(b(p(t),w)[w],""):"string"===typeof a&&e.css(b(p(t),w)[w],a)}else e.css(b(p(t),w)[w],"");var s=n.node;s.isBlock(e)||s.unwrap(e)}},t}return s(n,[{key:"init",value:function(){var t=this.editor;t.schema.add(this.schema()),i.isEngine(t)&&t.on(y,this.pasteEach)}},{key:"execute",value:function(t){var e=this,n=this.editor;if(i.isEngine(n)){"default"===t&&(t="");var r=n.change,o=n.block,a=r.range.get(),s=o.findBlocks(a);s&&s.forEach((function(n){e.addLineHeight(n,t)}))}}},{key:"queryState",value:function(){var t=this,e=this.editor;if(i.isEngine(e)){var n=e.change,r=e.node,o=n.range.get();if(!o.startNode.inEditor())return["default"];var a=n.blocks,s=[];return a.forEach((function(e){if(r.isNestedBlock(e)){var n,i=(null===(n=e.get())||void 0===n?void 0:n.style.lineHeight)||"";if(!i)return;var o=t.convertToPX(i),a=t.options.filter;if(a){var l=a(o);if(!1===l)return;"string"===typeof l?s.push(l):s.push(o)}}})),0===s.length?["default"]:s}}},{key:"addLineHeight",value:function(t,e){var n=this.editor.node;n.isNestedBlock(t)&&t.css(b(this,w)[w],e||"")}},{key:"schema",value:function(){return{type:"block",attributes:{style:l({},b(this,w)[w],"@length")}}}},{key:"convertToPX",value:function(t){var e=/([\d\.]+)(pt|px)$/i.exec(t);return e&&"pt"===e[2]?String(Math.round(96*parseInt(e[1],10)/72))+"px":t}},{key:"destroy",value:function(){this.editor.off(y,this.pasteEach)}}],[{key:"pluginName",get:function(){return"line-height"}}]),n}(i.Plugin);t.exports=x},"1b19":function(t,e,n){"use strict";function r(t,e){var n,r,i,o,a,s,l=e.length;for(n=l-1;n>=0;n--)r=e[n],95!==r.marker&&42!==r.marker||-1!==r.end&&(i=e[r.end],s=n>0&&e[n-1].end===r.end+1&&e[n-1].marker===r.marker&&e[n-1].token===r.token-1&&e[r.end+1].token===i.token+1,a=String.fromCharCode(r.marker),o=t.tokens[r.token],o.type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?a+a:a,o.content="",o=t.tokens[i.token],o.type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?a+a:a,o.content="",s&&(t.tokens[e[n-1].token].content="",t.tokens[e[r.end+1].token].content="",n--))}t.exports.tokenize=function(t,e){var n,r,i,o=t.pos,a=t.src.charCodeAt(o);if(e)return!1;if(95!==a&&42!==a)return!1;for(r=t.scanDelims(t.pos,42===a),n=0;n<r.length;n++)i=t.push("text","",0),i.content=String.fromCharCode(a),t.delimiters.push({marker:a,length:r.length,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return t.pos+=r.length,!0},t.exports.postProcess=function(t){var e,n=t.tokens_meta,i=t.tokens_meta.length;for(r(t,t.delimiters),e=0;e<i;e++)n[e]&&n[e].delimiters&&r(t,n[e].delimiters)}},"1b63":function(t,e,n){(function(t){t(n("56b3"),n("7b00"))})((function(t){"use strict";t.defineMode("sass",(function(e){var n=t.mimeModes["text/css"],r=n.propertyKeywords||{},i=n.colorKeywords||{},o=n.valueKeywords||{},a=n.fontProperties||{};function s(t){return new RegExp("^"+t.join("|"))}var l,c=["true","false","null","auto"],u=new RegExp("^"+c.join("|")),d=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],h=s(d),p=/^::?[a-zA-Z_][\w\-]*/;function f(t){return!t.peek()||t.match(/\s+$/,!1)}function g(t,e){var n=t.peek();return")"===n?(t.next(),e.tokenizer=x,"operator"):"("===n?(t.next(),t.eatSpace(),"operator"):"'"===n||'"'===n?(e.tokenizer=v(t.next()),"string"):(e.tokenizer=v(")",!1),"string")}function m(t,e){return function(n,r){return n.sol()&&n.indentation()<=t?(r.tokenizer=x,x(n,r)):(e&&n.skipTo("*/")?(n.next(),n.next(),r.tokenizer=x):n.skipToEnd(),"comment")}}function v(t,e){function n(r,i){var o=r.next(),a=r.peek(),s=r.string.charAt(r.pos-2),l="\\"!==o&&a===t||o===t&&"\\"!==s;return l?(o!==t&&e&&r.next(),f(r)&&(i.cursorHalf=0),i.tokenizer=x,"string"):"#"===o&&"{"===a?(i.tokenizer=b(n),r.next(),"operator"):"string"}return null==e&&(e=!0),n}function b(t){return function(e,n){return"}"===e.peek()?(e.next(),n.tokenizer=t,"operator"):x(e,n)}}function y(t){if(0==t.indentCount){t.indentCount++;var n=t.scopes[0].offset,r=n+e.indentUnit;t.scopes.unshift({offset:r})}}function w(t){1!=t.scopes.length&&t.scopes.shift()}function x(t,e){var n=t.peek();if(t.match("/*"))return e.tokenizer=m(t.indentation(),!0),e.tokenizer(t,e);if(t.match("//"))return e.tokenizer=m(t.indentation(),!1),e.tokenizer(t,e);if(t.match("#{"))return e.tokenizer=b(x),"operator";if('"'===n||"'"===n)return t.next(),e.tokenizer=v(n),"string";if(e.cursorHalf){if("#"===n&&(t.next(),t.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return f(t)&&(e.cursorHalf=0),"number";if(t.match(/^-?[0-9\.]+/))return f(t)&&(e.cursorHalf=0),"number";if(t.match(/^(px|em|in)\b/))return f(t)&&(e.cursorHalf=0),"unit";if(t.match(u))return f(t)&&(e.cursorHalf=0),"keyword";if(t.match(/^url/)&&"("===t.peek())return e.tokenizer=g,f(t)&&(e.cursorHalf=0),"atom";if("$"===n)return t.next(),t.eatWhile(/[\w-]/),f(t)&&(e.cursorHalf=0),"variable-2";if("!"===n)return t.next(),e.cursorHalf=0,t.match(/^[\w]+/)?"keyword":"operator";if(t.match(h))return f(t)&&(e.cursorHalf=0),"operator";if(t.eatWhile(/[\w-]/))return f(t)&&(e.cursorHalf=0),l=t.current().toLowerCase(),o.hasOwnProperty(l)?"atom":i.hasOwnProperty(l)?"keyword":r.hasOwnProperty(l)?(e.prevProp=t.current().toLowerCase(),"property"):"tag";if(f(t))return e.cursorHalf=0,null}else{if("-"===n&&t.match(/^-\w+-/))return"meta";if("."===n){if(t.next(),t.match(/^[\w-]+/))return y(e),"qualifier";if("#"===t.peek())return y(e),"tag"}if("#"===n){if(t.next(),t.match(/^[\w-]+/))return y(e),"builtin";if("#"===t.peek())return y(e),"tag"}if("$"===n)return t.next(),t.eatWhile(/[\w-]/),"variable-2";if(t.match(/^-?[0-9\.]+/))return"number";if(t.match(/^(px|em|in)\b/))return"unit";if(t.match(u))return"keyword";if(t.match(/^url/)&&"("===t.peek())return e.tokenizer=g,"atom";if("="===n&&t.match(/^=[\w-]+/))return y(e),"meta";if("+"===n&&t.match(/^\+[\w-]+/))return"variable-3";if("@"===n&&t.match("@extend")&&(t.match(/\s*[\w]/)||w(e)),t.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return y(e),"def";if("@"===n)return t.next(),t.eatWhile(/[\w-]/),"def";if(t.eatWhile(/[\w-]/)){if(t.match(/ *: *[\w-\+\$#!\("']/,!1)){l=t.current().toLowerCase();var s=e.prevProp+"-"+l;return r.hasOwnProperty(s)?"property":r.hasOwnProperty(l)?(e.prevProp=l,"property"):a.hasOwnProperty(l)?"property":"tag"}return t.match(/ *:/,!1)?(y(e),e.cursorHalf=1,e.prevProp=t.current().toLowerCase(),"property"):(t.match(/ *,/,!1)||y(e),"tag")}if(":"===n)return t.match(p)?"variable-3":(t.next(),e.cursorHalf=1,"operator")}return t.match(h)?"operator":(t.next(),null)}function C(t,n){t.sol()&&(n.indentCount=0);var r=n.tokenizer(t,n),i=t.current();if("@return"!==i&&"}"!==i||w(n),null!==r){for(var o=t.pos-i.length,a=o+e.indentUnit*n.indentCount,s=[],l=0;l<n.scopes.length;l++){var c=n.scopes[l];c.offset<=a&&s.push(c)}n.scopes=s}return r}return{startState:function(){return{tokenizer:x,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(t,e){var n=C(t,e);return e.lastToken={style:n,content:t.current()},n},indent:function(t){return t.scopes[0].offset},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"indent"}}),"css"),t.defineMIME("text/x-sass","sass")}))},"1c08":function(t,e,n){"use strict";n("1723")},"1c49":function(t,e,n){},"1d02":function(t,e,n){"use strict";var r=n("ebb5"),i=n("a258").findLastIndex,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("findLastIndex",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"1d04":function(t,e,n){"use strict";var r=n("dc08").HTML_TAG_RE;function i(t){return/^<a[>\s]/i.test(t)}function o(t){return/^<\/a\s*>/i.test(t)}function a(t){var e=32|t;return e>=97&&e<=122}t.exports=function(t,e){var n,s,l,c,u=t.pos;return!!t.md.options.html&&(l=t.posMax,!(60!==t.src.charCodeAt(u)||u+2>=l)&&(n=t.src.charCodeAt(u+1),!(33!==n&&63!==n&&47!==n&&!a(n))&&(s=t.src.slice(u).match(r),!!s&&(e||(c=t.push("html_inline","",0),c.content=t.src.slice(u,u+s[0].length),i(c.content)&&t.linkLevel++,o(c.content)&&t.linkLevel--),t.pos+=s[0].length,!0))))}},"1f0a":function(t,e,n){"use strict";n("a848")},"1fe2":function(t,e,n){n("7276")},2:function(t,e){},"219c":function(t,e,n){"use strict";var r=n("da84"),i=n("e330"),o=n("d039"),a=n("59ed"),s=n("addb"),l=n("ebb5"),c=n("04d1"),u=n("d998"),d=n("2d00"),h=n("512ce"),p=l.aTypedArray,f=l.exportTypedArrayMethod,g=r.Uint16Array,m=g&&i(g.prototype.sort),v=!!m&&!(o((function(){m(new g(2),null)}))&&o((function(){m(new g(2),{})}))),b=!!m&&!o((function(){if(d)return d<74;if(c)return c<67;if(u)return!0;if(h)return h<602;var t,e,n=new g(516),r=Array(516);for(t=0;t<516;t++)e=t%4,n[t]=515-t,r[t]=t-2*e+3;for(m(n,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(n[t]!==r[t])return!0})),y=function(t){return function(e,n){return void 0!==t?+t(e,n)||0:n!==n?-1:e!==e?1:0===e&&0===n?1/e>0&&1/n<0?1:-1:e>n}};f("sort",(function(t){return void 0!==t&&a(t),b?m(this,t):s(p(this),y(t))}),!b||v)},"227c":function(t,e,n){"use strict";t.exports=function(t){var e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}},"23de":function(t,e,n){(function(t){t(n("56b3"),n("715d"))})((function(t){"use strict";var e={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};function n(t){for(var n in this.options={},e)this.options[n]=(t&&t.hasOwnProperty(n)?t:e)[n];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function r(t){var e=t.state.matchHighlighter;(e.active||t.hasFocus())&&o(t,e)}function i(t){var e=t.state.matchHighlighter;e.active||(e.active=!0,o(t,e))}function o(t,e){clearTimeout(e.timeout),e.timeout=setTimeout((function(){l(t)}),e.options.delay)}function a(t,e,n,r){var i=t.state.matchHighlighter;if(t.addOverlay(i.overlay=d(e,n,r)),i.options.annotateScrollbar&&t.showMatchesOnScrollbar){var o=n?new RegExp((/\w/.test(e.charAt(0))?"\\b":"")+e.replace(/[\\\[.+*?(){|^$]/g,"\\$&")+(/\w/.test(e.charAt(e.length-1))?"\\b":"")):e;i.matchesonscroll=t.showMatchesOnScrollbar(o,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function s(t){var e=t.state.matchHighlighter;e.overlay&&(t.removeOverlay(e.overlay),e.overlay=null,e.matchesonscroll&&(e.matchesonscroll.clear(),e.matchesonscroll=null))}function l(t){t.operation((function(){var e=t.state.matchHighlighter;if(s(t),t.somethingSelected()||!e.options.showToken){var n=t.getCursor("from"),r=t.getCursor("to");if(n.line==r.line&&(!e.options.wordsOnly||c(t,n,r))){var i=t.getRange(n,r);e.options.trim&&(i=i.replace(/^\s+|\s+$/g,"")),i.length>=e.options.minChars&&a(t,i,!1,e.options.style)}}else{var o=!0===e.options.showToken?/[\w$]/:e.options.showToken,l=t.getCursor(),u=t.getLine(l.line),d=l.ch,h=d;while(d&&o.test(u.charAt(d-1)))--d;while(h<u.length&&o.test(u.charAt(h)))++h;d<h&&a(t,u.slice(d,h),o,e.options.style)}}))}function c(t,e,n){var r=t.getRange(e,n);if(null!==r.match(/^\w+$/)){if(e.ch>0){var i={line:e.line,ch:e.ch-1},o=t.getRange(i,e);if(null===o.match(/\W/))return!1}if(n.ch<t.getLine(e.line).length){i={line:n.line,ch:n.ch+1},o=t.getRange(n,i);if(null===o.match(/\W/))return!1}return!0}return!1}function u(t,e){return(!t.start||!e.test(t.string.charAt(t.start-1)))&&(t.pos==t.string.length||!e.test(t.string.charAt(t.pos)))}function d(t,e,n){return{token:function(r){if(r.match(t)&&(!e||u(r,e)))return n;r.next(),r.skipTo(t.charAt(0))||r.skipToEnd()}}}t.defineOption("highlightSelectionMatches",!1,(function(e,o,a){if(a&&a!=t.Init&&(s(e),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",r),e.off("focus",i)),o){var c=e.state.matchHighlighter=new n(o);e.hasFocus()?(c.active=!0,l(e)):e.on("focus",i),e.on("cursorActivity",r)}}))}))},2442:function(t,e,n){var r=n("2b03"),i=n("badf"),o=n("4b17"),a=Math.max,s=Math.min;function l(t,e,n){var l=null==t?0:t.length;if(!l)return-1;var c=l-1;return void 0!==n&&(c=o(n),c=n<0?a(l+c,0):s(c,l-1)),r(t,i(e,3),c,!0)}t.exports=l},2490:function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.normalizePathData=void 0;var i=n("ca8e");function o(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function a(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}function s(t,e,n,r,i,a,l,c,u,d){var h,p,f,g,m,v=120*Math.PI/180,b=Math.PI/180*(+i||0),y=[];if(d)p=d[0],f=d[1],g=d[2],m=d[3];else{h=o(t,e,-b),t=h.x,e=h.y,h=o(c,u,-b),c=h.x,u=h.y;var w=(t-c)/2,x=(e-u)/2,C=w*w/(n*n)+x*x/(r*r);C>1&&(C=Math.sqrt(C),n*=C,r*=C);var k=n*n,A=r*r,S=(a===l?-1:1)*Math.sqrt(Math.abs((k*A-k*x*x-A*w*w)/(k*x*x+A*w*w)));g=S*n*x/r+(t+c)/2,m=S*-r*w/n+(e+u)/2,p=Math.asin((e-m)/r),f=Math.asin((u-m)/r),p=t<g?Math.PI-p:p,f=c<g?Math.PI-f:f,p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),l&&p>f&&(p-=2*Math.PI),!l&&f>p&&(f-=2*Math.PI)}var E=f-p;if(Math.abs(E)>v){var O=f,T=c,_=u;f=p+v*(l&&f>p?1:-1),c=g+n*Math.cos(f),u=m+r*Math.sin(f),y=s(c,u,n,r,i,0,l,T,_,[f,O,g,m])}E=f-p;var M=Math.cos(p),N=Math.sin(p),P=Math.cos(f),L=Math.sin(f),D=Math.tan(E/4),j=4/3*(n*D),I=4/3*(r*D),R=[t,e],F=[t+j*N,e-I*M],B=[c+j*L,u-I*P],z=[c,u];if(F[0]=2*R[0]-F[0],F[1]=2*R[1]-F[1],d)return[F,B,z].concat(y);y=[F,B,z].concat(y).join().split(",");for(var H=[],V=y.length,q=0;q<V;q+=1)H[q]=q%2?o(+y[q-1],+y[q],b).y:o(+y[q],+y[q+1],b).x;return H}function l(t){if(!t)return null;var e="\t\n\v\f\r    \u2028\u2029",n=new RegExp("([a-z])["+e+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+e+"]*,?["+e+"]*)+)","ig"),i=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+e+"]*,?["+e+"]*","ig"),o={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=[];return t.replace(n,(function(t,e,n){var s=[],l=e.toLowerCase();n.replace(i,(function(t,e){return e&&s.push(+e),t})),"m"===l&&s.length>2&&(a.push(r([e],s.splice(0,2),!0)),l="l",e="m"===e?"l":"L");var c=o[l];while(s.length>=c)if(a.push(r([e],s.splice(0,c),!0)),!c)break;return t})),a}function c(t){var e=l(t);if(!e||!e.length)return[["M",0,0]];for(var n=0,r=0,i=0,o=0,a=[],s=0,c=e.length;s<c;s+=1){var u=[];a.push(u);var d=e[s],h=d[0];if(h!==h.toUpperCase())switch(u[0]=h.toUpperCase(),u[0]){case"A":u[1]=d[1],u[2]=d[2],u[3]=d[3],u[4]=d[4],u[5]=d[5],u[6]=+d[6]+n,u[7]=+d[7]+r;break;case"V":u[1]=+d[1]+r;break;case"H":u[1]=+d[1]+n;break;case"M":i=+d[1]+n,o=+d[2]+r;for(var p=1,f=d.length;p<f;p+=1)u[p]=+d[p]+(p%2?n:r);break;default:for(p=1,f=d.length;p<f;p+=1)u[p]=+d[p]+(p%2?n:r);break}else for(p=0,f=d.length;p<f;p+=1)u[p]=d[p];switch(u[0]){case"Z":n=+i,r=+o;break;case"H":n=u[1];break;case"V":r=u[1];break;case"M":i=u[u.length-2],o=u[u.length-1],n=u[u.length-2],r=u[u.length-1];break;default:n=u[u.length-2],r=u[u.length-1];break}}return a}function u(t){var e=c(t),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function r(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(t[0]in{T:1,Q:1}||(e.qx=null,e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":return 0===parseFloat(t[1])||0===parseFloat(t[2])?["L",t[6],t[7]]:["C"].concat(s.apply(0,[e.x,e.y].concat(t.slice(1))));case"S":return"C"===n||"S"===n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),["C",r,i].concat(t.slice(1));case"T":return"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),["C"].concat(a(e.x,e.y,e.qx,e.qy,t[1],t[2]));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(a(e.x,e.y,t[1],t[2],t[3],t[4]));case"H":return["L"].concat(t[1],e.y);case"V":return["L"].concat(e.x,t[1]);case"L":break;case"Z":break;default:break}return t}function i(t,n){if(t[n].length>7){t[n].shift();var r=t[n];while(r.length)o[n]="A",n+=1,t.splice(n,0,["C"].concat(r.splice(0,6)));t.splice(n,1),u=e.length}}for(var o=[],l="",u=e.length,d=0;d<u;d+=1){var h="";e[d]&&(h=e[d][0]),"C"!==h&&(o[d]=h,d>0&&(l=o[d-1])),e[d]=r(e[d],n,l),"A"!==o[d]&&"C"===h&&(o[d]="C"),i(e,d);var p=e[d],f=p.length;n.x=p[f-2],n.y=p[f-1],n.bx=parseFloat(p[f-4])||n.x,n.by=parseFloat(p[f-3])||n.y}return e[0][0]&&"M"===e[0][0]||e.unshift(["M",0,0]),e}function d(t){return u(t).map((function(t){return t.map((function(t){return"string"===typeof t?t:(0,i.round)(t,2)}))})).join(",").split(",").join(" ")}e.normalizePathData=d},"257e":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n("d9e2");function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},"25a1":function(t,e,n){"use strict";var r=n("ebb5"),i=n("d58f").right,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("reduceRight",(function(t){var e=arguments.length;return i(o(this),t,e,e>1?arguments[1]:void 0)}))},2613:function(t,e,n){"use strict";n("fdad")},"262e":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));n("d9e2"),n("131a");function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}function i(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)}},2639:function(t,e,n){t.exports=function(){return new Worker(n.p+"e5d0f237850f4ec00dfa.worker.js")}},2733:function(t,e,n){},2889:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CurveTo=void 0;var i=n("35fe"),o=n("6762"),a=n("f8f8"),s=function(t){function e(e,n,r,a,s,l){var c=t.call(this)||this;return i.Curve.isCurve(e)?(c.controlPoint1=e.controlPoint1.clone().round(2),c.controlPoint2=e.controlPoint2.clone().round(2),c.endPoint=e.end.clone().round(2)):"number"===typeof e?(c.controlPoint1=new o.Point(e,n).round(2),c.controlPoint2=new o.Point(r,a).round(2),c.endPoint=new o.Point(s,l).round(2)):(c.controlPoint1=o.Point.create(e).round(2),c.controlPoint2=o.Point.create(n).round(2),c.endPoint=o.Point.create(r).round(2)),c}return r(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"C"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"curve",{get:function(){return new i.Curve(this.start,this.controlPoint1,this.controlPoint2,this.end)},enumerable:!1,configurable:!0}),e.prototype.bbox=function(){return this.curve.bbox()},e.prototype.closestPoint=function(t){return this.curve.closestPoint(t)},e.prototype.closestPointLength=function(t){return this.curve.closestPointLength(t)},e.prototype.closestPointNormalizedLength=function(t){return this.curve.closestPointNormalizedLength(t)},e.prototype.closestPointTangent=function(t){return this.curve.closestPointTangent(t)},e.prototype.length=function(){return this.curve.length()},e.prototype.divideAt=function(t,n){void 0===n&&(n={});var r=this.curve.divideAt(t,n);return[new e(r[0]),new e(r[1])]},e.prototype.divideAtLength=function(t,n){void 0===n&&(n={});var r=this.curve.divideAtLength(t,n);return[new e(r[0]),new e(r[1])]},e.prototype.divideAtT=function(t){var n=this.curve.divideAtT(t);return[new e(n[0]),new e(n[1])]},e.prototype.getSubdivisions=function(){return[]},e.prototype.pointAt=function(t){return this.curve.pointAt(t)},e.prototype.pointAtLength=function(t){return this.curve.pointAtLength(t)},e.prototype.tangentAt=function(t){return this.curve.tangentAt(t)},e.prototype.tangentAtLength=function(t){return this.curve.tangentAtLength(t)},e.prototype.isDifferentiable=function(){if(!this.previousSegment)return!1;var t=this.start,e=this.controlPoint1,n=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(r))},e.prototype.scale=function(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this},e.prototype.rotate=function(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this},e.prototype.translate=function(t,e){return"number"===typeof t?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this},e.prototype.equals=function(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)},e.prototype.clone=function(){return new e(this.controlPoint1,this.controlPoint2,this.end)},e.prototype.toJSON=function(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}},e.prototype.serialize=function(){var t=this.controlPoint1,e=this.controlPoint2,n=this.end;return[this.type,t.x,t.y,e.x,e.y,n.x,n.y].join(" ")},e}(a.Segment);e.CurveTo=s,function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length,a=e[0];if(i.Curve.isCurve(a))return new t(a);if(o.Point.isPointLike(a)){if(3===r)return new t(e[0],e[1],e[2]);for(var s=[],l=0;l<r;l+=3)s.push(new t(e[l],e[l+1],e[l+2]));return s}if(6===r)return new t(e[0],e[1],e[2],e[3],e[4],e[5]);var c=[];for(l=0;l<r;l+=6)c.push(new t(e[l],e[l+1],e[l+2],e[l+3],e[l+4],e[l+5]));return c}t.create=e}(s=e.CurveTo||(e.CurveTo={})),e.CurveTo=s},2954:function(t,e,n){"use strict";var r=n("ebb5"),i=n("b6b7"),o=n("d039"),a=n("f36a"),s=r.aTypedArray,l=r.exportTypedArrayMethod,c=o((function(){new Int8Array(1).slice()}));l("slice",(function(t,e){var n=a(s(this),t,e),r=i(this),o=0,l=n.length,c=new r(l);while(l>o)c[o]=n[o++];return c}),c)},"2aed":function(t,e,n){(function(t){t(n("56b3"))})((function(t){function e(e,n,r){var i,o=e.getWrapperElement();return i=o.appendChild(document.createElement("div")),i.className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),t.addClass(o,"dialog-opened"),i}function n(t,e){t.state.currentNotificationClose&&t.state.currentNotificationClose(),t.state.currentNotificationClose=e}t.defineExtension("openDialog",(function(r,i,o){o||(o={}),n(this,null);var a=e(this,r,o.bottom),s=!1,l=this;function c(e){if("string"==typeof e)d.value=e;else{if(s)return;s=!0,t.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),l.focus(),o.onClose&&o.onClose(a)}}var u,d=a.getElementsByTagName("input")[0];return d?(d.focus(),o.value&&(d.value=o.value,!1!==o.selectValueOnOpen&&d.select()),o.onInput&&t.on(d,"input",(function(t){o.onInput(t,d.value,c)})),o.onKeyUp&&t.on(d,"keyup",(function(t){o.onKeyUp(t,d.value,c)})),t.on(d,"keydown",(function(e){o&&o.onKeyDown&&o.onKeyDown(e,d.value,c)||((27==e.keyCode||!1!==o.closeOnEnter&&13==e.keyCode)&&(d.blur(),t.e_stop(e),c()),13==e.keyCode&&i(d.value,e))})),!1!==o.closeOnBlur&&t.on(a,"focusout",(function(t){null!==t.relatedTarget&&c()}))):(u=a.getElementsByTagName("button")[0])&&(t.on(u,"click",(function(){c(),l.focus()})),!1!==o.closeOnBlur&&t.on(u,"blur",c),u.focus()),c})),t.defineExtension("openConfirm",(function(r,i,o){n(this,null);var a=e(this,r,o&&o.bottom),s=a.getElementsByTagName("button"),l=!1,c=this,u=1;function d(){l||(l=!0,t.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),c.focus())}s[0].focus();for(var h=0;h<s.length;++h){var p=s[h];(function(e){t.on(p,"click",(function(n){t.e_preventDefault(n),d(),e&&e(c)}))})(i[h]),t.on(p,"blur",(function(){--u,setTimeout((function(){u<=0&&d()}),200)})),t.on(p,"focus",(function(){++u}))}})),t.defineExtension("openNotification",(function(r,i){n(this,c);var o,a=e(this,r,i&&i.bottom),s=!1,l=i&&"undefined"!==typeof i.duration?i.duration:5e3;function c(){s||(s=!0,clearTimeout(o),t.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a))}return t.on(a,"click",(function(e){t.e_preventDefault(e),c()})),l&&(o=setTimeout(c,l)),c}))}))},"2caf":function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));n("4ae1"),n("d3b7"),n("f8c9");var r=n("7e84");function i(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}n("d9e2");var o=n("53ca"),a=n("257e");function s(t,e){if(e&&("object"===Object(o["a"])(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Object(a["a"])(t)}function l(t){var e=i();return function(){var n,i=Object(r["a"])(t);if(e){var o=Object(r["a"])(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return s(this,n)}}},"2cfe":function(t,e,n){},"2d61":function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.LineTo=void 0;var i=n("5c2e"),o=n("6762"),a=n("f8f8"),s=function(t){function e(e,n){var r=t.call(this)||this;return i.Line.isLine(e)?r.endPoint=e.end.clone().round(2):r.endPoint=o.Point.create(e,n).round(2),r}return r(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"L"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return new i.Line(this.start,this.end)},enumerable:!1,configurable:!0}),e.prototype.bbox=function(){return this.line.bbox()},e.prototype.closestPoint=function(t){return this.line.closestPoint(t)},e.prototype.closestPointLength=function(t){return this.line.closestPointLength(t)},e.prototype.closestPointNormalizedLength=function(t){return this.line.closestPointNormalizedLength(t)},e.prototype.closestPointTangent=function(t){return this.line.closestPointTangent(t)},e.prototype.length=function(){return this.line.length()},e.prototype.divideAt=function(t){var n=this.line.divideAt(t);return[new e(n[0]),new e(n[1])]},e.prototype.divideAtLength=function(t){var n=this.line.divideAtLength(t);return[new e(n[0]),new e(n[1])]},e.prototype.getSubdivisions=function(){return[]},e.prototype.pointAt=function(t){return this.line.pointAt(t)},e.prototype.pointAtLength=function(t){return this.line.pointAtLength(t)},e.prototype.tangentAt=function(t){return this.line.tangentAt(t)},e.prototype.tangentAtLength=function(t){return this.line.tangentAtLength(t)},e.prototype.isDifferentiable=function(){return null!=this.previousSegment&&!this.start.equals(this.end)},e.prototype.clone=function(){return new e(this.end)},e.prototype.scale=function(t,e,n){return this.end.scale(t,e,n),this},e.prototype.rotate=function(t,e){return this.end.rotate(t,e),this},e.prototype.translate=function(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this},e.prototype.equals=function(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)},e.prototype.toJSON=function(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}},e.prototype.serialize=function(){var t=this.end;return this.type+" "+t.x+" "+t.y},e}(a.Segment);e.LineTo=s,function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length,a=e[0];if(i.Line.isLine(a))return new t(a);if(o.Point.isPointLike(a))return 1===r?new t(a):e.map((function(e){return new t(e)}));if(2===r)return new t(+e[0],+e[1]);for(var s=[],l=0;l<r;l+=2){var c=+e[l],u=+e[l+1];s.push(new t(c,u))}return s}t.create=e}(s=e.LineTo||(e.LineTo={})),e.LineTo=s},"2e46":function(t,e,n){},3:function(t,e){},"30ac":function(t,e,n){"use strict";(function(t){var r=n("7037").default;n("b64b"),n("a4d3"),n("4de4"),n("d3b7"),n("e439"),n("159b"),n("dbb4"),n("e01a"),n("d28b"),n("3ca3"),n("ddb0"),n("d9e2"),n("131a"),n("3410"),n("f8c9"),n("4ae1"),n("5d41"),n("a630"),n("fb6a"),n("b0c0"),n("ac1f"),n("00b4"),n("7039"),n("99af"),n("c740"),n("a15b"),n("498a"),n("6062"),n("d81d"),n("313d"),n("0eb6"),n("b7ef"),n("8bd4"),n("e9c4"),n("7db0"),n("a9e3"),n("1276"),n("1913"),n("5319"),n("cc71"),n("c5d0"),n("664f"),n("4c53"),n("9767"),n("9911"),n("841c"),Object.defineProperty(e,"__esModule",{value:!0});var i=n("2b0e"),o=n("2ef0"),a=n("a57f");n("5136");var s=n("681b");n("9a33");var l=n("f933"),c=n("66cb"),u=n("4d7f");function d(t){return t&&"object"===r(t)&&"default"in t?t:{default:t}}var h=d(i),p=d(s),f=d(l),g=d(c),m=d(u);function v(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v(Object(n),!0).forEach((function(e){k(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function y(t){return y="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function x(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t,e,n){return e&&x(t.prototype,e),n&&x(t,n),t}function k(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(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&E(t,e)}function S(t){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},S(t)}function E(t,e){return E=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},E(t,e)}function O(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function T(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _(t,e){if(e&&("object"===r(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return T(t)}function M(t){var e=O();return function(){var n,r=S(t);if(e){var i=S(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _(this,n)}}function N(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=S(t),null===t)break;return t}function P(){return P="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=N(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},P.apply(this,arguments)}function L(t){return D(t)||j(t)||I(t)||F()}function D(t){if(Array.isArray(t))return R(t)}function j(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function I(t,e){if(t){if("string"===typeof t)return R(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(t,e):void 0}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function F(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var B=0;function z(t){return"__private_"+B+++"_"+t}function H(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function V(t,e,n,i){var o,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"===typeof Reflect?"undefined":r(Reflect))&&"function"===typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(e,n,s):o(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s
/**
* vue-class-component v7.2.6
* (c) 2015-present Evan You
* @license MIT
*/}function q(t){return q="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},q(t)}function U(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W(t){return $(t)||G(t)||Y()}function $(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function G(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function Y(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function X(){return"undefined"!==typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function K(t,e){Z(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){Z(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){Z(t,e,n)}))}function Z(t,e,n){var r=n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e);r.forEach((function(r){var i=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,i,t,n):Reflect.defineMetadata(r,i,t)}))}var J={__proto__:[]},Q=J instanceof Array;function tt(t){return function(e,n,r){var i="function"===typeof e?e:e.constructor;i.__decorators__||(i.__decorators__=[]),"number"!==typeof r&&(r=void 0),i.__decorators__.push((function(e){return t(e,n,r)}))}}function et(t){var e=q(t);return null==t||"object"!==e&&"function"!==e}function nt(t,e){var n=e.prototype._init;e.prototype._init=function(){var e=this,n=Object.getOwnPropertyNames(t);if(t.$options.props)for(var r in t.$options.props)t.hasOwnProperty(r)||n.push(r);n.forEach((function(n){Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){t[n]=e},configurable:!0})}))};var r=new e;e.prototype._init=n;var i={};return Object.keys(r).forEach((function(t){void 0!==r[t]&&(i[t]=r[t])})),i}var rt=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function it(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=e.name||t._componentTag||t.name;var n=t.prototype;Object.getOwnPropertyNames(n).forEach((function(t){if("constructor"!==t)if(rt.indexOf(t)>-1)e[t]=n[t];else{var r=Object.getOwnPropertyDescriptor(n,t);void 0!==r.value?"function"===typeof r.value?(e.methods||(e.methods={}))[t]=r.value:(e.mixins||(e.mixins=[])).push({data:function(){return U({},t,r.value)}}):(r.get||r.set)&&((e.computed||(e.computed={}))[t]={get:r.get,set:r.set})}})),(e.mixins||(e.mixins=[])).push({data:function(){return nt(this,t)}});var r=t.__decorators__;r&&(r.forEach((function(t){return t(e)})),delete t.__decorators__);var i=Object.getPrototypeOf(t.prototype),o=i instanceof h["default"]?i.constructor:h["default"],a=o.extend(e);return at(a,t,o),X()&&K(a,t),a}var ot={prototype:!0,arguments:!0,callee:!0,caller:!0};function at(t,e,n){Object.getOwnPropertyNames(e).forEach((function(r){if(!ot[r]){var i=Object.getOwnPropertyDescriptor(t,r);if(!i||i.configurable){var o=Object.getOwnPropertyDescriptor(e,r);if(!Q){if("cid"===r)return;var a=Object.getOwnPropertyDescriptor(n,r);if(!et(o.value)&&a&&a.value===o.value)return}0,Object.defineProperty(t,r,o)}}}))}function st(t){return"function"===typeof t?it(t):function(e){return it(e,t)}}st.registerHooks=function(t){rt.push.apply(rt,W(t))};var lt="undefined"!==typeof Reflect&&"undefined"!==typeof Reflect.getMetadata;function ct(t,e,n){if(lt&&!Array.isArray(t)&&"function"!==typeof t&&!t.hasOwnProperty("type")&&"undefined"===typeof t.type){var r=Reflect.getMetadata("design:type",e,n);r!==Object&&(t.type=r)}}function ut(t){return void 0===t&&(t={}),function(e,n){ct(t,e,n),tt((function(e,n){(e.props||(e.props={}))[n]=t}))(e,n)}}function dt(t,e){void 0===e&&(e={});var n=e.deep,i=void 0!==n&&n,o=e.immediate,a=void 0!==o&&o;return tt((function(e,n){"object"!==r(e.watch)&&(e.watch=Object.create(null));var o=e.watch;"object"!==r(o[t])||Array.isArray(o[t])?"undefined"===typeof o[t]&&(o[t]=[]):o[t]=[o[t]],o[t].push({handler:n,deep:i,immediate:a})}))}var ht=function(t,e,n){var r=null===t||void 0===t?void 0:t.plugin.components[e];if(r&&r.hotkey){var i=r.hotkey();if(i){if(Array.isArray(i))if(n){var o=i.findIndex((function(t){return"object"===y(t)&&t.args===n}));i=i[o>-1?o:0]}else i=i[0];return"object"===y(i)&&(i=i.key),i}}},pt=function(t){if("string"!==typeof t)return!1;var e,n=document.body,r=document.createElement("span");r.innerHTML=Array(10).join("wi"),r.style.cssText=["position:absolute","width:auto","font-size:128px","left:-99999px"].join(" !important;");var i=function(t){return r.style.fontFamily=t,n.appendChild(r),e=r.clientWidth,n.removeChild(r),e},o=i("monospace"),a=i("serif"),s=i("sans-serif");return o!==i(t+",monospace")||s!==i(t+",sans-serif")||a!==i(t+",serif")},ft=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.visible=!1,t.iconIsHtml=!1,t.isMobile=!1,t.hotkeyText="",t}return C(n,[{key:"mounted",value:function(){this.iconIsHtml=/^<.*>/.test(this.icon?this.icon.trim():"");var t=void 0;!this.engine||!0!==this.hotkey&&void 0!==this.hotkey||(t=ht(this.engine,this.command&&!Array.isArray(this.command)?this.command.name:this.name)),"string"===typeof this.hotkey&&""!==this.hotkey&&(t=a.formatHotkey(this.hotkey)),this.isMobile=a.isMobile,this.hotkeyText=t||""}},{key:"triggerMouseDown",value:function(t){t.preventDefault(),this.disabled||(this.onMouseDown&&this.onMouseDown(t,this.engine),this.visible=!1)}},{key:"triggerMouseEnter",value:function(t){this.onMouseEnter&&this.onMouseEnter(t,this.engine),this.visible=!0}},{key:"triggerMouseLeave",value:function(t){this.onMouseLevel&&this.onMouseLevel(t,this.engine),this.visible=!1}},{key:"triggerClick",value:function(t){var e=t.target.nodeName;if("INPUT"!==e&&"TEXTAREA"!==e&&t.preventDefault(),!this.disabled&&(!this.onClick||!1!==this.onClick(t,this.engine))&&!1!==this.autoExecute){var n,r=this.name,i=[];this.command&&(Array.isArray(this.command)?i=this.command:(r=this.command.name,i=this.command.args)),this.engine&&(n=this.engine.command).execute.apply(n,[r].concat(L(i)))}}}]),n}(h["default"]);V([ut({type:Object})],ft.prototype,"engine",void 0),V([ut({type:String,required:!0})],ft.prototype,"name",void 0),V([ut({type:String})],ft.prototype,"icon",void 0),V([ut({type:[String,Function]})],ft.prototype,"content",void 0),V([ut({type:String})],ft.prototype,"title",void 0),V([ut({type:String})],ft.prototype,"placement",void 0),V([ut({type:[String,Object]})],ft.prototype,"hotkey",void 0),V([ut({type:Object})],ft.prototype,"command",void 0),V([ut({type:[Boolean,Object],default:void 0})],ft.prototype,"autoExecute",void 0),V([ut({type:String})],ft.prototype,"className",void 0),V([ut({type:[Boolean,Object],default:void 0})],ft.prototype,"active",void 0),V([ut({type:[Boolean,Object],default:void 0})],ft.prototype,"disabled",void 0),V([ut(Function)],ft.prototype,"onClick",void 0),V([ut(Function)],ft.prototype,"onMouseDown",void 0),V([ut(Function)],ft.prototype,"onMouseEnter",void 0),V([ut(Function)],ft.prototype,"onMouseLevel",void 0),ft=V([st({components:{"a-tooltip":f["default"]}})],ft);var gt=ft;function mt(t,e,n,r,i,o,a,s,l,c){"boolean"!==typeof a&&(l=s,s=a,a=!1);var u,d="function"===typeof n?n.options:n;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),r&&(d._scopeId=r),o?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=u):e&&(u=a?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),u)if(d.functional){var h=d.render;d.render=function(t,e){return u.call(e),h(t,e)}}else{var p=d.beforeCreate;d.beforeCreate=p?[].concat(p,u):[u]}return n}var vt,bt="undefined"!==typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function yt(t){return function(t,e){return xt(t,e)}}var wt={};function xt(t,e){var n=bt?e.media||"default":t,r=wt[n]||(wt[n]={ids:new Set,styles:[]});if(!r.ids.has(t)){r.ids.add(t);var i=e.source;if(e.map&&(i+="\n/*# sourceURL="+e.map.sources[0]+" */",i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",e.media&&r.element.setAttribute("media",e.media),void 0===vt&&(vt=document.head||document.getElementsByTagName("head")[0]),vt.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(i),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{var o=r.ids.size-1,a=document.createTextNode(i),s=r.element.childNodes;s[o]&&r.element.removeChild(s[o]),s.length?r.element.insertBefore(a,s[o]):r.element.appendChild(a)}}}var Ct=gt,kt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("a-tooltip",{attrs:{placement:t.placement||"bottom",visible:!(!t.title&&!t.hotkeyText||t.isMobile)&&t.visible},scopedSlots:t._u([{key:"title",fn:function(){return[t.title?n("div",{staticClass:"toolbar-tooltip-title"},[t._v(t._s(t.title))]):t._e(),t._v(" "),t.hotkeyText?n("div",{staticClass:"toolbar-tooltip-hotkey",domProps:{innerHTML:t._s(t.hotkeyText)}}):t._e()]},proxy:!0}])},[t._v(" "),n("button",{ref:"element",class:["toolbar-button",t.className,{"toolbar-button-active":t.active,"toolbar-button-disabled":t.disabled}],on:{click:t.triggerClick,mousedown:t.triggerMouseDown,mouseenter:t.triggerMouseEnter,mouseleave:t.triggerMouseLeave}},[t._t("icon",(function(){return[t.iconIsHtml?n("span",{domProps:{innerHTML:t._s(t.icon)}}):t._e(),t._v(" "),!t.iconIsHtml&&t.icon?n("span",{class:"data-icon data-icon-"+t.icon}):t._e()]})),t._v(" "),t._t("default",(function(){return[t._v(t._s("function"===typeof t.content?t.content():t.content))]}))],2)])},At=[];kt._withStripped=!0;var St=function(t){t&&t("data-v-26361b6c_0",{source:"\n.editor-toolbar .toolbar-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: auto;\n min-width: 32px;\n margin: 0;\n text-align: center;\n padding: 0 7px;\n background-color: transparent;\n border: 1px solid transparent;\n border-radius: 3px 3px;\n font-size: 16px;\n cursor: pointer;\n color: #595959;\n outline: none;\n}\n.editor-toolbar.editor-toolbar-popup .toolbar-button {\n min-width: 24px;\n line-height: 24px;\n border-radius: 4px;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button {\n padding: 0 4px;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:hover {\n border: 1px solid transparent;\n background-color: #f5f5f5;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:active,\n.editor-toolbar .toolbar-button-active,\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-active:hover {\n background-color: #e8e8e8;\n border: 1px solid transparent;\n}\n.editor-toolbar .toolbar-button-disabled,\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-disabled:hover {\n background-color: transparent;\n border: 1px solid transparent;\n box-shadow: none;\n color: #000000;\n opacity: 0.25;\n cursor: not-allowed;\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/button.vue"],names:[],mappings:";AAoJA;EACA,oBAAA;EACA,mBAAA;EACA,uBAAA;EACA,WAAA;EACA,eAAA;EACA,SAAA;EACA,kBAAA;EACA,cAAA;EACA,6BAAA;EACA,6BAAA;EACA,sBAAA;EACA,eAAA;EACA,eAAA;EACA,cAAA;EACA,aAAA;AACA;AACA;EACA,eAAA;EACA,iBAAA;EACA,kBAAA;AACA;AACA;EACA,cAAA;AACA;AAEA;EACA,6BAAA;EACA,yBAAA;AACA;AAEA;;;EAGA,yBAAA;EACA,6BAAA;AACA;AAEA;;EAEA,6BAAA;EACA,6BAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;AACA",file:"button.vue",sourcesContent:['<template>\n <a-tooltip\n :placement="placement || \'bottom\'"\n :visible="(!!title || !!hotkeyText) && !isMobile ? visible : false"\n >\n <template #title>\n <div v-if="!!title" class="toolbar-tooltip-title">{{ title }}</div>\n <div\n v-if="!!hotkeyText"\n class="toolbar-tooltip-hotkey"\n v-html="hotkeyText"\n ></div>\n </template>\n <button\n ref="element"\n :class="[\n \'toolbar-button\',\n className,\n {\n \'toolbar-button-active\': active,\n \'toolbar-button-disabled\': disabled,\n },\n ]"\n @click="triggerClick"\n @mousedown="triggerMouseDown"\n @mouseenter="triggerMouseEnter"\n @mouseleave="triggerMouseLeave"\n >\n <slot name="icon">\n <span v-if="iconIsHtml" v-html="icon"></span>\n <span\n v-if="!iconIsHtml && icon"\n :class="`data-icon data-icon-${icon}`"\n />\n </slot>\n <slot>{{ typeof content === "function" ? content() : content }}</slot>\n </button>\n </a-tooltip>\n</template>\n<script lang="ts">\nimport { VNode } from "vue";\nimport { Component, Prop, Vue } from "vue-property-decorator";\nimport { Tooltip } from "ant-design-vue";\nimport {\n EditorInterface,\n EngineInterface,\n formatHotkey,\n isMobile,\n Placement,\n} from "@aomao/engine";\nimport { autoGetHotkey } from "../utils";\nimport { Command } from "../types";\n\n@Component({\n components: {\n "a-tooltip": Tooltip,\n },\n})\nexport default class Button extends Vue {\n @Prop({ type: Object }) engine?: EngineInterface;\n @Prop({ type: String, required: true }) name!: string;\n @Prop({ type: String }) icon?: string;\n @Prop({ type: [String, Function] }) content?: string | (() => string) | VNode;\n @Prop({ type: String }) title?: string;\n @Prop({ type: String }) placement?: Placement;\n @Prop({ type: [String, Object] }) hotkey?: boolean | string;\n @Prop({ type: Object }) command?: Command;\n @Prop({ type: [Boolean, Object], default: undefined }) autoExecute?: boolean;\n @Prop({ type: String }) className?: string;\n @Prop({ type: [Boolean, Object], default: undefined }) active?: boolean;\n @Prop({ type: [Boolean, Object], default: undefined }) disabled?: boolean;\n @Prop(Function) onClick?: (\n event: MouseEvent,\n engine?: EditorInterface\n ) => void | boolean;\n @Prop(Function) onMouseDown?: (\n event: MouseEvent,\n engine?: EditorInterface\n ) => void | boolean;\n @Prop(Function) onMouseEnter?: (\n event: MouseEvent,\n engine?: EditorInterface\n ) => void | boolean;\n @Prop(Function) onMouseLevel?: (\n event: MouseEvent,\n engine?: EditorInterface\n ) => void | boolean;\n\n visible = false;\n iconIsHtml = false;\n isMobile = false;\n hotkeyText = "";\n\n mounted() {\n this.iconIsHtml = /^<.*>/.test(this.icon ? this.icon.trim() : "");\n let hotkeyText: undefined | string = undefined;\n //默认获取插件的热键\n if (this.engine && (this.hotkey === true || this.hotkey === undefined)) {\n hotkeyText = autoGetHotkey(\n this.engine,\n this.command && !Array.isArray(this.command)\n ? this.command.name\n : this.name\n );\n }\n if (typeof this.hotkey === "string" && this.hotkey !== "") {\n hotkeyText = formatHotkey(this.hotkey);\n }\n this.isMobile = isMobile;\n this.hotkeyText = hotkeyText || "";\n }\n\n triggerMouseDown(event: MouseEvent) {\n event.preventDefault();\n if (this.disabled) return;\n if (this.onMouseDown) this.onMouseDown(event, this.engine);\n this.visible = false;\n }\n triggerMouseEnter(event: MouseEvent) {\n if (this.onMouseEnter) this.onMouseEnter(event, this.engine);\n this.visible = true;\n }\n triggerMouseLeave(event: MouseEvent) {\n if (this.onMouseLevel) this.onMouseLevel(event, this.engine);\n this.visible = false;\n }\n triggerClick(event: MouseEvent) {\n const nodeName = (event.target as Node).nodeName;\n if (nodeName !== "INPUT" && nodeName !== "TEXTAREA") event.preventDefault();\n if (this.disabled) return;\n if (this.onClick && this.onClick(event, this.engine) === false) return;\n if (this.autoExecute !== false) {\n let commandName = this.name;\n let commandArgs = [];\n if (this.command) {\n if (!Array.isArray(this.command)) {\n commandName = this.command.name;\n commandArgs = this.command.args;\n } else {\n commandArgs = this.command;\n }\n }\n if (this.engine) this.engine.command.execute(commandName, ...commandArgs);\n }\n }\n}\n<\/script>\n<style>\n.editor-toolbar .toolbar-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: auto;\n min-width: 32px;\n margin: 0;\n text-align: center;\n padding: 0 7px;\n background-color: transparent;\n border: 1px solid transparent;\n border-radius: 3px 3px;\n font-size: 16px;\n cursor: pointer;\n color: #595959;\n outline: none;\n}\n.editor-toolbar.editor-toolbar-popup .toolbar-button {\n min-width: 24px;\n line-height: 24px;\n border-radius: 4px;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button {\n padding: 0 4px;\n}\n\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:hover {\n border: 1px solid transparent;\n background-color: #f5f5f5;\n}\n\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:active,\n.editor-toolbar .toolbar-button-active,\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-active:hover {\n background-color: #e8e8e8;\n border: 1px solid transparent;\n}\n\n.editor-toolbar .toolbar-button-disabled,\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-disabled:hover {\n background-color: transparent;\n border: 1px solid transparent;\n box-shadow: none;\n color: #000000;\n opacity: 0.25;\n cursor: not-allowed;\n}\n</style>\n']},media:void 0})},Et=void 0,Ot=void 0,Tt=!1,_t=mt({render:kt,staticRenderFns:At},St,Ct,Et,Tt,Ot,!1,yt,void 0,void 0),Mt=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.hotkeys={},t.isMobile=!1,t.placement="",t}return C(n,[{key:"getHotkey",value:function(t){var e=t.command,n=t.key,r=t.hotkey;return!this.engine||!0!==r&&void 0!==r||(r=ht(this.engine,e&&!Array.isArray(e)?e.name:this.name,n)),"string"===typeof r&&""!==r&&(r=a.formatHotkey(r)),r}},{key:"mounted",value:function(){var t=this;this.items.forEach((function(e){t.hotkeys[e.key]=t.getHotkey(e)})),this.isMobile=a.isMobile;var e=this.$refs.elementRef;if(e&&this.engine&&this.engine.scrollNode){var n=this.engine.scrollNode.get();if(n){var r=e.getBoundingClientRect(),i=n.getBoundingClientRect();r.top<i.top&&(this.placement="bottom"),r.bottom>i.bottom&&(this.placement="top")}}}},{key:"triggerSelect",value:function(t,e){t.preventDefault(),t.stopPropagation();var n=this.items.find((function(t){return t.key===e}));if(n&&!n.disabled){var r=n.autoExecute,i=n.command;if((!this.onSelect||!1!==this.onSelect(t,e))&&!1!==r){var o,a=this.name,s=[e];i&&(Array.isArray(i)?s=s.concat(i):(a=i.name,s=s.concat(i.args))),this.engine&&(o=this.engine.command).execute.apply(o,[a].concat(L(s)))}}}}]),n}(h["default"]);V([ut({type:Object})],Mt.prototype,"engine",void 0),V([ut({type:String,required:!0})],Mt.prototype,"name",void 0),V([ut({type:[String,Array,Number]})],Mt.prototype,"values",void 0),V([ut({type:Array,default:[]})],Mt.prototype,"items",void 0),V([ut(String)],Mt.prototype,"className",void 0),V([ut(String)],Mt.prototype,"direction",void 0),V([ut(Function)],Mt.prototype,"onSelect",void 0),V([ut({type:[Boolean,Object],default:void 0})],Mt.prototype,"hasDot",void 0),Mt=V([st({components:{"a-tooltip":f["default"]}})],Mt);var Nt=Mt,Pt=Nt,Lt=function(){var t,e=this,n=e.$createElement,r=e._self._c||n;return r("div",{ref:"elementRef",class:["toolbar-dropdown-list","toolbar-dropdown-"+(e.direction||"vertical"),(t={},t["toolbar-dropdown-placement-"+e.placement]=!!e.placement,t),{"toolbar-dropdown-dot":!1!==e.hasDot},e.className]},e._l(e.items,(function(t){var n=t.key,i=t.placement,o=t.title,a=t.content,s=t.className,l=t.icon,c=t.hotkey,u=t.disabled;return r("a-tooltip",{key:n,attrs:{placement:i||"right"},scopedSlots:e._u([!o&&!1===c||e.isMobile?null:{key:"title",fn:function(){return[o?r("div",{staticClass:"toolbar-tooltip-title"},[e._v(e._s(o))]):e._e(),e._v(" "),e.hotkeys[n]?r("div",{staticClass:"toolbar-tooltip-hotkey",domProps:{innerHTML:e._s(e.hotkeys[n])}}):e._e()]},proxy:!0}],null,!0)},[e._v(" "),r("a",{class:["toolbar-dropdown-list-item",s,{"toolbar-dropdown-list-item-disabled":u}],on:{click:function(t){return e.triggerSelect(t,n)}}},[("string"===typeof e.values&&e.values===n||Array.isArray(e.values)&&e.values.indexOf(n)>-1)&&"horizontal"!==e.direction&&!1!==e.hasDot?r("span",{staticClass:"data-icon data-icon-dot"}):e._e(),e._v(" "),e._t("icon",(function(){return[l?r("span",{class:["data-icon","data-icon-"+l]}):e._e()]})),e._v(" "),r("div",{domProps:{innerHTML:e._s("function"===typeof a?a():a)}})],2)])})),1)},Dt=[];Lt._withStripped=!0;var jt=void 0,It=void 0,Rt=void 0,Ft=!1,Bt=mt({render:Lt,staticRenderFns:Dt},jt,Pt,It,Ft,Rt,!1,void 0,void 0,void 0),zt=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.valuesVar="",t.buttonContent=null,t.isRight=!1,t.visible=!1,t}return C(n,[{key:"mounted",value:function(){if(this.$refs.buttonRef&&a.isMobile){var t=this.$refs.buttonRef.getBoundingClientRect();this.isRight=t.left>window.visualViewport.width/2}}},{key:"update",value:function(t){!1!==this.single&&(t=Array.isArray(t)&&t.length>0?t[0]:t);var e=this.items.find((function(e){return"string"===typeof t&&e.key===t||Array.isArray(t)&&t.indexOf(e.key)>-1})),n=this.items.length>0?this.items.find((function(t){return!0===t.isDefault}))||this.items[0]:null;e?this.$slots.default?this.buttonContent=e:"function"===typeof this.content?this.buttonContent={icon:this.icon,content:this.content()}:Array.isArray(t)&&t.length>1?this.buttonContent={icon:this.icon,content:this.content}:this.buttonContent={icon:e.icon,content:"function"===typeof e.content?e.content():e.content}:this.icon||this.content?(!Array.isArray(t)||t.length<1)&&(this.buttonContent={icon:this.icon,content:"function"===typeof this.content?this.content():this.content}):n&&(this.buttonContent={icon:n.icon,content:"function"===typeof n.content?n.content():n.content}),this.valuesVar=t||(this.icon||this.content?"":n?n.key:"")}},{key:"watch",value:function(t){t?document.addEventListener("click",this.hide):document.removeEventListener("click",this.hide)}},{key:"triggerMouseDown",value:function(t){t.preventDefault()}},{key:"triggerClick",value:function(t){t.preventDefault(),this.disabled||(this.visible?this.hide():this.show())}},{key:"show",value:function(){this.visible=!0}},{key:"hide",value:function(t){t&&this.$refs.targetRef&&this.$refs.targetRef.$refs.element.contains(t.target)||(this.visible=!1)}},{key:"triggerSelect",value:function(t,e){this.hide(),this.onSelect&&this.onSelect(t,e)}}]),n}(h["default"]);V([ut({type:Object})],zt.prototype,"engine",void 0),V([ut({type:String,required:!0})],zt.prototype,"name",void 0),V([ut({type:[String,Array,Number]})],zt.prototype,"values",void 0),V([ut({type:Array,default:[]})],zt.prototype,"items",void 0),V([ut(String)],zt.prototype,"icon",void 0),V([ut({type:[String,Function]})],zt.prototype,"content",void 0),V([ut(String)],zt.prototype,"title",void 0),V([ut({type:[Boolean,Object],default:void 0})],zt.prototype,"disabled",void 0),V([ut({type:[Boolean,Object],default:void 0})],zt.prototype,"single",void 0),V([ut(String)],zt.prototype,"className",void 0),V([ut(String)],zt.prototype,"direction",void 0),V([ut(Function)],zt.prototype,"onSelect",void 0),V([ut({type:[Boolean,Object],default:void 0})],zt.prototype,"hasArrow",void 0),V([ut({type:[Boolean,Object],default:void 0})],zt.prototype,"hasDot",void 0),V([ut({type:[String],default:void 0})],zt.prototype,"placement",void 0),V([dt("$props.values",{immediate:!0,deep:!0})],zt.prototype,"update",null),V([dt("visible",{immediate:!0,deep:!0})],zt.prototype,"watch",null),zt=V([st({components:{AmButton:_t,AmDropdownList:Bt}})],zt);var Ht=zt,Vt=Ht,qt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"buttonRef",class:["toolbar-dropdown",{"toolbar-dropdown-right":t.isRight},t.className],on:{click:t.triggerClick,mousedown:t.triggerMouseDown}},[n("div",{class:["toolbar-dropdown-trigger",{"toolbar-dropdown-trigger-active":t.visible,"toolbar-dropdown-trigger-arrow":!1!==t.hasArrow}]},[n("am-button",{ref:"targetRef",attrs:{name:t.name,placement:t.placement,title:t.title,active:t.visible,disabled:t.disabled},scopedSlots:t._u([{key:"default",fn:function(){return[t._t("default",(function(){return[t.buttonContent&&t.buttonContent.icon?n("span",{class:["data-icon","data-icon-"+t.buttonContent.icon]}):t._e(),t._v(" "),t.buttonContent&&!t.buttonContent.icon&&t.buttonContent.content?n("span",{staticClass:"toolbar-dropdown-button-text",domProps:{innerHTML:t._s(t.buttonContent.content)}}):t._e()]}),{item:t.content}),t._v(" "),!1!==t.hasArrow?n("span",{staticClass:"data-icon data-icon-arrow"}):t._e()]},proxy:!0}],null,!0)})],1),t._v(" "),t.visible?n("am-dropdown-list",{attrs:{hasDot:t.hasDot,engine:t.engine,direction:t.direction,name:t.name,items:t.items,values:t.valuesVar,"on-select":t.triggerSelect}}):t._e()],1)},Ut=[];qt._withStripped=!0;var Wt=function(t){t&&t("data-v-085ec803_0",{source:"\n.toolbar-dropdown {\r\n position: relative;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger {\r\n display: flex;\r\n align-items: stretch;\r\n height: 100%;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-button {\r\n margin: 0;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-dropdown-button-text {\r\n font-size: 12px;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .toolbar-button{\r\n padding-right: 20px;\r\n margin: 0;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .data-icon-arrow {\r\n position: absolute;\r\n right: 6px;\r\n top: calc(100% / 2 - 2px);\r\n width: 8px;\r\n height: 8px;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjhweCIgaGVpZ2h0PSI1cHgiIHZpZXdCb3g9IjAgMCA4IDUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1Mi41ICg2NzQ2OSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+DQogICAgPHRpdGxlPkdyb3VwIENvcHkgNjwvdGl0bGU+DQogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPg0KICAgICAgICA8ZyBpZD0idG9vbGJhciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyOC4wMDAwMDAsIC0xOC4wMDAwMDApIj4NCiAgICAgICAgICAgIDxnIGlkPSJwYXJhZ3JhcGgtc3R5bGUiPg0KICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIyNi4wMDAwMDAsIDQuMDAwMDAwKSI+DQogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC1Db3B5LTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMi4wMDAwMDAsIDEyLjAwMDAwMCkiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjgiIGhlaWdodD0iOCI+PC9yZWN0Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTAuNTk2MDkzNzUsMi41NTcwMzEyNSBMMy43NDUzMTI1LDYuMzc4MTI1IEMzLjg3NzM0Mzc1LDYuNTI1NzgxMjUgNC4xMDg1OTM3NSw2LjUyNTc4MTI1IDQuMjQwNjI1LDYuMzc4MTI1IEw3LjQwNTQ2ODc1LDIuNTU3MDMxMjUgQzcuNTk2MDkzNzUsMi4zNDI5Njg3NSA3LjQ0NDUzMTI1LDIuMDAzOTA2MjUgNy4xNTc4MTI1LDIuMDAzOTA2MjUgTDAuODQ0NTMxMjUsMi4wMDM5MDYyNSBDMC41NTcwMzEyNSwyLjAwMzkwNjI1IDAuNDA0Njg3NSwyLjM0Mjk2ODc1IDAuNTk2MDkzNzUsMi41NTcwMzEyNSBaIiBpZD0iU2hhcGUiIGZpbGw9IiMwMDAwMDAiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICAgICAgICAgICAgICA8L2c+DQogICAgICAgICAgICAgICAgPC9nPg0KICAgICAgICAgICAgPC9nPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);\r\n background-repeat: no-repeat;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n}\n.toolbar-dropdown .toolbar-dropdown-list {\r\n position: absolute;\r\n top: 32px;\r\n font-size: 12px;\r\n background: #ffffff;\r\n border: 1px solid #e8e8e8;\r\n border-radius: 3px 3px;\r\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);\r\n padding: 5px 0;\r\n height: auto;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\r\n z-index: 999;\r\n max-height: calc(80vh);\r\n overflow: auto;\n}\n.toolbar-dropdown.toolbar-dropdown-right:not(.toolbar-dropdown-right) .toolbar-dropdown-list{\r\n left: 0px;\n}\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list, .editor-toolbar-popup .toolbar-dropdown .toolbar-dropdown-list:not(.toolbar-dropdown-placement-bottom) {\r\n bottom: 32px;\r\n top: auto;\r\n overflow: auto;\n}\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list {\r\n max-height: calc(30vh);\n}\n.editor-toolbar-mobile .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list,.editor-toolbar-popup .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list{\r\n right: 0px;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item {\r\n padding: 2px 10px 2px 16px;\r\n line-height: 30px;\r\n color: #595959;\r\n text-align: left;\r\n position: relative;\r\n display: flex;\r\n white-space: nowrap;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item-disabled {\r\n color: rgba(17, 31, 44, 0.24);\r\n cursor: not-allowed;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item:not(.toolbar-dropdown-list-item-disabled):hover {\r\n color: #262626;\r\n background-color: #f5f5f5;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon {\r\n margin-right: 8px;\n}\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-horizontal .toolbar-dropdown-list-item {\r\n display: inline-block;\n}\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-dot .toolbar-dropdown-list-item {\r\n padding-left: 30px;\r\n padding-right: 16px;\r\n white-space: nowrap;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon-dot\r\n{\r\n position: absolute;\r\n top: 50%;\r\n left: 8px;\r\n margin-top: -7px;\r\n width: 14px;\r\n height: 14px;\r\n display: block;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTRweCIgaGVpZ2h0PSIxNHB4IiB2aWV3Qm94PSIwIDAgMTQgMTQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjQgKDY3Mzc4KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5VbnRpdGxlZDwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPgogICAgICAgIDxnIGlkPSJjaGVjayIgZmlsbD0iIzAwMDAwMCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIG9wYWNpdHk9IjAiIHg9IjAiIHk9IjAiIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTIuNDY4NzUsMi41OTc2NTYyNSBMMTEuNTEzMDg1OSwyLjU5NzY1NjI1IEMxMS4zNzkxMDE2LDIuNTk3NjU2MjUgMTEuMjUxOTUzMSwyLjY1OTE3OTY5IDExLjE2OTkyMTksMi43NjQ0NTMxMiBMNS41MzMwMDc4MSw5LjkwNTI3MzQ0IEwyLjgzMDA3ODEyLDYuNDgwNDY4NzUgQzIuNzQ2Njc5NjksNi4zNzUxOTUzMSAyLjYyMDg5ODQ0LDYuMzEzNjcxODcgMi40ODY5MTQwNiw2LjMxMzY3MTg3IEwxLjUzMTI1LDYuMzEzNjcxODcgQzEuNDM5NjQ4NDQsNi4zMTM2NzE4NyAxLjM4OTA2MjUsNi40MTg5NDUzMSAxLjQ0NTExNzE5LDYuNDkwMDM5MDYgTDUuMTg5ODQzNzUsMTEuMjM0MTc5NyBDNS4zNjQ4NDM3NSwxMS40NTU2NjQxIDUuNzAxMTcxODcsMTEuNDU1NjY0MSA1Ljg3NzUzOTA2LDExLjIzNDE3OTcgTDEyLjU1NDg4MjgsMi43NzI2NTYyNSBDMTIuNjEwOTM3NSwyLjcwMjkyOTY5IDEyLjU2MDM1MTYsMi41OTc2NTYyNSAxMi40Njg3NSwyLjU5NzY1NjI1IFoiIGlkPSJQYXRoIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=);\r\n background-repeat: no-repeat;\n}\r\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/dropdown.vue"],names:[],mappings:";AAqMA;IACA,kBAAA;AACA;AAEA;IACA,aAAA;IACA,oBAAA;IACA,YAAA;AACA;AAEA;IACA,SAAA;AACA;AAEA;IACA,eAAA;AACA;AAEA;IACA,mBAAA;IACA,SAAA;AACA;AAEA;IACA,kBAAA;IACA,UAAA;IACA,yBAAA;IACA,UAAA;IACA,WAAA;IACA,isDAAA;IACA,4BAAA;IACA,oDAAA;AACA;AAEA;IACA,kBAAA;IACA,SAAA;IACA,eAAA;IACA,mBAAA;IACA,yBAAA;IACA,sBAAA;IACA,0CAAA;IACA,cAAA;IACA,YAAA;IACA,oDAAA;IACA,YAAA;IACA,sBAAA;IACA,cAAA;AACA;AAEA;IACA,SAAA;AACA;AAEA;IACA,YAAA;IACA,SAAA;IACA,cAAA;AACA;AAEA;IACA,sBAAA;AACA;AAGA;IACA,UAAA;AACA;AAEA;IACA,0BAAA;IACA,iBAAA;IACA,cAAA;IACA,gBAAA;IACA,kBAAA;IACA,aAAA;IACA,mBAAA;AACA;AAEA;IACA,6BAAA;IACA,mBAAA;AACA;AAEA;IACA,cAAA;IACA,yBAAA;AACA;AAEA;IACA,iBAAA;AACA;AAEA;IACA,qBAAA;AACA;AAEA;IACA,kBAAA;IACA,mBAAA;IACA,mBAAA;AACA;AAEA;;IAEA,kBAAA;IACA,QAAA;IACA,SAAA;IACA,gBAAA;IACA,WAAA;IACA,YAAA;IACA,cAAA;IACA,igDAAA;IACA,4BAAA;AACA",file:"dropdown.vue",sourcesContent:['<template>\r\n <div\r\n :class="[\r\n \'toolbar-dropdown\',\r\n { \'toolbar-dropdown-right\': isRight },\r\n className,\r\n ]"\r\n ref="buttonRef"\r\n @click="triggerClick"\r\n @mousedown="triggerMouseDown"\r\n >\r\n <div\r\n :class="[\r\n \'toolbar-dropdown-trigger\',\r\n {\r\n \'toolbar-dropdown-trigger-active\': visible,\r\n \'toolbar-dropdown-trigger-arrow\': hasArrow !== false,\r\n },\r\n ]"\r\n >\r\n <am-button\r\n :name="name"\r\n :placement="placement"\r\n :title="title"\r\n :active="visible"\r\n :disabled="disabled"\r\n ref="targetRef"\r\n >\r\n <template #default>\r\n <slot :item="content">\r\n <span\r\n v-if="buttonContent && buttonContent.icon"\r\n :class="[\'data-icon\', `data-icon-${buttonContent.icon}`]"\r\n />\r\n <span\r\n v-if="\r\n buttonContent && !buttonContent.icon && buttonContent.content\r\n "\r\n class="toolbar-dropdown-button-text"\r\n v-html="buttonContent.content"\r\n ></span>\r\n </slot>\r\n <span v-if="hasArrow !== false" class="data-icon data-icon-arrow" />\r\n </template>\r\n </am-button>\r\n </div>\r\n <am-dropdown-list\r\n v-if="visible"\r\n :hasDot="hasDot"\r\n :engine="engine"\r\n :direction="direction"\r\n :name="name"\r\n :items="items"\r\n :values="valuesVar"\r\n :on-select="triggerSelect"\r\n />\r\n </div>\r\n</template>\r\n<script lang="ts">\r\nimport { Component, Prop, Vue, Watch } from "vue-property-decorator";\r\nimport { EngineInterface, isMobile, Placement } from "@aomao/engine";\r\nimport { DropdownListItem } from "../types";\r\nimport AmDropdownList from "./dropdown-list.vue";\r\nimport AmButton from "./button.vue";\r\n\r\n@Component({\r\n components: {\r\n AmButton,\r\n AmDropdownList,\r\n },\r\n})\r\nexport default class Dropdown extends Vue {\r\n @Prop({ type: Object }) engine?: EngineInterface;\r\n @Prop({ type: String, required: true }) name!: string;\r\n @Prop({ type: [String, Array, Number] }) values?: string | number | string[];\r\n @Prop({ type: Array, default: [] }) items!: DropdownListItem[];\r\n @Prop(String) icon?: string;\r\n @Prop({ type: [String, Function] }) content?: string | (() => string);\r\n @Prop(String) title?: string;\r\n @Prop({ type: [Boolean, Object], default: undefined }) disabled?: boolean;\r\n @Prop({ type: [Boolean, Object], default: undefined }) single?: boolean;\r\n @Prop(String) className?: string;\r\n @Prop(String) direction?: "vertical" | "horizontal";\r\n @Prop(Function) onSelect?: (event: MouseEvent, key: string) => void | boolean;\r\n @Prop({ type: [Boolean, Object], default: undefined }) hasArrow?: boolean;\r\n @Prop({ type: [Boolean, Object], default: undefined }) hasDot?: boolean;\r\n @Prop({ type: [String], default: undefined }) placement?: Placement;\r\n valuesVar: string | number | string[] = "";\r\n buttonContent?:\r\n | DropdownListItem\r\n | { icon?: string; content?: string }\r\n | null = null;\r\n isRight = false;\r\n visible = false;\r\n\r\n mounted() {\r\n if (this.$refs.buttonRef && isMobile) {\r\n const rect = (this.$refs.buttonRef as Element).getBoundingClientRect();\r\n this.isRight = rect.left > window.visualViewport.width / 2;\r\n }\r\n }\r\n\r\n @Watch("$props.values", { immediate: true, deep: true })\r\n update(values?: string | number | string[]) {\r\n if (this.single !== false)\r\n values = Array.isArray(values) && values.length > 0 ? values[0] : values;\r\n const item = this.items.find(\r\n (item) =>\r\n (typeof values === "string" && item.key === values) ||\r\n (Array.isArray(values) && values.indexOf(item.key) > -1)\r\n );\r\n const defaultItem =\r\n this.items.length > 0\r\n ? this.items.find((item) => item.isDefault === true) || this.items[0]\r\n : null;\r\n\r\n if (item) {\r\n if (this.$slots.default) {\r\n this.buttonContent = item;\r\n } else if (typeof this.content === "function") {\r\n this.buttonContent = { icon: this.icon, content: this.content() };\r\n } else if (Array.isArray(values) && values.length > 1) {\r\n this.buttonContent = { icon: this.icon, content: this.content };\r\n } else {\r\n this.buttonContent = {\r\n icon: item.icon,\r\n content:\r\n typeof item.content === "function" ? item.content() : item.content,\r\n };\r\n }\r\n } else if (this.icon || this.content) {\r\n if (!Array.isArray(values) || values.length < 1) {\r\n this.buttonContent = {\r\n icon: this.icon,\r\n content:\r\n typeof this.content === "function" ? this.content() : this.content,\r\n };\r\n }\r\n } else if (defaultItem) {\r\n this.buttonContent = {\r\n icon: defaultItem.icon,\r\n content:\r\n typeof defaultItem.content === "function"\r\n ? defaultItem.content()\r\n : defaultItem.content,\r\n };\r\n }\r\n this.valuesVar =\r\n values ||\r\n (this.icon || this.content ? "" : defaultItem ? defaultItem.key : "");\r\n }\r\n\r\n @Watch("visible", { immediate: true, deep: true })\r\n watch(value: boolean) {\r\n if (value) document.addEventListener("click", this.hide);\r\n else document.removeEventListener("click", this.hide);\r\n }\r\n\r\n triggerMouseDown(event: MouseEvent) {\r\n event.preventDefault();\r\n }\r\n\r\n triggerClick(event: MouseEvent) {\r\n event.preventDefault();\r\n if (this.disabled) {\r\n return;\r\n }\r\n if (this.visible) {\r\n this.hide();\r\n } else {\r\n this.show();\r\n }\r\n }\r\n\r\n show() {\r\n this.visible = true;\r\n }\r\n\r\n hide(event?: MouseEvent) {\r\n if (\r\n event &&\r\n this.$refs.targetRef &&\r\n ((this.$refs.targetRef as Vue).$refs.element as Element).contains(\r\n event.target as Node\r\n )\r\n )\r\n return;\r\n this.visible = false;\r\n }\r\n\r\n triggerSelect(event: MouseEvent, key: string) {\r\n this.hide();\r\n if (this.onSelect) this.onSelect(event, key);\r\n }\r\n}\r\n<\/script>\r\n<style>\r\n.toolbar-dropdown {\r\n position: relative;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger {\r\n display: flex;\r\n align-items: stretch;\r\n height: 100%;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-button {\r\n margin: 0;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-dropdown-button-text {\r\n font-size: 12px;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .toolbar-button{\r\n padding-right: 20px;\r\n margin: 0;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .data-icon-arrow {\r\n position: absolute;\r\n right: 6px;\r\n top: calc(100% / 2 - 2px);\r\n width: 8px;\r\n height: 8px;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjhweCIgaGVpZ2h0PSI1cHgiIHZpZXdCb3g9IjAgMCA4IDUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1Mi41ICg2NzQ2OSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+DQogICAgPHRpdGxlPkdyb3VwIENvcHkgNjwvdGl0bGU+DQogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPg0KICAgICAgICA8ZyBpZD0idG9vbGJhciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyOC4wMDAwMDAsIC0xOC4wMDAwMDApIj4NCiAgICAgICAgICAgIDxnIGlkPSJwYXJhZ3JhcGgtc3R5bGUiPg0KICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIyNi4wMDAwMDAsIDQuMDAwMDAwKSI+DQogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC1Db3B5LTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMi4wMDAwMDAsIDEyLjAwMDAwMCkiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjgiIGhlaWdodD0iOCI+PC9yZWN0Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTAuNTk2MDkzNzUsMi41NTcwMzEyNSBMMy43NDUzMTI1LDYuMzc4MTI1IEMzLjg3NzM0Mzc1LDYuNTI1NzgxMjUgNC4xMDg1OTM3NSw2LjUyNTc4MTI1IDQuMjQwNjI1LDYuMzc4MTI1IEw3LjQwNTQ2ODc1LDIuNTU3MDMxMjUgQzcuNTk2MDkzNzUsMi4zNDI5Njg3NSA3LjQ0NDUzMTI1LDIuMDAzOTA2MjUgNy4xNTc4MTI1LDIuMDAzOTA2MjUgTDAuODQ0NTMxMjUsMi4wMDM5MDYyNSBDMC41NTcwMzEyNSwyLjAwMzkwNjI1IDAuNDA0Njg3NSwyLjM0Mjk2ODc1IDAuNTk2MDkzNzUsMi41NTcwMzEyNSBaIiBpZD0iU2hhcGUiIGZpbGw9IiMwMDAwMDAiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICAgICAgICAgICAgICA8L2c+DQogICAgICAgICAgICAgICAgPC9nPg0KICAgICAgICAgICAgPC9nPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);\r\n background-repeat: no-repeat;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list {\r\n position: absolute;\r\n top: 32px;\r\n font-size: 12px;\r\n background: #ffffff;\r\n border: 1px solid #e8e8e8;\r\n border-radius: 3px 3px;\r\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);\r\n padding: 5px 0;\r\n height: auto;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\r\n z-index: 999;\r\n max-height: calc(80vh);\r\n overflow: auto;\r\n}\r\n\r\n.toolbar-dropdown.toolbar-dropdown-right:not(.toolbar-dropdown-right) .toolbar-dropdown-list{\r\n left: 0px;\r\n}\r\n\r\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list, .editor-toolbar-popup .toolbar-dropdown .toolbar-dropdown-list:not(.toolbar-dropdown-placement-bottom) {\r\n bottom: 32px;\r\n top: auto;\r\n overflow: auto;\r\n}\r\n\r\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list {\r\n max-height: calc(30vh);\r\n}\r\n\r\n\r\n.editor-toolbar-mobile .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list,.editor-toolbar-popup .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list{\r\n right: 0px;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item {\r\n padding: 2px 10px 2px 16px;\r\n line-height: 30px;\r\n color: #595959;\r\n text-align: left;\r\n position: relative;\r\n display: flex;\r\n white-space: nowrap;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item-disabled {\r\n color: rgba(17, 31, 44, 0.24);\r\n cursor: not-allowed;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item:not(.toolbar-dropdown-list-item-disabled):hover {\r\n color: #262626;\r\n background-color: #f5f5f5;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon {\r\n margin-right: 8px;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-horizontal .toolbar-dropdown-list-item {\r\n display: inline-block;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-dot .toolbar-dropdown-list-item {\r\n padding-left: 30px;\r\n padding-right: 16px;\r\n white-space: nowrap;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon-dot\r\n{\r\n position: absolute;\r\n top: 50%;\r\n left: 8px;\r\n margin-top: -7px;\r\n width: 14px;\r\n height: 14px;\r\n display: block;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTRweCIgaGVpZ2h0PSIxNHB4IiB2aWV3Qm94PSIwIDAgMTQgMTQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjQgKDY3Mzc4KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5VbnRpdGxlZDwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPgogICAgICAgIDxnIGlkPSJjaGVjayIgZmlsbD0iIzAwMDAwMCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIG9wYWNpdHk9IjAiIHg9IjAiIHk9IjAiIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTIuNDY4NzUsMi41OTc2NTYyNSBMMTEuNTEzMDg1OSwyLjU5NzY1NjI1IEMxMS4zNzkxMDE2LDIuNTk3NjU2MjUgMTEuMjUxOTUzMSwyLjY1OTE3OTY5IDExLjE2OTkyMTksMi43NjQ0NTMxMiBMNS41MzMwMDc4MSw5LjkwNTI3MzQ0IEwyLjgzMDA3ODEyLDYuNDgwNDY4NzUgQzIuNzQ2Njc5NjksNi4zNzUxOTUzMSAyLjYyMDg5ODQ0LDYuMzEzNjcxODcgMi40ODY5MTQwNiw2LjMxMzY3MTg3IEwxLjUzMTI1LDYuMzEzNjcxODcgQzEuNDM5NjQ4NDQsNi4zMTM2NzE4NyAxLjM4OTA2MjUsNi40MTg5NDUzMSAxLjQ0NTExNzE5LDYuNDkwMDM5MDYgTDUuMTg5ODQzNzUsMTEuMjM0MTc5NyBDNS4zNjQ4NDM3NSwxMS40NTU2NjQxIDUuNzAxMTcxODcsMTEuNDU1NjY0MSA1Ljg3NzUzOTA2LDExLjIzNDE3OTcgTDEyLjU1NDg4MjgsMi43NzI2NTYyNSBDMTIuNjEwOTM3NSwyLjcwMjkyOTY5IDEyLjU2MDM1MTYsMi41OTc2NTYyNSAxMi40Njg3NSwyLjU5NzY1NjI1IFoiIGlkPSJQYXRoIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=);\r\n background-repeat: no-repeat;\r\n}\r\n</style>\r\n']},media:void 0})},$t=void 0,Gt=void 0,Yt=!1,Xt=mt({render:qt,staticRenderFns:Ut},Wt,Vt,$t,Yt,Gt,!1,yt,void 0,void 0),Kt=function t(){w(this,t)};Kt.colors=[["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FAFAFA","#FFFFFF"],["#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96"],["#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB"],["#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2"],["#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB"],["#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F"],["#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"]],Kt._map=function(){for(var t={},e=Kt.colors,n=0,r=e.length;n<r;n++)for(var i=e[n],o=0,a=i.length;o<a;o++){var s=e[n][o];t[s]={y:n,x:o}}return t}(),Kt.getStroke=function(t){var e=Kt._map[t];return e&&(2===e.y||3===e.y&&e.x>2&&e.x<5)?this.colors[4][e.x]:t},Kt.getColors=function(){return this.colors};var Zt=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.title="",t.special=!1,t.needBorder=!1,t}return C(n,[{key:"mounted",value:function(){this.special="transparent"===this.color,this.title=this.engine.language.get("toolbar","colorPicker",this.color.toUpperCase()),this.state=this.toState(this.color||"#FFFFFF"),this.needBorder=["#ffffff","#fafafa","transparent"].indexOf(this.state.hex)>=0,this.styles=this.getStyles(this.state)}},{key:"triggerSelect",value:function(t){t.preventDefault(),t.stopPropagation(),this.onSelect&&this.onSelect(this.color,t)}},{key:"refreshStyles",get:function(){return this.getStyles()}},{key:"getContrastingColor",value:function(t){if(!t)return"";if("transparent"===t.hex)return"rgba(0,0,0,0.4)";var e=(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3;return e>=210?"#8C8C8C":"#FFFFFF"}},{key:"toState",value:function(t,e){var n=t["hex"]?g["default"](t["hex"]):g["default"](t),r=n.toHsl(),i=n.toHsv(),o=n.toRgb(),a=n.toHex();0===r.s&&(r.h=e||0,i.h=e||0);var s="000000"===a&&0===o.a;return{hsl:r,hex:s?"transparent":"#".concat(a),rgb:o,hsv:i,oldHue:t["h"]||e||r.h,source:t["source"]}}},{key:"getStyles",value:function(t){return{check:{fill:this.getContrastingColor(t||this.state),display:this.active?"block":"none"},block:{backgroundColor:this.color,border:this.setStroke?"1px solid ".concat(Kt.getStroke(this.color)):void 0}}}}]),n}(h["default"]);V([ut({type:Object,required:!0})],Zt.prototype,"engine",void 0),V([ut(String)],Zt.prototype,"color",void 0),V([ut({type:[Boolean,Object],default:void 0})],Zt.prototype,"active",void 0),V([ut({type:[Boolean,Object],default:void 0})],Zt.prototype,"setStroke",void 0),V([ut(Function)],Zt.prototype,"onSelect",void 0),Zt=V([st({})],Zt);var Jt=Zt,Qt=Jt,te=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{class:["colorpicker-group-item",{"colorpicker-group-item-border":t.needBorder,"colorpicker-group-item-active":t.active,"colorpicker-group-item-special":t.special}],attrs:{title:t.title},on:{click:t.triggerSelect}},[n("span",{style:t.refreshStyles.block},[n("svg",{style:t.refreshStyles.check,attrs:{viewBox:"0 0 18 18"}},[n("path",{attrs:{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}})])])])},ee=[];te._withStripped=!0;var ne=void 0,re=void 0,ie=void 0,oe=!1,ae=mt({render:te,staticRenderFns:ee},ne,Qt,re,oe,ie,!1,void 0,void 0,void 0),se=function(t){A(n,t);var e=M(n);function n(){return w(this,n),e.apply(this,arguments)}return n}(h["default"]);V([ut({type:Object,required:!0})],se.prototype,"engine",void 0),V([ut(Array)],se.prototype,"colors",void 0),V([ut({type:[Boolean,Object],default:void 0})],se.prototype,"setStroke",void 0),V([ut(Function)],se.prototype,"onSelect",void 0),se=V([st({components:{AmColorPickerItem:ae}})],se);var le=se,ce=le,ue=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"colorpicker-group"},t._l(t.colors,(function(e){return n("am-color-picker-item",{key:e.value,attrs:{engine:t.engine,color:e.value,active:e.active,"on-select":t.onSelect,"set-stroke":t.setStroke}})})),1)},de=[];ue._withStripped=!0;var he=void 0,pe=void 0,fe=void 0,ge=!1,me=mt({render:ue,staticRenderFns:de},he,ce,pe,ge,fe,!1,void 0,void 0,void 0),ve=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.colorValues=[],t.text="",t}return C(n,[{key:"activeColors",value:function(t,e){return t.map((function(t){return t.map((function(t){var n="string"===typeof t?t:t.value;return{value:n,active:e===n}}))}))}},{key:"mounted",value:function(){this.colorValues=this.activeColors(this.colors||Kt.getColors(),this.defaultActiveColor),this.text=this.engine.language.get("toolbar","colorPicker","transparent"===this.defaultColor?"nonFillText":"defaultText")}},{key:"triggerSelect",value:function(t,e){this.colorValues=this.activeColors(this.colorValues,t),this.onSelect&&this.onSelect(t,e)}},{key:"triggerMouseDown",value:function(t){"INPUT"!==t.target.tagName&&t.preventDefault()}}]),n}(h["default"]);V([ut({type:Object,required:!0})],ve.prototype,"engine",void 0),V([ut(Array)],ve.prototype,"colors",void 0),V([ut({type:String,required:!0})],ve.prototype,"defaultColor",void 0),V([ut({type:String,required:!0})],ve.prototype,"defaultActiveColor",void 0),V([ut({type:[Boolean,Object],default:void 0})],ve.prototype,"setStroke",void 0),V([ut(Function)],ve.prototype,"onSelect",void 0),ve=V([st({components:{AmColorPickerItem:ae,AmColorPickerGroup:me}})],ve);var be=ve,ye=be,we=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"colorpicker-board",on:{mousedown:t.triggerMouseDown}},[n("div",{staticClass:"colorpicker-default",on:{click:function(e){return t.triggerSelect(t.defaultColor,e)}}},[n("am-color-picker-item",{attrs:{engine:t.engine,color:t.defaultColor,"active-colors":[],"on-select":t.triggerSelect}}),t._v(" "),n("span",{staticClass:"colorpicker-default-text"},[t._v("\n "+t._s(t.text)+"\n ")])],1),t._v(" "),t._l(t.colorValues,(function(e,r){return n("am-color-picker-group",{key:r,attrs:{engine:t.engine,colors:e,"on-select":t.triggerSelect,"set-stroke":t.setStroke}})}))],2)},xe=[];we._withStripped=!0;var Ce=function(t){t&&t("data-v-3eb43e2e_0",{source:'\n.colorpicker-default {\n display: flex;\n align-items: center;\n padding: 4px 8px;\n margin: 4px 0 8px;\n border-radius: 2px;\n cursor: pointer;\n}\n.colorpicker-default:hover {\n background-color: #f5f5f5;\n}\n.colorpicker-default-text {\n margin-left: 8px;\n}\n.colorpicker-group {\n display: flex;\n width: 100%;\n height: auto;\n position: relative;\n padding: 0 8px;\n}\n.colorpicker-group:nth-child(2){\n margin-bottom: 6px;\n}\n.colorpicker-group:last-child {\n margin-bottom: 0px;\n}\n.colorpicker-group-item {\n width: 24px;\n height: 24px;\n padding: 2px 2px;\n display: inline-block;\n border-radius: 3px 3px;\n border: 1px solid transparent;\n flex: 0 0 auto;\n cursor: pointer;\n background-color: #fff;\n}\n.colorpicker-group-item > span {\n position: relative;\n width: 18px;\n height: 18px;\n display: block;\n border-radius: 2px 2px;\n border: 1px solid transparent;\n}\n.colorpicker-group-item > span svg {\n position: absolute;\n top: -1px;\n left: 1px;\n width: 12px;\n height: 12px;\n}\n.colorpicker-group-item-border > span {\n border: 1px solid #e8e8e8;\n}\n.colorpicker-group-item-special {\n position: relative;\n}\n.colorpicker-group-item-special:after {\n content: "";\n display: block;\n position: absolute;\n top: 10px;\n left: 0px;\n width: 22px;\n height: 0;\n border-bottom: 2px solid #ff5151;\n transform: rotate(45deg);\n}\n.colorpicker-group-item:hover {\n border: 1px solid #d9d9d9;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);\n}\n',map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/color/picker/picker.vue"],names:[],mappings:";AAyFA;IACA,aAAA;IACA,mBAAA;IACA,gBAAA;IACA,iBAAA;IACA,kBAAA;IACA,eAAA;AACA;AAEA;IACA,yBAAA;AACA;AAEA;IACA,gBAAA;AACA;AAEA;IACA,aAAA;IACA,WAAA;IACA,YAAA;IACA,kBAAA;IACA,cAAA;AACA;AAEA;IACA,kBAAA;AACA;AAEA;IACA,kBAAA;AACA;AAEA;IACA,WAAA;IACA,YAAA;IACA,gBAAA;IACA,qBAAA;IACA,sBAAA;IACA,6BAAA;IACA,cAAA;IACA,eAAA;IACA,sBAAA;AACA;AACA;IACA,kBAAA;IACA,WAAA;IACA,YAAA;IACA,cAAA;IACA,sBAAA;IACA,6BAAA;AACA;AACA;IACA,kBAAA;IACA,SAAA;IACA,SAAA;IACA,WAAA;IACA,YAAA;AACA;AACA;IACA,yBAAA;AACA;AACA;IACA,kBAAA;AACA;AACA;IACA,WAAA;IACA,cAAA;IACA,kBAAA;IACA,SAAA;IACA,SAAA;IACA,WAAA;IACA,SAAA;IACA,gCAAA;IACA,wBAAA;AACA;AACA;IACA,yBAAA;IACA,yCAAA;AACA",file:"picker.vue",sourcesContent:['<template>\n <div\n class="colorpicker-board"\n @mousedown="triggerMouseDown"\n >\n <div\n class="colorpicker-default"\n @click="triggerSelect(defaultColor,$event)"\n >\n <am-color-picker-item\n :engine="engine"\n :color="defaultColor"\n :active-colors="[]"\n :on-select="triggerSelect"\n />\n <span class="colorpicker-default-text">\n {{text}}\n </span>\n </div>\n <am-color-picker-group\n v-for="(data,index) in colorValues"\n :engine="engine"\n :colors="data"\n :key="index"\n :on-select="triggerSelect"\n :set-stroke="setStroke"\n />\n </div>\n</template>\n<script lang="ts">\nimport { Component, Prop, Vue } from "vue-property-decorator";\nimport { EngineInterface } from "@aomao/engine";\nimport AmColorPickerItem from \'./item.vue\'\nimport AmColorPickerGroup from \'./group.vue\'\nimport Palette from \'./palette\'\n\n@Component({\n components: {\n AmColorPickerItem,\n AmColorPickerGroup\n },\n})\nexport default class ColorPicker extends Vue {\n @Prop({ type: Object, required: true}) engine!: EngineInterface\n @Prop(Array) colors?: string[][]\n @Prop({ type: String, required: true}) defaultColor!: string\n @Prop({ type: String, required: true}) defaultActiveColor!: string\n @Prop({ type: [Boolean, Object], default: undefined}) setStroke?: boolean\n @Prop(Function) onSelect?: (color: string, event: MouseEvent) => void\n \n\n activeColors(values:Array<Array<string | {value:string,active:boolean}>>,activeValue:string){\n return values.map(group => group.map(color => {\n const value = typeof color === "string" ? color : color.value\n return { value, active:activeValue === value }\n }))\n }\n\n colorValues: {\n value: string;\n active: boolean;\n }[][] = []\n\n text = \'\'\n\n mounted(){\n this.colorValues = this.activeColors(this.colors || Palette.getColors(), this.defaultActiveColor)\n this.text = this.engine.language.get(\n \'toolbar\',\n \'colorPicker\',\n this.defaultColor === \'transparent\'\n ? \'nonFillText\'\n : \'defaultText\',\n )\n }\n\n triggerSelect(color: string, event: MouseEvent){\n this.colorValues = this.activeColors(this.colorValues, color)\n if (this.onSelect) this.onSelect(color, event);\n }\n\n triggerMouseDown(event:MouseEvent){\n if (\'INPUT\' !== (event.target as Element).tagName) {\n event.preventDefault();\n }\n }\n}\n<\/script>\n<style>\n.colorpicker-default {\n display: flex;\n align-items: center;\n padding: 4px 8px;\n margin: 4px 0 8px;\n border-radius: 2px;\n cursor: pointer;\n}\n\n.colorpicker-default:hover {\n background-color: #f5f5f5;\n}\n\n.colorpicker-default-text {\n margin-left: 8px; \n}\n\n.colorpicker-group {\n display: flex;\n width: 100%;\n height: auto;\n position: relative;\n padding: 0 8px;\n}\n\n.colorpicker-group:nth-child(2){\n margin-bottom: 6px;\n}\n\n.colorpicker-group:last-child {\n margin-bottom: 0px;\n}\n\n.colorpicker-group-item {\n width: 24px;\n height: 24px;\n padding: 2px 2px;\n display: inline-block;\n border-radius: 3px 3px;\n border: 1px solid transparent;\n flex: 0 0 auto;\n cursor: pointer;\n background-color: #fff;\n}\n.colorpicker-group-item > span {\n position: relative;\n width: 18px;\n height: 18px;\n display: block;\n border-radius: 2px 2px;\n border: 1px solid transparent;\n}\n.colorpicker-group-item > span svg {\n position: absolute;\n top: -1px;\n left: 1px;\n width: 12px;\n height: 12px;\n}\n.colorpicker-group-item-border > span {\n border: 1px solid #e8e8e8;\n}\n.colorpicker-group-item-special {\n position: relative;\n}\n.colorpicker-group-item-special:after {\n content: "";\n display: block;\n position: absolute;\n top: 10px;\n left: 0px;\n width: 22px;\n height: 0;\n border-bottom: 2px solid #ff5151;\n transform: rotate(45deg);\n}\n.colorpicker-group-item:hover {\n border: 1px solid #d9d9d9;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);\n}\n</style>']},media:void 0})},ke=void 0,Ae=void 0,Se=!1,Ee=mt({render:we,staticRenderFns:xe},Ce,ye,ke,Se,Ae,!1,yt,void 0,void 0),Oe=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.visible=!1,t.isRight=!1,t.currentColor="",t.buttonContent="",t.listPlacement="",t}return C(n,[{key:"mounted",value:function(){if(this.$refs.buttonRef&&a.isMobile){var t=this.$refs.buttonRef.getBoundingClientRect();this.isRight=t.left>window.visualViewport.width/2}this.currentColor=this.defaultActiveColor}},{key:"unmounted",value:function(){document.removeEventListener("click",this.hideDropdown)}},{key:"getContent",value:function(){this.buttonContent="string"===typeof this.content?this.content:this.content(this.currentColor,Kt.getStroke(this.currentColor),this.disabled)}},{key:"toggleDropdown",value:function(t){t.preventDefault(),this.visible?this.hideDropdown():this.showDropdown()}},{key:"showDropdown",value:function(){this.visible=!0}},{key:"hideDropdown",value:function(t){t&&this.$refs.targetRef&&this.$refs.targetRef.$refs.element.contains(t.target)||(this.visible=!1)}},{key:"watch",value:function(t){var e=this;t?(document.addEventListener("click",this.hideDropdown),setTimeout((function(){var t=e.$refs.elementRef;if(t&&e.engine&&e.engine.scrollNode){var n=e.engine.scrollNode.get();if(n){var r=t.getBoundingClientRect(),i=n.getBoundingClientRect();r.top<i.top&&(e.listPlacement="bottom"),r.bottom>i.bottom&&(e.listPlacement="top")}}}),0)):document.removeEventListener("click",this.hideDropdown)}},{key:"triggerClick",value:function(t){this.triggerSelect(this.currentColor,t)}},{key:"triggerSelect",value:function(t,e){if(this.hideDropdown(),this.currentColor=t,this.buttonContent="string"===typeof this.content?this.content:this.content(t,Kt.getStroke(t),this.disabled),!1!==this.autoExecute){var n,r=this.name,i=[t,this.defaultColor];this.command&&(Array.isArray(this.command)?i=this.command:(r=this.command.name,i=this.command.args)),this.engine&&(n=this.engine.command).execute.apply(n,[r].concat(L(i)))}this.onSelect&&this.onSelect(t,e)}}]),n}(h["default"]);V([ut({type:Object})],Oe.prototype,"engine",void 0),V([ut({type:String,required:!0})],Oe.prototype,"name",void 0),V([ut({type:[String,Function],required:!0})],Oe.prototype,"content",void 0),V([ut(String)],Oe.prototype,"buttonTitle",void 0),V([ut(String)],Oe.prototype,"dropdownTitle",void 0),V([ut({type:Object})],Oe.prototype,"command",void 0),V([ut({type:[Boolean,Object],default:void 0})],Oe.prototype,"autoExecute",void 0),V([ut({type:[Boolean,Object],default:void 0})],Oe.prototype,"disabled",void 0),V([ut(Array)],Oe.prototype,"colors",void 0),V([ut({type:String,required:!0})],Oe.prototype,"defaultColor",void 0),V([ut({type:String,required:!0})],Oe.prototype,"defaultActiveColor",void 0),V([ut({type:[Boolean,Object],default:void 0})],Oe.prototype,"setStroke",void 0),V([ut(Function)],Oe.prototype,"onSelect",void 0),V([ut({type:[String],default:void 0})],Oe.prototype,"placement",void 0),V([dt("currentColor",{immediate:!0,deep:!0}),dt("$props.disabled",{immediate:!0,deep:!0})],Oe.prototype,"getContent",null),V([dt("visible",{immediate:!0,deep:!0})],Oe.prototype,"watch",null),Oe=V([st({components:{AmButton:_t,AmColorPicker:Ee}})],Oe);var Te=Oe,_e=Te,Me=function(){var t,e=this,n=e.$createElement,r=e._self._c||n;return r("div",{ref:"buttonRef",class:["toolbar-dropdown","colorpicker-button",{"toolbar-dropdown-right":e.isRight}]},[r("div",{class:["toolbar-dropdown-trigger colorpicker-button-group",{"colorpicker-button-group-active":e.visible}]},[r("am-button",{staticClass:"colorpicker-button-text",attrs:{name:e.name,title:e.buttonTitle,"on-click":e.triggerClick,placement:e.placement,disabled:e.disabled}},[r("span",{domProps:{innerHTML:e._s(e.buttonContent)}})]),e._v(" "),r("am-button",{ref:"targetRef",staticClass:"colorpicker-button-dropdown toolbar-dropdown-trigger-arrow",attrs:{name:e.name,title:e.dropdownTitle,"on-click":e.toggleDropdown,placement:e.placement,disabled:e.disabled},scopedSlots:e._u([{key:"icon",fn:function(){return[r("span",{staticClass:"colorpicker-button-dropdown-empty"})]},proxy:!0}])},[e._v(" "),r("span",{staticClass:"data-icon data-icon-arrow"})])],1),e._v(" "),e.visible?r("div",{ref:"elementRef",class:["toolbar-dropdown-list",(t={},t["toolbar-dropdown-placement-"+e.listPlacement]=!!e.listPlacement,t)],attrs:{"data-element":"ui"}},[r("am-color-picker",{attrs:{engine:e.engine,colors:e.colors,"default-active-color":e.currentColor,"default-color":e.defaultColor,"on-select":e.triggerSelect,"set-stroke":e.setStroke}})],1):e._e()])},Ne=[];Me._withStripped=!0;var Pe=function(t){t&&t("data-v-71c5f20e_0",{source:"\n.editor-toolbar .colorpicker-button .colorpicker-button-group {\n padding: 0 2px;\n}\n.colorpicker-button-group .toolbar-button {\n padding: 0;\n}\n.colorpicker-button-group .colorpicker-button-text {\n margin-right: 0;\n min-width: 26px;\n border-radius: 3px 0 0 3px;\n display: block;\n}\n.editor-toolbar.editor-toolbar-popup\n .colorpicker-button-group\n .colorpicker-button-text {\n margin: 0;\n border-radius: 3px 0 0 3px;\n}\n.colorpicker-button-group .colorpicker-button-text:active {\n background-color: #e8e8e8;\n}\n.colorpicker-button-group .colorpicker-button-dropdown {\n margin-left: -1px;\n min-width: 17px;\n text-align: center;\n padding: 0 0;\n border-radius: 0 3px 3px 0;\n display: block;\n}\n.editor-toolbar.editor-toolbar-popup\n .colorpicker-button-group\n .colorpicker-button-dropdown {\n line-height: 24px;\n min-width: 17px;\n padding: 0 4px;\n margin: 0;\n margin-left: -1px;\n border-radius: 0 3px 3px 0;\n}\n.colorpicker-button-group .colorpicker-button-dropdown:hover,\n.colorpicker-button-group .colorpicker-button-dropdown:active {\n background-color: #e8e8e8;\n}\n.colorpicker-button-group\n .colorpicker-button-dropdown\n .colorpicker-button-dropdown-empty {\n display: inline-block;\n}\n.colorpicker-button-group:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n.colorpicker-button-group-active .toolbar-button,\n.colorpicker-button-group-active:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/color/color.vue"],names:[],mappings:";AAmMA;EACA,cAAA;AACA;AAEA;EACA,UAAA;AACA;AAEA;EACA,eAAA;EACA,eAAA;EACA,0BAAA;EACA,cAAA;AACA;AAEA;;;EAGA,SAAA;EACA,0BAAA;AACA;AAEA;EACA,yBAAA;AACA;AAEA;EACA,iBAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;EACA,0BAAA;EACA,cAAA;AACA;AAEA;;;EAGA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,SAAA;EACA,iBAAA;EACA,0BAAA;AACA;AAEA;;EAEA,yBAAA;AACA;AAEA;;;EAGA,qBAAA;AACA;AAEA;EACA,yBAAA;AACA;AACA;;EAEA,yBAAA;AACA",file:"color.vue",sourcesContent:['<template>\n <div\n :class="[\n \'toolbar-dropdown\',\n \'colorpicker-button\',\n { \'toolbar-dropdown-right\': isRight },\n ]"\n ref="buttonRef"\n >\n <div\n :class="[\n \'toolbar-dropdown-trigger colorpicker-button-group\',\n { \'colorpicker-button-group-active\': visible },\n ]"\n >\n <am-button\n class="colorpicker-button-text"\n :name="name"\n :title="buttonTitle"\n :on-click="triggerClick"\n :placement="placement"\n :disabled="disabled"\n >\n <span v-html="buttonContent"></span>\n </am-button>\n <am-button\n class="colorpicker-button-dropdown toolbar-dropdown-trigger-arrow"\n :name="name"\n :title="dropdownTitle"\n :on-click="toggleDropdown"\n :placement="placement"\n :disabled="disabled"\n ref="targetRef"\n >\n <template #icon>\n <span class="colorpicker-button-dropdown-empty" />\n </template>\n <span class="data-icon data-icon-arrow" />\n </am-button>\n </div>\n <div\n v-if="visible"\n ref="elementRef"\n :class="[\n \'toolbar-dropdown-list\',\n { [`toolbar-dropdown-placement-${listPlacement}`]: !!listPlacement },\n ]"\n data-element="ui"\n >\n <am-color-picker\n :engine="engine"\n :colors="colors"\n :default-active-color="currentColor"\n :default-color="defaultColor"\n :on-select="triggerSelect"\n :set-stroke="setStroke"\n />\n </div>\n </div>\n</template>\n<script lang="ts">\nimport { Component, Prop, Vue, Watch } from "vue-property-decorator";\nimport { EngineInterface, isMobile, Placement, $ } from "@aomao/engine";\nimport AmButton from "../button.vue";\nimport AmColorPicker from "./picker/picker.vue";\nimport Palette from "./picker/palette";\nimport { Command } from "../../types";\n\n@Component({\n components: {\n AmButton,\n AmColorPicker,\n },\n})\nexport default class AmColor extends Vue {\n @Prop({ type: Object }) engine?: EngineInterface;\n @Prop({ type: String, required: true }) name!: string;\n @Prop({ type: [String, Function], required: true }) content!:\n | string\n | ((color: string, stroke: string, disabled?: boolean) => string);\n @Prop(String) buttonTitle?: string;\n @Prop(String) dropdownTitle?: string;\n @Prop({ type: Object }) command?: Command;\n @Prop({ type: [Boolean, Object], default: undefined }) autoExecute?: boolean;\n @Prop({ type: [Boolean, Object], default: undefined }) disabled?: boolean;\n @Prop(Array) colors?: string[][];\n @Prop({ type: String, required: true }) defaultColor!: string;\n @Prop({ type: String, required: true }) defaultActiveColor!: string;\n @Prop({ type: [Boolean, Object], default: undefined }) setStroke?: boolean;\n @Prop(Function) onSelect?: (color: string, event: MouseEvent) => void;\n @Prop({ type: [String], default: undefined }) placement?: Placement;\n\n visible = false;\n isRight = false;\n currentColor = "";\n buttonContent?: string = "";\n listPlacement = "";\n\n mounted() {\n if (this.$refs.buttonRef && isMobile) {\n const rect = (this.$refs.buttonRef as Element).getBoundingClientRect();\n this.isRight = rect.left > window.visualViewport.width / 2;\n }\n this.currentColor = this.defaultActiveColor;\n }\n\n unmounted() {\n document.removeEventListener("click", this.hideDropdown);\n }\n @Watch("currentColor", { immediate: true, deep: true })\n @Watch("$props.disabled", { immediate: true, deep: true })\n getContent() {\n this.buttonContent =\n typeof this.content === "string"\n ? this.content\n : this.content(\n this.currentColor,\n Palette.getStroke(this.currentColor),\n this.disabled\n );\n }\n\n toggleDropdown(event: MouseEvent) {\n event.preventDefault();\n if (this.visible) {\n this.hideDropdown();\n } else {\n this.showDropdown();\n }\n }\n\n showDropdown() {\n this.visible = true;\n }\n\n hideDropdown(event?: MouseEvent) {\n if (\n event &&\n this.$refs.targetRef &&\n ((this.$refs.targetRef as Vue).$refs.element as Element).contains(\n event.target as Node\n )\n )\n return;\n this.visible = false;\n }\n\n @Watch("visible", { immediate: true, deep: true })\n watch(value: boolean) {\n if (value) {\n document.addEventListener("click", this.hideDropdown);\n setTimeout(() => {\n const current = this.$refs.elementRef;\n if (!current || !this.engine || !this.engine.scrollNode) return;\n const scrollElement = this.engine.scrollNode.get<HTMLElement>();\n if (!scrollElement) return;\n const rect = (current as Element).getBoundingClientRect();\n const scrollRect = scrollElement.getBoundingClientRect();\n if (rect.top < scrollRect.top) this.listPlacement = "bottom";\n if (rect.bottom > scrollRect.bottom) this.listPlacement = "top";\n }, 0);\n }\n else document.removeEventListener("click", this.hideDropdown);\n }\n\n triggerClick(event: MouseEvent) {\n this.triggerSelect(this.currentColor, event);\n }\n\n triggerSelect(color: string, event: MouseEvent) {\n this.hideDropdown();\n this.currentColor = color;\n this.buttonContent =\n typeof this.content === "string"\n ? this.content\n : this.content(color, Palette.getStroke(color), this.disabled);\n\n if (this.autoExecute !== false) {\n let commandName = this.name;\n let commandArgs = [color, this.defaultColor];\n if (this.command) {\n if (!Array.isArray(this.command)) {\n commandName = this.command.name;\n commandArgs = this.command.args;\n } else {\n commandArgs = this.command;\n }\n }\n if (this.engine) this.engine.command.execute(commandName, ...commandArgs);\n }\n if (this.onSelect) this.onSelect(color, event);\n }\n}\n<\/script>\n<style>\n.editor-toolbar .colorpicker-button .colorpicker-button-group {\n padding: 0 2px;\n}\n\n.colorpicker-button-group .toolbar-button {\n padding: 0;\n}\n\n.colorpicker-button-group .colorpicker-button-text {\n margin-right: 0;\n min-width: 26px;\n border-radius: 3px 0 0 3px;\n display: block;\n}\n\n.editor-toolbar.editor-toolbar-popup\n .colorpicker-button-group\n .colorpicker-button-text {\n margin: 0;\n border-radius: 3px 0 0 3px;\n}\n\n.colorpicker-button-group .colorpicker-button-text:active {\n background-color: #e8e8e8;\n}\n\n.colorpicker-button-group .colorpicker-button-dropdown {\n margin-left: -1px;\n min-width: 17px;\n text-align: center;\n padding: 0 0;\n border-radius: 0 3px 3px 0;\n display: block;\n}\n\n.editor-toolbar.editor-toolbar-popup\n .colorpicker-button-group\n .colorpicker-button-dropdown {\n line-height: 24px;\n min-width: 17px;\n padding: 0 4px;\n margin: 0;\n margin-left: -1px;\n border-radius: 0 3px 3px 0;\n}\n\n.colorpicker-button-group .colorpicker-button-dropdown:hover,\n.colorpicker-button-group .colorpicker-button-dropdown:active {\n background-color: #e8e8e8;\n}\n\n.colorpicker-button-group\n .colorpicker-button-dropdown\n .colorpicker-button-dropdown-empty {\n display: inline-block;\n}\n\n.colorpicker-button-group:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n.colorpicker-button-group-active .toolbar-button,\n.colorpicker-button-group-active:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n</style>\n']},media:void 0})},Le=void 0,De=void 0,je=!1,Ie=mt({render:Me,staticRenderFns:Ne},Pe,_e,Le,je,De,!1,yt,void 0,void 0),Re=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.iconIsHtml=!1,t.active=!1,t}return C(n,[{key:"mounted",value:function(){this.iconIsHtml=/^<.*>/.test(this.icon?this.icon.trim():"")}},{key:"handleMouseDown",value:function(t){t.preventDefault(),this.onMouseDown&&this.onMouseDown(t)}},{key:"handleClick",value:function(t){if(!this.disabled){var e=t.target.nodeName;if("INPUT"!==e&&"TEXTAREA"!==e&&t.preventDefault(),(!this.onClick||!1!==this.onClick(t,this.name,this.engine))&&!1!==this.autoExecute){var n,r=this.name,i=[];this.command&&(Array.isArray(this.command)?i=this.command:(r=this.command.name,i=this.command.args)),this.engine&&(n=this.engine.command).execute.apply(n,[r].concat(L(i)))}}}},{key:"triggerMouseEnter",value:function(){this.active=!this.disabled}},{key:"triggerMouseLeave",value:function(){this.active=!1}}]),n}(h["default"]);V([ut({type:Object})],Re.prototype,"engine",void 0),V([ut({type:String,required:!0})],Re.prototype,"name",void 0),V([ut({type:String,default:void 0})],Re.prototype,"icon",void 0),V([ut({type:String})],Re.prototype,"search",void 0),V([ut({type:[String,Function]})],Re.prototype,"description",void 0),V([ut({type:String})],Re.prototype,"title",void 0),V([ut({type:String})],Re.prototype,"placement",void 0),V([ut({type:Object})],Re.prototype,"command",void 0),V([ut({type:[Boolean,Object],default:void 0})],Re.prototype,"autoExecute",void 0),V([ut({type:String})],Re.prototype,"className",void 0),V([ut({type:[Boolean,Object],default:void 0})],Re.prototype,"disabled",void 0),V([ut({type:[String,Function,Object]})],Re.prototype,"prompt",void 0),V([ut(Function)],Re.prototype,"onClick",void 0),V([ut(Function)],Re.prototype,"onMouseDown",void 0),Re=V([st({components:{"a-popover":p["default"]}})],Re);var Fe=Re,Be=Fe,ze=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("a-popover",{attrs:{placement:t.placement||"right",content:"function"===typeof t.prompt?t.prompt(t.$props):t.prompt,overlayClassName:t.prompt?"":"prompt-popover-hide"}},[n("div",{class:["toolbar-collapse-item",{"toolbar-collapse-item-active":t.active},{"toolbar-collapse-item-disabled":t.disabled},t.className],on:{mouseenter:t.triggerMouseEnter,mouseleave:t.triggerMouseLeave,click:t.handleClick,mousedown:t.handleMouseDown}},[t._t("icon",(function(){return[t.iconIsHtml?n("span",{domProps:{innerHTML:t._s(t.icon)}}):t._e(),t._v(" "),!t.iconIsHtml&&t.icon?n("span",{class:"data-icon data-icon-"+t.icon}):t._e()]})),t._v(" "),t.title?n("div",{staticClass:"toolbar-collapse-item-text"},[n("div",{staticClass:"toolbar-collapse-item-title"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),t.description?n("div",{staticClass:"toolbar-collapse-item-description"},[t._v("\n "+t._s(t.description)+"\n ")]):t._e()]):t._e()],2)])},He=[];ze._withStripped=!0;var Ve=function(t){t&&t("data-v-ed80cffa_0",{source:"\n.prompt-popover-hide {\n display: none;\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/collapse/item.vue"],names:[],mappings:";AAoHA;EACA,aAAA;AACA",file:"item.vue",sourcesContent:['<template>\n <a-popover\n :placement="placement || \'right\'"\n :content="typeof prompt === \'function\' ? prompt($props) : prompt"\n :overlayClassName="prompt ? \'\' : \'prompt-popover-hide\'"\n >\n <div\n :class="[\n \'toolbar-collapse-item\',\n { \'toolbar-collapse-item-active\': active },\n { \'toolbar-collapse-item-disabled\': disabled },\n className,\n ]"\n @mouseenter="triggerMouseEnter"\n @mouseleave="triggerMouseLeave"\n @click="handleClick"\n @mousedown="handleMouseDown"\n >\n <slot name="icon">\n <span v-if="iconIsHtml" v-html="icon"></span>\n <span\n v-if="!iconIsHtml && icon"\n :class="`data-icon data-icon-${icon}`"\n />\n </slot>\n <div v-if="title" class="toolbar-collapse-item-text">\n <div class="toolbar-collapse-item-title">\n {{ title }}\n </div>\n <div v-if="description" class="toolbar-collapse-item-description">\n {{ description }}\n </div>\n </div>\n </div>\n </a-popover>\n</template>\n<script lang="ts">\nimport { Component, Prop, Vue } from "vue-property-decorator";\nimport { Popover } from "ant-design-vue";\nimport { VNode } from "vue";\nimport { EngineInterface, Placement } from "@aomao/engine";\nimport { Command } from "../../types";\n\n@Component({\n components: {\n "a-popover": Popover,\n },\n})\nexport default class CollapseItem extends Vue {\n @Prop({ type: Object }) engine?: EngineInterface;\n @Prop({ type: String, required: true }) name!: string;\n @Prop({ type: String, default: undefined }) icon?: string;\n @Prop({ type: String }) search?: string;\n @Prop({ type: [String, Function] }) description?:\n | string\n | (() => string)\n | VNode;\n @Prop({ type: String }) title?: string;\n @Prop({ type: String }) placement?: Placement;\n @Prop({ type: Object }) command?: Command;\n @Prop({ type: [Boolean, Object], default: undefined }) autoExecute?: boolean;\n @Prop({ type: String }) className?: string;\n @Prop({ type: [Boolean, Object], default: undefined }) disabled?: boolean;\n @Prop({ type: [String, Function, Object] }) prompt?:\n | string\n | ((props: any) => string) | ((props: any) => VNode)\n | VNode;\n @Prop(Function) onClick?: (event: MouseEvent, name: string, engine?: EngineInterface) => void | boolean;\n @Prop(Function) onMouseDown?: (event: MouseEvent) => void | boolean;\n\n iconIsHtml = false;\n active = false;\n\n mounted() {\n this.iconIsHtml = /^<.*>/.test(this.icon ? this.icon.trim() : "");\n }\n\n handleMouseDown(event: MouseEvent) {\n event.preventDefault();\n if (this.onMouseDown) this.onMouseDown(event);\n }\n\n handleClick(event: MouseEvent) {\n if (this.disabled) return;\n\n const nodeName = (event.target as Node).nodeName;\n if (nodeName !== "INPUT" && nodeName !== "TEXTAREA") event.preventDefault();\n\n if (this.onClick && this.onClick(event, this.name, this.engine) === false) {\n return;\n }\n if (this.autoExecute !== false) {\n let commandName = this.name;\n let commandArgs = [];\n if (this.command) {\n if (!Array.isArray(this.command)) {\n commandName = this.command.name;\n commandArgs = this.command.args;\n } else {\n commandArgs = this.command;\n }\n }\n if (this.engine) this.engine.command.execute(commandName, ...commandArgs);\n }\n }\n\n triggerMouseEnter() {\n this.active = this.disabled ? false : true;\n }\n\n triggerMouseLeave() {\n this.active = false;\n }\n}\n<\/script>\n<style>\n.prompt-popover-hide {\n display: none;\n}\n</style>\n']},media:void 0})},qe=void 0,Ue=void 0,We=!1,$e=mt({render:ze,staticRenderFns:He},Ve,Be,qe,We,Ue,!1,yt,void 0,void 0),Ge=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.handleOmit=o.omit,t}return C(n,[{key:"onClick",value:function(t,e,n){var r,i=this.items.find((function(t){return t.name===e}));return i&&i.onClick&&(r=i.onClick(t,e,n)),this.onSelect&&this.onSelect(t,e,n),r}}]),n}(h["default"]);V([ut(Object)],Ge.prototype,"engine",void 0),V([ut(String)],Ge.prototype,"title",void 0),V([ut({type:Array,required:!0,default:[]})],Ge.prototype,"items",void 0),V([ut(Function)],Ge.prototype,"onSelect",void 0),Ge=V([st({components:{AmCollapseItem:$e}})],Ge);var Ye=Ge,Xe=Ye,Ke=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"toolbar-collapse-group"},[t.title?n("div",{staticClass:"toolbar-collapse-group-title"},[t._v(t._s(t.title))]):t._e(),t._v(" "),t._l(t.items,(function(e){return n("am-collapse-item",t._b({key:e.name,attrs:{engine:t.engine,"on-click":t.onClick}},"am-collapse-item",Object.assign({},t.handleOmit(e,"onClick","onDisabled")),!1))}))],2)},Ze=[];Ke._withStripped=!0;var Je=void 0,Qe=void 0,tn=void 0,en=!1,nn=mt({render:Ke,staticRenderFns:Ze},Je,Xe,Qe,en,tn,!1,void 0,void 0,void 0),rn=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.isCustomize=!1,t.visible=!1,t.isRight=!1,t}return C(n,[{key:"show",value:function(){var t=this;this.visible=!0,setTimeout((function(){document.addEventListener("click",t.hide)}),10)}},{key:"hide",value:function(t){document.removeEventListener("click",this.hide),this.visible=!1}},{key:"mounted",value:function(){if(this.isCustomize=!(this.icon||this.content),this.visible=this.isCustomize,this.$refs.collapse&&a.isMobile){var t=this.$refs.collapse.getBoundingClientRect();this.isRight=t.left>window.visualViewport.width/2}}},{key:"unmounted",value:function(){this.isCustomize&&document.removeEventListener("click",this.hide)}},{key:"triggerClick",value:function(){this.visible?this.hide():this.show()}},{key:"triggerSelect",value:function(t,e){this.hide(),this.onSelect&&this.onSelect(t,e)}}]),n}(h["default"]);V([ut(Object)],rn.prototype,"engine",void 0),V([ut(String)],rn.prototype,"header",void 0),V([ut({type:Array,required:!0,default:[]})],rn.prototype,"groups",void 0),V([ut({type:[Boolean,Object],default:void 0})],rn.prototype,"disabled",void 0),V([ut(String)],rn.prototype,"className",void 0),V([ut({type:String,default:void 0})],rn.prototype,"icon",void 0),V([ut({type:[String,Function],default:void 0})],rn.prototype,"content",void 0),V([ut(Function)],rn.prototype,"onSelect",void 0),rn=V([st({components:{AmButton:_t,AmCollapseGroup:nn}})],rn);var on=rn,an=on,sn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"collapse",class:["toolbar-dropdown toolbar-collapse",{"toolbar-dropdown-right":t.isRight},t.className]},[t.isCustomize?t._e():n("am-button",{attrs:{name:"collapse",icon:t.icon,content:t.content,"on-click":t.triggerClick,active:t.visible,disabled:t.disabled}}),t._v(" "),t.visible?n("div",{staticClass:"toolbar-dropdown-list",attrs:{"data-element":"ui"}},[t._t("header",(function(){return[t.header?n("div",{staticClass:"toolbar-collapse-header",domProps:{innerHTML:t._s(t.header)}}):t._e()]})),t._v(" "),n("div",{staticClass:"toolbar-collapse-content"},t._l(t.groups,(function(e,r){return n("am-collapse-group",t._b({key:r,attrs:{engine:t.engine,"on-select":t.triggerSelect}},"am-collapse-group",e,!1))})),1)],2):t._e()],1)},ln=[];sn._withStripped=!0;var cn=function(t){t&&t("data-v-54003d33_0",{source:"\n.toolbar-collapse-header {\n color: #8c8c8c;\n margin: 4px 16px 0;\n font-size: 12px;\n line-height: 20px;\n text-align: left;\n padding-bottom: 8px;\n margin-bottom: 6px;\n border-bottom: 1px solid #e8e8e8;\n}\n.toolbar-collapse-header code{\n background-color: #f5f5f5;\n border-radius: 4px;\n padding: 2px;\n border: 1px solid #d9d9d9;\n}\n.toolbar-collapse-content {\n min-width: 200px\n}\n.toolbar-collapse-group-title {\n padding: 2px 16px;\n text-align: left;\n color: #8c8c8c;\n font-weight: 700;\n font-size: 12px;\n line-height: 24px;\n}\n.toolbar-collapse-item {\n display: flex;\n cursor: pointer;\n padding: 4px 16px 0;\n}\n.toolbar-collapse-item-active {\n background-color: #f4f4f4;\n}\n.editor-toolbar .toolbar-collapse-item-disabled, .data-toolbar-component-list .toolbar-collapse-item-disabled, .editor-toolbar:not(.editor-toolbar-mobile) .toolbar-collapse-item-disabled:hover, .data-toolbar-component-list .toolbar-collapse-item-disabled:hover {\n background-color: transparent;\n border: 1px solid transparent;\n box-shadow: none;\n color: #000000;\n opacity: 0.25;\n cursor: not-allowed;\n}\n.toolbar-collapse-item .toolbar-collapse-item-text\n{\n display: block;\n text-align: left;\n margin-left: 8px;\n}\n.toolbar-collapse-item .toolbar-collapse-item-title{\n display: block;\n color: #595959;\n line-height: 24px;\n font-size: 14px;\n font-weight: normal;\n}\n.toolbar-collapse-item .toolbar-collapse-item-description\n{\n display: block;\n font-size: 12px;\n color: rgba(0,0,0,.45);\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/collapse/collapse.vue"],names:[],mappings:";AA2GA;IACA,cAAA;IACA,kBAAA;IACA,eAAA;IACA,iBAAA;IACA,gBAAA;IACA,mBAAA;IACA,kBAAA;IACA,gCAAA;AACA;AAEA;IACA,yBAAA;IACA,kBAAA;IACA,YAAA;IACA,yBAAA;AACA;AAEA;IACA;AACA;AAEA;IACA,iBAAA;IACA,gBAAA;IACA,cAAA;IACA,gBAAA;IACA,eAAA;IACA,iBAAA;AACA;AAEA;IACA,aAAA;IACA,eAAA;IACA,mBAAA;AACA;AAEA;IACA,yBAAA;AACA;AAEA;EACA,6BAAA;EACA,6BAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;AACA;AAEA;;IAEA,cAAA;IACA,gBAAA;IACA,gBAAA;AACA;AAEA;IACA,cAAA;IACA,cAAA;IACA,iBAAA;IACA,eAAA;IACA,mBAAA;AACA;AAEA;;IAEA,cAAA;IACA,eAAA;IACA,sBAAA;AACA",file:"collapse.vue",sourcesContent:['<template>\n <div\n :class="[\'toolbar-dropdown toolbar-collapse\', {\'toolbar-dropdown-right\': isRight},className]"\n ref="collapse"\n >\n <am-button\n v-if="!isCustomize"\n name="collapse"\n :icon="icon"\n :content="content"\n :on-click="triggerClick"\n :active="visible"\n :disabled="disabled"\n />\n <div v-if="visible" class="toolbar-dropdown-list" data-element="ui">\n <slot name="header">\n <div v-if="header" class="toolbar-collapse-header" v-html="header" />\n </slot>\n <div class="toolbar-collapse-content">\n <am-collapse-group \n v-for="(group,index) in groups"\n :key="index"\n :engine="engine"\n v-bind="group"\n :on-select="triggerSelect"\n />\n </div>\n </div>\n</div>\n</template>\n<script lang="ts">\nimport { Component, Prop, Vue } from "vue-property-decorator";\nimport { VNode } from "vue";\nimport { EngineInterface, isMobile } from "@aomao/engine";\nimport { CollapseGroupProps } from \'../../types\';\nimport AmButton from \'../button.vue\';\nimport AmCollapseGroup from \'./group.vue\';\n\n@Component({\n components: {\n AmButton,\n AmCollapseGroup\n },\n})\nexport default class AmCollapse extends Vue {\n @Prop(Object) engine?: EngineInterface\n @Prop(String) header?: string\n @Prop({ type: Array, required: true, default: [] }) groups!: Array<CollapseGroupProps>\n @Prop({ type: [Boolean, Object], default: undefined}) disabled?: boolean\n @Prop(String) className?: string\n\t@Prop({ type: String, default: undefined}) icon?: string\n @Prop({ type: [String, Function], default: undefined}) content?: string | (() => string) | VNode\n @Prop(Function) onSelect?: (event: MouseEvent, name: string) => boolean | void\n\n isCustomize = false\n visible = false\n isRight = false\n\n show(){\n this.visible = true\n setTimeout(() => {\n document.addEventListener(\'click\', this.hide);\n }, 10);\n };\n\n hide(event?: MouseEvent){\n if (event) {\n // let node = event.target;\n // while (node) {\n // if (node === collapse.value) {\n // return;\n // }\n // node = (node as Element).parentNode;\n // }\n }\n document.removeEventListener(\'click\', this.hide);\n this.visible = false\n };\n\n mounted(){\n this.isCustomize = !(this.icon || this.content);\n this.visible = this.isCustomize\n if (this.$refs.collapse && isMobile) {\n\t\t\tconst rect = (this.$refs.collapse as Element).getBoundingClientRect();\n\t\t\tthis.isRight = rect.left > window.visualViewport.width / 2;\n\t\t}\n }\n\n unmounted(){\n if(this.isCustomize) document.removeEventListener(\'click\', this.hide);\n }\n\n triggerClick(){\n if (this.visible) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n triggerSelect(event:MouseEvent,name:string){\n this.hide()\n if(this.onSelect) this.onSelect(event,name)\n }\n}\n<\/script>\n<style>\n.toolbar-collapse-header {\n color: #8c8c8c;\n margin: 4px 16px 0;\n font-size: 12px;\n line-height: 20px;\n text-align: left;\n padding-bottom: 8px;\n margin-bottom: 6px;\n border-bottom: 1px solid #e8e8e8;\n}\n\n.toolbar-collapse-header code{\n background-color: #f5f5f5;\n border-radius: 4px;\n padding: 2px;\n border: 1px solid #d9d9d9;\n}\n\n.toolbar-collapse-content {\n min-width: 200px\n}\n\n.toolbar-collapse-group-title {\n padding: 2px 16px;\n text-align: left;\n color: #8c8c8c;\n font-weight: 700;\n font-size: 12px;\n line-height: 24px;\n}\n\n.toolbar-collapse-item {\n display: flex;\n cursor: pointer;\n padding: 4px 16px 0;\n}\n\n.toolbar-collapse-item-active {\n background-color: #f4f4f4;\n}\n\n.editor-toolbar .toolbar-collapse-item-disabled, .data-toolbar-component-list .toolbar-collapse-item-disabled, .editor-toolbar:not(.editor-toolbar-mobile) .toolbar-collapse-item-disabled:hover, .data-toolbar-component-list .toolbar-collapse-item-disabled:hover {\n background-color: transparent;\n border: 1px solid transparent;\n box-shadow: none;\n color: #000000;\n opacity: 0.25;\n cursor: not-allowed;\n}\n\n.toolbar-collapse-item .toolbar-collapse-item-text\n{\n display: block;\n text-align: left;\n margin-left: 8px;\n}\n\n.toolbar-collapse-item .toolbar-collapse-item-title{\n display: block;\n color: #595959;\n line-height: 24px;\n font-size: 14px;\n font-weight: normal;\n}\n\n.toolbar-collapse-item .toolbar-collapse-item-description\n{\n display: block;\n font-size: 12px;\n color: rgba(0,0,0,.45);\n}\n</style>']},media:void 0})},un=void 0,dn=void 0,hn=!1,pn=mt({render:sn,staticRenderFns:ln},cn,an,un,hn,dn,!1,yt,void 0,void 0),fn=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.isMobile=!1,t}return C(n,[{key:"mounted",value:function(){this.isMobile=a.isMobile}},{key:"getPopupContainer",value:function(){return document.querySelector(".data-toolbar-popup-wrapper")||document.querySelector(".editor-toolbar")||document.body}}]),n}(h["default"]);V([ut(Object)],fn.prototype,"engine",void 0),V([ut({type:Array,default:[]})],fn.prototype,"items",void 0),V([ut(String)],fn.prototype,"icon",void 0),V([ut([String,Function])],fn.prototype,"content",void 0),V([ut(Boolean)],fn.prototype,"popup",void 0),fn=V([st({components:{AmButton:_t,AmCollapse:pn,AmDropdown:Xt,AmColor:Ie,"a-popover":p["default"]}})],fn);var gn=fn,mn=gn,vn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"editor-toolbar-group"},[t.icon||t.content?n("a-popover",{attrs:{"get-popup-container":t.getPopupContainer,"overlay-class-name":"editor-toolbar-popover","arrow-point-at-center":!0,placement:t.isMobile?"topRight":void 0},scopedSlots:t._u([{key:"content",fn:function(){return[n("div",{class:["editor-toolbar",{"editor-toolbar-mobile":t.isMobile&&!t.popup,"editor-toolbar-popup":t.popup}],attrs:{"data-element":"ui"}},[t._l(t.items,(function(e,r){return["button"===e.type?n("am-button",t._b({key:r,attrs:{placement:"top",engine:t.engine}},"am-button",e,!1)):t._e(),t._v(" "),"dropdown"===e.type?n("am-dropdown",t._b({key:r,attrs:{placement:"top",engine:t.engine}},"am-dropdown",e,!1)):t._e(),t._v(" "),"color"===e.type?n("am-color",t._b({key:r,attrs:{placement:"top",engine:t.engine}},"am-color",e,!1)):t._e(),t._v(" "),"collapse"===e.type?n("am-collapse",t._b({key:r,attrs:{placement:"top",engine:t.engine}},"am-collapse",e,!1)):t._e()]}))],2)]},proxy:!0}],null,!1,2736660531)},[t._v(" "),n("am-button",{attrs:{name:"group-popover",icon:t.icon,content:t.content}})],1):t._e(),t._v(" "),t.icon||t.content?t._e():[t._l(t.items,(function(e,r){return["button"===e.type?n("am-button",t._b({key:r,attrs:{engine:t.engine}},"am-button",e,!1)):t._e(),t._v(" "),"dropdown"===e.type?n("am-dropdown",t._b({key:r,attrs:{engine:t.engine}},"am-dropdown",e,!1)):t._e(),t._v(" "),"color"===e.type?n("am-color",t._b({key:r,attrs:{engine:t.engine}},"am-color",e,!1)):t._e(),t._v(" "),"collapse"===e.type?n("am-collapse",t._b({key:r,attrs:{engine:t.engine}},"am-collapse",e,!1)):t._e()]}))]],2)},bn=[];vn._withStripped=!0;var yn=function(t){t&&t("data-v-45231865_0",{source:"\n.editor-toolbar-group {\r\n padding: 4px;\r\n width: auto;\r\n border-left: 1px solid #e8e8e8;\r\n display: flex;\r\n align-items: stretch;\n}\n.editor-toolbar .editor-toolbar-group:nth-child(1) {\r\n border-left: none;\n}\r\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/group.vue"],names:[],mappings:";AA0EA;IACA,YAAA;IACA,WAAA;IACA,8BAAA;IACA,aAAA;IACA,oBAAA;AACA;AAEA;IACA,iBAAA;AACA",file:"group.vue",sourcesContent:['<template>\r\n <div class="editor-toolbar-group">\r\n <a-popover\r\n :get-popup-container="getPopupContainer"\r\n overlay-class-name="editor-toolbar-popover"\r\n :arrow-point-at-center="true"\r\n :placement="isMobile ? \'topRight\' : undefined"\r\n v-if="!!icon || !!content"\r\n >\r\n <template #content>\r\n <div :class="[\'editor-toolbar\', {\'editor-toolbar-mobile\': isMobile && !popup,\r\n \'editor-toolbar-popup\': popup,}]" data-element="ui">\r\n <template v-for="(item , index) in items">\r\n <am-button v-if="item.type === \'button\'" :key="index" v-bind="item" placement="top" :engine="engine" />\r\n <am-dropdown v-if="item.type === \'dropdown\'" :key="index" v-bind="item" placement="top" :engine="engine" />\r\n <am-color v-if="item.type === \'color\'" :key="index" v-bind="item" placement="top" :engine="engine" />\r\n <am-collapse v-if="item.type === \'collapse\'" :key="index" v-bind="item" placement="top" :engine="engine" />\r\n </template>\r\n </div>\r\n </template>\r\n <am-button name="group-popover" :icon="icon" :content="content" />\r\n </a-popover>\r\n <template v-if="!icon && !content">\r\n <template v-for="(item , index) in items">\r\n <am-button v-if="item.type === \'button\'" :key="index" v-bind="item" :engine="engine" />\r\n <am-dropdown v-if="item.type === \'dropdown\'" :key="index" v-bind="item" :engine="engine" />\r\n <am-color v-if="item.type === \'color\'" :key="index" v-bind="item" :engine="engine" />\r\n <am-collapse v-if="item.type === \'collapse\'" :key="index" v-bind="item" :engine="engine" />\r\n </template>\r\n </template>\r\n </div>\r\n</template>\r\n\r\n<script lang="ts">\r\nimport { Component, Vue, Prop } from "vue-property-decorator";\r\nimport { EngineInterface, isMobile } from \'@aomao/engine\'\r\nimport { Popover } from \'ant-design-vue\'\r\nimport AmButton from \'./button.vue\'\r\nimport { GroupButtonProps, GroupColorProps, GroupDropdownProps, ToolbarCollapseGroupProps } from "../types";\r\nimport { VNode } from "vue";\r\nimport AmDropdown from \'./dropdown.vue\'\r\nimport AmColor from \'./color/color.vue\'\r\nimport AmCollapse from \'./collapse/collapse.vue\'\r\n\r\n@Component({\r\n components:{\r\n AmButton,\r\n AmCollapse,\r\n AmDropdown,\r\n AmColor,\r\n \'a-popover\': Popover\r\n }\r\n})\r\nexport default class ToolbarGroup extends Vue {\r\n @Prop(Object) engine!: EngineInterface\r\n @Prop({ type: Array, default: []}) items!: (GroupButtonProps\r\n\t\t\t\t| GroupDropdownProps\r\n\t\t\t\t| GroupColorProps\r\n\t\t\t\t| ToolbarCollapseGroupProps)[]\r\n\t@Prop(String) icon?: string\r\n @Prop([String, Function]) content?: string | (() => string) | VNode\r\n @Prop(Boolean) popup?: boolean\r\n isMobile = false\r\n\r\n mounted() {\r\n this.isMobile = isMobile\r\n }\r\n\r\n getPopupContainer(){\r\n return document.querySelector(\'.data-toolbar-popup-wrapper\') || document.querySelector(\'.editor-toolbar\') || document.body\r\n }\r\n}\r\n<\/script>\r\n<style>\r\n.editor-toolbar-group {\r\n padding: 4px;\r\n width: auto;\r\n border-left: 1px solid #e8e8e8;\r\n display: flex;\r\n align-items: stretch;\r\n}\r\n\r\n.editor-toolbar .editor-toolbar-group:nth-child(1) {\r\n border-left: none;\r\n}\r\n</style>']},media:void 0})},wn=void 0,xn=void 0,Cn=!1,kn=mt({render:vn,staticRenderFns:bn},yn,mn,wn,Cn,xn,!1,yt,void 0,void 0),An={toolbar:{collapse:{title:"Type <code>".concat(a.isMacos?"⌘":"Ctrl","</code> + <code>/</code> to quickly insert a card")},undo:{title:"Undo"},redo:{title:"Redo"},paintformat:{title:"Format brush"},removeformat:{title:"Clear format"},heading:{title:"Text and title",p:"Text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6"},fontfamily:{title:"Font family",notInstalled:"The font may not be installed",items:{default:"Default",arial:"Arial",comicSansMS:"Comic Sans MS",courierNew:"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact",timesNewRoman:"Times New Roman",trebuchetMS:"Trebuchet MS",verdana:"Verdana",fangSong:"FangSong",stFangsong:"STFangsong",stSong:"STSong",stKaiti:"STKaiti",simSun:"SimSum",microsoftYaHei:"Microsoft YaHei",kaiTi:"KaiTi",kaitiSC:"KaiTi SC",simHei:"SimHei",heitiSC:"Heiti SC",fzHei:"FZHeiTi",fzKai:"FZKaiTi",fzFangSong:"FZFangSong"}},fontsize:{title:"Font size"},fontcolor:{title:"Font color",more:"More colors"},backcolor:{title:"Background color",more:"More colors"},bold:{title:"Bold"},italic:{title:"Italic"},strikethrough:{title:"Strikethrough"},underline:{title:"Underline"},moremark:{title:"More text styles",sup:"Sup",sub:"Sub",code:"Inline code"},alignment:{title:"Alignment",left:"Align left",center:"Align center",right:"Align right",justify:"Align justify"},unorderedlist:{title:"Unordered list"},orderedlist:{title:"Ordered list"},tasklist:{title:"Task list"},indent:{title:"Ident",in:"Increase indent",out:"Reduce indent"},"line-height":{title:"Line height",default:"Default"},link:{title:"Insert Link"},quote:{title:"Insert reference"},hr:{title:"Insert dividing line"},colorPicker:{defaultText:"Default Color",nonFillText:"No fill color","#000000":"Black","#262626":"Dark Gray 3","#595959":"Dark Gray 2","#8C8C8C":"Dark Gray 1","#BFBFBF":"Gray","#D9D9D9":"Light Gray 4","#E9E9E9":"Light Gray 3","#F5F5F5":"Light Gray 2","#FAFAFA":"Light Gray 1","#FFFFFF":"White","#F5222D":"Red","#FA541C":"Chinese Red","#FA8C16":"Orange","#FADB14":"Yellow","#52C41A":"Green","#13C2C2":"Cyan","#1890FF":"Light Blue","#2F54EB":"Blue","#722ED1":"Purple","#EB2F96":"Magenta","#FFE8E6":"Red 1","#FFECE0":"Chinese Red 1","#FFEFD1":"Orange 1","#FCFCCA":"Yellow 1","#E4F7D2":"Green 1","#D3F5F0":"Cyan 1","#D4EEFC":"Light Blue 1","#DEE8FC":"Blue 1","#EFE1FA":"Purple 1","#FAE1EB":"Magenta 1","#FFA39E":"Red 2","#FFBB96":"Chinese Red 2","#FFD591":"Orange 2","#FFFB8F":"Yellow 2","#B7EB8F":"Green 2","#87E8DE":"Cyan 2","#91D5FF":"Light Blue 2","#ADC6FF":"Blue 2","#D3ADF7":"Purple 2","#FFADD2":"Magenta 2","#FF4D4F":"Red 3","#FF7A45":"Chinese Red 3","#FFA940":"Orange 3","#FFEC3D":"Yellow 3","#73D13D":"Green 3","#36CFC9":"Cyan 3","#40A9FF":"Light Blue 3","#597EF7":"Blue 3","#9254DE":"Purple 3","#F759AB":"Magenta 3","#CF1322":"Red 4","#D4380D":"Chinese Red 4","#D46B08":"Orange 4","#D4B106":"Yellow 4","#389E0D":"Green 4","#08979C":"Cyan 4","#096DD9":"Light Blue 4","#1D39C4":"Blue 4","#531DAB":"Purple 4","#C41D7F":"Magenta 4","#820014":"Red 5","#871400":"Chinese Red 5","#873800":"Orange 5","#614700":"Yellow 5","#135200":"Green 5","#00474F":"Cyan 5","#003A8C":"Light Blue 5","#061178":"Blue 5","#22075E":"Purple 5","#780650":"Magenta 5"},component:{placeholder:"Card name"},image:{title:"Image"},codeblock:{title:"Codeblock"},table:{title:"Table"},file:{title:"File"},video:{title:"Video"},math:{title:"Formula"},status:{title:"Status"},mind:{title:"Mind Map"},commonlyUsed:{title:"Commonly used"},searchEmtpy:{title:"No matching card"}}},Sn={toolbar:{collapse:{title:"输入 <code>".concat(a.isMacos?"⌘":"Ctrl","</code> + <code>/</code> 快速插入卡片")},undo:{title:"撤销"},redo:{title:"重做"},paintformat:{title:"格式刷"},removeformat:{title:"清除格式"},heading:{title:"正文与标题",p:"正文",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},fontfamily:{title:"字体",notInstalled:"可能未安装该字体",items:{default:"默认",arial:"Arial",comicSansMS:"Comic Sans MS",courierNew:"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact",timesNewRoman:"Times New Roman",trebuchetMS:"Trebuchet MS",verdana:"Verdana",fangSong:"仿宋",stFangsong:"华文仿宋",stSong:"华文宋体",stKaiti:"华文楷体",simSun:"宋体",microsoftYaHei:"微软雅黑",kaiTi:"楷体",kaitiSC:"楷体-简",simHei:"黑体",heitiSC:"黑体-简",fzHei:"方正黑体",fzKai:"方正楷体",fzFangSong:"方正仿宋"}},fontsize:{title:"字号"},fontcolor:{title:"字体颜色",more:"更多颜色"},backcolor:{title:"背景颜色",more:"更多颜色"},bold:{title:"粗体"},italic:{title:"斜体"},strikethrough:{title:"删除线"},underline:{title:"下划线"},moremark:{title:"更多文本样式",sup:"上标",sub:"下标",code:"行内代码"},alignment:{title:"对齐方式",left:"左对齐",center:"居中对齐",right:"右对齐",justify:"两端对齐"},unorderedlist:{title:"无序列表"},orderedlist:{title:"有序列表"},tasklist:{title:"任务列表"},indent:{title:"缩进",in:"增加缩进",out:"减少缩进"},"line-height":{title:"行高",default:"默认"},link:{title:"链接"},quote:{title:"插入引用"},hr:{title:"插入分割线"},colorPicker:{defaultText:"默认",nonFillText:"无填充色","#000000":"黑色","#262626":"深灰 3","#595959":"深灰 2","#8C8C8C":"深灰 1","#BFBFBF":"灰色","#D9D9D9":"浅灰 4","#E9E9E9":"浅灰 3","#F5F5F5":"浅灰 2","#FAFAFA":"浅灰 1","#FFFFFF":"白色","#F5222D":"红色","#FA541C":"朱红","#FA8C16":"橙色","#FADB14":"黄色","#52C41A":"绿色","#13C2C2":"青色","#1890FF":"浅蓝","#2F54EB":"蓝色","#722ED1":"紫色","#EB2F96":"玫红","#FFE8E6":"红色 1","#FFECE0":"朱红 1","#FFEFD1":"橙色 1","#FCFCCA":"黄色 1","#E4F7D2":"绿色 1","#D3F5F0":"青色 1","#D4EEFC":"浅蓝 1","#DEE8FC":"蓝色 1","#EFE1FA":"紫色 1","#FAE1EB":"玫红 1","#FFA39E":"红色 2","#FFBB96":"朱红 2","#FFD591":"橙色 2","#FFFB8F":"黄色 2","#B7EB8F":"绿色 2","#87E8DE":"青色 2","#91D5FF":"浅蓝 2","#ADC6FF":"蓝色 2","#D3ADF7":"紫色 2","#FFADD2":"玫红 2","#FF4D4F":"红色 3","#FF7A45":"朱红 3","#FFA940":"橙色 3","#FFEC3D":"黄色 3","#73D13D":"绿色 3","#36CFC9":"青色 3","#40A9FF":"浅蓝 3","#597EF7":"蓝色 3","#9254DE":"紫色 3","#F759AB":"玫红 3","#CF1322":"红色 4","#D4380D":"朱红 4","#D46B08":"橙色 4","#D4B106":"黄色 4","#389E0D":"绿色 4","#08979C":"青色 4","#096DD9":"浅蓝 4","#1D39C4":"蓝色 4","#531DAB":"紫色 4","#C41D7F":"玫红 4","#820014":"红色 5","#871400":"朱红 5","#873800":"橙色 5","#614700":"黄色 5","#135200":"绿色 5","#00474F":"青色 5","#003A8C":"浅蓝 5","#061178":"蓝色 5","#22075E":"紫色 5","#780650":"玫红 5"},component:{placeholder:"卡片名称"},image:{title:"图片"},codeblock:{title:"代码块"},table:{title:"表格"},file:{title:"附件"},video:{title:"视频"},math:{title:"公式"},status:{title:"状态"},mind:{title:"脑图"},commonlyUsed:{title:"常用"},searchEmtpy:{title:"无匹配卡片"}}},En={"en-US":An,"zh-CN":Sn},On=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.currentRows=4,t.currentCols=4,t.selectedRows=0,t.selectedCols=0,t}return C(n,[{key:"triggerSelect",value:function(t,e,n){t.preventDefault(),this.onSelect&&this.onSelect(t,e+1,n+1)}},{key:"triggerHover",value:function(t,e){var n=Math.max(this.minRows,Math.min(this.maxRows,t+2)),r=Math.max(this.minCols,Math.min(this.maxCols,e+2));this.currentRows=n,this.currentCols=r,this.selectedRows=t+1,this.selectedCols=e+1}}]),n}(h["default"]);V([ut({type:Number,default:10})],On.prototype,"maxRows",void 0),V([ut({type:Number,default:10})],On.prototype,"maxCols",void 0),V([ut({type:Number,default:4})],On.prototype,"minRows",void 0),V([ut({type:Number,default:4})],On.prototype,"minCols",void 0),V([ut(Function)],On.prototype,"onSelect",void 0),On=V([st({})],On);var Tn=On,_n=Tn,Mn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"data-toolbar-table-selector",attrs:{"data-element":"ui"}},[t._l(t.currentRows,(function(e){return n("div",{key:e,staticClass:"data-toolbar-table-selector-tr"},t._l(t.currentCols,(function(r,i){return n("div",{key:i,class:[{"data-toolbar-table-selector-td":!0},{actived:e-1<t.selectedRows&&r-1<t.selectedCols}],on:{mousedown:function(n){return t.triggerSelect(n,e-1,r-1)},mouseover:function(n){return t.triggerHover(e-1,r-1)}}})})),0)})),t._v(" "),n("div",{staticClass:"data-toolbar-table-selector-info"},[t._v("\n "+t._s(void 0===t.selectedRows?0:t.selectedRows)+"x"+t._s(void 0===t.selectedCols?0:t.selectedCols)+"\n ")])],2)},Nn=[];Mn._withStripped=!0;var Pn=function(t){t&&t("data-v-54af51ca_0",{source:"\n.data-toolbar-table-selector .data-toolbar-table-selector-tr {\n display: flex;\n flex-wrap: nowrap;\n}\n.data-toolbar-table-selector\n .data-toolbar-table-selector-tr\n .data-toolbar-table-selector-td {\n width: 20px;\n height: 16px;\n border: 1px solid #d9d9d9;\n margin-right: -1px;\n margin-bottom: -1px;\n cursor: pointer;\n}\n.data-toolbar-table-selector\n .data-toolbar-table-selector-tr\n .data-toolbar-table-selector-td.actived {\n background: #ddefff;\n}\n.data-toolbar-table-selector .data-toolbar-table-selector-info {\n text-align: center;\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/table.vue"],names:[],mappings:";AA8DA;EACA,aAAA;EACA,iBAAA;AACA;AACA;;;EAGA,WAAA;EACA,YAAA;EACA,yBAAA;EACA,kBAAA;EACA,mBAAA;EACA,eAAA;AACA;AACA;;;EAGA,mBAAA;AACA;AACA;EACA,kBAAA;AACA",file:"table.vue",sourcesContent:['<template>\n <div data-element="ui" class="data-toolbar-table-selector">\n <div\n class="data-toolbar-table-selector-tr"\n v-for="row in currentRows"\n :key="row"\n >\n <div\n v-for="(col, index) in currentCols"\n :class="[\n { \'data-toolbar-table-selector-td\': true },\n { actived: row - 1 < selectedRows && col - 1 < selectedCols },\n ]"\n :key="index"\n @mousedown="triggerSelect($event, row - 1, col - 1)"\n @mouseover="triggerHover(row - 1, col - 1)"\n />\n </div>\n <div class="data-toolbar-table-selector-info">\n {{ selectedRows === undefined ? 0 : selectedRows }}x{{\n selectedCols === undefined ? 0 : selectedCols\n }}\n </div>\n </div>\n</template>\n\n<script lang="ts">\nimport { Component, Prop, Vue } from "vue-property-decorator";\n\n@Component({})\nexport default class TableSelector extends Vue {\n @Prop({ type: Number, default: 10 }) maxRows!: number;\n @Prop({ type: Number, default: 10 }) maxCols!: number;\n @Prop({ type: Number, default: 4 }) minRows!: number;\n @Prop({ type: Number, default: 4 }) minCols!: number;\n @Prop(Function) onSelect?: (\n event: MouseEvent,\n rows: number,\n cols: number\n ) => void;\n\n currentRows = 4;\n currentCols = 4;\n selectedRows = 0;\n selectedCols = 0;\n\n triggerSelect(event: MouseEvent, rows: number, cols: number) {\n event.preventDefault();\n if (this.onSelect) this.onSelect(event, rows + 1, cols + 1);\n }\n\n triggerHover(rows: number, cols: number) {\n const showRows = Math.max(this.minRows, Math.min(this.maxRows, rows + 2));\n const showCols = Math.max(this.minCols, Math.min(this.maxCols, cols + 2));\n this.currentRows = showRows;\n this.currentCols = showCols;\n this.selectedRows = rows + 1;\n this.selectedCols = cols + 1;\n }\n}\n<\/script>\n<style>\n.data-toolbar-table-selector .data-toolbar-table-selector-tr {\n display: flex;\n flex-wrap: nowrap;\n}\n.data-toolbar-table-selector\n .data-toolbar-table-selector-tr\n .data-toolbar-table-selector-td {\n width: 20px;\n height: 16px;\n border: 1px solid #d9d9d9;\n margin-right: -1px;\n margin-bottom: -1px;\n cursor: pointer;\n}\n.data-toolbar-table-selector\n .data-toolbar-table-selector-tr\n .data-toolbar-table-selector-td.actived {\n background: #ddefff;\n}\n.data-toolbar-table-selector .data-toolbar-table-selector-info {\n text-align: center;\n}\n</style>\n']},media:void 0})},Ln=void 0,Dn=void 0,jn=!1,In=mt({render:Mn,staticRenderFns:Nn},Pn,_n,Ln,jn,Dn,!1,yt,void 0,void 0),Rn=[{key:"default",value:""},{key:"arial",value:"Arial"},{key:"comicSansMS",value:'"Comic Sans MS"'},{key:"courierNew",value:'"Courier New"'},{key:"georgia",value:"Georgia"},{key:"helvetica",value:"Helvetica"},{key:"impact",value:"Impact"},{key:"timesNewRoman",value:'"Times New Roman"'},{key:"trebuchetMS",value:'"Trebuchet MS"'},{key:"verdana",value:"Verdana"},{key:"fangSong",value:"FangSong, 仿宋, FZFangSong-Z02S, STFangsong, fangsong"},{key:"stFangsong",value:"STFangsong, 华文仿宋, FangSong, FZFangSong-Z02S, fangsong"},{key:"stSong",value:'STSong, 华文宋体, SimSun, "Songti SC", NSimSun, serif'},{key:"stKaiti",value:'STKaiti, 华文楷体, KaiTi, "Kaiti SC", cursive'},{key:"simSun",value:'SimSun, 宋体, "Songti SC", NSimSun, STSong, serif'},{key:"microsoftYaHei",value:'"Microsoft YaHei", 微软雅黑, "PingFang SC", SimHei, STHeiti, sans-serif'},{key:"kaiTi",value:'KaiTi, 楷体, STKaiti, "Kaiti SC", cursive'},{key:"kaitiSC",value:'"Kaiti SC"'},{key:"simHei",value:'SimHei, 黑体, "Microsoft YaHei", "PingFang SC", STHeiti, sans-serif'},{key:"heitiSC",value:'"Heiti SC"'},{key:"fzHei",value:"FZHei-B01S"},{key:"fzKai",value:"FZKai-Z03S"},{key:"fzFangSong",value:"FZFangSong-Z02S"}],Fn=function(t,e){return t.map((function(t){var n=t.key,r=t.value,i="default"!==n&&!r.split(",").some((function(t){return pt(t.trim())}));return{key:r,faimlyName:e?e[n]:n,content:'<span style="font-family: '.concat(r,'">').concat(e?e[n]:n,"</span>"),hotkey:!1,disabled:i,title:i?e&&e["notInstalled"]||"The font may not be installed":void 0}}))};function Bn(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var zn=".editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .toolbar-button {\n font-weight: bold;\n min-width: 73px;\n}\n\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h1,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h2,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h3,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h4,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h5,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h6 {\n line-height: 1.6;\n font-weight: bold;\n color: #262626;\n}\n\n.heading-item-h1 {\n font-size: 28px;\n}\n\n.heading-item-h2 {\n font-size: 24px;\n}\n\n.heading-item-h3 {\n font-size: 20px;\n}\n\n.heading-item-h4 {\n font-size: 16px;\n}\n\n.heading-item-h5 {\n font-size: 14px;\n}\n\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h6 {\n font-size: 14px;\n font-weight: normal;\n}\n\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-fontsize .toolbar-button {\n font-weight: bold;\n min-width: 58px;\n}\n\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-fontfamily .toolbar-button {\n font-size: 12px;\n}";Bn(zn);var Hn=function(t){var e=t.language.get("toolbar");return[{type:"collapse",header:e["collapse"]["title"],icon:"collapse",groups:[{items:[{name:"image-uploader",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\t\t\t\t\t\twidth="24"\n\t\t\t\t\t\t\t\t\t\theight="24"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<g fill="none" fill-rule="evenodd">\n\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\tstroke="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=".667"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFF"\n\t\t\t\t\t\t\t\t\t\t\t\tx=".333"\n\t\t\t\t\t\t\t\t\t\t\t\ty=".333"\n\t\t\t\t\t\t\t\t\t\t\t\twidth="23.333"\n\t\t\t\t\t\t\t\t\t\t\t\theight="23.333"\n\t\t\t\t\t\t\t\t\t\t\t\trx="1.333"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<g fill-rule="nonzero">\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\td="M8.625 8a1.126 1.126 0 010 2.25 1.126 1.126 0 010-2.25z"\n\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFD666"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\td="M17.95 14.88a.144.144 0 01-.092.033H6.14a.139.139 0 01-.14-.137.14.14 0 01.033-.089l2.981-3.45a.143.143 0 01.198-.018c.005.005.012.01.017.017l1.74 2.016 2.767-3.203a.143.143 0 01.198-.017l.018.017 4.018 4.64a.137.137 0 01-.02.191z"\n\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#CCC"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\td="M17.91 14.88a.144.144 0 01-.092.033H9.333l4.363-4.864a.143.143 0 01.198-.017l.018.017 4.018 4.64a.137.137 0 01-.02.191z"\n\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#737373"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</span>',title:e["image"]["title"],search:"图片,tupian,image,img"},{name:"codeblock",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\t\t\t\t\t\twidth="24"\n\t\t\t\t\t\t\t\t\t\theight="24"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<g fill="none" fill-rule="evenodd">\n\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\tstroke="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFF"\n\t\t\t\t\t\t\t\t\t\t\t\tx=".5"\n\t\t\t\t\t\t\t\t\t\t\t\ty=".5"\n\t\t\t\t\t\t\t\t\t\t\t\twidth="23"\n\t\t\t\t\t\t\t\t\t\t\t\theight="23"\n\t\t\t\t\t\t\t\t\t\t\t\trx="2"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\td="M19.331 11.815c-.407-.22-.665-.678-.665-1.181V8.062c0-.202-.148-.367-.33-.367h-.933a.153.153 0 01-.153-.153v-.64c0-.084.068-.152.153-.152h.933c.651 0 1.18.588 1.18 1.312v2.572c0 .14.072.269.186.33l.843.455c.05.026.08.078.08.134v.894c0 .056-.03.108-.08.134l-.843.455a.373.373 0 00-.186.33v2.572c0 .724-.529 1.312-1.18 1.312h-.933a.153.153 0 01-.153-.153v-.64c0-.084.068-.152.153-.152h.933c.182 0 .33-.165.33-.367v-2.572c0-.503.258-.961.665-1.18l.344-.186-.344-.185zM5.044 11.815c.407-.22.665-.678.665-1.181V8.062c0-.202.148-.367.33-.367h.933a.153.153 0 00.153-.153v-.64a.153.153 0 00-.153-.152H6.04c-.651 0-1.18.588-1.18 1.312v2.572c0 .14-.072.269-.186.33l-.843.455a.153.153 0 00-.08.134v.894c0 .056.03.108.08.134l.843.455c.114.061.186.19.186.33v2.572c0 .724.529 1.312 1.18 1.312h.933a.153.153 0 00.153-.153v-.64a.153.153 0 00-.153-.152H6.04c-.182 0-.33-.165-.33-.367v-2.572c0-.503-.258-.961-.665-1.18L4.7 12l.344-.185z"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#595959"\n\t\t\t\t\t\t\t\t\t\t\t\tfill-rule="nonzero"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#1890FF"\n\t\t\t\t\t\t\t\t\t\t\t\topacity=".25"\n\t\t\t\t\t\t\t\t\t\t\t\td="M8.25 8.25h7.5v1.125h-7.5z"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#D2E8DB"\n\t\t\t\t\t\t\t\t\t\t\t\td="M8.25 10.5h4.5v1.125h-4.5z"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#E0E0E0"\n\t\t\t\t\t\t\t\t\t\t\t\td="M8.25 12.75h4.5v1.125h-4.5zM8.25 15h6v1.125h-6z"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</span>',title:e["codeblock"]["title"],search:"代码块,daimakuai,code"},{name:"table",command:{name:"table",args:[3,3]},placement:"rightTop",onDisabled:function(){return!!t.card.active||!t.command.queryEnabled("table")},prompt:t.card.active||!t.command.queryEnabled("table")?void 0:function(e){return(new h["default"]).$createElement(In,{props:{onSelect:function(n,r,i){e.onClick&&e.onClick(n,"table"),t.command.execute("table",r,i)}}})},icon:'<span><svg\n\t\t\t\t\t\t\t\t\twidth="24px"\n\t\t\t\t\t\t\t\t\theight="24px"\n\t\t\t\t\t\t\t\t\tview-box="0 0 24 24"\n\t\t\t\t\t\t\t\t\tversion="1.1"\n\t\t\t\t\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<g\n\t\t\t\t\t\t\t\t\t\tstroke="none"\n\t\t\t\t\t\t\t\t\t\tstroke-width="1"\n\t\t\t\t\t\t\t\t\t\tfill="none"\n\t\t\t\t\t\t\t\t\t\tfill-rule="evenodd"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<g transform="translate(-16.000000, -93.000000)">\n\t\t\t\t\t\t\t\t\t\t\t<g>\n\t\t\t\t\t\t\t\t\t\t\t\t<g transform="translate(16.000000, 53.000000)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<g transform="translate(0.000000, 40.000000)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<g>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.666666667"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFFFFF"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="0.333333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="0.333333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="23.3333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="23.3333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trx="1.33333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<g transform="translate(5.250000, 6.750000)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td="M0.75,0 L3.75,0 L3.75,10.5 L0.75,10.5 C0.335786438,10.5 5.07265313e-17,10.1642136 0,9.75 L0,0.75 C-5.07265313e-17,0.335786438 0.335786438,7.6089797e-17 0.75,0 Z"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#F0F0F0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></path>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td="M0.25,2.75 L13.25,2.75 L13.25,0.75 C13.25,0.473857625 13.0261424,0.25 12.75,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,2.75 Z"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#595959"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill-opacity="0.15"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#25B864"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></path>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="5.25"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="13.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle-Copy"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="7.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="13.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="6.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="10.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle-Copy-5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="9.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="10.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#737373"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="0.375"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="0.375"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="12.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="9.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trx="0.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td="M3.5,10.25 L3.5,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,9.75 C0.25,10.0261424 0.473857625,10.25 0.75,10.25 L3.5,10.25 Z"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#737373"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></path>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td="M0.25,2.75 L13.25,2.75 L13.25,0.75 C13.25,0.473857625 13.0261424,0.25 12.75,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,2.75 Z"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#737373"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></path>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t</svg></span>',title:e["table"]["title"],search:"biaoge,table"},{name:"file-uploader",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\twidth="24"\n\t\t\t\t\t\t\t\t\t\theight="24"\n\t\t\t\t\t\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<g fill="none" fill-rule="evenodd">\n\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\tstroke="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFF"\n\t\t\t\t\t\t\t\t\t\t\t\tx=".5"\n\t\t\t\t\t\t\t\t\t\t\t\ty=".5"\n\t\t\t\t\t\t\t\t\t\t\t\twidth="23"\n\t\t\t\t\t\t\t\t\t\t\t\theight="23"\n\t\t\t\t\t\t\t\t\t\t\t\trx="2"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#E0E0E0"\n\t\t\t\t\t\t\t\t\t\t\t\td="M11.25 15h8.25v1.125h-8.25zM14.25 11.25h5.25v1.125h-5.25zM14.25 8.25h5.25v1.125h-5.25z"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\td="M11.216 8.324a2.593 2.593 0 00-3.791 0l-2.896 3.04a.108.108 0 00-.029.074c0 .028.01.055.029.075l.41.43c.038.041.101.041.14 0l2.896-3.04a1.841 1.841 0 012.69 0c.36.378.557.88.557 1.413 0 .534-.197 1.035-.557 1.413l-2.95 3.1-.48.502c-.446.47-1.173.47-1.62 0a1.226 1.226 0 01-.335-.851c0-.322.119-.624.335-.851l2.928-3.075a.382.382 0 01.276-.12h.001c.105 0 .201.043.274.12.075.078.115.18.115.29a.416.416 0 01-.115.288l-2.393 2.512a.108.108 0 00-.029.075c0 .028.01.054.03.074l.409.43c.038.041.102.041.14 0l2.392-2.513c.221-.232.342-.54.342-.867 0-.328-.122-.637-.342-.868a1.131 1.131 0 00-1.653 0l-.284.3-2.642 2.776a2.06 2.06 0 00-.564 1.43c0 .54.2 1.047.564 1.428.376.394.868.591 1.36.591.494 0 .986-.197 1.361-.591l3.43-3.602c.505-.532.785-1.24.785-1.991a2.867 2.867 0 00-.784-1.992z"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#595959"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</span>',title:e["file"]["title"],search:"附件,文件,fujian,wenjian,file"},{name:"video-uploader",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-16.000000, -641.000000)">\n <g>\n <g transform="translate(16.000000, 641.000000)">\n <g>\n <rect stroke="#E8E8E8" fill="#FFFFFF" x="0.5" y="0.5" width="23" height="23" rx="2"/>\n <g transform="translate(6.000000, 6.000000)" fill-rule="nonzero">\n <rect fill="#000000" opacity="0" x="0" y="0" width="12" height="12"/>\n <path d="M6,0.75 C3.10078125,0.75 0.75,3.10078125 0.75,6 C0.75,8.89921875 3.10078125,11.25 6,11.25 C8.89921875,11.25 11.25,8.89921875 11.25,6 C11.25,3.10078125 8.89921875,0.75 6,0.75 Z M6,10.359375 C3.59296875,10.359375 1.640625,8.40703125 1.640625,6 C1.640625,3.59296875 3.59296875,1.640625 6,1.640625 C8.40703125,1.640625 10.359375,3.59296875 10.359375,6 C10.359375,8.40703125 8.40703125,10.359375 6,10.359375 Z" id="Shape" fill="#595959"/>\n <path d="M7.93963415,5.8884912 L5.23140244,4.02687575 C5.13445122,3.96020395 5,4.02514402 5,4.13857268 L5,7.86180356 C5,7.97523223 5.13536585,8.03930643 5.23140244,7.97350049 L7.93963415,6.11188505 C8.02012195,6.05646952 8.02012195,5.94390673 7.93963415,5.8884912 Z" id="Shape" fill="#71D19A"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n\t\t\t\t\t\t\t\t</span>',title:e["video"]["title"],search:"视频,MP4,shipin,video"},{name:"math",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><g fill="none" fill-rule="evenodd"><rect stroke="#E8E8E8" fill="#FFF" x=".5" y=".5" width="23" height="23" rx="2"/><path d="M14.073 14.18a.122.122 0 01.004.073l-.346 1.404a.122.122 0 01-.119.093H9.438a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h.61v-3.924h-.61a.122.122 0 01-.122-.122v-.384c0-.068.055-.122.122-.122h.355l-.012-.063a.976.976 0 00-.96-.8h-.487v3.845H9.35c.068 0 .122.055.122.122v.384a.122.122 0 01-.122.122H6.341a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h1.017V9.706H6.87a.976.976 0 00-.96.8l-.097.535h-.437a.122.122 0 01-.122-.132l.143-1.797A.122.122 0 015.52 9h4.654c.064 0 .117.049.122.112l.116 1.458h3.19c.06 0 .113.046.12.107l.214 1.718a.122.122 0 01-.121.137h-.339a.122.122 0 01-.117-.09l-.16-.577a.91.91 0 00-.877-.667h-1.134v1.57h.423c.26 0 .471-.211.471-.471v-.192c0-.068.055-.122.122-.122h.407c.067 0 .122.054.122.122v1.953a.122.122 0 01-.122.122h-.407a.122.122 0 01-.122-.122v-.192a.47.47 0 00-.47-.47h-.424v1.726h1.187c.34 0 .655-.177.832-.467l.291-.475h-.155a.122.122 0 01-.122-.122v-.384c0-.067.054-.122.122-.122h.577l1.468-2.004-1.305-1.92h-.659a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h2.196c.067 0 .122.055.122.122v.384a.122.122 0 01-.122.122h-.317l.718 1.057.774-1.057h-.362a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h1.87c.068 0 .123.055.123.122v.384a.122.122 0 01-.122.122h-.614l-1.238 1.69 1.518 2.234h.659c.067 0 .122.055.122.122v.384a.122.122 0 01-.122.122h-2.196a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h.317l-.931-1.37-1.004 1.37h.398c.068 0 .122.055.122.122v.384a.122.122 0 01-.122.122h-1.14z" fill-opacity=".65" fill="#000"/></g></svg>\n\t\t\t\t\t\t\t\t</span>',title:e["math"]["title"],search:"公式,数学公式,gongshi,formula,math,latex"},{name:"status",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><g fill="none" fill-rule="evenodd"><rect stroke="#E8E8E8" stroke-width=".667" fill="#FFF" x=".333" y=".333" width="23.333" height="23.333" rx="1.333"/><g transform="translate(6 6)"><path d="M2.534 6.192L.53 4.34a.667.667 0 01-.144-.788L1.98.37A.667.667 0 012.575 0h9.714c.369 0 .667.298.667.667v5.036a.667.667 0 01-.667.666H2.986a.667.667 0 01-.452-.177z" fill="#BFBFBF"/><path d="M.598 4.07a.267.267 0 00.02.226l4.125 7.146a.267.267 0 00.364.097l4.62-2.666a.267.267 0 00.097-.365L5.698 1.363a.267.267 0 00-.186-.13L2.095.648a.267.267 0 00-.295.17L.598 4.07z" stroke="#595959" stroke-width=".8" fill="#FFF"/><path d="M3.956 3.036a.667.667 0 11-1.333 0 .667.667 0 011.333 0z" fill="#595959"/><circle fill="#595959" transform="scale(-1 1) rotate(30 0 -9.207)" cx="3.283" cy="3.047" r="1"/></g></g></svg>\n\t\t\t\t\t\t\t\t</span>',title:e["status"]["title"],search:"status,label,状态"}]}]},{type:"button",name:"undo",icon:"undo",title:e["undo"]["title"],onDisabled:function(){return!t.command.queryState("undo")||!t.command.queryEnabled("undo")},onActive:function(){return!1}},{type:"button",name:"redo",icon:"redo",title:e["redo"]["title"],onDisabled:function(){return!t.command.queryState("redo")||!t.command.queryEnabled("redo")},onActive:function(){return!1}},{type:"button",name:"paintformat",icon:"paintformat",title:e["paintformat"]["title"]},{type:"button",name:"removeformat",icon:"clean",title:e["removeformat"]["title"]},{type:"dropdown",name:"heading",className:"toolbar-dropdown-heading",title:e["heading"]["title"],items:[{key:"p",className:"heading-item-p",content:e["heading"]["p"]},{key:"h1",className:"heading-item-h1",content:e["heading"]["h1"]},{key:"h2",className:"heading-item-h2",content:e["heading"]["h2"]},{key:"h3",className:"heading-item-h3",content:e["heading"]["h3"]},{key:"h4",className:"heading-item-h4",content:e["heading"]["h4"]},{key:"h5",className:"heading-item-h5",content:e["heading"]["h5"]},{key:"h6",className:"heading-item-h6",content:e["heading"]["h6"]}]},{type:"dropdown",name:"fontsize",className:"toolbar-dropdown-fontsize",title:e["fontsize"]["title"],items:[{key:"12px",content:"12px",hotkey:!1},{key:"13px",content:"13px",hotkey:!1},{key:"14px",content:"14px",hotkey:!1},{key:"15px",content:"15px",hotkey:!1},{key:"16px",content:"16px",hotkey:!1},{key:"19px",content:"19px",hotkey:!1},{key:"22px",content:"22px",hotkey:!1},{key:"24px",content:"24px",hotkey:!1},{key:"29px",content:"29px",hotkey:!1},{key:"32px",content:"32px",hotkey:!1},{key:"40px",content:"40px",hotkey:!1},{key:"48px",content:"48px",hotkey:!1}].map((function(e){return e.key===t.container.css("font-size")?b(b({},e),{},{isDefault:!0}):e})),onDisabled:function(){var e=t.command.queryState("heading")||"p";return/^h\d$/.test(e)||!t.command.queryEnabled("fontsize")}},{type:"dropdown",name:"fontfamily",className:"toolbar-dropdown-fontfamily",title:e["fontfamily"]["title"],items:Fn(Rn,b(b({},e["fontfamily"]["items"]),{},{notInstalled:e["fontfamily"]["notInstalled"]})),onActive:function(e){var n,r=t.command.queryState("fontfamily");if(!r||!Array.isArray(r)||0===r.length)return"";var i=r[0].split(",").map((function(t){return t.replace(/"/g,"").trim().toLowerCase()}));return(null===(n=e.find((function(t){return i.indexOf(t["faimlyName"].trim().toLowerCase())>-1})))||void 0===n?void 0:n.key)||""}},{type:"button",name:"bold",icon:"bold",title:e["bold"]["title"],onDisabled:function(){var e=t.command.queryState("heading")||"p";return/^h\d$/.test(e)||!t.command.queryEnabled("bold")}},{type:"button",name:"italic",icon:"italic",title:e["italic"]["title"]},{type:"button",name:"strikethrough",icon:"strikethrough",title:e["strikethrough"]["title"]},{type:"button",name:"underline",icon:"underline",title:e["underline"]["title"]},{type:"dropdown",name:"moremark",icon:"moremark",single:!1,title:e["moremark"]["title"],items:[{key:"sup",icon:"sup",content:e["moremark"]["sup"],disabled:!t.command.queryEnabled("sup"),command:{name:"sup",args:[]}},{key:"sub",icon:"sub",disabled:!t.command.queryEnabled("sub"),content:e["moremark"]["sub"],command:{name:"sub",args:[]}},{key:"code",icon:"code",disabled:!t.command.queryEnabled("code"),content:e["moremark"]["code"],command:{name:"code",args:[]}}],onDisabled:function(){var e=[];return!0===t.command.queryEnabled("sup")&&e.push("sup"),!0===t.command.queryEnabled("sub")&&e.push("sub"),!0===t.command.queryEnabled("code")&&e.push("code"),0===e.length},onActive:function(){var e=[];return!0===t.command.queryState("sup")&&e.push("sup"),!0===t.command.queryState("sub")&&e.push("sub"),!0===t.command.queryState("code")&&e.push("code"),e}},{type:"color",name:"fontcolor",defaultColor:"#262626",defaultActiveColor:"#F5222D",buttonTitle:e["fontcolor"]["title"],dropdownTitle:e["fontcolor"]["more"],content:function(t,e,n){return!0===n&&(t="#BFBFBF",e="#BFBFBF"),'<svg\n\t\t\t\t\t\twidth="16px"\n\t\t\t\t\t\theight="16px"\n\t\t\t\t\t\tviewBox="0 0 16 16"\n\t\t\t\t\t\tstyle="margin-bottom: -2"\n\t\t\t\t\t>\n\t\t\t\t\t\t<title>color-font</title>\n\t\t\t\t\t\t<desc>Created with Sketch.</desc>\n\t\t\t\t\t\t<g\n\t\t\t\t\t\t\tid="color-font"\n\t\t\t\t\t\t\tstroke="none"\n\t\t\t\t\t\t\tstroke-width="1"\n\t\t\t\t\t\t\tfill="none"\n\t\t\t\t\t\t\tfill-rule="evenodd"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tid="Rectangle-55"\n\t\t\t\t\t\t\t\tstroke='.concat(e,'\n\t\t\t\t\t\t\t\tstroke-width="0.5"\n\t\t\t\t\t\t\t\tfill=').concat(t,'\n\t\t\t\t\t\t\t\tx="2"\n\t\t\t\t\t\t\t\ty="12.75"\n\t\t\t\t\t\t\t\twidth="12"\n\t\t\t\t\t\t\t\theight="1.5"\n\t\t\t\t\t\t\t\trx="0.125"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td="M5.29102819,11.25 L3.96365715,11.25 C3.87952002,11.25 3.8113134,11.1817934 3.8113134,11.0976562 C3.8113134,11.08076 3.81412419,11.0639814 3.81963067,11.0480076 L7.0756112,1.60269506 C7.09679504,1.5412426 7.15463644,1.5 7.21963767,1.5 L8.81868806,1.5 C8.883726,1.5 8.94159158,1.54128846 8.96274706,1.60278951 L12.2118,11.048102 C12.239168,11.1276636 12.1968568,11.2143472 12.1172952,11.2417152 C12.1013495,11.2472004 12.0846037,11.25 12.067741,11.25 L10.6761419,11.25 C10.6099165,11.25 10.5512771,11.2072154 10.531066,11.1441494 L9.69970662,8.55 L6.27433466,8.55 L5.43599205,11.1444975 C5.41567115,11.2073865 5.35711879,11.25 5.29102819,11.25 Z M8.02635163,3.18571429 L7.96199183,3.18571429 L6.63904023,7.30714286 L9.33500105,7.30714286 L8.02635163,3.18571429 Z"\n\t\t\t\t\t\t\t\tid="A"\n\t\t\t\t\t\t\t\tfill="#595959"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</g>\n\t\t\t\t\t</svg>')}},{type:"color",name:"backcolor",defaultColor:"transparent",defaultActiveColor:"#FADB14",buttonTitle:e["backcolor"]["title"],dropdownTitle:e["backcolor"]["more"],content:function(t,e,n){return!0===n&&(t="#BFBFBF",e="#BFBFBF"),'<svg\n width="16px"\n height="16px"\n viewBox="0 0 16 16"\n style="margin-bottom: -2"\n\t\t\t\t\t>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect stroke="'.concat(e,'" stroke-width="0.5" fill="').concat(t,'" x="2" y="12.75" width="12" height="1.5" rx="0.125"></rect>\n <g transform="translate(2.781250, 1.375000)" fill-rule="nonzero"><path fill="#595959" d="M2.86079849,6.64817222 L2.05713835,5.84451208 C2.00832281,5.79569655 2.00832281,5.71655092 2.05713835,5.66773539 L3.61029491,4.11457882 L3.11963835,3.62392225 C3.07082281,3.57510672 3.07082281,3.49596109 3.11963835,3.44714556 L6.47839556,0.0883883476 C6.52721109,0.0395728112 6.60635672,0.0395728112 6.65517225,0.0883883476 L11.5165314,4.94974747 C11.5653469,4.998563 11.5653469,5.07770863 11.5165314,5.12652416 L8.15777416,8.48528137 C8.10895863,8.53409691 8.029813,8.53409691 7.98099747,8.48528137 L7.38889678,7.89318068 L5.83574021,9.44633725 C5.78692467,9.49515278 5.70777905,9.49515278 5.65896351,9.44633725 L5.0267407,8.81411444 L4.48856529,9.35326519 C4.39477378,9.44720966 4.26747335,9.5 4.13472392,9.5 L0.608857988,9.5 C0.470786801,9.5 0.358857988,9.38807119 0.358857988,9.25 C0.358857988,9.18363253 0.385247413,9.11998865 0.432210608,9.07309408 L2.86079849,6.64817222 Z M6.56678391,1.67937861 L4.71062861,3.53553391 L8.06938582,6.89429112 L9.92554112,5.03813582 L6.56678391,1.67937861 Z M3.64812861,5.75612373 L5.74735186,7.85534699 L6.54284699,7.05985186 L4.44362373,4.96062861 L3.64812861,5.75612373 Z" id="Combined-Shape"></path></g></g>\n\t\t\t\t\t</svg>')}},{type:"dropdown",name:"alignment",title:e["alignment"]["title"],items:[{key:"left",icon:"align-left",content:e["alignment"]["left"]},{key:"center",icon:"align-center",content:e["alignment"]["center"]},{key:"right",icon:"align-right",content:e["alignment"]["right"]},{key:"justify",icon:"align-justify",content:e["alignment"]["justify"]}]},{type:"button",name:"unorderedlist",icon:"unordered-list",title:e["unorderedlist"]["title"]},{type:"button",name:"orderedlist",icon:"ordered-list",title:e["orderedlist"]["title"]},{type:"button",name:"tasklist",icon:"task-list",title:e["tasklist"]["title"]},{type:"dropdown",name:"indent",icon:"indent",hasDot:!1,title:e["indent"]["title"],items:[{key:"in",icon:"indent",content:e["indent"]["in"]},{key:"out",icon:"outdent",content:e["indent"]["out"]}]},{type:"dropdown",name:"line-height",content:function(){return'<span class="data-icon data-icon-line-height"></span>'},title:e["line-height"]["title"],items:[{key:"default",content:e["line-height"]["default"]},{key:"1",content:"1"},{key:"1.15",content:"1.15"},{key:"1.5",content:"1.5"},{key:"2",content:"2"},{key:"2.5",content:"2.5"},{key:"3",content:"3"}]},{type:"button",name:"link",icon:"link",command:{name:"link",args:["_blank"]},title:e["link"]["title"],onDisabled:function(){var e=t.change,n=t.card,r=e.range.get(),i=n.find(r.startNode);return!!i&&!i.isCursor(r.startNode)||r.containsCard()||!t.command.queryEnabled("link")}},{type:"button",name:"quote",icon:"quote",title:e["quote"]["title"]},{type:"button",name:"hr",icon:"hr",title:e["hr"]["title"]}]},Vn=function(e){A(r,e);var n=M(r);function r(){var t;return w(this,r),t=n.apply(this,arguments),t.groupValue=[],t.isMobile=!1,t.caluTimeoutRef=null,t.updateTimer=null,t.scrollTimer=null,t.mobileView={top:0},t.hideMobileToolbar=function(){t.mobileView={top:-120},t.scrollTimer&&clearTimeout(t.scrollTimer),t.scrollTimer=setTimeout((function(){t.calcuMobileView()}),200)},t.handleReadonly=function(){t.engine.readonly?t.hideMobileToolbar():t.calcuMobileView()},t}return C(r,[{key:"mounted",value:function(){this.engine.language.add(En),this.engine.on("select",this.updateByTimeout),this.engine.on("change",this.updateByTimeout),this.engine.on("blur",this.updateByTimeout),this.engine.on("focus",this.updateByTimeout),a.isMobile?(this.engine.isFocus()||this.hideMobileToolbar(),this.engine.on("readonly",this.handleReadonly),this.engine.on("blur",this.hideMobileToolbar),document.addEventListener("scroll",this.calcuMobileView),visualViewport.addEventListener("resize",this.calcuMobileView),visualViewport.addEventListener("scroll",this.calcuMobileView)):this.engine.on("readonly",this.updateByTimeout),this.updateByTimeout(),this.isMobile=a.isMobile}},{key:"unmounted",value:function(){this.engine.off("select",this.updateByTimeout),this.engine.off("change",this.updateByTimeout),this.engine.off("readonly",this.updateByTimeout),this.engine.off("blur",this.updateByTimeout),this.engine.off("focus",this.updateByTimeout),a.isMobile?(this.engine.off("readonly",this.handleReadonly),this.engine.off("blur",this.hideMobileToolbar),document.removeEventListener("scroll",this.calcuMobileView),visualViewport.removeEventListener("resize",this.calcuMobileView),visualViewport.removeEventListener("scroll",this.calcuMobileView)):this.engine.off("readonly",this.updateByTimeout)}},{key:"updateByTimeout",value:function(){var t=this;this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout((function(){t.update()}),100)}},{key:"calcuMobileView",value:function(){var e=this;this.engine.isFocus()&&!this.engine.readonly&&(this.caluTimeoutRef&&clearTimeout(this.caluTimeoutRef),this.caluTimeoutRef=setTimeout((function(){var n=e.$refs.toolbarRef,r=n.getBoundingClientRect(),i=a.removeUnit(getComputedStyle(n).borderTopWidth),o=a.removeUnit(getComputedStyle(n).borderBottomWidth),s=r.height||0;e.mobileView.top=t.Math.max(document.body.scrollTop,document.documentElement.scrollTop)+(window.visualViewport.height||0)-s+i+o}),100))}},{key:"update",value:function(){var t=this;a.isMobile&&this.calcuMobileView();var e=[],n=Hn(this.engine);this.items.forEach((function(r){var i={items:[]};Array.isArray(r)||(i.icon=r.icon,i.content=r.content,r=r.items),r.forEach((function(e){var r=void 0;if("string"===typeof e){var a=n.find((function(t){return"collapse"===e?t.type===e:"collapse"!==t.type&&t.name===e}));a&&(r=a)}else{var s=n.find((function(t){return"collapse"===e.type?t.type===e.type:"collapse"!==t.type&&t.name===e.name}));if("collapse"===e.type){var l=b(b({},o.merge(o.omit(b({},s),"groups"),o.omit(b({},e),"groups"))),{},{groups:[]});e.groups.forEach((function(t){var e=[];t.items.forEach((function(t){var n=void 0;s.groups.some((function(e){return e.items.some((function(e){var r=e.name===("string"===typeof t?t:t.name);return r&&(n=b(b({},e),"string"===typeof t?{}:t)),r}))})),n?e.push(n):"object"===y(t)&&e.push(t)})),e.length>0&&l.groups.push(b(b({},o.omit(t,"itmes")),{},{items:e}))})),r=l.groups.length>0?l:void 0}else"dropdown"===e.type?(r=s?o.merge(s,o.omit(b({},e),"type","items")):b({},e),r.items=e.items):r=s?o.merge(s,o.omit(b({},e),"type")):b({},e)}r&&("button"===r.type?r.onActive?r.active=r.onActive():t.engine.command.queryEnabled(r.name)&&(r.active=t.engine.command.queryState(r.name)):"dropdown"===r.type&&(r.onActive?r.values=r.onActive(r.items):r.values=t.engine.command.queryState(r.name)),"collapse"!==r.type?r.disabled=r.onDisabled?r.onDisabled():!t.engine.command.queryEnabled(r.name):(r.groups.forEach((function(e){return e.items.forEach((function(e){e.disabled=e.onDisabled?e.onDisabled():!t.engine.command.queryEnabled(e.name)}))})),r.disabled=!r.groups.some((function(t){return t.items.some((function(t){return!t.disabled}))}))),i.items.push(r))})),i.items.length>0&&e.push(i)})),this.groupValue=e}},{key:"preventDefault",value:function(t){t.preventDefault()}},{key:"triggerMouseOver",value:function(t){this.preventDefault(t)}},{key:"triggerMouseMove",value:function(t){this.preventDefault(t)}},{key:"triggerContextMenu",value:function(t){this.preventDefault(t)}}]),r}(h["default"]);V([ut({type:Object,required:!0})],Vn.prototype,"engine",void 0),V([ut({type:Array,default:[]})],Vn.prototype,"items",void 0),V([ut(String)],Vn.prototype,"className",void 0),V([ut({type:Boolean,default:!1})],Vn.prototype,"popup",void 0),Vn=V([st({components:{AmGroup:kn}})],Vn);var qn=Vn,Un=qn,Wn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"toolbarRef",class:["editor-toolbar",t.className,{"editor-toolbar-mobile":t.isMobile&&!t.popup,"editor-toolbar-popup":t.popup}],style:t.isMobile?{top:t.mobileView.top+"px"}:{},attrs:{"data-element":"ui"},on:{mouseover:t.triggerMouseOver,mousemove:t.triggerMouseMove,contextmenu:t.triggerContextMenu}},[n("div",{staticClass:"editor-toolbar-content"},t._l(t.groupValue,(function(e,r){return n("am-group",t._b({key:r,attrs:{engine:t.engine,popup:t.popup}},"am-group",e,!1))})),1)])},$n=[];Wn._withStripped=!0;var Gn=function(t){t&&t("data-v-00e9b844_0",{source:"\n.ant-tooltip .toolbar-tooltip-title {\r\n font-size: 12px;\r\n text-align: center;\n}\n.ant-tooltip .toolbar-tooltip-hotkey {\r\n font-size: 12px;\r\n color: rgba(255, 255, 255, 0.85);\r\n text-align: center;\n}\n.editor-toolbar {\r\n position: relative;\r\n width: 100%;\r\n padding: 0;\r\n z-index: 200;\r\n border-top: 1px solid rgba(0, 0, 0, 0.05);\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.05);\r\n user-select: none;\n}\n.editor-toolbar .editor-toolbar-content {\r\n position: relative;\r\n flex-direction: row;\r\n background: transparent;\r\n text-align: center;\r\n width: 100%;\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\n}\n.editor-toolbar.editor-toolbar-mobile,\r\n.editor-toolbar.editor-toolbar-popover {\r\n position: absolute;\r\n left: 0;\r\n box-shadow: none;\n}\n.editor-toolbar.editor-toolbar-popup {\r\n position: initial;\r\n box-shadow: none;\r\n top: 0;\r\n left: 0;\r\n border: 0 none;\n}\n.editor-toolbar-mobile .editor-toolbar-content {\r\n text-align: left;\r\n padding: 0 12px;\n}\n.editor-toolbar-mobile .editor-toolbar-group,\r\n.editor-toolbar-popup .editor-toolbar-group {\r\n border: 0 none;\r\n padding: 0;\n}\n.editor-toolbar-popup .editor-toolbar-content {\r\n text-align: center;\r\n padding: 0;\n}\n.editor-toolbar-popover .editor-toolbar {\r\n position: relative;\r\n box-shadow: none;\r\n border: 0 none;\r\n left: 0;\r\n top: 0;\r\n display: flex;\n}\n.editor-toolbar-popover {\r\n border-radius: 3px;\r\n background: transparent;\n}\n.editor-toolbar-popover .ant-popover-inner {\r\n border-radius: 3px;\n}\n.editor-toolbar-popover .ant-popover-inner-content {\r\n padding: 2px;\n}\n.am-engine-mobile {\r\n margin-bottom: 40px;\n}\r\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/toolbar.vue"],names:[],mappings:";AAiSA;EACA,eAAA;EACA,kBAAA;AACA;AAEA;EACA,eAAA;EACA,gCAAA;EACA,kBAAA;AACA;AAEA;EACA,kBAAA;EACA,WAAA;EACA,UAAA;EACA,YAAA;EACA,yCAAA;EACA,4CAAA;EACA,iBAAA;AACA;AAEA;EACA,kBAAA;EACA,mBAAA;EACA,uBAAA;EACA,kBAAA;EACA,WAAA;EACA,aAAA;EACA,uBAAA;EACA,eAAA;AACA;AAEA;;EAEA,kBAAA;EACA,OAAA;EACA,gBAAA;AACA;AAEA;EACA,iBAAA;EACA,gBAAA;EACA,MAAA;EACA,OAAA;EACA,cAAA;AACA;AAEA;EACA,gBAAA;EACA,eAAA;AACA;AAEA;;EAEA,cAAA;EACA,UAAA;AACA;AAEA;EACA,kBAAA;EACA,UAAA;AACA;AAEA;EACA,kBAAA;EACA,gBAAA;EACA,cAAA;EACA,OAAA;EACA,MAAA;EACA,aAAA;AACA;AAEA;EACA,kBAAA;EACA,uBAAA;AACA;AAEA;EACA,kBAAA;AACA;AAEA;EACA,YAAA;AACA;AAEA;EACA,mBAAA;AACA",file:"toolbar.vue",sourcesContent:['<template>\r\n <div\r\n ref="toolbarRef"\r\n :class="[\r\n \'editor-toolbar\',\r\n className,\r\n {\r\n \'editor-toolbar-mobile\': isMobile && !popup,\r\n \'editor-toolbar-popup\': popup,\r\n },\r\n ]"\r\n :style="isMobile ? { top: `${mobileView.top}px` } : {}"\r\n data-element="ui"\r\n @mouseover="triggerMouseOver"\r\n @mousemove="triggerMouseMove"\r\n @contextmenu="triggerContextMenu"\r\n >\r\n <div class="editor-toolbar-content">\r\n <am-group\r\n v-for="(group, index) in groupValue"\r\n :key="index"\r\n :engine="engine"\r\n :popup="popup"\r\n v-bind="group"\r\n />\r\n </div>\r\n </div>\r\n</template>\r\n<script lang="ts">\r\nimport { Component, Vue, Prop } from "vue-property-decorator";\r\nimport { merge, omit } from "lodash";\r\nimport { EngineInterface, isMobile, removeUnit } from "@aomao/engine";\r\nimport {\r\n ToolbarButtonProps,\r\n CollapseItemProps,\r\n ToolbarColorProps,\r\n ToolbarDropdownProps,\r\n GroupDataProps,\r\n ToolbarCollapseGroupProps,\r\n GroupItemProps,\r\n} from "../types";\r\nimport AmGroup from "./group.vue";\r\nimport locales from "../locales";\r\nimport {\r\n getToolbarDefaultConfig,\r\n fontFamilyDefaultData,\r\n fontfamily,\r\n} from "../config";\r\n\r\n@Component({\r\n components: {\r\n AmGroup,\r\n },\r\n})\r\nexport default class Toolbar extends Vue {\r\n @Prop({ type: Object, required: true }) engine!: EngineInterface;\r\n @Prop({ type: Array, default: [] }) items!: Array<GroupItemProps>;\r\n @Prop(String) className?: string;\r\n @Prop({ type: Boolean, default: false }) popup!: boolean;\r\n\r\n groupValue: GroupDataProps[] = [];\r\n isMobile = false;\r\n caluTimeoutRef: NodeJS.Timeout | null = null;\r\n updateTimer: NodeJS.Timeout | null = null;\r\n scrollTimer: NodeJS.Timeout | null = null;\r\n mobileView = { top: 0 };\r\n\r\n mounted() {\r\n this.engine.language.add(locales);\r\n this.engine.on("select", this.updateByTimeout);\r\n this.engine.on("change", this.updateByTimeout);\r\n this.engine.on("blur", this.updateByTimeout);\r\n this.engine.on("focus", this.updateByTimeout);\r\n if (isMobile) {\r\n if (!this.engine.isFocus()) this.hideMobileToolbar();\r\n this.engine.on("readonly", this.handleReadonly);\r\n this.engine.on("blur", this.hideMobileToolbar);\r\n document.addEventListener("scroll", this.calcuMobileView);\r\n visualViewport.addEventListener("resize", this.calcuMobileView);\r\n visualViewport.addEventListener("scroll", this.calcuMobileView);\r\n } else {\r\n this.engine.on("readonly", this.updateByTimeout);\r\n }\r\n this.updateByTimeout();\r\n this.isMobile = isMobile;\r\n }\r\n\r\n unmounted() {\r\n this.engine.off("select", this.updateByTimeout);\r\n this.engine.off("change", this.updateByTimeout);\r\n this.engine.off("readonly", this.updateByTimeout);\r\n this.engine.off("blur", this.updateByTimeout);\r\n this.engine.off("focus", this.updateByTimeout);\r\n if (isMobile) {\r\n this.engine.off("readonly", this.handleReadonly);\r\n this.engine.off("blur", this.hideMobileToolbar);\r\n document.removeEventListener("scroll", this.calcuMobileView);\r\n visualViewport.removeEventListener("resize", this.calcuMobileView);\r\n visualViewport.removeEventListener("scroll", this.calcuMobileView);\r\n } else {\r\n this.engine.off("readonly", this.updateByTimeout);\r\n }\r\n }\r\n\r\n hideMobileToolbar = () => {\r\n this.mobileView = { top: -120 };\r\n if (this.scrollTimer) clearTimeout(this.scrollTimer);\r\n this.scrollTimer = setTimeout(() => {\r\n this.calcuMobileView();\r\n }, 200);\r\n };\r\n\r\n handleReadonly = () => {\r\n if (this.engine.readonly) {\r\n this.hideMobileToolbar();\r\n } else {\r\n this.calcuMobileView();\r\n }\r\n };\r\n\r\n updateByTimeout() {\r\n if (this.updateTimer) clearTimeout(this.updateTimer);\r\n this.updateTimer = setTimeout(() => {\r\n this.update();\r\n }, 100);\r\n }\r\n\r\n //计算移动浏览器的视图变化\r\n calcuMobileView() {\r\n if (!this.engine.isFocus() || this.engine.readonly) return;\r\n\r\n if (this.caluTimeoutRef) clearTimeout(this.caluTimeoutRef);\r\n this.caluTimeoutRef = setTimeout(() => {\r\n const element = this.$refs.toolbarRef as Element;\r\n const rect = element.getBoundingClientRect();\r\n const borderTop = removeUnit(getComputedStyle(element).borderTopWidth);\r\n const borderBottom = removeUnit(\r\n getComputedStyle(element).borderBottomWidth\r\n );\r\n const height = rect.height || 0;\r\n\r\n this.mobileView.top =\r\n global.Math.max(\r\n document.body.scrollTop,\r\n document.documentElement.scrollTop\r\n ) +\r\n (window.visualViewport.height || 0) -\r\n height +\r\n borderTop +\r\n borderBottom;\r\n }, 100);\r\n }\r\n\r\n update() {\r\n if (isMobile) this.calcuMobileView();\r\n const data: Array<GroupDataProps> = [];\r\n const defaultConfig = getToolbarDefaultConfig(this.engine);\r\n\r\n this.items.forEach((group) => {\r\n const dataGroup: GroupDataProps = { items: [] };\r\n if (!Array.isArray(group)) {\r\n dataGroup.icon = group.icon;\r\n dataGroup.content = group.content;\r\n\r\n group = group.items;\r\n }\r\n group.forEach((item) => {\r\n let customItem:\r\n | ToolbarButtonProps\r\n | ToolbarDropdownProps\r\n | ToolbarColorProps\r\n | ToolbarCollapseGroupProps\r\n | undefined = undefined;\r\n if (typeof item === "string") {\r\n const defaultItem = defaultConfig.find((config) =>\r\n item === "collapse"\r\n ? config.type === item\r\n : config.type !== "collapse" && config.name === item\r\n );\r\n if (defaultItem) customItem = defaultItem;\r\n } else {\r\n const defaultItem = defaultConfig.find((config) =>\r\n item.type === "collapse"\r\n ? config.type === item.type\r\n : config.type !== "collapse" && config.name === item.name\r\n );\r\n // 解析collapse item 为字符串时\r\n if (item.type === "collapse") {\r\n const customCollapse: ToolbarCollapseGroupProps = {\r\n ...merge(\r\n omit({ ...defaultItem }, "groups"),\r\n omit({ ...item }, "groups")\r\n ),\r\n groups: [],\r\n };\r\n item.groups.forEach((group) => {\r\n const items: Array<Omit<CollapseItemProps, "engine">> = [];\r\n group.items.forEach((cItem) => {\r\n let targetItem = undefined;\r\n (defaultItem as ToolbarCollapseGroupProps).groups.some((g) =>\r\n g.items.some((i) => {\r\n const isEqual =\r\n i.name ===\r\n (typeof cItem === "string" ? cItem : cItem.name);\r\n if (isEqual) {\r\n targetItem = {\r\n ...i,\r\n ...(typeof cItem === "string" ? {} : cItem),\r\n };\r\n }\r\n return isEqual;\r\n })\r\n );\r\n if (targetItem) items.push(targetItem);\r\n else if (typeof cItem === "object") items.push(cItem);\r\n });\r\n if (items.length > 0) {\r\n customCollapse.groups.push({ ...omit(group, "itmes"), items });\r\n }\r\n });\r\n customItem =\r\n customCollapse.groups.length > 0 ? customCollapse : undefined;\r\n } else if (item.type === "dropdown") {\r\n customItem = defaultItem\r\n ? merge(defaultItem, omit({ ...item }, "type", "items"))\r\n : { ...item };\r\n (customItem as ToolbarDropdownProps).items = item.items;\r\n } else {\r\n customItem = defaultItem\r\n ? merge(defaultItem, omit({ ...item }, "type"))\r\n : { ...item };\r\n }\r\n }\r\n if (customItem) {\r\n if (customItem.type === "button") {\r\n if (customItem.onActive) customItem.active = customItem.onActive();\r\n else if (this.engine.command.queryEnabled(customItem.name))\r\n customItem.active = this.engine.command.queryState(\r\n customItem.name\r\n );\r\n } else if (customItem.type === "dropdown") {\r\n if (customItem.onActive)\r\n customItem.values = customItem.onActive(customItem.items);\r\n else\r\n customItem.values = this.engine.command.queryState(\r\n customItem.name\r\n );\r\n }\r\n if (customItem.type !== "collapse")\r\n customItem.disabled = customItem.onDisabled\r\n ? customItem.onDisabled()\r\n : !this.engine.command.queryEnabled(customItem.name);\r\n else {\r\n customItem.groups.forEach((group) =>\r\n group.items.forEach((item) => {\r\n item.disabled = item.onDisabled\r\n ? item.onDisabled()\r\n : !this.engine.command.queryEnabled(item.name);\r\n })\r\n );\r\n customItem.disabled = !customItem.groups.some((g) =>\r\n g.items.some((item) => !item.disabled)\r\n );\r\n }\r\n dataGroup.items.push(customItem);\r\n }\r\n });\r\n if (dataGroup.items.length > 0) data.push(dataGroup);\r\n });\r\n this.groupValue = data;\r\n }\r\n\r\n preventDefault(event: MouseEvent) {\r\n event.preventDefault();\r\n }\r\n triggerMouseOver(event: MouseEvent) {\r\n this.preventDefault(event);\r\n }\r\n triggerMouseMove(event: MouseEvent) {\r\n this.preventDefault(event);\r\n }\r\n triggerContextMenu(event: MouseEvent) {\r\n this.preventDefault(event);\r\n }\r\n}\r\n\r\nexport { getToolbarDefaultConfig, fontFamilyDefaultData, fontfamily };\r\n<\/script>\r\n<style>\r\n.ant-tooltip .toolbar-tooltip-title {\r\n font-size: 12px;\r\n text-align: center;\r\n}\r\n\r\n.ant-tooltip .toolbar-tooltip-hotkey {\r\n font-size: 12px;\r\n color: rgba(255, 255, 255, 0.85);\r\n text-align: center;\r\n}\r\n\r\n.editor-toolbar {\r\n position: relative;\r\n width: 100%;\r\n padding: 0;\r\n z-index: 200;\r\n border-top: 1px solid rgba(0, 0, 0, 0.05);\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.05);\r\n user-select: none;\r\n}\r\n\r\n.editor-toolbar .editor-toolbar-content {\r\n position: relative;\r\n flex-direction: row;\r\n background: transparent;\r\n text-align: center;\r\n width: 100%;\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\r\n}\r\n\r\n.editor-toolbar.editor-toolbar-mobile,\r\n.editor-toolbar.editor-toolbar-popover {\r\n position: absolute;\r\n left: 0;\r\n box-shadow: none;\r\n}\r\n\r\n.editor-toolbar.editor-toolbar-popup {\r\n position: initial;\r\n box-shadow: none;\r\n top: 0;\r\n left: 0;\r\n border: 0 none;\r\n}\r\n\r\n.editor-toolbar-mobile .editor-toolbar-content {\r\n text-align: left;\r\n padding: 0 12px;\r\n}\r\n\r\n.editor-toolbar-mobile .editor-toolbar-group,\r\n.editor-toolbar-popup .editor-toolbar-group {\r\n border: 0 none;\r\n padding: 0;\r\n}\r\n\r\n.editor-toolbar-popup .editor-toolbar-content {\r\n text-align: center;\r\n padding: 0;\r\n}\r\n\r\n.editor-toolbar-popover .editor-toolbar {\r\n position: relative;\r\n box-shadow: none;\r\n border: 0 none;\r\n left: 0;\r\n top: 0;\r\n display: flex;\r\n}\r\n\r\n.editor-toolbar-popover {\r\n border-radius: 3px;\r\n background: transparent;\r\n}\r\n\r\n.editor-toolbar-popover .ant-popover-inner {\r\n border-radius: 3px;\r\n}\r\n\r\n.editor-toolbar-popover .ant-popover-inner-content {\r\n padding: 2px;\r\n}\r\n\r\n.am-engine-mobile {\r\n margin-bottom: 40px;\r\n}\r\n</style>\r\n']},media:void 0})},Yn=void 0,Xn=void 0,Kn=!1,Zn=mt({render:Wn,staticRenderFns:$n},Gn,Un,Yn,Kn,Xn,!1,yt,void 0,void 0),Jn=z("position"),Qn=function(){function t(e,n){var r=this;w(this,t),Object.defineProperty(this,Jn,{writable:!0,value:void 0}),this.SCOPE_NAME="data-toolbar-component",this.handlePreventDefault=function(t){var e;if(0!==(null===(e=r.root)||void 0===e?void 0:e.closest("body").length))return t.preventDefault(),!1},this.otpions=n,this.engine=e,H(this,Jn)[Jn]=new a.Position(e)}return C(t,[{key:"select",value:function(t){var e,n,r;null===(e=this.root)||void 0===e||e.find(".toolbar-collapse-item-active").removeClass("toolbar-collapse-item-active"),null===(n=this.root)||void 0===n||null===(r=n.find(".toolbar-collapse-item").eq(t))||void 0===r||r.addClass("toolbar-collapse-item-active")}},{key:"scroll",value:function(t){if(this.root){var e=this.root.find(".toolbar-collapse-item").toArray(),n=this.root.find(".toolbar-collapse-item-active"),r=e.findIndex((function(t){return t.equal(n)})),i="up"===t?r-1:r+1;i<0&&(i=e.length-1),i>=e.length&&(i=0),n=e[i],this.select(i);var o=0;this.root.find(".toolbar-collapse-group-title,.toolbar-collapse-item").each((function(t){if(n.equal(t))return!1;o+=t.clientHeight}));var a=this.root.get();a.scrollTop=o-a.clientHeight/2}}},{key:"unbindEvents",value:function(){u.deleteScope(this.SCOPE_NAME),u.unbind("enter",this.SCOPE_NAME),u.unbind("up",this.SCOPE_NAME),u.unbind("down",this.SCOPE_NAME),u.unbind("esc",this.SCOPE_NAME),this.engine.off("keydown:enter",this.handlePreventDefault)}},{key:"bindEvents",value:function(){var t=this;this.unbindEvents(),u.setScope(this.SCOPE_NAME),m["default"]("enter",this.SCOPE_NAME,(function(e){var n,r,i;if(0!==(null===(n=t.root)||void 0===n?void 0:n.closest("body").length)){e.preventDefault();var o=null===(r=t.root)||void 0===r?void 0:r.find(".toolbar-collapse-item-active");null===o||void 0===o||null===(i=o.get())||void 0===i||i.click()}})),m["default"]("up",this.SCOPE_NAME,(function(e){var n;0!==(null===(n=t.root)||void 0===n?void 0:n.closest("body").length)&&(e.preventDefault(),t.scroll("up"))})),m["default"]("down",this.SCOPE_NAME,(function(e){var n;0!==(null===(n=t.root)||void 0===n?void 0:n.closest("body").length)&&(e.preventDefault(),t.scroll("down"))})),m["default"]("esc",this.SCOPE_NAME,(function(e){e.preventDefault(),t.unbindEvents();var n=t.otpions.onCancel;n&&n()})),this.engine.on("keydown:enter",this.handlePreventDefault)}},{key:"remove",value:function(){var t;this.root&&0!==this.root.length&&(null===(t=H(this,Jn)[Jn])||void 0===t||t.destroy(),this.vm&&(this.vm.$destroy(),this.vm=void 0),this.root.remove(),this.root=void 0)}},{key:"render",value:function(t,e,n){var r,i=this;this.unbindEvents(),this.remove(),this.root=a.$('<div class="data-toolbar-component-list" />'),t.append(this.root);var o=this.root.get(),s=this.otpions.onSelect;if(n.length>0){var l=this.engine;this.vm=new h["default"]({render:function(t){return t(pn,{props:{engine:l,groups:n,onSelect:s}})}}),o.append(this.vm.$mount().$el)}else this.root.append('<div class="data-toolbar-component-list-empty">'.concat(this.engine.language.get("toolbar","searchEmtpy","title"),"</div>"));this.bindEvents(),null===(r=H(this,Jn)[Jn])||void 0===r||r.bind(this.root,e),setTimeout((function(){i.select(0)}),0)}}]),t}(),tr=z("editor"),er=z("root"),nr=z("point"),rr=z("align"),ir=z("options"),or=z("vm"),ar=function(){function t(e){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};w(this,t),Object.defineProperty(this,tr,{writable:!0,value:void 0}),Object.defineProperty(this,er,{writable:!0,value:void 0}),Object.defineProperty(this,nr,{writable:!0,value:void 0}),Object.defineProperty(this,rr,{writable:!0,value:void 0}),Object.defineProperty(this,ir,{writable:!0,value:void 0}),Object.defineProperty(this,or,{writable:!0,value:void 0}),H(this,nr)[nr]={left:0,top:-9999},H(this,rr)[rr]="bottom",H(this,ir)[ir]={},this.onSelect=function(){var t,e=null===(t=a.Range.from(H(i,tr)[tr]))||void 0===t?void 0:t.cloneRange().shrinkToTextNode(),n=window.getSelection();if(e&&n&&n.focusNode&&!e.collapsed&&!H(i,tr)[tr].card.getSingleSelectedCard(e)&&(e.commonAncestorNode.inEditor(H(i,tr)[tr].container)||e.commonAncestorNode.isRoot(H(i,tr)[tr].container))){var r=e.startNode.next();if((null===r||void 0===r?void 0:r.isElement())&&1===Math.abs(e.endOffset-e.startOffset)){var o=H(i,tr)[tr].card.closest(r);if(o)return void i.hide()}var s=e.startNode.prev();if((null===s||void 0===s?void 0:s.isElement())&&1===Math.abs(e.startOffset-e.endOffset)){var l=H(i,tr)[tr].card.closest(s);if(l)return void i.hide()}var c=e.getSubRanges();if(0===c.length||H(i,tr)[tr].card.active&&!H(i,tr)[tr].card.active.isEditable)i.hide();else{var u=c[0],d=c[c.length-1],h=u.cloneRange().collapse(!0).getBoundingClientRect(),p=d.cloneRange().collapse(!1).getBoundingClientRect(),f=void 0;i.showContent((function(){var t,e,r;if(f=null===(t=H(i,er)[er].get())||void 0===t?void 0:t.getBoundingClientRect(),f){H(i,rr)[rr]=d.startNode.equal(n.focusNode)&&(!u.startNode.equal(n.focusNode)||n.focusOffset>n.anchorOffset)?"bottom":"top";var o=12,a="bottom"===H(i,rr)[rr]?p:h;"top"===H(i,rr)[rr]&&a.top-f.height-o<window.innerHeight-((null===(e=H(i,tr)[tr].scrollNode)||void 0===e?void 0:e.height())||0)?H(i,rr)[rr]="bottom":"bottom"===H(i,rr)[rr]&&a.bottom+f.height+o>window.innerHeight&&(H(i,rr)[rr]="top"),a="bottom"===H(i,rr)[rr]?p:h;var s=null===(r=H(i,tr)[tr].scrollNode)||void 0===r?void 0:r.get(),l=null===s||void 0===s?void 0:s.getBoundingClientRect(),c="top"===H(i,rr)[rr]?a.top-f.height-o-((null===l||void 0===l?void 0:l.top)||0)+((null===s||void 0===s?void 0:s.scrollTop)||0):a.bottom+o-((null===l||void 0===l?void 0:l.top)||0)+((null===s||void 0===s?void 0:s.scrollTop)||0),g=a.left-((null===l||void 0===l?void 0:l.left)||0)+((null===s||void 0===s?void 0:s.scrollLeft)||0)+a.width-f.width/2;g<0&&(g=16),H(i,nr)[nr]={left:g,top:c},H(i,er)[er].css({left:"".concat(H(i,nr)[nr].left,"px"),top:"".concat(H(i,nr)[nr].top,"px")})}else i.hide()}))}}else i.hide()},this.hide=function(t){if(null===t||void 0===t?void 0:t.target){var e=a.$(t.target);if(e.closest(".data-toolbar-popup-wrapper").length>0||e.closest(a.UI_SELECTOR).length>0)return}H(i,er)[er].css({left:"0px",top:"-9999px"})},H(this,ir)[ir]=o,H(this,tr)[tr]=e,H(this,er)[er]=a.$('<div class="data-toolbar-popup-wrapper"></div>'),((null===(n=H(this,tr)[tr].scrollNode)||void 0===n?void 0:n.get())||document.body).appendChild(H(this,er)[er][0]),a.isEngine(e)?H(this,tr)[tr].on("select",this.onSelect):document.addEventListener("selectionchange",this.onSelect),a.isMobile||window.addEventListener("scroll",this.onSelect),window.addEventListener("resize",this.onSelect),null===(r=H(this,tr)[tr].scrollNode)||void 0===r||r.on("scroll",this.onSelect),document.addEventListener("mousedown",this.hide)}return C(t,[{key:"showContent",value:function(t){var e,n=this,r=H(this,tr)[tr].trigger("toolbar-render",H(this,ir)[ir]);if(!r&&0===(H(this,ir)[ir].items||[]).length)return null===(e=H(this,or)[or])||void 0===e||e.$destroy(),H(this,or)[or]=void 0,void this.hide();var i,o=Zn;"object"===y(r)&&(null===(i=H(this,or)[or])||void 0===i||i.$destroy(),H(this,or)[or]=void 0,o=r);H(this,or)[or]||(H(this,or)[or]=new h["default"]({render:function(t){return t(o,{props:b(b({},H(n,ir)[ir]),{},{engine:H(n,tr)[tr],popup:!0})})}}),H(this,er)[er].empty().append(H(this,or)[or].$mount().$el)),setTimeout((function(){t&&t()}),200)}},{key:"destroy",value:function(){var t;H(this,er)[er].remove(),a.isEngine(H(this,tr)[tr])?H(this,tr)[tr].off("select",this.onSelect):document.removeEventListener("selectionchange",this.onSelect),a.isMobile||window.removeEventListener("scroll",this.onSelect),window.removeEventListener("resize",this.onSelect),null===(t=H(this,tr)[tr].scrollNode)||void 0===t||t.off("scroll",this.onSelect),document.removeEventListener("mousedown",this.hide),H(this,or)[or]&&(H(this,or)[or].$destroy(),H(this,or)[or]=void 0)}}]),t}(),sr=".data-toolbar-component-list {\n position: absolute;\n min-height: 0px;\n top: 10px;\n left: 0;\n}\n\n.data-toolbar-component-list .toolbar-dropdown-list {\n top:0px;\n position: relative;\n}\n\n.data-toolbar-component-placeholder {\n color: rgba(0,0,0,0.25);\n pointer-events: none;\n width: 76px;\n}\n\n.data-toolbar-component-list-empty {\n position: relative;\n font-size: 14px;\n background: #ffffff;\n border: 1px solid #e8e8e8;\n border-radius: 3px 3px;\n box-shadow: 0 2px 10px rgb(0 0 0 / 12%);\n padding: 5px 16px;\n line-height: 32px;\n min-width: 200px;\n height: auto;\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n z-index: 999;\n max-height: calc(80vh);\n overflow: auto;\n}\n/** ------------------- popup ---------------------- **/\n.data-toolbar-popup-wrapper {\n position: absolute;\n z-index: 9999;\n padding: 4px;\n background-color: #fff;\n border-radius: 4px;\n border: 1px solid #dee0e3;\n box-shadow: 0 4px 8px 0 rgba(31, 35, 41, 0.1);\n}\n\n.data-toolbar-popup-wrapper .editor-toolbar-popover {\n width: -webkit-max-content;\n width: -moz-max-content;\n width: max-content;\n}\n\n.data-toolbar-popup-wrapper .editor-toolbar-popover .ant-popover-inner-content {\n padding: 4px;\n background-color: #fff;\n border-radius: 4px;\n border: 1px solid #dee0e3;\n}\n\n.data-toolbar-popup-wrapper .editor-toolbar-popover .ant-popover-arrow {\n display: none;\n}";Bn(sr);var lr=z("collapseData"),cr=z("data"),ur=function(t){A(n,t);var e=M(n);function n(){var t;w(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Object.defineProperty(T(t),lr,{writable:!0,value:void 0}),Object.defineProperty(T(t),cr,{writable:!0,value:void 0}),t}return C(n,[{key:"init",value:function(){var t=this;a.isEngine(this.editor)&&!a.isServer&&(this.component=new Qn(this.editor,{onCancel:function(){t.changeToText()},onSelect:function(){t.remove()}}))}},{key:"setData",value:function(t){H(this,cr)[cr]=t}},{key:"getData",value:function(){var t=this;if(!a.isEngine(this.editor))return[];var e=[],n=Hn(this.editor),r=n.find((function(t){var e=t.type;return"collapse"===e})),i=[];r&&(i=r.groups);var o=[];i.forEach((function(t){o.push.apply(o,L(t.items))}));var s=this.getValue();return(H(this,cr)[cr]||(s?s.data:[])||[]).forEach((function(n){var r=n.title,i=[];n.items.forEach((function(e){var n=e;"string"!==typeof e&&(n=e.name);var r=o.find((function(t){return t.name===n}));r?i.push(b(b(b({},r),"string"!==typeof e?e:{}),{},{disabled:r.onDisabled?r.onDisabled():!t.editor.command.queryEnabled(n)})):"object"===y(e)&&i.push(e)})),e.push({title:r,items:i})})),e}},{key:"search",value:function(t){var e=[];"string"===typeof t&&(t=t.toLowerCase()),H(this,lr)[lr]||(H(this,lr)[lr]=[]),H(this,lr)[lr].forEach((function(n){n.items.forEach((function(n){n.search&&n.search.toLowerCase().indexOf(t)>=0&&(e.find((function(t){var e=t.name;return e===n.name}))||e.push(b({},n)))}))}));var n=[];return e.length>0&&n.push({title:"",items:e}),n}},{key:"remove",value:function(){var t;a.isEngine(this.editor)&&(null===(t=this.component)||void 0===t||t.remove(),this.editor.card.remove(this.id))}},{key:"changeToText",value:function(){var t,e;if(this.root.inEditor()&&a.isEngine(this.editor)){var n=(null===(t=this.keyword)||void 0===t||null===(e=t.get())||void 0===e?void 0:e.innerText)||"";this.remove(),this.editor.node.insertText(n)}}},{key:"destroy",value:function(){var t,e;null===(t=this.component)||void 0===t||t.unbindEvents(),null===(e=this.component)||void 0===e||e.remove()}},{key:"activate",value:function(t){var e;(P(S(n.prototype),"activate",this).call(this,t),t)||(null===(e=this.component)||void 0===e||e.unbindEvents(),this.changeToText())}},{key:"handleInput",value:function(){var t,e,n;if(a.isEngine(this.editor)){var r=this.editor,i=r.change,o=r.card;if(!i.isComposing()){var s,l=(null===(t=this.keyword)||void 0===t||null===(e=t.get())||void 0===e?void 0:e.innerText.replace(/[\r\n]/g,""))||"";if(""===l)return null===(s=this.component)||void 0===s||s.remove(),void o.remove(this.id);var c=l.substr(1);if(""!==c){var u=this.search(c);null===(n=this.component)||void 0===n||n.render(this.editor.root,this.root,u)}else{var d;null===(d=this.component)||void 0===d||d.render(this.editor.root,this.root,H(this,lr)[lr]||[])}}}}},{key:"resetPlaceHolder",value:function(){var t,e,n,r;"/"===(null===(t=this.keyword)||void 0===t||null===(e=t.get())||void 0===e?void 0:e.innerText)?null===(n=this.placeholder)||void 0===n||n.show():null===(r=this.placeholder)||void 0===r||r.hide()}},{key:"render",value:function(t){var e,n,r,i=this;this.setData(t);var o=this.editor;if(a.isEngine(o)&&!a.isServer){var s=o.language.get("toolbar","component");this.root.attributes("data-transient","true"),this.root.attributes("contenteditable","false");var l=a.$('<span class="data-toolbar-component-keyword" contenteditable="true">/</span><span class="data-toolbar-component-placeholder">'.concat(s["placeholder"],"</span>")),c=this.getCenter();c.empty().append(l),this.keyword=c.find(".data-toolbar-component-keyword"),this.placeholder=c.find(".data-toolbar-component-placeholder"),null===(e=this.keyword)||void 0===e||e.on("keydown",(function(t){a.isHotkey("enter",t)&&t.preventDefault()}));var u=Date.now();null===(n=this.keyword)||void 0===n||n.on("input",(function(){if(i.resetPlaceHolder(),Date.now()-u<200){var t,e,n=null===(t=i.keyword)||void 0===t?void 0:t.first();if(n&&n.isText()&&"/、"===n[0].nodeValue||"//"===(null===n||void 0===n||null===(e=n.get())||void 0===e?void 0:e.nodeValue)){var r,o=null===(r=n.get())||void 0===r?void 0:r.splitText(1);null===o||void 0===o||o.remove()}}setTimeout((function(){i.handleInput()}),10)})),H(this,lr)[lr]||(H(this,lr)[lr]=this.getData()),null===(r=this.component)||void 0===r||r.render(o.root,this.root,H(this,lr)[lr])}}}],[{key:"cardName",get:function(){return"toolbar"}},{key:"cardType",get:function(){return a.CardType.INLINE}},{key:"singleSelectable",get:function(){return!1}},{key:"autoSelected",get:function(){return!1}}]),n}(a.Card),dr=function(t){return[{title:t.language.get("toolbar","commonlyUsed","title"),items:["image-uploader","codeblock","table","file-uploader","video-uploader","math","status"]}]},hr=function(t){A(n,t);var e=M(n);function n(){var t;return w(this,n),t=e.apply(this,arguments),t.paserValue=function(t){return!t.isCard()||t.attributes("name")!==ur.cardName},t.onSlash=function(e){if(a.isEngine(t.editor)){var n=t.editor.change,r=n.range.get(),i=t.editor.block.closest(r.startNode),o=i.text().trim();if("/"===o&&a.isSafari&&i.empty(),(""===o||"/"===o&&a.isSafari||e.ctrlKey||e.metaKey)&&(r=n.range.get(),r.collapsed)){e.preventDefault();var s=t.options.config||dr(t.editor),l=t.editor.card.insert(ur.cardName,{},s);l.setData(s),t.editor.card.activate(l.root),r=n.range.get();var c=l.find(".data-toolbar-component-keyword");r.select(c,!0),r.collapse(!1),n.range.select(r)}}},t}return C(n,[{key:"init",value:function(){a.isEngine(this.editor)&&(this.editor.on("keydown:slash",this.onSlash),this.editor.on("parse:value",this.paserValue)),this.editor.language.add(En),this.options.popup&&(this.popup=new ar(this.editor,{items:this.options.popup.items}))}},{key:"execute",value:function(){throw new Error("Method not implemented.")}},{key:"destroy",value:function(){var t;null===(t=this.popup)||void 0===t||t.destroy(),this.editor.off("keydown:slash",this.onSlash),this.editor.off("parse:value",this.paserValue)}}],[{key:"pluginName",get:function(){return"toolbar"}}]),n}(a.Plugin);e.ToolbarComponent=ur,e.ToolbarPlugin=hr,e.default=Zn,e.fontFamilyDefaultData=Rn,e.fontfamily=Fn,e.getToolbarDefaultConfig=Hn}).call(this,n("c8ba"))},"313d":function(t,e,n){var r=n("23e7"),i=n("d066"),o=n("e330"),a=n("d039"),s=n("577e"),l=n("d6d6"),c=n("b917").itoc,u=i("btoa"),d=o("".charAt),h=o("".charCodeAt),p=!!u&&!a((function(){u()})),f=!!u&&a((function(){return"bnVsbA=="!==u(null)})),g=!!u&&1!==u.length;r({global:!0,enumerable:!0,forced:p||f||g},{btoa:function(t){if(l(arguments.length,1),p||f||g)return u(s(t));var e,n,r=s(t),o="",a=0,m=c;while(d(r,a)||(m="=",a%1)){if(n=h(r,a+=3/4),n>255)throw new(i("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");e=e<<8|n,o+=d(m,63&e>>8-a%1*8)}return o}})},"31c5":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";var e="CodeMirror-activeline",n="CodeMirror-activeline-background",r="CodeMirror-activeline-gutter";function i(t){for(var i=0;i<t.state.activeLines.length;i++)t.removeLineClass(t.state.activeLines[i],"wrap",e),t.removeLineClass(t.state.activeLines[i],"background",n),t.removeLineClass(t.state.activeLines[i],"gutter",r)}function o(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function a(t,a){for(var s=[],l=0;l<a.length;l++){var c=a[l],u=t.getOption("styleActiveLine");if("object"==typeof u&&u.nonEmpty?c.anchor.line==c.head.line:c.empty()){var d=t.getLineHandleVisualStart(c.head.line);s[s.length-1]!=d&&s.push(d)}}o(t.state.activeLines,s)||t.operation((function(){i(t);for(var o=0;o<s.length;o++)t.addLineClass(s[o],"wrap",e),t.addLineClass(s[o],"background",n),t.addLineClass(s[o],"gutter",r);t.state.activeLines=s}))}function s(t,e){a(t,e.ranges)}t.defineOption("styleActiveLine",!1,(function(e,n,r){var o=r!=t.Init&&r;n!=o&&(o&&(e.off("beforeSelectionChange",s),i(e),delete e.state.activeLines),n&&(e.state.activeLines=[],a(e,e.listSelections()),e.on("beforeSelectionChange",s)))}))}))},3280:function(t,e,n){"use strict";var r=n("ebb5"),i=n("2ba4"),o=n("e58c"),a=r.aTypedArray,s=r.exportTypedArrayMethod;s("lastIndexOf",(function(t){var e=arguments.length;return i(o,a(this),e>1?[t,arguments[1]]:[t])}))},"33c5":function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"isArray",(function(){return vt["a"]})),n.d(r,"isArrayLike",(function(){return bt["a"]})),n.d(r,"uniq",(function(){return yt["a"]})),n.d(r,"union",(function(){return wt["a"]})),n.d(r,"sortedIndex",(function(){return xt["a"]})),n.d(r,"sortedIndexBy",(function(){return Ct["a"]})),n.d(r,"sortBy",(function(){return kt["a"]})),n.d(r,"groupBy",(function(){return At["a"]})),n.d(r,"difference",(function(){return St["a"]})),n.d(r,"max",(function(){return Et["a"]})),n.d(r,"diff",(function(){return Ot}));var i={};n.r(i),n.d(i,"has",(function(){return _t["a"]})),n.d(i,"pick",(function(){return Mt["a"]})),n.d(i,"forIn",(function(){return Nt["a"]})),n.d(i,"merge",(function(){return Pt["a"]})),n.d(i,"extend",(function(){return Lt["a"]})),n.d(i,"isEqual",(function(){return Dt["a"]})),n.d(i,"isEmpty",(function(){return jt["a"]})),n.d(i,"isObject",(function(){return It["a"]})),n.d(i,"isPlainObject",(function(){return Rt["a"]})),n.d(i,"clone",(function(){return Ft["a"]})),n.d(i,"cloneDeep",(function(){return Bt["a"]})),n.d(i,"defaults",(function(){return zt["a"]})),n.d(i,"defaultsDeep",(function(){return Ht["a"]})),n.d(i,"applyMixins",(function(){return Vt})),n.d(i,"inherit",(function(){return Ut})),n.d(i,"createClass",(function(){return Gt})),n.d(i,"ensure",(function(){return Yt})),n.d(i,"getValue",(function(){return Xt})),n.d(i,"getNumber",(function(){return Kt})),n.d(i,"getBoolean",(function(){return Zt})),n.d(i,"isMaliciousProp",(function(){return Jt})),n.d(i,"getByPath",(function(){return Qt})),n.d(i,"setByPath",(function(){return te})),n.d(i,"unsetByPath",(function(){return ee})),n.d(i,"flatten",(function(){return ne}));var o={};n.r(o),n.d(o,"isString",(function(){return re["a"]})),n.d(o,"toString",(function(){return ie["a"]})),n.d(o,"escape",(function(){return oe["a"]})),n.d(o,"unescape",(function(){return ae["a"]})),n.d(o,"startsWith",(function(){return se["a"]})),n.d(o,"endsWith",(function(){return le["a"]})),n.d(o,"split",(function(){return ce["a"]})),n.d(o,"repeat",(function(){return ue["a"]})),n.d(o,"pad",(function(){return de["a"]})),n.d(o,"padEnd",(function(){return he["a"]})),n.d(o,"padStart",(function(){return pe["a"]})),n.d(o,"truncate",(function(){return fe["a"]})),n.d(o,"template",(function(){return ge["a"]})),n.d(o,"uniqueId",(function(){return me["a"]})),n.d(o,"eval",(function(){return ve})),n.d(o,"lowerFirst",(function(){return ke["a"]})),n.d(o,"upperFirst",(function(){return Ce["a"]})),n.d(o,"camelCase",(function(){return ye["a"]})),n.d(o,"kebabCase",(function(){return Se})),n.d(o,"pascalCase",(function(){return Ee})),n.d(o,"constantCase",(function(){return Oe})),n.d(o,"dotCase",(function(){return Te})),n.d(o,"pathCase",(function(){return _e})),n.d(o,"sentenceCase",(function(){return Me})),n.d(o,"titleCase",(function(){return Ne})),n.d(o,"hashcode",(function(){return Pe})),n.d(o,"uuid",(function(){return Le})),n.d(o,"sanitizeHTML",(function(){return De})),n.d(o,"getSpellingSuggestion",(function(){return je}));var a={};n.r(a),n.d(a,"isNaN",(function(){return Re["a"]})),n.d(a,"isNumber",(function(){return Fe["a"]})),n.d(a,"isFinite",(function(){return Be["a"]})),n.d(a,"isInteger",(function(){return ze["a"]})),n.d(a,"isSafeInteger",(function(){return He["a"]})),n.d(a,"clamp",(function(){return Ve["a"]})),n.d(a,"inRange",(function(){return qe["a"]})),n.d(a,"toFinite",(function(){return Ue["a"]})),n.d(a,"toNumber",(function(){return We["a"]})),n.d(a,"toInteger",(function(){return $e["a"]})),n.d(a,"toSafeInteger",(function(){return Ge["a"]})),n.d(a,"parseInt",(function(){return Ye["a"]})),n.d(a,"isNumeric",(function(){return mt})),n.d(a,"mod",(function(){return Xe})),n.d(a,"random",(function(){return Ke})),n.d(a,"isPercentage",(function(){return Ze})),n.d(a,"normalizePercentage",(function(){return Je})),n.d(a,"parseCssNumeric",(function(){return Qe})),n.d(a,"normalizeSides",(function(){return tn}));var s={};n.r(s),n.d(s,"isFunction",(function(){return en["a"]})),n.d(s,"once",(function(){return nn["a"]})),n.d(s,"noop",(function(){return rn["a"]})),n.d(s,"debounce",(function(){return on["a"]})),n.d(s,"defer",(function(){return an["a"]})),n.d(s,"apply",(function(){return sn})),n.d(s,"call",(function(){return ln})),n.d(s,"cacher",(function(){return un})),n.d(s,"isAsyncLike",(function(){return dn})),n.d(s,"isAsync",(function(){return hn})),n.d(s,"toAsyncBoolean",(function(){return pn})),n.d(s,"toDeferredBoolean",(function(){return fn}));var l={};n.r(l),n.d(l,"annotate",(function(){return rr})),n.d(l,"findAnnotationsAtIndex",(function(){return ir})),n.d(l,"findAnnotationsBetweenIndexes",(function(){return or})),n.d(l,"shiftAnnotations",(function(){return ar})),n.d(l,"sanitize",(function(){return sr}));var c={};n.r(c),n.d(c,"requestAnimationFrame",(function(){return pr})),n.d(c,"cancelAnimationFrame",(function(){return fr})),n.d(c,"getAttribute",(function(){return Yn})),n.d(c,"removeAttribute",(function(){return Xn})),n.d(c,"setAttribute",(function(){return Kn})),n.d(c,"setAttributes",(function(){return Zn})),n.d(c,"attr",(function(){return Jn})),n.d(c,"qualifyAttr",(function(){return Qn})),n.d(c,"kebablizeAttrs",(function(){return tr})),n.d(c,"styleToObject",(function(){return er})),n.d(c,"mergeAttrs",(function(){return nr})),n.d(c,"uniqueId",(function(){return An})),n.d(c,"ensureId",(function(){return Sn})),n.d(c,"isSVGGraphicsElement",(function(){return En})),n.d(c,"ns",(function(){return On})),n.d(c,"svgVersion",(function(){return Tn})),n.d(c,"createElement",(function(){return _n})),n.d(c,"createElementNS",(function(){return Mn})),n.d(c,"createSvgElement",(function(){return Nn})),n.d(c,"createSvgDocument",(function(){return Pn})),n.d(c,"parseXML",(function(){return Ln})),n.d(c,"tagName",(function(){return Dn})),n.d(c,"index",(function(){return jn})),n.d(c,"find",(function(){return In})),n.d(c,"findOne",(function(){return Rn})),n.d(c,"findParentByClass",(function(){return Fn})),n.d(c,"contains",(function(){return Bn})),n.d(c,"remove",(function(){return zn})),n.d(c,"empty",(function(){return Hn})),n.d(c,"append",(function(){return Vn})),n.d(c,"prepend",(function(){return qn})),n.d(c,"before",(function(){return Un})),n.d(c,"appendTo",(function(){return Wn})),n.d(c,"isHTMLElement",(function(){return $n})),n.d(c,"getClass",(function(){return bn})),n.d(c,"hasClass",(function(){return yn})),n.d(c,"addClass",(function(){return wn})),n.d(c,"removeClass",(function(){return xn})),n.d(c,"toggleClass",(function(){return Cn})),n.d(c,"setPrefixedStyle",(function(){return Cr})),n.d(c,"getComputedStyle",(function(){return kr})),n.d(c,"hasScrollbars",(function(){return Ar})),n.d(c,"getVendorPrefixedName",(function(){return xr})),n.d(c,"clearSelection",(function(){return Sr})),n.d(c,"text",(function(){return hi})),n.d(c,"breakText",(function(){return fi})),n.d(c,"KAPPA",(function(){return gi})),n.d(c,"sample",(function(){return vi})),n.d(c,"lineToPathData",(function(){return bi})),n.d(c,"polygonToPathData",(function(){return yi})),n.d(c,"polylineToPathData",(function(){return wi})),n.d(c,"getPointsFromSvgElement",(function(){return Ci})),n.d(c,"circleToPathData",(function(){return ki})),n.d(c,"ellipseToPathData",(function(){return Ai})),n.d(c,"rectangleToPathData",(function(){return Si})),n.d(c,"rectToPathData",(function(){return Ei})),n.d(c,"toPath",(function(){return Oi})),n.d(c,"toPathData",(function(){return Ti})),n.d(c,"createSlicePathData",(function(){return _i})),n.d(c,"bbox",(function(){return Ki})),n.d(c,"getBBox",(function(){return Zi})),n.d(c,"getBBoxByElementAttr",(function(){return Ji})),n.d(c,"getMatrixByElementAttr",(function(){return Qi})),n.d(c,"getTransformToElement",(function(){return to})),n.d(c,"toLocalPoint",(function(){return eo})),n.d(c,"toGeometryShape",(function(){return no})),n.d(c,"getIntersection",(function(){return ro})),n.d(c,"animate",(function(){return io})),n.d(c,"animateTransform",(function(){return oo})),n.d(c,"animateAlongPath",(function(){return lo})),n.d(c,"getBoundingOffsetRect",(function(){return co})),n.d(c,"createSVGPoint",(function(){return Di})),n.d(c,"createSVGMatrix",(function(){return ji})),n.d(c,"createSVGTransform",(function(){return Ii})),n.d(c,"transformStringToMatrix",(function(){return Ri})),n.d(c,"matrixToTransformString",(function(){return Fi})),n.d(c,"parseTransformString",(function(){return Bi})),n.d(c,"decomposeMatrix",(function(){return Hi})),n.d(c,"matrixToScale",(function(){return Vi})),n.d(c,"matrixToRotation",(function(){return qi})),n.d(c,"matrixToTranslation",(function(){return Ui})),n.d(c,"transformPoint",(function(){return Wi})),n.d(c,"transformLine",(function(){return $i})),n.d(c,"transformPolyline",(function(){return Gi})),n.d(c,"transformRectangle",(function(){return Yi})),n.d(c,"transform",(function(){return uo})),n.d(c,"translate",(function(){return ho})),n.d(c,"rotate",(function(){return po})),n.d(c,"scale",(function(){return fo})),n.d(c,"translateAndAutoOrient",(function(){return go})),n.d(c,"MouseWheelHandle",(function(){return mo})),n.d(c,"isVector",(function(){return vo})),n.d(c,"createVector",(function(){return bo})),n.d(c,"createVectors",(function(){return yo}));var u={};n.r(u),n.d(u,"block",(function(){return Sa})),n.d(u,"classic",(function(){return Ea})),n.d(u,"diamond",(function(){return _a})),n.d(u,"path",(function(){return Na})),n.d(u,"cross",(function(){return La})),n.d(u,"async",(function(){return ja})),n.d(u,"circle",(function(){return Ra})),n.d(u,"circlePlus",(function(){return Fa})),n.d(u,"ellipse",(function(){return za}));var d={};n.r(d),n.d(d,"ref",(function(){return To})),n.d(d,"refX",(function(){return _o})),n.d(d,"refY",(function(){return Mo})),n.d(d,"refDx",(function(){return No})),n.d(d,"refDy",(function(){return Po})),n.d(d,"refWidth",(function(){return Lo})),n.d(d,"refHeight",(function(){return Do})),n.d(d,"refRx",(function(){return jo})),n.d(d,"refRy",(function(){return Io})),n.d(d,"refRInscribed",(function(){return Ro})),n.d(d,"refRCircumscribed",(function(){return Fo})),n.d(d,"refCx",(function(){return Bo})),n.d(d,"refCy",(function(){return zo})),n.d(d,"refDResetOffset",(function(){return Ho})),n.d(d,"refDKeepOffset",(function(){return Vo})),n.d(d,"refPointsResetOffset",(function(){return qo})),n.d(d,"refPointsKeepOffset",(function(){return Uo})),n.d(d,"refR",(function(){return Wo})),n.d(d,"refD",(function(){return $o})),n.d(d,"refPoints",(function(){return Go})),n.d(d,"refX2",(function(){return Yo})),n.d(d,"refY2",(function(){return Xo})),n.d(d,"refWidth2",(function(){return Ko})),n.d(d,"refHeight2",(function(){return Zo})),n.d(d,"fill",(function(){return ra})),n.d(d,"stroke",(function(){return ia})),n.d(d,"text",(function(){return oa})),n.d(d,"textWrap",(function(){return aa})),n.d(d,"lineHeight",(function(){return la})),n.d(d,"textVerticalAnchor",(function(){return ca})),n.d(d,"textPath",(function(){return ua})),n.d(d,"annotations",(function(){return da})),n.d(d,"eol",(function(){return ha})),n.d(d,"displayEmpty",(function(){return pa})),n.d(d,"title",(function(){return fa})),n.d(d,"xAlign",(function(){return ga})),n.d(d,"yAlign",(function(){return ma})),n.d(d,"resetOffset",(function(){return va})),n.d(d,"style",(function(){return ya})),n.d(d,"html",(function(){return wa})),n.d(d,"filter",(function(){return xa})),n.d(d,"port",(function(){return Ca})),n.d(d,"sourceMarker",(function(){return Ua})),n.d(d,"targetMarker",(function(){return Wa})),n.d(d,"vertexMarker",(function(){return $a})),n.d(d,"connection",(function(){return Ka})),n.d(d,"atConnectionLengthKeepGradient",(function(){return Za})),n.d(d,"atConnectionLengthIgnoreGradient",(function(){return Ja})),n.d(d,"atConnectionRatioKeepGradient",(function(){return Qa})),n.d(d,"atConnectionRatioIgnoreGradient",(function(){return ts})),n.d(d,"atConnectionLength",(function(){return es})),n.d(d,"atConnectionRatio",(function(){return ns}));var h={};n.r(h),n.d(h,"dot",(function(){return os})),n.d(h,"fixedDot",(function(){return as})),n.d(h,"mesh",(function(){return ss})),n.d(h,"doubleMesh",(function(){return ls}));var p={};n.r(p),n.d(p,"outline",(function(){return hs})),n.d(p,"highlight",(function(){return ps})),n.d(p,"blur",(function(){return fs})),n.d(p,"dropShadow",(function(){return gs})),n.d(p,"grayScale",(function(){return ms})),n.d(p,"sepia",(function(){return vs})),n.d(p,"saturate",(function(){return bs})),n.d(p,"hueRotate",(function(){return ys})),n.d(p,"invert",(function(){return ws})),n.d(p,"brightness",(function(){return xs})),n.d(p,"contrast",(function(){return Cs}));var f={};n.r(f),n.d(f,"flipX",(function(){return As})),n.d(f,"flipY",(function(){return Ss})),n.d(f,"flipXY",(function(){return Es})),n.d(f,"watermark",(function(){return Os}));var g={};n.r(g),n.d(g,"className",(function(){return Ls})),n.d(g,"opacity",(function(){return js})),n.d(g,"stroke",(function(){return Rs}));var m={};n.r(m),n.d(m,"absolute",(function(){return Vs})),n.d(m,"ellipse",(function(){return qs})),n.d(m,"ellipseSpread",(function(){return Us})),n.d(m,"line",(function(){return Gs})),n.d(m,"left",(function(){return Ys})),n.d(m,"right",(function(){return Xs})),n.d(m,"top",(function(){return Ks})),n.d(m,"bottom",(function(){return Zs}));var v={};n.r(v),n.d(v,"manual",(function(){return nl})),n.d(v,"left",(function(){return rl})),n.d(v,"right",(function(){return il})),n.d(v,"top",(function(){return ol})),n.d(v,"bottom",(function(){return al})),n.d(v,"outside",(function(){return sl})),n.d(v,"outsideOriented",(function(){return ll})),n.d(v,"inside",(function(){return cl})),n.d(v,"insideOriented",(function(){return ul})),n.d(v,"radial",(function(){return fl})),n.d(v,"radialOriented",(function(){return gl}));var b={};n.r(b),n.d(b,"noop",(function(){return Dl})),n.d(b,"pinRelative",(function(){return Bl})),n.d(b,"pinAbsolute",(function(){return zl}));var y={};n.r(y),n.d(y,"center",(function(){return pc})),n.d(y,"top",(function(){return fc})),n.d(y,"bottom",(function(){return gc})),n.d(y,"left",(function(){return mc})),n.d(y,"right",(function(){return vc})),n.d(y,"topLeft",(function(){return bc})),n.d(y,"topRight",(function(){return yc})),n.d(y,"bottomLeft",(function(){return wc})),n.d(y,"bottomRight",(function(){return xc})),n.d(y,"orth",(function(){return Ec})),n.d(y,"nodeCenter",(function(){return Oc})),n.d(y,"midSide",(function(){return _c}));var w={};n.r(w),n.d(w,"ratio",(function(){return Nc})),n.d(w,"length",(function(){return Pc})),n.d(w,"orth",(function(){return Ic})),n.d(w,"closest",(function(){return Dc}));var x={};n.r(x),n.d(x,"bbox",(function(){return Hc})),n.d(x,"rect",(function(){return Vc})),n.d(x,"boundary",(function(){return qc})),n.d(x,"anchor",(function(){return Wc}));var C={};n.r(C),n.d(C,"normal",(function(){return Gc})),n.d(C,"oneSide",(function(){return Yc})),n.d(C,"orth",(function(){return eu})),n.d(C,"metro",(function(){return Pu})),n.d(C,"manhattan",(function(){return Mu})),n.d(C,"er",(function(){return Lu})),n.d(C,"loop",(function(){return ju}));var k={};n.r(k),n.d(k,"normal",(function(){return Ru})),n.d(k,"loop",(function(){return Fu})),n.d(k,"rounded",(function(){return Bu})),n.d(k,"smooth",(function(){return zu})),n.d(k,"jumpover",(function(){return Qu}));var A={};n.r(A),n.d(A,"Empty",(function(){return Pd})),n.d(A,"Rect",(function(){return jd})),n.d(A,"HeaderedRect",(function(){return Id})),n.d(A,"Circle",(function(){return Rd})),n.d(A,"Cylinder",(function(){return Bd})),n.d(A,"Ellipse",(function(){return zd})),n.d(A,"Polygon",(function(){return qd})),n.d(A,"Polyline",(function(){return Ud})),n.d(A,"Path",(function(){return $d})),n.d(A,"TextBlock",(function(){return Yd})),n.d(A,"Image",(function(){return Xd})),n.d(A,"BorderedImage",(function(){return Kd})),n.d(A,"EmbeddedImage",(function(){return Zd})),n.d(A,"InscribedImage",(function(){return Jd})),n.d(A,"Edge",(function(){return Qd})),n.d(A,"ShadowEdge",(function(){return th})),n.d(A,"DoubleEdge",(function(){return eh})),n.d(A,"HTML",(function(){return nh}));var S={};n.r(S),n.d(S,"AutoSave",(function(){return ih})),n.d(S,"Clipboard",(function(){return Rp})),n.d(S,"Halo",(function(){return zp})),n.d(S,"MiniMap",(function(){return kh})),n.d(S,"Scroller",(function(){return Dh})),n.d(S,"Selection",(function(){return Bh})),n.d(S,"Snapline",(function(){return Eh})),n.d(S,"Transform",(function(){return zh})),n.d(S,"Knob",(function(){return yh})),n.d(S,"Dnd",(function(){return Wp})),n.d(S,"Stencil",(function(){return Gp}));var E=function(){var t,e,n=this,r=n._self._c;return r("div",{class:"article-box ".concat(n.nowSelectArticle.resourceAuthority?"editor-download":"editor-no-download")},[n.pageLoading?r("div",{staticClass:"loading-box"},[r("a-spin",{attrs:{size:"large"}})],1):n._e(),r("div",{directives:[{name:"show",rawName:"v-show",value:!n.pageLoading,expression:"!pageLoading"}],staticClass:"article-manage-main"},[r("div",{staticClass:"article-manage-toolbar"},[r("div",{staticClass:"toolbar-article-title text-overflow"},[n._v(" "+n._s(n.nowSelectArticle.title)+" ")]),n.engine&&n.isEditor?r("div",{staticClass:"toolbar",attrs:{id:"toolbar"}},[r("am-toolbar",{ref:"editorToolbar",attrs:{engine:n.engine,items:n.getItmes()}})],1):n._e(),n.baseRole<=2?r("div",{staticClass:"toolbar-article-other"},[(null===(t=n.allArticleList)||void 0===t?void 0:t.length)>0?r("div",{staticClass:"search-main"},[r("a-icon",{class:{"search-button":!0,"search-button-active":n.isShowReplaceInput},staticStyle:{cursor:"pointer"},style:{fontSize:"20px"},attrs:{width:"50px",type:"search"},on:{click:function(t){n.isShowReplaceInput=!n.isShowReplaceInput}}}),n.isShowReplaceInput?r("ReplaceForm",{on:{searchContent:n.searchContent,replaceContent:n.replaceContent,close:function(t){n.isShowReplaceInput=!n.isShowReplaceInput}}}):n._e()],1):n._e(),(null===(e=n.allArticleList)||void 0===e?void 0:e.length)>0||n.isEditor?r("a-button",{staticClass:"save-button",attrs:{type:"primary",size:"small"},on:{click:n.editorArticle}},[n._v(" "+n._s(n.isEditor?"保存":"编辑")+" ")]):n._e(),n.isEditor?n._e():r("a-button",{staticClass:"save-button",attrs:{type:"primary",size:"small"},on:{click:n.addArticle}},[n._v(" 新建 ")]),n.isEditor?n._e():r("a-button",{staticClass:"save-button",attrs:{type:"danger",size:"small"},on:{click:n.deleteArticle}},[n._v(" 删除 ")])],1):n._e()]),r("div",{ref:"editorBody",staticClass:"article-contents-box hideScrollBar",attrs:{id:"article-contents-box"}},[r("div",{staticClass:"article-contents hideScrollBar",attrs:{id:"article-contents"}})])]),r("Catalog",{attrs:{isEditor:n.isEditor,allArticleList:n.allArticleList,treeArticleList:n.treeArticleList,defaultCheckKey:n.routerQueryInfo.article},on:{selectArticle:n.selectArticle}}),r("ArticleOutline",{ref:"outline",attrs:{outlineData:n.outlineData,baseOutline:n.baseOutline,isEditor:n.isEditor,outlineOtherData:n.outlineOtherData,activeId:n.outlinToolbarActive}}),r("a-modal",{attrs:{title:"保存文章信息",cancelText:"取消",okText:"确认"},on:{ok:n.saveEditor,onCancel:function(t){n.isShowArtileModal=!1}},model:{value:n.isShowArtileModal,callback:function(t){n.isShowArtileModal=t},expression:"isShowArtileModal"}},[r("a-form-model",{ref:"ruleForm",attrs:{model:n.nowSelectArticle,rules:n.rules,"label-col":n.labelCol,"wrapper-col":n.wrapperCol}},[r("a-form-model-item",{attrs:{label:"文章标题",prop:"title"}},[r("a-input",{model:{value:n.nowSelectArticle.title,callback:function(t){n.$set(n.nowSelectArticle,"title",t)},expression:"nowSelectArticle.title"}})],1),r("a-form-model-item",{attrs:{label:"资源下载"}},[r("a-switch",{model:{value:n.nowSelectArticle.resourceAuthority,callback:function(t){n.$set(n.nowSelectArticle,"resourceAuthority",t)},expression:"nowSelectArticle.resourceAuthority"}})],1),r("a-form-model-item")],1)],1),r("div",{staticClass:"floor-update-time"},[r("div",[r("strong",[n._v("最后更新时间")]),n._v(""+n._s(n.nowSelectArticle.updateTime)+" ")])]),r("FloatingSidebar",{on:{showHelpInfo:function(t){n.isShowHelpInfo=!0},scrollToTop:n.scrollToTop}}),r("HelpInfo",{attrs:{isShowHelpInfo:n.isShowHelpInfo},on:{closeHelpInfo:function(t){n.isShowHelpInfo=!1}}})],1)},O=[],T=n("2909"),_=n("5530"),M=n("c7eb"),N=n("1da1"),P=(n("e9c4"),n("d3b7"),n("159b"),n("ac1f"),n("466d"),n("7db0"),n("4e82"),n("a434"),n("b0c0"),n("4de4"),n("25f0"),n("498a"),n("caad"),n("2532"),n("1276"),n("a15b"),n("4d63"),n("c607"),n("2c3e"),n("5319"),n("2f62")),L=n("c1fa"),D=n("a57f"),j=n("fc35"),I=n("a41c"),R=n("060e"),F=n("d4ec"),B=n("bee2"),z=n("45eb"),H=n("7e84"),V=n("262e"),q=n("2caf"),U=function(){function t(){Object(F["a"])(this,t),this.headingTags={h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0}}return Object(B["a"])(t,[{key:"getHeadings",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.headingTags;Object(D["isNodeEntry"])(t)||(t=Object(D["$"])(t));var n=t.children();if(!n)return[];var r=[];return n.each((function(t){e[t.nodeName.toLowerCase()]&&r.push(t)})),r}},{key:"getText",value:function(t){var e=Object(D["getTextNodes"])(t,(function(t){return!t.getAttribute(D["CARD_KEY"])})),n="";return e.forEach((function(t){n+=t.textContent})),n}},{key:"normalize",value:function(t){var e=this;if(t=t||[],0===t.length)return[];var n=[];t.forEach((function(t){var r=(e.getText(t)||"").trim(),i=t["id"]||t[D["DATA_ID"]];r&&i&&n.push({id:i,text:r,level:parseInt(t.tagName.substr(1)),depth:-1,node:t})}));var r=[];n.forEach((function(t){r.indexOf(t.level)<0&&r.push(t.level)})),r.sort();var i={};return r.forEach((function(t,e){i[t]=e+1})),n.forEach((function(t){t.depth=i[t.level]})),n}},{key:"getFromDom",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.headingTags;try{var n=this.getHeadings(t,e),r=this.normalize(n);return r}catch(i){return[]}}}]),t}();function W(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var $=".data-anchor-button {\r\n\tposition: absolute;\r\n\twidth: 24px;\r\n\theight: 24px;\r\n\tline-height: 24px;\r\n\ttext-align: center;\r\n\tfont-size: 14px;\r\n\tdisplay: block;\r\n\tbackground: rgba(255, 255, 255, 0.9);\r\n\tcolor: #BFBFBF;\r\n\tborder-radius: 2px 2px;\r\n\tcursor: pointer;\r\n\t-webkit-user-select: none;\r\n\t-moz-user-select: none;\r\n\t-ms-user-select: none;\r\n\tuser-select: none;\r\n\topacity: 0;\r\n\tvisibility: hidden;\r\n\t-webkit-transition: opacity 0.3s ease-in-out;\r\n\ttransition: opacity 0.3s ease-in-out;\r\n}\r\n\r\n.data-anchor-button.data-anchor-button-active {\r\n\topacity: 1;\r\n\tvisibility: visible;\r\n}\r\n\r\n.data-anchor-button .data-icon {\r\n\twidth: 18px;\r\n}\r\n\r\n.data-anchor-button:hover {\r\n\tbackground: #f4f4f4;\r\n\tcolor: #595959;\r\n}\r\n\r\n.am-engine-view h1,.am-engine-view h2,.am-engine-view h3,.am-engine-view h4,.am-engine-view h5,.am-engine-view h6 {\r\n position: relative;\r\n}\r\n\r\n.am-engine-view h1 .data-anchor-button,.am-engine-view h2 .data-anchor-button,.am-engine-view h3 .data-anchor-button,.am-engine-view h4 .data-anchor-button,.am-engine-view h5 .data-anchor-button,.am-engine-view h6 .data-anchor-button{\r\n position: absolute;\r\n left: -24px;\r\n display: none;\r\n}\r\n\r\n.am-engine-view h1:hover .data-anchor-button,.am-engine-view h2:hover .data-anchor-button,.am-engine-view h3:hover .data-anchor-button,.am-engine-view h4:hover .data-anchor-button,.am-engine-view h5:hover .data-anchor-button,.am-engine-view h6:hover .data-anchor-button {\r\n display: inline-block;\r\n opacity: 1;\r\n visibility: visible;\r\n}\r\n\r\n.am-engine-view h1 , .am-engine h1,.am-engine-view h2 , .am-engine h2,.am-engine-view h3 , .am-engine h3,.am-engine-view h4 , .am-engine h4,.am-engine-view h5 , .am-engine h5,.am-engine-view h6 , .am-engine h6 {\r\n margin: 0;\r\n word-spacing: 1px;\r\n color: #262626;\r\n font-weight: bold;\r\n padding:0;\r\n}\r\n\r\n.am-engine-view h1 , .am-engine h1 {\r\n font-size: 28px;\r\n line-height: 36px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h2 , .am-engine h2 {\r\n font-size: 24px;\r\n line-height: 32px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h3 , .am-engine h3 {\r\n font-size: 20px;\r\n line-height: 28px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h4 , .am-engine h4 {\r\n font-size: 16px;\r\n line-height: 24px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h5 , .am-engine h5 {\r\n font-size: 14px;\r\n line-height: 24px;\r\n padding: 7px 0;\r\n}\r\n\r\n.am-engine-view h6 , .am-engine h6 {\r\n font-size: 14px;\r\n line-height: 24px;\r\n padding: 7px 0;\r\n font-weight: normal;\r\n}";W($);var G=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.attributes={id:"@var0"},t.variable={"@var0":/^[\w\.\-]+$/},t.tagName=["h1","h2","h3","h4","h5","h6"].filter((function(e){return!t.options.enableTypes||t.options.enableTypes.indexOf(e)>-1})),t.allowIn=["blockquote","$root"],t.disableMark=t.options.disableMark||["fontsize","bold"],t.onRender=function(e){var n=t.editor,r=n.language,i=Object(D["$"])(e);0!==t.tagName.length&&i.find(t.tagName.join(",")).each((function(e){var i=Object(D["$"])(e),o=i.attributes("id");if(o){i.find(".data-anchor-button").remove(),D["Tooltip"].hide();var a=Object(D["$"])('<a class="data-anchor-button" '.concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'"><span class="data-icon data-icon-').concat(i.name,'"></span></a>'));24!==i.height()&&a.css({top:(i.height()-24)/2+"px"}),a.on("mouseenter",(function(){D["Tooltip"].show(a,r.get("copyAnchor","title").toString())})),a.on("mouseleave",(function(){D["Tooltip"].hide()})),a.on("click",(function(e){e.preventDefault(),e.stopPropagation();var i=t.options.anchorCopy?t.options.anchorCopy(o):window.location.href+"/"+o;n.clipboard.copy(i)?n.messageSuccess("copy",r.get("copy","success").toString()):n.messageError("copy",r.get("copy","error").toString())})),i.prepend(a)}}))},t.updateId=function(){0!==t.tagName.length&&t.editor.container.find(t.tagName.join(",")).each((function(t){var e,n=Object(D["$"])(t);if(null===(e=n.parent())||void 0===e?void 0:e.isEditable()){var r=n.attributes("id");(!r||Object(D["$"])('[id="'.concat(r,'"]')).length>1)&&(r=n.attributes(D["DATA_ID"])||Object(D["getHashId"])(n),n.attributes("id",r))}else n.removeAttributes("id")}))},t.realtimeChange=function(){t.updateId(),t.showAnchor()},t.updateAnchorPosition=function(){var e,n=t.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.root,o=i.find(".data-anchor-button");if(0!==o.length){var a=r.range.get(),s=a.startNode.closest("h1,h2,h3,h4,h5,h6");if(0===s.length)return o.remove(),void D["Tooltip"].hide();var l=(null===(e=i.get())||void 0===e?void 0:e.getBoundingClientRect())||{left:0,top:0},c=s.get().getBoundingClientRect(),u=Math.round(c.left-l.left-o.get().clientWidth-1),d=Math.round(c.top-l.top+c.height/2-o.get().clientHeight/2);o.css({top:"".concat(d,"px"),left:"".concat(u,"px")})}}},t.showAnchor=function(){var e,n,r=t.editor;if(Object(D["isEngine"])(r)&&0!==t.tagName.length&&!1!==t.options.showAnchor){var i=r.change,o=r.root,a=r.clipboard,s=r.language,l=r.card,c=i.range.get(),u=o.find(".data-anchor-button"),d=c.startNode.closest(t.tagName.join(","));if((0===d.length||u.length>0&&0===u.find(".data-icon-".concat(d.name)).length||!r.isFocus())&&(u.remove(),D["Tooltip"].hide()),0!==d.length&&!l.closest(d,!0)&&r.isFocus()&&(null===(e=d.parent())||void 0===e?void 0:e.isEditable()))if(u.find(".data-icon-".concat(d.name)).length>0)t.updateAnchorPosition();else{u=Object(D["$"])('<span class="data-anchor-button" '.concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'"><span class="data-icon data-icon-').concat(d.name,'"></span></span>')),o.append(u);var h=(null===(n=o.get())||void 0===n?void 0:n.getBoundingClientRect())||{left:0,top:0},p=d.get().getBoundingClientRect(),f=Math.round(p.left-h.left-u.get().clientWidth-1),g=Math.round(p.top-h.top+p.height/2-u.get().clientHeight/2);u.css({top:"".concat(g,"px"),left:"".concat(f,"px")}),u.addClass("data-anchor-button-active"),u.on("mouseenter",(function(){D["Tooltip"].show(u,s.get("copyAnchor","title").toString())})),u.on("mouseleave",(function(){D["Tooltip"].hide()})),u.on("click",(function(e){e.preventDefault(),e.stopPropagation();var n=d.attributes("id"),i=t.options.anchorCopy?t.options.anchorCopy(n):window.location.href+"/"+n;a.copy(i)?r.messageSuccess("copy",s.get("copy","success").toString()):r.messageError("copy",s.get("copy","error").toString())}))}}},t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("heading")},t.onBackspace=function(e){var n,r=t.editor;if(Object(D["isEngine"])(r)){var i=r.change,o=r.node,a=i.range.get();if(a.collapsed){var s=r.block;if(s.isFirstOffset(a,"start")){var l=s.closest(a.startNode);if(t.tagName.indexOf(l.name)>-1&&o.isEmptyWithTrim(l)&&(null===(n=l.parent())||void 0===n?void 0:n.isEditable()))return e.preventDefault(),s.setBlocks("<p />"),!1;var c=l.parent();return!(t.tagName.indexOf(l.name)>-1)||c&&o.isBlock(c)?void 0:(e.preventDefault(),i.mergeAfterDelete(l),!1)}}}},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;if(Object(D["isEngine"])(t))t.on("keydown:backspace",this.onBackspace),t.on("markdown-it",this.markdownIt),t.on("setValue",this.updateId),t.on("realtimeChange",this.realtimeChange),t.on("select",this.showAnchor),t.on("blur",this.showAnchor),window.addEventListener("resize",this.updateAnchorPosition);else{if(!1===this.options.showAnchor)return;t.on("render",this.onRender)}}},{key:"execute",value:function(t){var e=this.editor;if(Object(D["isEngine"])(e)){t&&t!==this.queryState()||(t="p");var n=this.options.enableTypes;if(!("p"!==t&&n&&n.indexOf(t)<0)){var r=e.list,i=e.block;r.split(),i.setBlocks("<".concat(t," />"))}}}},{key:"queryState",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.change,n=e.blocks;if(0===n.length)return"";var r=this.tagName.find((function(t){return n.some((function(e){return e.name===t}))}));return r||""}}},{key:"hotkey",value:function(){var t,e,n,r,i,o,a=(null===(t=this.options.hotkey)||void 0===t?void 0:t.h1)||"mod+opt+1",s=(null===(e=this.options.hotkey)||void 0===e?void 0:e.h2)||"mod+opt+2",l=(null===(n=this.options.hotkey)||void 0===n?void 0:n.h3)||"mod+opt+3",c=(null===(r=this.options.hotkey)||void 0===r?void 0:r.h4)||"mod+opt+4",u=(null===(i=this.options.hotkey)||void 0===i?void 0:i.h5)||"mod+opt+5",d=(null===(o=this.options.hotkey)||void 0===o?void 0:o.h6)||"mod+opt+6",h=this.options.enableTypes;return[{key:a,args:"h1"},{key:s,args:"h2"},{key:l,args:"h3"},{key:c,args:"h4"},{key:u,args:"h5"},{key:d,args:"h6"}].filter((function(t){return!h||h.indexOf(t.key)>-1}))}},{key:"destroy",value:function(){var t=this.editor;Object(D["isEngine"])(t)?(t.off("keydown:backspace",this.onBackspace),t.off("markdown-it",this.markdownIt),t.off("setValue",this.updateId),t.off("realtimeChange",this.realtimeChange),t.off("select",this.showAnchor),t.off("blur",this.showAnchor),window.removeEventListener("resize",this.updateAnchorPosition)):t.off("render",this.onRender)}}],[{key:"pluginName",get:function(){return"heading"}}]),n}(D["BlockPlugin"]),Y=G,X=function(){var t=this,e=t._self._c;return e("div",{staticClass:"mobild_view_box"},[t.pageLoading?e("div",{staticClass:"loading-box"},[e("a-spin",{attrs:{size:"large"}})],1):t._e(),e("div",{ref:"mobildViewManusals",staticClass:"mobild_view_manusals"},[e("div",{staticClass:"mobild_view_manusals-body"},[e("h1",{staticClass:"manusals-body-title"},[t._v(" "+t._s(t.manualsInfo.name)+" ")]),e("a-directory-tree",{attrs:{"tree-data":t.treeArticleList,multiple:"","default-expand-all":"",expandedKeys:t.expandedCatalogTreeKeys,selectedKeys:t.nowSelectArticleKey},on:{expand:t.expandCatalogTreeNode,select:t.selectCatalogTree}})],1),e("div",{staticClass:"mobild_view_manusals-back",on:{click:t.showMenu}})]),e("div",{ref:"mobildViewManusalsMenu",class:"mobild_view_manusals-menu ".concat(t.isShowMenu?"menu-unflod":""),on:{click:t.showMenu}},[t.isShowMenu?e("a-icon",{attrs:{type:"close"}}):e("a-icon",{attrs:{type:"menu"}})],1),e("h1",{staticClass:"mobild_view_title"},[t._v(t._s(t.articleInfo.title))]),e("div",{staticClass:"mobild_view_time"},[t._v("最后更新于:"+t._s(t.articleInfo.updateTime))]),e("editor",{attrs:{articleInfo:t.articleInfo}}),e("div",{staticClass:"page-footer"},[t._v(t._s(t.pageData.pageFooterText))])],1)},K=[],Z=function(){var t=this,e=t._self._c;return e("div",{ref:"outlineBox",staticClass:"outline-box"},[t.isPackUpOutline?e("div",{ref:"unPackUpButton",staticClass:"unPackUp-button",on:{click:function(e){return t.packUpOutline(!1)}}},t._l(t.baseOutline,(function(n){return e("div",{key:n.id,class:"".concat(n.id==t.selectKeys[0]?"outline-hidden-line-active":"outline-hidden-line"," ")})})),0):t._e(),t.isPackUpOutline&&t.baseOutline.length<=0?e("a-icon",{staticClass:"unPackUp-button unPackUp-button-else",attrs:{type:"double-left"},on:{click:function(e){return t.packUpOutline(!1)}}}):t._e(),e("a-tabs",{attrs:{"default-active-key":"1",size:"small"},on:{change:t.changeShowType}},[e("div",{staticClass:"outline-box-toolbar",attrs:{slot:"tabBarExtraContent"},slot:"tabBarExtraContent"},[e("div",{staticClass:"division-line"}),e("div",{staticClass:"icon-box",on:{click:function(e){return t.packUpOutline(!t.isPackUpOutline||"unPack")}}},[t.isPackUpOutline?t._e():e("a-tooltip",{attrs:{title:"隐藏大纲"}},[t.isPackUpOutline?t._e():e("a-icon",{staticStyle:{color:"#08aea8"},attrs:{type:"pushpin"}})],1),e("a-tooltip",{attrs:{title:"钉住大纲"}},[t.isPackUpOutline?e("a-icon",{attrs:{type:"pushpin"}}):t._e()],1)],1),e("div",{staticClass:"icon-box",on:{click:t.flodOutLine}},[t.isFoldOutLine?e("a-tooltip",{attrs:{title:"全部展开"}},[e("a-icon",{attrs:{type:"menu-fold"}})],1):t._e(),t.isFoldOutLine?t._e():e("a-tooltip",{attrs:{title:"全部折叠"}},[e("a-icon",{attrs:{type:"menu-unfold"}})],1)],1)]),e("a-tab-pane",{key:"1",attrs:{tab:"大纲"}},[e("div",[1==t.activeId?e("a-directory-tree",{staticClass:"outline-outline",attrs:{multiple:"","tree-data":t.outlineData,forceRender:!1,expandAction:!1,selectedKeys:t.selectKeys,expandedKeys:t.expandNodes,replaceFields:{title:"text",key:"id"}},on:{select:t.onSelect,expand:t.onExpand}}):t._e()],1)]),e("a-tab-pane",{key:"2",attrs:{tab:"图片","force-render":""}},[e("viewer",{attrs:{images:t.outlineOtherData.imageListData}},[t.isEditor||t.downloadAuthority?e("div",{staticClass:"outline-image"},t._l(t.outlineOtherData.imageData,(function(n,r){return e("div",{key:r,staticClass:"outline-image-body"},[e("a-tooltip",[e("template",{slot:"title"},[t._v(" "+t._s(n.alt)+" ")]),e("img",{attrs:{src:n.src,alt:n.alt}}),e("span",{staticClass:"image-title"},[t._v(" "+t._s(n.alt)+" ")])],2)],1)})),0):t._e(),t.downloadAuthority||t.isEditor?t._e():e("div",{staticClass:"outline-image"},t._l(t.outlineOtherData.imageData,(function(n,r){return e("div",{key:r,staticClass:"outline-image-body",on:{mouseenter:function(t){t.stopPropagation()}}},[e("a-tooltip",[e("template",{slot:"title"},[t._v(" "+t._s(n.alt)+" ")]),e("img",{attrs:{src:n.src,draggable:"false",alt:n.alt},on:{contextmenu:t.clear,click:t.closeViewerMney}}),e("span",{staticClass:"image-title"},[t._v(" "+t._s(n.alt)+" ")])],2)],1)})),0)])],1),e("a-tab-pane",{key:"3",attrs:{tab:"视频"}},[e("div",{staticClass:"outline-video"},t._l(t.outlineOtherData.videoData,(function(n,r){return e("div",{key:r,staticClass:"outline-video-body"},[t.downloadAuthority?e("video",{attrs:{controls:"",src:n.src}},[t._v(" 您的浏览器不支持 video 标签。 ")]):e("video",{attrs:{controls:"",controlsList:"nodownload",src:n.src}},[t._v(" 您的浏览器不支持 video 标签。 ")]),e("a-tooltip",{attrs:{placement:"topLeft"}},[e("template",{slot:"title"},[t._v(" "+t._s(n.alt)+" ")]),e("span",{staticClass:"video-title"},[t._v(" "+t._s(n.alt)+" ")])],2)],1)})),0)]),e("a-tab-pane",{key:"4",attrs:{tab:"音频"}},[e("div",{staticClass:"outline-audio"},t._l(t.outlineOtherData.audioData,(function(n,r){return e("div",{key:r,staticClass:"outline-audio-body"},[e("a-tooltip",[e("template",{slot:"title"},[t._v(" "+t._s(n.alt)+" ")]),t.downloadAuthority?e("audio",{attrs:{controls:"",src:n.src}},[t._v(" 您的浏览器不支持 video 标签。 ")]):e("audio",{attrs:{controls:"",src:n.src,controlsList:"nodownload"}},[t._v(" 您的浏览器不支持 video 标签。 ")]),e("span",{staticClass:"outline-audiot-title"},[t._v(" "+t._s(n.alt))])],2)],1)})),0)])],1)],1)},J=[],Q=(n("a9e3"),n("b775"));n("ddf1"),n("7424");function tt(t){return et.apply(this,arguments)}function et(){return et=Object(N["a"])(Object(M["a"])().mark((function t(e){return Object(M["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(Q["d"])(MODEL_UPLOAD_URL+"webglUrl",Q["a"].POST,e));case 1:case"end":return t.stop()}}),t)}))),et.apply(this,arguments)}var nt={props:{outlineData:{type:Array,default:function(){return[]}},baseOutline:{type:Array,default:function(){return[]}},activeId:{type:Number,default:1},isEditor:{type:Boolean},outlineOtherData:{type:Object,default:function(){}}},data:function(){return{expandNodes:[],selectKeys:[],showToolbarClass:"",isFoldOutLine:!1,isPackUpOutline:!1,downloadAuthority:!1,showImageTitle:0,isPreviewModel:!1,iframeSrc:""}},mounted:function(){var t=this;this.baseOutline.forEach((function(e){t.expandNodes.push(e.id)}))},methods:{onSelect:function(t,e){this.selectKeys=t;var n=document.getElementById(e.node.dataRef.id),r=document.getElementById("article-contents-box");r.scrollTo(0,n.offsetTop)},showHiddenToolbar:function(t,e,n){var r=t.target,i=r.getElementsByClassName("iframe-toolbar")[0];e?i.classList.add("iframe-toolbar-show"):i.classList.remove("iframe-toolbar-show")},clear:function(t){return t.preventDefault(),!1},onExpand:function(t,e){this.expandNodes=t},openNewlabel:function(t){},fullScreenIframe:function(t){var e=document.getElementById(t);e.requestFullscreen()},flodOutLine:function(){var t=this;this.isFoldOutLine=!this.isFoldOutLine,this.expandNodes=[],this.isFoldOutLine||(this.baseOutline.forEach((function(e){t.expandNodes.push(e.id)})),this.$forceUpdate())},packUpOutline:function(t){var e=this,n=this.$refs.outlineBox;t&&"unPack"!==t?(this.isPackUpOutline=t,n.style.transform="translateX(100%)"):"unPack"==t?(this.isPackUpOutline=!1,n.style.transform="translateX(0)"):(this.isPackUpOutline=!1,n.style.transform="translateX(0)",setTimeout((function(){e.$refs.unPackUpButton.style.display="none"}),100))},closeViewerMney:function(){var t=this;setTimeout((function(){var e=document.getElementsByClassName("viewer-canvas");e[0].oncontextmenu=function(e){if(!t.downloadAuthority&&!t.isEditor)return!1}}),0)},changeShowType:function(){},toPreview:function(t){var e=this;return Object(N["a"])(Object(M["a"])().mark((function n(){var r;return Object(M["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:try{null===(r=window.article_model_list[t])||void 0===r||r.toPreview()}catch(i){e.$message.error("未连接到UNITY服务器")}case 1:case"end":return n.stop()}}),n)})))()}},watch:{outlineData:function(t,e){},outlineOtherData:function(t,e){},baseOutline:function(){var t=this;this.expandNodes=[],this.baseOutline.forEach((function(e){t.expandNodes.push(e.id)})),this.downloadAuthority=JSON.parse(localStorage.getItem("NOW_ARTICLE_DOWNLOAD")||"")}}},rt=nt,it=(n("459e"),n("2877")),ot=Object(it["a"])(rt,Z,J,!1,null,"16a65850",null),at=ot.exports,st=function(){var t=this,e=t._self._c;return e("div",{attrs:{id:"editor-window-parent"}},[e("div",{ref:"container",class:"editor-window ".concat(t.isEditor?"":"editor-window-view"),attrs:{id:"editor-window"},on:{scroll:function(e){return t.$emit("editorBodyScroll",t.$refs.container)}}})])},lt=[],ct=(n("a630"),n("3ca3"),n("6b62")),ut=function(){var t=this,e=t._self._c;return t.showMindMap?e("div",{staticClass:"echart-box"},[e("div",{attrs:{id:"container"}}),e("div",{attrs:{id:"graph-container"}}),e("div",{staticClass:"toolbar-button"},[e("a-button",{attrs:{type:"primary"},on:{click:t.saveMindMap}},[t._v(" 保存")]),e("a-button",{attrs:{type:"danger"},on:{click:t.close}},[t._v(" 关闭")])],1)]):t._e()},dt=[],ht=(n("bf19"),n("d81d"),n("1157")),pt=n.n(ht);n("b22e");const ft=navigator.userAgent;var gt;if(function(t){t.IS_MAC=navigator.appVersion.indexOf("Mac")>0,t.IS_IOS=!!ft.match(/(iPad|iPhone|iPod)/g),t.IS_WINDOWS=navigator.appVersion.indexOf("Win")>0,t.IS_IE=ft.indexOf("MSIE")>=0,t.IS_IE11=!!ft.match(/Trident\/7\./),t.IS_EDGE=!!ft.match(/Edge\//),t.IS_NETSCAPE=ft.indexOf("Mozilla/")>=0&&ft.indexOf("MSIE")<0&&ft.indexOf("Edge/")<0,t.IS_CHROME_APP=null!=window.chrome&&null!=window.chrome.app&&null!=window.chrome.app.runtime,t.IS_CHROME=ft.indexOf("Chrome/")>=0&&ft.indexOf("Edge/")<0,t.IS_OPERA=ft.indexOf("Opera/")>=0||ft.indexOf("OPR/")>=0,t.IS_FIREFOX=ft.indexOf("Firefox/")>=0,t.IS_SAFARI=ft.indexOf("AppleWebKit/")>=0&&ft.indexOf("Chrome/")<0&&ft.indexOf("Edge/")<0,t.SUPPORT_TOUCH="ontouchstart"in document.documentElement,t.SUPPORT_POINTER=null!=window.PointerEvent&&!t.IS_MAC,t.SUPPORT_PASSIVE=!1;try{const e=Object.defineProperty({},"passive",{get(){t.SUPPORT_PASSIVE=!0}}),n=document.createElement("div");n.addEventListener&&n.addEventListener("click",()=>{},e)}catch(e){}t.NO_FOREIGNOBJECT=!document.createElementNS||""+document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!=="[object SVGForeignObjectElement]"||ft.indexOf("Opera/")>=0,t.SUPPORT_FOREIGNOBJECT=!t.NO_FOREIGNOBJECT}(gt||(gt={})),function(t){function e(){const t=window.module;return null!=t&&null!=t.hot&&null!=t.hot.status?t.hot.status():"unkonwn"}function n(){return"apply"===e()}t.getHMRStatus=e,t.isApplyingHMR=n;const r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function i(t){const e=document.createElement(r[t]||"div"),n="on"+t;let i=n in e;return i||(e.setAttribute(n,"return;"),i="function"===typeof e[n]),i}t.isEventSupported=i}(gt||(gt={})),gt.SUPPORT_PASSIVE){pt.a.event.special.touchstart={setup(t,e,n){if(!this.addEventListener)return!1;this.addEventListener("touchstart",n,{passive:!0})}};const t=pt.a.event.special.mousewheel;if(t){const e=t.setup;t.setup=function(){const t=this.addEventListener;if(!t)return!1;this.addEventListener=(e,n)=>{t.call(this,e,n,{passive:!0})},e.call(this),this.addEventListener=t}}}window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),function(t){t.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const e=document.createDocumentFragment();t.forEach(t=>{const n=t instanceof Node;e.appendChild(n?t:document.createTextNode(String(t)))}),this.appendChild(e)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);const mt=t=>!Array.isArray(t)&&t-parseFloat(t)+1>=0;var vt=n("ff51"),bt=n("e56b"),yt=n("05e2"),wt=n("7191"),xt=n("a596"),Ct=n("dff3"),kt=n("d66c"),At=n("a474"),St=n("5b2e"),Et=n("64fd");function Ot(t,e,n){const r=Tt(t,n),i=Tt(e,n),o=i.free,a=r.keyIndex,s=i.keyIndex,l=[],c=[];let u,d,h=0,p=0;while(h<t.length){if(u=t[h],d=u[n],d)if(s.hasOwnProperty(d)){const t=s[d];c.push(e[t])}else c.push(null);else{p+=1;const t=o[p];c.push(t||null)}h+=1}const f=c.slice(0);h=0;while(h<f.length)null===f[h]?(v(h),y(h)):h+=1;let g=h=0;while(h<e.length){u=e[h],d=u[n];const t=f[g];if(t){const e=t[n];if(d===e)g+=1;else if(a.hasOwnProperty(d)){const t=f[g+1];if(t){const e=t[n];e===d?(v(h),y(g),g+=1):b(h,u)}}else b(h,u)}else b(h,u);h+=1}let m=f.length-g;while((g+=1)<f.length)m-=1,v(m+h);function v(t){const e={index:t,type:0,item:null};l.push(e)}function b(t,e){const n={index:t,item:e,type:1};l.push(n)}function y(t){f.splice(t,1)}return{moves:l}}function Tt(t,e){const n={},r=[];for(let i=0,o=t.length;i<o;i+=1){const o=t[i],a=o[e];a?n[a]=i:r.push(o)}return{keyIndex:n,free:r}}var _t=n("bc59"),Mt=n("070e"),Nt=n("997c"),Pt=n("a1a3"),Lt=n("61f1"),Dt=n("32e8"),jt=n("7ee8"),It=n("2332"),Rt=n("e8b2"),Ft=n("758b"),Bt=n("5c8a"),zt=n("e247"),Ht=n("d7e7");function Vt(t,...e){e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(n=>{"constructor"!==n&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))})})}const qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])};function Ut(t,e){function n(){this.constructor=t}qt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}class Wt{}const $t=/^\s*class\s+/.test(""+Wt)||/^\s*class\s*\{/.test(""+class{});function Gt(t,e){let n;return $t?n=class extends e{}:(n=function(){return e.apply(this,arguments)},Ut(n,e)),Object.defineProperty(n,"name",{value:t}),n}function Yt(t,e){return null!=t?t:e}function Xt(t,e,n){const r=null!=t?t[e]:null;return void 0!==n?Yt(r,n):r}function Kt(t,e,n){let r=null!=t?t[e]:null;return null==r?n:(r=+r,Number.isNaN(r)||!Number.isFinite(r)?n:r)}function Zt(t,e,n){const r=null!=t?t[e]:null;return null==r?n:!!r}function Jt(t){return"__proto__"===t}function Qt(t,e,n="/"){let r;const i=Array.isArray(e)?e:e.split(n);if(i.length){r=t;while(i.length){const t=i.shift();if(Object(r)!==r||!t||!(t in r))return;r=r[t]}}return r}function te(t,e,n,r="/"){const i=Array.isArray(e)?e:e.split(r),o=i.pop();if(o&&!Jt(o)){let e=t;i.forEach(t=>{Jt(t)||(null==e[t]&&(e[t]={}),e=e[t])}),e[o]=n}return t}function ee(t,e,n="/"){const r=Array.isArray(e)?e.slice():e.split(n),i=r.pop();if(i)if(r.length>0){const e=Qt(t,r);e&&delete e[i]}else delete t[i];return t}function ne(t,e="/",n){const r={};Object.keys(t).forEach(i=>{const o=t[i];let a="object"===typeof o||Array.isArray(o);if(a&&n&&n(o)&&(a=!1),a){const t=ne(o,e,n);Object.keys(t).forEach(n=>{r[i+e+n]=t[n]})}else r[i]=o});for(const i in t)Object.prototype.hasOwnProperty.call(t,i);return r}var re=n("8121"),ie=n("79f6"),oe=n("0e98"),ae=n("c7dd"),se=n("5fa8"),le=n("0651"),ce=n("e8f6"),ue=n("3786"),de=n("42f0"),he=n("38ac"),pe=n("9caa"),fe=n("749b"),ge=n("44a0"),me=n("7e9e");function ve(t){let e=null;try{e=window.eval(t)}catch(n){}return e}var be=n("874f"),ye=n("c67b"),we=n("0f3b"),xe=n("9996"),Ce=n("0e40"),ke=n("d87e");const Ae=t=>{const e=Object.create(null);return n=>{const r=e[n];return r||(e[n]=t(n))}},Se=Ae(t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Ee=Ae(t=>Object(be["a"])(Object(ye["a"])(t)).replace(/ /g,"")),Oe=Ae(t=>Object(we["a"])(t).replace(/ /g,"_")),Te=Ae(t=>Object(xe["a"])(t).replace(/ /g,".")),_e=Ae(t=>Object(xe["a"])(t).replace(/ /g,"/")),Me=Ae(t=>Object(Ce["a"])(Object(xe["a"])(t))),Ne=Ae(t=>Object(be["a"])(Object(ye["a"])(t)));function Pe(t){let e=2166136261,n=!1,r=t;for(let i=0,o=r.length;i<o;i+=1){let t=r.charCodeAt(i);t>127&&!n&&(r=unescape(encodeURIComponent(r)),t=r.charCodeAt(i),n=!0),e^=t,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Le(){let t="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let n=0,r=e.length;n<r;n+=1){const r=e[n],i=16*Math.random()|0,o="x"===r?i:"y"===r?3&i|8:r;t+=o.toString(16)}return t}function De(t,e={}){const n=pt.a.parseHTML(t,null,!1);return n.forEach(t=>{const e=t;if(e){const t=e.attributes;if(t)for(let n=0,r=t.length;n<r;n+=1){const r=t.item(n);if(r){const t=r.value.toLowerCase(),n=r.name.toLowerCase();(n.startsWith("on")||t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))&&e.removeAttribute(n)}}}}),e.raw?n:pt()("<div/>").append(n).html()}function je(t,e,n){const r=Math.min(2,Math.floor(.34*t.length));let i,o=Math.floor(.4*t.length)+1,a=!1;const s=t.toLowerCase();for(const l of e){const e=n(l);if(void 0!==e&&Math.abs(e.length-s.length)<=r){const n=e.toLowerCase();if(n===s){if(e===t)continue;return l}if(a)continue;if(e.length<3)continue;const r=Ie(s,n,o-1);if(void 0===r)continue;r<3?(a=!0,i=l):(o=r,i=l)}}return i}function Ie(t,e,n){let r=new Array(e.length+1),i=new Array(e.length+1);const o=n+1;for(let s=0;s<=e.length;s+=1)r[s]=s;for(let s=1;s<=t.length;s+=1){const a=t.charCodeAt(s-1),l=s>n?s-n:1,c=e.length>n+s?n+s:e.length;i[0]=s;let u=s;for(let t=1;t<l;t+=1)i[t]=o;for(let t=l;t<=c;t+=1){const n=a===e.charCodeAt(t-1)?r[t-1]:Math.min(r[t]+1,i[t-1]+1,r[t-1]+2);i[t]=n,u=Math.min(u,n)}for(let t=c+1;t<=e.length;t+=1)i[t]=o;if(u>n)return;const d=r;r=i,i=d}const a=r[e.length];return a>n?void 0:a}var Re=n("62c5"),Fe=n("c88b"),Be=n("f677"),ze=n("f2f9"),He=n("fb16"),Ve=n("f102"),qe=n("450b"),Ue=n("cb09"),We=n("4a24"),$e=n("7ec8"),Ge=n("6275"),Ye=n("d6f6");function Xe(t,e){return(t%e+e)%e}function Ke(t,e){if(null==e)e=null==t?1:t,t=0;else if(e<t){const n=t;t=e,e=n}return Math.floor(Math.random()*(e-t+1)+t)}function Ze(t){return"string"===typeof t&&"%"===t.slice(-1)}function Je(t,e){if(null==t)return 0;let n;if("string"===typeof t){if(n=parseFloat(t),Ze(t)&&(n/=100,Number.isFinite(n)))return n*e}else n=t;return Number.isFinite(n)?n>0&&n<1?n*e:n:0}function Qe(t,e){function n(e){const n=new RegExp(`(?:\\d+(?:\\.\\d+)*)(${e})$`).exec(t);return n?n[1]:null}const r=parseFloat(t);if(Number.isNaN(r))return null;let i;if(null==e)i="[A-Za-z]*";else if(Array.isArray(e)){if(0===e.length)return null;i=e.join("|")}else"string"===typeof e&&(i=e);const o=n(i);return null===o?null:{unit:o,value:r}}function tn(t){if("object"===typeof t){let e=0,n=0,r=0,i=0;return null!=t.vertical&&Number.isFinite(t.vertical)&&(n=i=t.vertical),null!=t.horizontal&&Number.isFinite(t.horizontal)&&(r=e=t.horizontal),null!=t.left&&Number.isFinite(t.left)&&(e=t.left),null!=t.top&&Number.isFinite(t.top)&&(n=t.top),null!=t.right&&Number.isFinite(t.right)&&(r=t.right),null!=t.bottom&&Number.isFinite(t.bottom)&&(i=t.bottom),{top:n,right:r,bottom:i,left:e}}let e=0;return null!=t&&Number.isFinite(t)&&(e=t),{top:e,right:e,bottom:e,left:e}}var en=n("bc9b"),nn=n("3174"),rn=n("89f2"),on=n("85b1"),an=n("b320");function sn(t,e,n){if(n)switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2]);case 4:return t.call(e,n[0],n[1],n[2],n[3]);case 5:return t.call(e,n[0],n[1],n[2],n[3],n[4]);case 6:return t.call(e,n[0],n[1],n[2],n[3],n[4],n[5]);default:return t.apply(e,n)}return t.call(e)}function ln(t,e,...n){return sn(t,e,n)}function cn(t,e){for(let n=0,r=t.length;n<r;n+=1)if(t[n]===e)return t.push(t.splice(n,1)[0])}function un(t,e,n){const r=[],i={},o=(...o)=>{let a=!1;const s=o.join("␀");return s in i?(a=!0,cn(r,s)):(r.length>=1e3&&delete i[r.shift()],r.push(s),i[s]=sn(t,e||null,o)),n?n(i[s],a):i[s]};return o}function dn(t){return"object"===typeof t&&t.then&&"function"===typeof t.then}function hn(t){return null!=t&&(t instanceof Promise||dn(t))}function pn(...t){const e=[];t.forEach(t=>{Array.isArray(t)?e.push(...t):e.push(t)});const n=e.some(t=>hn(t));if(n){const t=e.map(t=>hn(t)?t:Promise.resolve(!1!==t));return Promise.all(t).then(t=>t.reduce((t,e)=>!1!==e&&t,!0))}return e.every(t=>!1!==t)}function fn(...t){const e=pn(t);return"boolean"===typeof e?Promise.resolve(e):e}const gn=/[\t\r\n\f]/g,mn=/\S+/g,vn=t=>` ${t} `;function bn(t){return t&&t.getAttribute&&t.getAttribute("class")||""}function yn(t,e){if(null==t||null==e)return!1;const n=vn(bn(t)),r=vn(e);return 1===t.nodeType&&n.replace(gn," ").includes(r)}function wn(t,e){if(null!=t&&null!=e){if("function"===typeof e)return wn(t,e(bn(t)));if("string"===typeof e&&1===t.nodeType){const n=e.match(mn)||[],r=vn(bn(t)).replace(gn," ");let i=n.reduce((t,e)=>t.indexOf(vn(e))<0?`${t}${e} `:t,r);i=i.trim(),r!==i&&t.setAttribute("class",i)}}}function xn(t,e){if(null!=t){if("function"===typeof e)return xn(t,e(bn(t)));if((!e||"string"===typeof e)&&1===t.nodeType){const n=(e||"").match(mn)||[],r=vn(bn(t)).replace(gn," ");let i=n.reduce((t,e)=>{const n=vn(e);return t.indexOf(n)>-1?t.replace(n," "):t},r);i=e?i.trim():"",r!==i&&t.setAttribute("class",i)}}}function Cn(t,e,n){if(null!=t&&null!=e)if(null==n||"string"!==typeof e){if("function"===typeof e)return Cn(t,e(bn(t),n),n);if("string"===typeof e){const n=e.match(mn)||[];n.forEach(e=>{yn(t,e)?xn(t,e):wn(t,e)})}}else n?wn(t,e):xn(t,e)}let kn=0;function An(){return kn+=1,"v"+kn}function Sn(t){return null!=t.id&&""!==t.id||(t.id=An()),t.id}function En(t){return null!=t&&("function"===typeof t.getScreenCTM&&t instanceof SVGElement)}const On={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},Tn="1.1";function _n(t,e=document){return e.createElement(t)}function Mn(t,e=On.xhtml,n=document){return n.createElementNS(e,t)}function Nn(t,e=document){return Mn(t,On.svg,e)}function Pn(t){if(t){const e=`<svg xmlns="${On.svg}" xmlns:xlink="${On.xlink}" version="${Tn}">${t}</svg>`,{documentElement:n}=Ln(e,{async:!1});return n}const e=document.createElementNS(On.svg,"svg");return e.setAttributeNS(On.xmlns,"xmlns:xlink",On.xlink),e.setAttribute("version",Tn),e}function Ln(t,e={}){let n;try{const r=new DOMParser;if(null!=e.async){const t=r;t.async=e.async}n=r.parseFromString(t,e.mimeType||"text/xml")}catch(r){n=void 0}if(!n||n.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+t);return n}function Dn(t,e=!0){const n=t.nodeName;return e?n.toLowerCase():n.toUpperCase()}function jn(t){let e=0,n=t.previousSibling;while(n)1===n.nodeType&&(e+=1),n=n.previousSibling;return e}function In(t,e){return t.querySelectorAll(e)}function Rn(t,e){return t.querySelector(e)}function Fn(t,e,n){const r=t.ownerSVGElement;let i=t.parentNode;while(i&&i!==n&&i!==r){if(yn(i,e))return i;i=i.parentNode}return null}function Bn(t,e){const n=e&&e.parentNode;return t===n||!!(n&&1===n.nodeType&&16&t.compareDocumentPosition(n))}function zn(t){t.parentNode&&t.parentNode.removeChild(t)}function Hn(t){while(t.firstChild)t.removeChild(t.firstChild)}function Vn(t,e){const n=Array.isArray(e)?e:[e];n.forEach(e=>{null!=e&&t.appendChild(e)})}function qn(t,e){const n=t.firstChild;return n?Un(n,e):Vn(t,e)}function Un(t,e){const n=t.parentNode;if(n){const r=Array.isArray(e)?e:[e];r.forEach(e=>{null!=e&&n.insertBefore(e,t)})}}function Wn(t,e){null!=e&&e.appendChild(t)}function $n(t){try{return t instanceof HTMLElement}catch(e){return"object"===typeof t&&1===t.nodeType&&"object"===typeof t.style&&"object"===typeof t.ownerDocument}}const Gn=["viewBox","attributeName","attributeType","repeatCount"];function Yn(t,e){return t.getAttribute(e)}function Xn(t,e){const n=Qn(e);n.ns?t.hasAttributeNS(n.ns,n.local)&&t.removeAttributeNS(n.ns,n.local):t.hasAttribute(e)&&t.removeAttribute(e)}function Kn(t,e,n){if(null==n)return Xn(t,e);const r=Qn(e);r.ns&&"string"===typeof n?t.setAttributeNS(r.ns,e,n):"id"===e?t.id=""+n:t.setAttribute(e,""+n)}function Zn(t,e){Object.keys(e).forEach(n=>{Kn(t,n,e[n])})}function Jn(t,e,n){if(null==e){const e=t.attributes,n={};for(let t=0;t<e.length;t+=1)n[e[t].name]=e[t].value;return n}if("string"===typeof e&&void 0===n)return t.getAttribute(e);"object"===typeof e?Zn(t,e):Kn(t,e,n)}function Qn(t){if(-1!==t.indexOf(":")){const e=t.split(":");return{ns:On[e[0]],local:e[1]}}return{ns:null,local:t}}function tr(t){const e={};return Object.keys(t).forEach(n=>{const r=Gn.includes(n)?n:Se(n);e[r]=t[n]}),e}function er(t){const e={},n=t.split(";");return n.forEach(t=>{const n=t.trim();if(n){const t=n.split("=");t.length&&(e[t[0].trim()]=t[1]?t[1].trim():"")}}),e}function nr(t,e){return Object.keys(e).forEach(n=>{if("class"===n)t[n]=t[n]?`${t[n]} ${e[n]}`:e[n];else if("style"===n){const r="object"===typeof t[n],i="object"===typeof e[n];let o,a;r&&i?(o=t[n],a=e[n]):r?(o=t[n],a=er(e[n])):i?(o=er(t[n]),a=e[n]):(o=er(t[n]),a=er(e[n])),t[n]=nr(o,a)}else t[n]=e[n]}),t}function rr(t,e,n={}){const r=n.offset||0,o=[],a=[];let s,l,c=null;for(let u=0;u<t.length;u+=1){s=a[u]=t[u];for(let i=0,o=e.length;i<o;i+=1){const o=e[i],l=o.start+r,c=o.end+r;u>=l&&u<c&&("string"===typeof s?s=a[u]={t:t[u],attrs:o.attrs}:s.attrs=nr(nr({},s.attrs),o.attrs),n.includeAnnotationIndices&&(null==s.annotations&&(s.annotations=[]),s.annotations.push(i)))}l=a[u-1],l?i.isObject(s)&&i.isObject(l)?(c=c,JSON.stringify(s.attrs)===JSON.stringify(l.attrs)?c.t+=s.t:(o.push(c),c=s)):i.isObject(s)||i.isObject(l)?(c=c,o.push(c),c=s):c=(c||"")+s:c=s}return null!=c&&o.push(c),o}function ir(t,e){return t?t.filter(t=>t.start<e&&e<=t.end):[]}function or(t,e,n){return t?t.filter(t=>e>=t.start&&e<t.end||n>t.start&&n<=t.end||t.start>=e&&t.end<n):[]}function ar(t,e,n){return t&&t.forEach(t=>{t.start<e&&t.end>=e?t.end+=n:t.start>=e&&(t.start+=n,t.end+=n)}),t}function sr(t){return t.replace(/ /g," ")}var lr,cr;let ur;(function(t){function e(t){return null===t||void 0===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t}function n(t){return Array.isArray(t)}function r(t){return!e(t)&&!n(t)}function i(t,r){if(t===r)return!0;if(e(t)||e(r))return!1;const i=n(t),o=n(r);return i===o&&(i&&o?a(t,r):s(t,r))}function o(t){return e(t)?t:n(t)?l(t):c(t)}function a(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n+=1)if(!i(t[n],e[n]))return!1;return!0}function s(t,e){if(t===e)return!0;for(const n in t)if(!(n in e))return!1;for(const n in e)if(!(n in t))return!1;for(const n in t)if(!i(t[n],e[n]))return!1;return!0}function l(t){const e=new Array(t.length);for(let n=0,r=t.length;n<r;n+=1)e[n]=o(t[n]);return e}function c(t){const e={};return Object.keys(t).forEach(n=>{e[n]=o(t[n])}),e}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=r,t.deepEqual=i,t.deepCopy=o})(lr||(lr={})),function(t){function e(t){const e="data:";return t.substr(0,e.length)===e}function n(t,n){if(!t||e(t))return void setTimeout(()=>n(null,t));const r=()=>{n(new Error("Failed to load image: "+t))},i=window.FileReader?t=>{if(200===t.status){const e=new FileReader;e.onload=t=>{const e=t.target.result;n(null,e)},e.onerror=r,e.readAsDataURL(t.response)}else r()}:e=>{const i=t=>{const e=32768,n=[];for(let r=0;r<t.length;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return n.join("")};if(200===e.status){let r=t.split(".").pop()||"png";"svg"===r&&(r="svg+xml");const o=`data:image/${r};base64,`,a=new Uint8Array(e.response),s=o+btoa(i(a));n(null,s)}else r()},o=new XMLHttpRequest;o.responseType=window.FileReader?"blob":"arraybuffer",o.open("GET",t,!0),o.addEventListener("error",r),o.addEventListener("load",()=>i(o)),o.send()}function r(t){let e=t.replace(/\s/g,"");e=decodeURIComponent(e);const n=e.indexOf(","),r=e.slice(0,n),i=r.split(":")[1].split(";")[0],o=e.slice(n+1);let a;a=r.indexOf("base64")>=0?atob(o):unescape(encodeURIComponent(o));const s=new Uint8Array(a.length);for(let l=0;l<a.length;l+=1)s[l]=a.charCodeAt(l);return new Blob([s],{type:i})}function i(t,e){const n=window.navigator.msSaveBlob;if(n)n(t,e);else{const n=window.URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)}}function o(t,e){const n=r(t);i(n,e)}function a(t){const e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}function s(t){const e=parseFloat(t);return Number.isNaN(e)?null:e}function l(t,e={}){let n=null;const r=e=>(null==n&&(n=a(t)),null!=n?s(n[e]):null),i=e=>{const n=t.match(e);return n&&n[2]?s(n[2]):null};let o=e.width;if(null==o&&(o=i(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==o&&(o=r(2)),null==o)throw new Error("Can not parse width from svg string");let l=e.height;if(null==l&&(l=i(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==l&&(l=r(3)),null==l)throw new Error("Can not parse height from svg string");const c=encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22"),u="data:image/svg+xml",d=`${u},${c}`;return d}t.isDataUrl=e,t.imageToDataUri=n,t.dataUriToBlob=r,t.downloadBlob=i,t.downloadDataUri=o,t.svgToDataUrl=l}(cr||(cr={}));const dr={px(t){return t},mm(t){return ur*t},cm(t){return ur*t*10},in(t){return ur*t*25.4},pt(t){return ur*(25.4*t/72)},pc(t){return ur*(25.4*t/6)}};var hr;(function(t){function e(t,e,n){const r=pt()("<div/>").css({display:"inline-block",position:"absolute",left:-15e3,top:-15e3,width:t+(n||""),height:e+(n||"")}).appendTo(document.body),i={width:r.width()||0,height:r.height()||0};return r.remove(),i}function n(t,n){null==ur&&(ur=e("1","1","mm").width);const r=n?dr[n]:null;return r?r(t):t}t.measure=e,t.toPx=n})(hr||(hr={}));const pr=function(){let t;const e=window;if(null!=e&&(t=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame,null!=t&&(t=t.bind(e))),null==t){let e=0;t=t=>{const n=(new Date).getTime(),r=Math.max(0,16-(n-e)),i=setTimeout(()=>{t(n+r)},r);return e=n+r,i}}return t}(),fr=function(){let t;const e=window;return null!=e&&(t=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.webkitCancelRequestAnimationFrame||e.msCancelAnimationFrame||e.msCancelRequestAnimationFrame||e.oCancelAnimationFrame||e.oCancelRequestAnimationFrame||e.mozCancelAnimationFrame||e.mozCancelRequestAnimationFrame,t&&(t=t.bind(e))),null==t&&(t=clearTimeout),t}(),gr=/-(.)/g;function mr(t){return t.replace(gr,(t,e)=>e.toUpperCase())}const vr={},br=["Webkit","ms","Moz","O"],yr=document?document.createElement("div").style:{};function wr(t){for(let e=0;e<br.length;e+=1){const n=br[e]+t;if(n in yr)return n}return null}function xr(t){const e=mr(t);if(null==vr[e]){const t=e.charAt(0).toUpperCase()+e.slice(1);vr[e]=e in yr?e:wr(t)}return vr[e]}function Cr(t,e,n){const r=xr(e);null!=r&&(t[r]=n),t[e]=n}function kr(t,e){const n=t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):window.getComputedStyle(t,null);return n&&e?n.getPropertyValue(e)||n[e]:n}function Ar(t){const e=kr(t);return null!=e&&("scroll"===e.overflow||"auto"===e.overflow)}const Sr=function(){const t=document;return t.selection?function(){t.selection.empty()}:window.getSelection?function(){const t=window.getSelection();t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())}:function(){}}();var Er;function Or(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function Tr(t,e){let n,r;if(null==e?(r=null==t?1:t,n=0):(r=e,n=null==t?0:t),r<n){const t=n;n=r,r=t}return Math.floor(Math.random()*(r-n+1)+n)}function _r(t,e,n){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(n)?0:e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}function Mr(t,e){return e*Math.round(t/e)}function Nr(t,e){return null!=e&&null!=t&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function Pr(t,e){const n=t.x-e.x,r=t.y-e.y;return n*n+r*r}(function(t){function e(t){return 180*t/Math.PI%360}function n(t){return t%360+(t<0?360:0)}t.toDeg=e,t.toRad=function(t,e=!1){const n=e?t:t%360;return n*Math.PI/180},t.normalize=n})(Er||(Er={}));class Lr{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class Dr extends Lr{constructor(t,e){super(),this.x=null==t?0:t,this.y=null==e?0:e}get[Symbol.toStringTag](){return Dr.toStringTag}round(t=0){return this.x=Or(this.x,t),this.y=Or(this.y,t),this}add(t,e){const n=Dr.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=Dr.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=Dr.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=Dr.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new Dr){const r=Dr.create(n);return this.x=r.x+t*(this.x-r.x),this.y=r.y+e*(this.y-r.y),this}closest(t){if(1===t.length)return Dr.create(t[0]);let e=null,n=1/0;return t.forEach(t=>{const r=this.squaredDistance(t);r<n&&(e=t,n=r)}),e?Dr.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=Dr.create(t),n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistance(t){const e=Dr.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new Dr){const e=Dr.create(t),n=-(e.y-this.y),r=e.x-this.x;let i=Math.atan2(n,r);return i<0&&(i=2*Math.PI+i),180*i/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n}vectorAngle(t){const e=new Dr(0,0);return e.angleBetween(this,t)}toPolar(t){return this.update(Dr.toPolar(this,t)),this}changeInAngle(t,e,n=new Dr){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return Nr(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this}bearing(t){const e=Dr.create(t),n=Er.toRad(this.y),r=Er.toRad(e.y),i=this.x,o=e.x,a=Er.toRad(o-i),s=Math.sin(a)*Math.cos(r),l=Math.cos(n)*Math.sin(r)-Math.sin(n)*Math.cos(r)*Math.cos(a),c=Er.toDeg(Math.atan2(s,l)),u=["NE","E","SE","S","SW","W","NW","N"];let d=c-22.5;return d<0&&(d+=360),d=parseInt(d/45,10),u[d]}cross(t,e){if(null!=t&&null!=e){const n=Dr.create(t),r=Dr.create(e);return(r.x-this.x)*(n.y-this.y)-(r.y-this.y)*(n.x-this.x)}return NaN}dot(t){const e=Dr.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if("number"===typeof t)return new Dr(this.x-t,this.y-e);const n=Dr.create(t);return new Dr(this.x-n.x,this.y-n.y)}lerp(t,e){const n=Dr.create(t);return new Dr((1-e)*this.x+e*n.x,(1-e)*this.y+e*n.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const n=Dr.create(t),r=Er.toRad(n.theta(this));return this.translate(Math.cos(r)*e,-Math.sin(r)*e)}reflection(t){return Dr.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=Mr(this.x,t),this.y=Mr(this.y,null==e?t:e),this}equals(t){const e=Dr.create(t);return null!=e&&e.x===this.x&&e.y===this.y}clone(){return Dr.clone(this)}toJSON(){return Dr.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"number"===typeof r.x&&"number"===typeof r.y&&"function"===typeof r.toPolar}t.toStringTag="X6.Geometry."+t.name,t.isPoint=e})(Dr||(Dr={})),function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y}function n(t){return null!=t&&Array.isArray(t)&&2===t.length&&"number"===typeof t[0]&&"number"===typeof t[1]}t.isPointLike=e,t.isPointData=n}(Dr||(Dr={})),function(t){function e(e,r){return null==e||"number"===typeof e?new t(e,r):n(e)}function n(e){return t.isPoint(e)?new t(e.x,e.y):Array.isArray(e)?new t(e[0],e[1]):new t(e.x,e.y)}function r(e){return t.isPoint(e)?{x:e.x,y:e.y}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}function i(e,r,i=new t){let o=Math.abs(e*Math.cos(r)),a=Math.abs(e*Math.sin(r));const s=n(i),l=Er.normalize(Er.toDeg(r));return l<90?a=-a:l<180?(o=-o,a=-a):l<270&&(o=-o),new t(s.x+o,s.y+a)}function o(e,r=new t){const i=n(e),o=n(r),a=i.x-o.x,s=i.y-o.y;return new t(Math.sqrt(a*a+s*s),Er.toRad(o.theta(i)))}function a(t,e){return t===e||null!=t&&null!=e&&(t.x===e.x&&t.y===e.y)}function s(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!==e.length)return!1;if(null!=t&&null!=e)for(let n=0,r=t.length;n<r;n+=1)if(!a(t[n],e[n]))return!1;return!0}function l(e,n,r,i){return new t(Tr(e,n),Tr(r,i))}function c(t,e,n){const r=Er.toRad(Er.normalize(-e)),i=Math.sin(r),o=Math.cos(r);return u(t,o,i,n)}function u(e,r,i,o=new t){const a=n(e),s=n(o),l=a.x-s.x,c=a.y-s.y,u=l*r-c*i,d=c*r+l*i;return new t(u+s.x,d+s.y)}t.create=e,t.clone=n,t.toJSON=r,t.fromPolar=i,t.toPolar=o,t.equals=a,t.equalPoints=s,t.random=l,t.rotate=c,t.rotateEx=u}(Dr||(Dr={}));class jr extends Lr{constructor(t,e,n,r){super(),this.x=null==t?0:t,this.y=null==e?0:e,this.width=null==n?0:n,this.height=null==r?0:r}get[Symbol.toStringTag](){return jr.toStringTag}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new Dr(this.x,this.y)}get topLeft(){return new Dr(this.x,this.y)}get topCenter(){return new Dr(this.x+this.width/2,this.y)}get topRight(){return new Dr(this.x+this.width,this.y)}get center(){return new Dr(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new Dr(this.x,this.y+this.height)}get bottomCenter(){return new Dr(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new Dr(this.x+this.width,this.y+this.height)}get corner(){return new Dr(this.x+this.width,this.y+this.height)}get rightMiddle(){return new Dr(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new Dr(this.x,this.y+this.height/2)}get topLine(){return new Ir(this.topLeft,this.topRight)}get rightLine(){return new Ir(this.topRight,this.bottomRight)}get bottomLine(){return new Ir(this.bottomLeft,this.bottomRight)}get leftLine(){return new Ir(this.topLeft,this.bottomLeft)}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=Er.toRad(t),n=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e)),i=this.width*r+this.height*n,o=this.width*n+this.height*r;return new jr(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(t=0){return this.x=Or(this.x,t),this.y=Or(this.y,t),this.width=Or(this.width,t),this.height=Or(this.height,t),this}add(t,e,n,r){const i=jr.create(t,e,n,r),o=Math.min(this.x,i.x),a=Math.min(this.y,i.y),s=Math.max(this.x+this.width,i.x+i.width),l=Math.max(this.y+this.height,i.y+i.height);return this.x=o,this.y=a,this.width=s-o,this.height=l-a,this}update(t,e,n,r){const i=jr.create(t,e,n,r);return this.x=i.x,this.y=i.y,this.width=i.width,this.height=i.height,this}inflate(t,e){const n=t,r=null!=e?e:t;return this.x-=n,this.y-=r,this.width+=2*n,this.height+=2*r,this}snapToGrid(t,e){const n=this.origin.snapToGrid(t,e),r=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=r.x-n.x,this.height=r.y-n.y,this}translate(t,e){const n=Dr.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new Dr){const r=this.origin.scale(t,e,n);return this.x=r.x,this.y=r.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(0!==t){const n=Er.toRad(t),r=Math.cos(n),i=Math.sin(n);let o=this.getOrigin(),a=this.getTopRight(),s=this.getBottomRight(),l=this.getBottomLeft();o=Dr.rotateEx(o,r,i,e),a=Dr.rotateEx(a,r,i,e),s=Dr.rotateEx(s,r,i,e),l=Dr.rotateEx(l,r,i,e);const c=new jr(o.x,o.y,0,0);c.add(a.x,a.y,0,0),c.add(s.x,s.y,0,0),c.add(l.x,l.y,0,0),this.update(c)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=jr.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const n=jr.clone(t),r=e.x,i=e.y;let o=1/0,a=1/0,s=1/0,l=1/0,c=1/0,u=1/0,d=1/0,h=1/0;const p=n.topLeft;p.x<r&&(o=(this.x-r)/(p.x-r)),p.y<i&&(c=(this.y-i)/(p.y-i));const f=n.bottomRight;f.x>r&&(a=(this.x+this.width-r)/(f.x-r)),f.y>i&&(u=(this.y+this.height-i)/(f.y-i));const g=n.topRight;g.x>r&&(s=(this.x+this.width-r)/(g.x-r)),g.y<i&&(d=(this.y-i)/(g.y-i));const m=n.bottomLeft;return m.x<r&&(l=(this.x-r)/(m.x-r)),m.y>i&&(h=(this.y+this.height-i)/(m.y-i)),{sx:Math.min(o,a,s,l),sy:Math.min(c,u,d,h)}}getMaxUniformScaleToFit(t,e=this.center){const n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)}containsPoint(t,e){return Nr(this,Dr.create(t,e))}containsRect(t,e,n,r){const i=jr.create(t,e,n,r),o=this.x,a=this.y,s=this.width,l=this.height,c=i.x,u=i.y,d=i.width,h=i.height;return 0!==s&&0!==l&&0!==d&&0!==h&&(c>=o&&u>=a&&c+d<=o+s&&u+h<=a+l)}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],r=[];return e.forEach(e=>{const i=t.intersectsWithLine(e);null!==i&&r.indexOf(i.toString())<0&&(n.push(i),r.push(i.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(t,e){const n=Dr.clone(t),r=this.center;let i=null;null!=e&&0!==e&&n.rotate(e,r);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new Ir(r,n);for(let s=o.length-1;s>=0;s-=1){const t=o[s].intersectsWithLine(a);if(null!==t){i=t;break}}return i&&null!=e&&0!==e&&i.rotate(-e,r),i}intersectsWithRect(t,e,n,r){const i=jr.create(t,e,n,r);if(!this.isIntersectWithRect(i))return null;const o=this.origin,a=this.corner,s=i.origin,l=i.corner,c=Math.max(o.x,s.x),u=Math.max(o.y,s.y);return new jr(c,u,Math.min(a.x,l.x)-c,Math.min(a.y,l.y)-u)}isIntersectWithRect(t,e,n,r){const i=jr.create(t,e,n,r),o=this.origin,a=this.corner,s=i.origin,l=i.corner;return!(l.x<=o.x||l.y<=o.y||s.x>=a.x||s.y>=a.y)}normalize(){let t=this.x,e=this.y,n=this.width,r=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,r=-this.height),this.x=t,this.y=e,this.width=n,this.height=r,this}union(t){const e=jr.clone(t),n=this.origin,r=this.corner,i=e.origin,o=e.corner,a=Math.min(n.x,i.x),s=Math.min(n.y,i.y),l=Math.max(r.x,o.x),c=Math.max(r.y,o.y);return new jr(a,s,l-a,c-s)}getNearestSideToPoint(t){const e=Dr.clone(t),n=e.x-this.x,r=this.x+this.width-e.x,i=e.y-this.y,o=this.y+this.height-e.y;let a=n,s="left";return r<a&&(a=r,s="right"),i<a&&(a=i,s="top"),o<a&&(s="bottom"),s}getNearestPointToPoint(t){const e=Dr.clone(t);if(this.containsPoint(e)){const t=this.getNearestSideToPoint(e);switch(t){case"right":return new Dr(this.x+this.width,e.y);case"left":return new Dr(this.x,e.y);case"bottom":return new Dr(e.x,this.y+this.height);case"top":return new Dr(e.x,this.y);default:break}}return e.adhereToRect(this)}equals(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new jr(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"number"===typeof r.x&&"number"===typeof r.y&&"number"===typeof r.width&&"number"===typeof r.height&&"function"===typeof r.inflate&&"function"===typeof r.moveAndExpand}t.toStringTag="X6.Geometry."+t.name,t.isRectangle=e})(jr||(jr={})),function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y&&"number"===typeof t.width&&"number"===typeof t.height}t.isRectangleLike=e}(jr||(jr={})),function(t){function e(e,r,i,o){return null==e||"number"===typeof e?new t(e,r,i,o):n(e)}function n(e){return t.isRectangle(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.width,e.height)}function r(e){return new t(0,0,e.width,e.height)}function i(e,n){return new t(e.x,e.y,n.width,n.height)}function o(e){return new t(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}t.create=e,t.clone=n,t.fromSize=r,t.fromPositionAndSize=i,t.fromEllipse=o}(jr||(jr={}));class Ir extends Lr{constructor(t,e,n,r){super(),"number"===typeof t&&"number"===typeof e?(this.start=new Dr(t,e),this.end=new Dr(n,r)):(this.start=Dr.create(t),this.end=Dr.create(e))}get[Symbol.toStringTag](){return Ir.toStringTag}get center(){return new Dr((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return"number"===typeof t?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const n=t/e;return this.scale(n,n,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:n,end:r}=e,i=n.clone().rotate(270,r),o=r.clone().rotate(90,n);return n.move(o,t),r.move(i,t),e}vector(){return new Dr(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new Dr(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),r=Math.max(this.start.y,this.end.y);return new jr(t,e,n-t,r-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new Ir(this.start,t).vector()),n=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(t){const e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)}pointAtLength(t){const e=this.start,n=this.end;let r=!0;t<0&&(r=!1,t=-t);const i=this.length();if(t>=i)return r?n.clone():e.clone();const o=(r?t:i-t)/i;return this.pointAt(o)}divideAt(t){const e=this.pointAt(t);return[new Ir(this.start,e),new Ir(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new Ir(this.start,e),new Ir(e,this.end)]}containsPoint(t){const e=this.start,n=this.end;if(0!==e.cross(t,n))return!1;const r=this.length();return!(new Ir(e,t).length()>r)&&!(new Ir(t,n).length()>r)}intersect(t,e){const n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(t){const e=new Dr(this.end.x-this.start.x,this.end.y-this.start.y),n=new Dr(t.end.x-t.start.x,t.end.y-t.start.y),r=e.x*n.y-e.y*n.x,i=new Dr(t.start.x-this.start.x,t.start.y-this.start.y),o=i.x*n.y-i.y*n.x,a=i.x*e.y-i.y*e.x;if(0===r||o*r<0||a*r<0)return null;if(r>0){if(o>r||a>r)return null}else if(o<r||a<r)return null;return new Dr(this.start.x+o*e.x/r,this.start.y+o*e.y/r)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=Dr.clone(t),n=this.start,r=this.end,i=(r.x-n.x)*(e.y-n.y)-(r.y-n.y)*(e.x-n.x);return i/this.length()}pointSquaredDistance(t,e){const n=Dr.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=Dr.create(t,e);return this.closestPoint(n).distance(n)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,r=this.pointAt(t),i=new Ir(e,n);return i.translate(r.x-e.x,r.y-e.y),i}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,r=this.pointAtLength(t),i=new Ir(e,n);return i.translate(r.x-e.x,r.y-e.y),i}relativeCcw(t,e){const n=Dr.create(t,e);let r=n.x-this.start.x,i=n.y-this.start.y;const o=this.end.x-this.start.x,a=this.end.y-this.start.y;let s=r*a-i*o;return 0===s&&(s=r*o+i*a,s>0&&(r-=o,i-=a,s=r*o+i*a,s<0&&(s=0))),s<0?-1:s>0?1:0}equals(t){return null!=t&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new Ir(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;try{if((null==n||n===t.toStringTag)&&Dr.isPoint(r.start)&&Dr.isPoint(r.end)&&"function"===typeof r.vector&&"function"===typeof r.bearing&&"function"===typeof r.parallel&&"function"===typeof r.intersect)return!0}catch(i){return!1}return!1}t.toStringTag="X6.Geometry."+t.name,t.isLine=e})(Ir||(Ir={}));class Rr extends Lr{constructor(t,e,n,r){super(),this.x=null==t?0:t,this.y=null==e?0:e,this.a=null==n?0:n,this.b=null==r?0:r}get[Symbol.toStringTag](){return Rr.toStringTag}get center(){return new Dr(this.x,this.y)}bbox(){return jr.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const n=t,r=null!=e?e:t;return this.a+=2*n,this.b+=2*r,this}normalizedDistance(t,e){const n=Dr.create(t,e),r=n.x-this.x,i=n.y-this.y,o=this.a,a=this.b;return r*r/(o*o)+i*i/(a*a)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],n=this.a,r=this.b,i=t.start,o=t.end,a=t.vector(),s=i.diff(new Dr(this.x,this.y)),l=new Dr(a.x/(n*n),a.y/(r*r)),c=new Dr(s.x/(n*n),s.y/(r*r)),u=a.dot(l),d=a.dot(c),h=s.dot(c)-1,p=d*d-u*h;if(p<0)return null;if(p>0){const t=Math.sqrt(p),n=(-d-t)/u,r=(-d+t)/u;if((n<0||n>1)&&(r<0||r>1))return null;n>=0&&n<=1&&e.push(i.lerp(o,n)),r>=0&&r<=1&&e.push(i.lerp(o,r))}else{const t=-d/u;if(!(t>=0&&t<=1))return null;e.push(i.lerp(o,t))}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=Dr.clone(t);e&&n.rotate(e,this.getCenter());const r=n.x-this.x,i=n.y-this.y;let o;if(0===r)return o=this.bbox().getNearestPointToPoint(n),e?o.rotate(-e,this.getCenter()):o;const a=i/r,s=a*a,l=this.a*this.a,c=this.b*this.b;let u=Math.sqrt(1/(1/l+s/c));u=r<0?-u:u;const d=a*u;return o=new Dr(this.x+u,this.y+d),e?o.rotate(-e,this.getCenter()):o}tangentTheta(t){const e=Dr.clone(t),n=e.x,r=e.y,i=this.a,o=this.b,a=this.bbox().center,s=a.x,l=a.y,c=30,u=n>a.x+i/2,d=n<a.x-i/2;let h,p;return u||d?(p=n>a.x?r-c:r+c,h=i*i/(n-s)-i*i*(r-l)*(p-l)/(o*o*(n-s))+s):(h=r>a.y?n+c:n-c,p=o*o/(r-l)-o*o*(n-s)*(h-s)/(i*i*(r-l))+l),new Dr(h,p).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=jr.fromEllipse(this);n.rotate(t,e);const r=Rr.fromRect(n);return this.a=r.a,this.b=r.b,this.x=r.x,this.y=r.y,this}translate(t,e){const n=Dr.create(t,e);return this.x+=n.x,this.y+=n.y,this}equals(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new Rr(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"number"===typeof r.x&&"number"===typeof r.y&&"number"===typeof r.a&&"number"===typeof r.b&&"function"===typeof r.inflate&&"function"===typeof r.normalizedDistance}t.toStringTag="X6.Geometry."+t.name,t.isEllipse=e})(Rr||(Rr={})),function(t){function e(e,r,i,o){return null==e||"number"===typeof e?new t(e,r,i,o):n(e)}function n(e){return t.isEllipse(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.a,e.b)}function r(e){const n=e.center;return new t(n.x,n.y,e.width/2,e.height/2)}t.create=e,t.parse=n,t.fromRect=r}(Rr||(Rr={}));class Fr extends Lr{constructor(t){if(super(),null!=t){if("string"===typeof t)return Fr.parse(t);this.points=t.map(t=>Dr.create(t))}else this.points=[]}get[Symbol.toStringTag](){return Fr.toStringTag}get start(){return 0===this.points.length?null:this.points[0]}get end(){return 0===this.points.length?null:this.points[this.points.length-1]}scale(t,e,n=new Dr){return this.points.forEach(r=>r.scale(t,e,n)),this}rotate(t,e){return this.points.forEach(n=>n.rotate(t,e)),this}translate(t,e){const n=Dr.create(t,e);return this.points.forEach(t=>t.translate(n.x,n.y)),this}bbox(){if(0===this.points.length)return new jr;let t=1/0,e=-1/0,n=1/0,r=-1/0;const i=this.points;for(let o=0,a=i.length;o<a;o+=1){const a=i[o],s=a.x,l=a.y;s<t&&(t=s),s>e&&(e=s),l<n&&(n=l),l>r&&(r=l)}return new jr(t,n,e-t,r-n)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,n=e.length;if(0===n||1===n)return 0;let r=0,i=0,o=1/0;for(let a=0,s=n-1;a<s;a+=1){const n=new Ir(e[a],e[a+1]),s=n.length(),l=n.closestPointNormalizedLength(t),c=n.pointAt(l),u=c.squaredDistance(t);u<o&&(o=u,i=r+l*s),r+=s}return i}closestPointNormalizedLength(t){const e=this.closestPointLength(t);if(0===e)return 0;const n=this.length();return 0===n?0:e/n}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(0===this.points.length)return!1;const e=Dr.clone(t),n=e.x,r=e.y,i=this.points,o=i.length;let a=o-1,s=0;for(let l=0;l<o;l+=1){const o=i[a],c=i[l];if(e.equals(o))return!0;const u=new Ir(o,c);if(u.containsPoint(t))return!0;if(r<=o.y&&r>c.y||r>o.y&&r<=c.y){const e=o.x-n>c.x-n?o.x-n:c.x-n;if(e>=0){const i=new Dr(n+e,r),o=new Ir(t,i);u.intersectsWithLine(o)&&(s+=1)}}a=l}return s%2===1}intersectsWithLine(t){const e=[];for(let n=0,r=this.points.length-1;n<r;n+=1){const r=this.points[n],i=this.points[n+1],o=t.intersectsWithLine(new Ir(r,i));o&&e.push(o)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const e=this.points[t],n=this.points[t+1],r=new Ir(e,n);if(r.isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,n=this.points.length-1;e<n;e+=1){const n=this.points[e],r=this.points[e+1];t+=n.distance(r)}return t}pointAt(t){const e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();if(t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();const r=this.length(),i=r*t;return this.pointAtLength(i)}pointAtLength(t){const e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();let r=!0;t<0&&(r=!1,t=-t);let i=0;for(let a=0,s=n-1;a<s;a+=1){const n=r?a:s-1-a,o=e[n],l=e[n+1],c=new Ir(o,l),u=o.distance(l);if(t<=i+u)return c.pointAtLength((r?1:-1)*(t-i));i+=u}const o=r?e[n-1]:e[0];return o.clone()}tangentAt(t){const e=this.points,n=e.length;if(0===n||1===n)return null;t<0&&(t=0),t>1&&(t=1);const r=this.length(),i=r*t;return this.tangentAtLength(i)}tangentAtLength(t){const e=this.points,n=e.length;if(0===n||1===n)return null;let r,i=!0;t<0&&(i=!1,t=-t);let o=0;for(let a=0,s=n-1;a<s;a+=1){const n=i?a:s-1-a,l=e[n],c=e[n+1],u=new Ir(l,c),d=l.distance(c);if(u.isDifferentiable()){if(t<=o+d)return u.tangentAtLength((i?1:-1)*(t-o));r=u}o+=d}if(r){const t=i?1:0;return r.tangentAt(t)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const n=t.threshold||0;let r=0;while(e[r+2]){const t=r,i=r+1,o=r+2,a=e[t],s=e[i],l=e[o],c=new Ir(a,l),u=c.closestPoint(s),d=u.distance(s);d<=n?e.splice(i,1):r+=1}return this}toHull(){const t=this.points,e=t.length;if(0===e)return new Fr;let n=t[0];for(let d=1;d<e;d+=1)(t[d].y<n.y||t[d].y===n.y&&t[d].x>n.x)&&(n=t[d]);const r=[];for(let d=0;d<e;d+=1){let e=n.theta(t[d]);0===e&&(e=360),r.push([t[d],d,e])}if(r.sort((t,e)=>{let n=t[2]-e[2];return 0===n&&(n=e[1]-t[1]),n}),r.length>2){const t=r[r.length-1];r.unshift(t)}const i={},o=[],a=t=>`${t[0].toString()}@${t[1]}`;while(0!==r.length){const t=r.pop(),e=t[0];if(i[a(t)])continue;let n=!1;while(!n)if(o.length<2)o.push(t),n=!0;else{const s=o.pop(),l=s[0],c=o.pop(),u=c[0],d=u.cross(l,e);if(d<0)o.push(c),o.push(s),o.push(t),n=!0;else if(0===d){const t=1e-10,n=l.angleBetween(u,e);Math.abs(n-180)<t||l.equals(e)||u.equals(l)?(i[a(s)]=l,o.push(c)):Math.abs((n+1)%360-1)<t&&(o.push(c),r.push(s))}else i[a(s)]=l,o.push(c)}}let s;o.length>2&&o.pop();let l=-1;for(let d=0,h=o.length;d<h;d+=1){const t=o[d][1];(void 0===s||t<s)&&(s=t,l=d)}let c=[];if(l>0){const t=o.slice(l),e=o.slice(0,l);c=t.concat(e)}else c=o;const u=[];for(let d=0,h=c.length;d<h;d+=1)u.push(c[d][0]);return new Fr(u)}equals(t){return null!=t&&(t.points.length===this.points.length&&t.points.every((t,e)=>t.equals(this.points[e])))}clone(){return new Fr(this.points.map(t=>t.clone()))}toJSON(){return this.points.map(t=>t.toJSON())}serialize(){return this.points.map(t=>`${t.x}, ${t.y}`).join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"===typeof r.toHull&&"function"===typeof r.simplify}t.toStringTag="X6.Geometry."+t.name,t.isPolyline=e})(Fr||(Fr={})),function(t){function e(e){const n=e.trim();if(""===n)return new t;const r=[],i=n.split(/\s*,\s*|\s+/);for(let t=0,o=i.length;t<o;t+=2)r.push({x:+i[t],y:+i[t+1]});return new t(r)}t.parse=e}(Fr||(Fr={}));class Br extends Lr{constructor(t,e,n,r){super(),this.PRECISION=3,this.start=Dr.create(t),this.controlPoint1=Dr.create(e),this.controlPoint2=Dr.create(n),this.end=Dr.create(r)}get[Symbol.toStringTag](){return Br.toStringTag}bbox(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,r=this.end,i=t.x,o=t.y,a=e.x,s=e.y,l=n.x,c=n.y,u=r.x,d=r.y,h=[],p=[],f=[[],[]];let g,m,v,b,y,w,x,C,k,A,S;for(let P=0;P<2;P+=1)if(0===P?(m=6*i-12*a+6*l,g=-3*i+9*a-9*l+3*u,v=3*a-3*i):(m=6*o-12*s+6*c,g=-3*o+9*s-9*c+3*d,v=3*s-3*o),Math.abs(g)<1e-12){if(Math.abs(m)<1e-12)continue;b=-v/m,b>0&&b<1&&p.push(b)}else x=m*m-4*v*g,C=Math.sqrt(x),x<0||(y=(-m+C)/(2*g),y>0&&y<1&&p.push(y),w=(-m-C)/(2*g),w>0&&w<1&&p.push(w));let E=p.length;const O=E;while(E)E-=1,b=p[E],S=1-b,k=S*S*S*i+3*S*S*b*a+3*S*b*b*l+b*b*b*u,f[0][E]=k,A=S*S*S*o+3*S*S*b*s+3*S*b*b*c+b*b*b*d,f[1][E]=A,h[E]={X:k,Y:A};p[O]=0,p[O+1]=1,h[O]={X:i,Y:o},h[O+1]={X:u,Y:d},f[0][O]=i,f[1][O]=o,f[0][O+1]=u,f[1][O+1]=d,p.length=O+2,f[0].length=O+2,f[1].length=O+2,h.length=O+2;const T=Math.min.apply(null,f[0]),_=Math.min.apply(null,f[1]),M=Math.max.apply(null,f[0]),N=Math.max.apply(null,f[1]);return new jr(T,_,M-T,N-_)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),r=this.closestPointLength(t,n);if(!r)return 0;const i=this.length(n);return 0===i?0:r/i}closestPointT(t,e={}){const n=this.getPrecision(e),r=this.getDivisions(e),i=Math.pow(10,-n);let o=null,a=0,s=0,l=0,c=0,u=0,d=null;const h=r.length;let p=h>0?1/h:0;r.forEach((e,n)=>{const r=e.start.distance(t),i=e.end.distance(t),h=r+i;(null==d||h<d)&&(o=e,a=n*p,s=(n+1)*p,l=r,c=i,d=h,u=e.endpointDistance())});while(1){const e=l?Math.abs(l-c)/l:0,n=null!=c?Math.abs(l-c)/c:0,r=e<i||n<i,d=!l||l<u*i,h=!c||c<u*i,f=d||h;if(r||f)return l<=c?a:s;const g=o.divide(.5);p/=2;const m=g[0].start.distance(t),v=g[0].end.distance(t),b=m+v,y=g[1].start.distance(t),w=g[1].end.distance(t),x=y+w;b<=x?(o=g[0],s-=p,l=m,c=v):(o=g[1],a+=p,l=y,c=w)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){const n=this.toPolyline(e);return n.containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const n=this.tAt(t,e);return this.divideAtT(n)}divideAtLength(t,e={}){const n=this.tAtLength(t,e);return this.divideAtT(n)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,n=this.controlPoint1,r=this.controlPoint2,i=this.end;if(t<=0)return[new Br(e,e,e,e),new Br(e,n,r,i)];if(t>=1)return[new Br(e,n,r,i),new Br(i,i,i,i)];const o=this.getSkeletonPoints(t),a=o.startControlPoint1,s=o.startControlPoint2,l=o.divider,c=o.dividerControlPoint1,u=o.dividerControlPoint2;return[new Br(e,a,s,l),new Br(l,c,u,i)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,n=this.controlPoint1,r=this.controlPoint2,i=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:r.clone()};if(t>=1)return{startControlPoint1:n.clone(),startControlPoint2:r.clone(),divider:i.clone(),dividerControlPoint1:i.clone(),dividerControlPoint2:i.clone()};const o=new Ir(e,n).pointAt(t),a=new Ir(n,r).pointAt(t),s=new Ir(r,i).pointAt(t),l=new Ir(o,a).pointAt(t),c=new Ir(a,s).pointAt(t),u=new Ir(l,c).pointAt(t);return{startControlPoint1:o,startControlPoint2:l,divider:u,dividerControlPoint1:c,dividerControlPoint2:s}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new Br(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===e)return n;let r=this.endpointDistance();const i=Math.pow(10,-e);let o=0;while(1){o+=1;const t=[];n.forEach(e=>{const n=e.divide(.5);t.push(n[0],n[1])});const e=t.reduce((t,e)=>t+e.endpointDistance(),0),a=0!==e?(e-r)/e:0;if(o>1&&a<i)return t;n=t,r=e}}length(t={}){const e=this.getDivisions(t);return e.reduce((t,e)=>t+e.endpointDistance(),0)}lengthAtT(t,e={}){if(t<=0)return 0;const n=void 0===e.precision?this.PRECISION:e.precision,r=this.divide(t)[0];return r.length({precision:n})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.tAt(t,e);return this.pointAtT(n)}pointAtLength(t,e={}){const n=this.tAtLength(t,e);return this.pointAtT(n)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(r))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const n=this.tAt(t,e);return this.tangentAtT(n)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(t,e);return this.tangentAtT(n)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),n=e.startControlPoint2,r=e.dividerControlPoint1,i=e.divider,o=new Ir(n,r);return o.translate(i.x-n.x,i.y-n.y),o}getPrecision(t={}){return null==t.precision?this.PRECISION:t.precision}getDivisions(t={}){if(null!=t.subdivisions)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),n=this.getDivisions(t);return{precision:e,subdivisions:n}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const n=this.getOptions(e),r=this.length(n),i=r*t;return this.tAtLength(i,n)}tAtLength(t,e={}){let n=!0;t<0&&(n=!1,t=-t);const r=this.getPrecision(e),i=this.getDivisions(e),o={precision:r,subdivisions:i};let a,s,l=null,c=0,u=0,d=0;const h=i.length;let p=h>0?1/h:0;for(let m=0;m<h;m+=1){const e=n?m:h-1-m,r=i[m],o=r.endpointDistance();if(t<=d+o){l=r,a=e*p,s=(e+1)*p,c=n?t-d:o+d-t,u=n?o+d-t:t-d;break}d+=o}if(null==l)return n?1:0;const f=this.length(o),g=Math.pow(10,-r);while(1){let t,e,n;if(t=0!==f?c/f:0,t<g)return a;if(t=0!==f?u/f:0,t<g)return s;const r=l.divide(.5);p/=2;const i=r[0].endpointDistance(),o=r[1].endpointDistance();c<=i?(l=r[0],s-=p,e=c,n=i-e):(l=r[1],a+=p,e=c-i,n=o-e),c=e,u=n}}toPoints(t={}){const e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach(t=>n.push(t.end.clone())),n}toPolyline(t={}){return new Fr(this.toPoints(t))}scale(t,e,n){return this.start.scale(t,e,n),this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return null!=t&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new Br(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;try{if((null==n||n===t.toStringTag)&&Dr.isPoint(r.start)&&Dr.isPoint(r.controlPoint1)&&Dr.isPoint(r.controlPoint2)&&Dr.isPoint(r.end)&&"function"===typeof r.toPoints&&"function"===typeof r.toPolyline)return!0}catch(i){return!1}return!1}t.toStringTag="X6.Geometry."+t.name,t.isCurve=e})(Br||(Br={})),function(t){function e(t){const e=t.length,n=[],r=[];let i=2;n[0]=t[0]/i;for(let o=1;o<e;o+=1)r[o]=1/i,i=(o<e-1?4:3.5)-r[o],n[o]=(t[o]-n[o-1])/i;for(let o=1;o<e;o+=1)n[e-o-1]-=r[e-o]*n[e-o];return n}function n(t){const n=t.map(t=>Dr.clone(t)),r=[],i=[],o=n.length-1;if(1===o)return r[0]=new Dr((2*n[0].x+n[1].x)/3,(2*n[0].y+n[1].y)/3),i[0]=new Dr(2*r[0].x-n[0].x,2*r[0].y-n[0].y),[r,i];const a=[];for(let e=1;e<o-1;e+=1)a[e]=4*n[e].x+2*n[e+1].x;a[0]=n[0].x+2*n[1].x,a[o-1]=(8*n[o-1].x+n[o].x)/2;const s=e(a);for(let e=1;e<o-1;e+=1)a[e]=4*n[e].y+2*n[e+1].y;a[0]=n[0].y+2*n[1].y,a[o-1]=(8*n[o-1].y+n[o].y)/2;const l=e(a);for(let e=0;e<o;e+=1)r.push(new Dr(s[e],l[e])),e<o-1?i.push(new Dr(2*n[e+1].x-s[e+1],2*n[e+1].y-l[e+1])):i.push(new Dr((n[o].x+s[o-1])/2,(n[o].y+l[o-1])/2));return[r,i]}function r(e){if(null==e||Array.isArray(e)&&e.length<2)throw new Error("At least 2 points are required");const r=n(e),i=[];for(let n=0,o=r[0].length;n<o;n+=1){const o=new Dr(r[0][n].x,r[0][n].y),a=new Dr(r[1][n].x,r[1][n].y);i.push(new t(e[n],o,a,e[n+1]))}return i}t.throughPoints=r}(Br||(Br={}));class zr extends Lr{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(null==this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const n=this.length();return t>=1?n:n*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class Hr extends zr{constructor(t,e){super(),Ir.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=Dr.create(t,e).round(2)}get type(){return"L"}get line(){return new Ir(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new Hr(e[0]),new Hr(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new Hr(e[0]),new Hr(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return null!=this.previousSegment&&!this.start.equals(this.end)}clone(){return new Hr(this.end)}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(t){function e(...e){const n=e.length,r=e[0];if(Ir.isLine(r))return new t(r);if(Dr.isPointLike(r))return 1===n?new t(r):e.map(e=>new t(e));if(2===n)return new t(+e[0],+e[1]);const i=[];for(let o=0;o<n;o+=2){const n=+e[o],r=+e[o+1];i.push(new t(n,r))}return i}t.create=e})(Hr||(Hr={}));class Vr extends zr{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new Ir(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new Hr(e[0]):this.clone(),new Hr(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new Hr(e[0]):this.clone(),new Hr(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new Vr}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(t){function e(){return new t}t.create=e})(Vr||(Vr={}));class qr extends zr{constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,Ir.isLine(t)||Br.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=Dr.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this}clone(){return new qr(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(t){function e(...e){const n=e.length,r=e[0];if(Ir.isLine(r))return new t(r);if(Br.isCurve(r))return new t(r);if(Dr.isPointLike(r)){if(1===n)return new t(r);const i=[];for(let r=0;r<n;r+=1)0===r?i.push(new t(e[r])):i.push(new Hr(e[r]));return i}if(2===n)return new t(+e[0],+e[1]);const i=[];for(let o=0;o<n;o+=2){const n=+e[o],r=+e[o+1];0===o?i.push(new t(n,r)):i.push(new Hr(n,r))}return i}t.create=e})(qr||(qr={}));class Ur extends zr{constructor(t,e,n,r,i,o){super(),Br.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):"number"===typeof t?(this.controlPoint1=new Dr(t,e).round(2),this.controlPoint2=new Dr(n,r).round(2),this.endPoint=new Dr(i,o).round(2)):(this.controlPoint1=Dr.create(t).round(2),this.controlPoint2=Dr.create(e).round(2),this.endPoint=Dr.create(n).round(2))}get type(){return"C"}get curve(){return new Br(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const n=this.curve.divideAt(t,e);return[new Ur(n[0]),new Ur(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new Ur(n[0]),new Ur(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new Ur(e[0]),new Ur(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,n=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(r))}scale(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new Ur(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.controlPoint1,e=this.controlPoint2,n=this.end;return[this.type,t.x,t.y,e.x,e.y,n.x,n.y].join(" ")}}function Wr(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function $r(t,e,n,r,i,o){const a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}function Gr(t,e,n,r,i,o,a,s,l,c){const u=120*Math.PI/180,d=Math.PI/180*(+i||0);let h,p,f,g,m,v=[];if(c)p=c[0],f=c[1],g=c[2],m=c[3];else{h=Wr(t,e,-d),t=h.x,e=h.y,h=Wr(s,l,-d),s=h.x,l=h.y;const i=(t-s)/2,c=(e-l)/2;let u=i*i/(n*n)+c*c/(r*r);u>1&&(u=Math.sqrt(u),n*=u,r*=u);const v=n*n,b=r*r,y=(o===a?-1:1)*Math.sqrt(Math.abs((v*b-v*c*c-b*i*i)/(v*c*c+b*i*i)));g=y*n*c/r+(t+s)/2,m=y*-r*i/n+(e+l)/2,p=Math.asin((e-m)/r),f=Math.asin((l-m)/r),p=t<g?Math.PI-p:p,f=s<g?Math.PI-f:f,p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),a&&p>f&&(p-=2*Math.PI),!a&&f>p&&(f-=2*Math.PI)}let b=f-p;if(Math.abs(b)>u){const t=f,e=s,o=l;f=p+u*(a&&f>p?1:-1),s=g+n*Math.cos(f),l=m+r*Math.sin(f),v=Gr(s,l,n,r,i,0,a,e,o,[f,t,g,m])}b=f-p;const y=Math.cos(p),w=Math.sin(p),x=Math.cos(f),C=Math.sin(f),k=Math.tan(b/4),A=4/3*(n*k),S=4/3*(r*k),E=[t,e],O=[t+A*w,e-S*y],T=[s+A*C,l-S*x],_=[s,l];if(O[0]=2*E[0]-O[0],O[1]=2*E[1]-O[1],c)return[O,T,_].concat(v);{v=[O,T,_].concat(v).join().split(",");const t=[],e=v.length;for(let n=0;n<e;n+=1)t[n]=n%2?Wr(+v[n-1],+v[n],d).y:Wr(+v[n],+v[n+1],d).x;return t}}function Yr(t){if(!t)return null;const e="\t\n\v\f\r    \u2028\u2029",n=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),r=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return t.replace(n,(t,e,n)=>{const a=[];let s=e.toLowerCase();n.replace(r,(t,e)=>(e&&a.push(+e),t)),"m"===s&&a.length>2&&(o.push([e,...a.splice(0,2)]),s="l",e="m"===e?"l":"L");const l=i[s];while(a.length>=l)if(o.push([e,...a.splice(0,l)]),!l)break;return t}),o}function Xr(t){const e=Yr(t);if(!e||!e.length)return[["M",0,0]];let n=0,r=0,i=0,o=0;const a=[];for(let s=0,l=e.length;s<l;s+=1){const t=[];a.push(t);const l=e[s],c=l[0];if(c!==c.toUpperCase())switch(t[0]=c.toUpperCase(),t[0]){case"A":t[1]=l[1],t[2]=l[2],t[3]=l[3],t[4]=l[4],t[5]=l[5],t[6]=+l[6]+n,t[7]=+l[7]+r;break;case"V":t[1]=+l[1]+r;break;case"H":t[1]=+l[1]+n;break;case"M":i=+l[1]+n,o=+l[2]+r;for(let e=1,i=l.length;e<i;e+=1)t[e]=+l[e]+(e%2?n:r);break;default:for(let e=1,i=l.length;e<i;e+=1)t[e]=+l[e]+(e%2?n:r);break}else for(let e=0,n=l.length;e<n;e+=1)t[e]=l[e];switch(t[0]){case"Z":n=+i,r=+o;break;case"H":n=t[1];break;case"V":r=t[1];break;case"M":i=t[t.length-2],o=t[t.length-1],n=t[t.length-2],r=t[t.length-1];break;default:n=t[t.length-2],r=t[t.length-1];break}}return a}function Kr(t){const e=Xr(t),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function r(t,e,n){let r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(t[0]in{T:1,Q:1}||(e.qx=null,e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":return 0===parseFloat(t[1])||0===parseFloat(t[2])?["L",t[6],t[7]]:["C"].concat(Gr.apply(0,[e.x,e.y].concat(t.slice(1))));case"S":return"C"===n||"S"===n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),["C",r,i].concat(t.slice(1));case"T":return"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),["C"].concat($r(e.x,e.y,e.qx,e.qy,t[1],t[2]));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat($r(e.x,e.y,t[1],t[2],t[3],t[4]));case"H":return["L"].concat(t[1],e.y);case"V":return["L"].concat(e.x,t[1]);case"L":break;case"Z":break;default:break}return t}function i(t,n){if(t[n].length>7){t[n].shift();const r=t[n];while(r.length)o[n]="A",n+=1,t.splice(n,0,["C"].concat(r.splice(0,6)));t.splice(n,1),s=e.length}}const o=[];let a="",s=e.length;for(let l=0;l<s;l+=1){let t="";e[l]&&(t=e[l][0]),"C"!==t&&(o[l]=t,l>0&&(a=o[l-1])),e[l]=r(e[l],n,a),"A"!==o[l]&&"C"===t&&(o[l]="C"),i(e,l);const s=e[l],c=s.length;n.x=s[c-2],n.y=s[c-1],n.bx=parseFloat(s[c-4])||n.x,n.by=parseFloat(s[c-3])||n.y}return e[0][0]&&"M"===e[0][0]||e.unshift(["M",0,0]),e}function Zr(t){return Kr(t).map(t=>t.map(t=>"string"===typeof t?t:Or(t,2))).join(",").split(",").join(" ")}(function(t){function e(...e){const n=e.length,r=e[0];if(Br.isCurve(r))return new t(r);if(Dr.isPointLike(r)){if(3===n)return new t(e[0],e[1],e[2]);const r=[];for(let i=0;i<n;i+=3)r.push(new t(e[i],e[i+1],e[i+2]));return r}if(6===n)return new t(e[0],e[1],e[2],e[3],e[4],e[5]);const i=[];for(let o=0;o<n;o+=6)i.push(new t(e[o],e[o+1],e[o+2],e[o+3],e[o+4],e[o+5]));return i}t.create=e})(Ur||(Ur={}));const Jr=new RegExp("^[\\s\\dLMCZz,.]*$");function Qr(t){return"string"===typeof t&&Jr.test(t)}function ti(t,e){return(t%e+e)%e}function ei(t,e,n,r,i){const o=[],a=t[t.length-1],s=null!=e&&e>0,l=e||0;if(r&&s){t=t.slice();const e=t[0],n=new Dr(a.x+(e.x-a.x)/2,a.y+(e.y-a.y)/2);t.splice(0,0,n)}let c=t[0],u=1;n?o.push("M",c.x,c.y):o.push("L",c.x,c.y);while(u<(r?t.length:t.length-1)){let e=t[ti(u,t.length)],n=c.x-e.x,r=c.y-e.y;if(s&&(0!==n||0!==r)&&(null==i||i.indexOf(u-1)<0)){let i=Math.sqrt(n*n+r*r);const a=n*Math.min(l,i/2)/i,s=r*Math.min(l,i/2)/i,c=e.x+a,d=e.y+s;o.push("L",c,d);let h=t[ti(u+1,t.length)];while(u<t.length-2&&0===Math.round(h.x-e.x)&&0===Math.round(h.y-e.y))h=t[ti(u+2,t.length)],u+=1;n=h.x-e.x,r=h.y-e.y,i=Math.max(1,Math.sqrt(n*n+r*r));const p=n*Math.min(l,i/2)/i,f=r*Math.min(l,i/2)/i,g=e.x+p,m=e.y+f;o.push("Q",e.x,e.y,g,m),e=new Dr(g,m)}else o.push("L",e.x,e.y);c=e,u+=1}return r?o.push("Z"):o.push("L",a.x,a.y),o.map(t=>"string"===typeof t?t:+t.toFixed(3)).join(" ")}function ni(t,e={}){const n=[];return t&&t.length&&t.forEach(t=>{Array.isArray(t)?n.push({x:t[0],y:t[1]}):n.push({x:t.x,y:t.y})}),ei(n,e.round,null==e.initialMove||e.initialMove,e.close,e.exclude)}function ri(t,e,n,r,i=0,o=0,a=0,s,l){if(0===n||0===r)return[];s-=t,l-=e,n=Math.abs(n),r=Math.abs(r);const c=-s/2,u=-l/2,d=Math.cos(i*Math.PI/180),h=Math.sin(i*Math.PI/180),p=d*c+h*u,f=-1*h*c+d*u,g=p*p,m=f*f,v=n*n,b=r*r,y=g/v+m/b;let w;if(y>1)n=Math.sqrt(y)*n,r=Math.sqrt(y)*r,w=0;else{let t=1;o===a&&(t=-1),w=t*Math.sqrt((v*b-v*m-b*g)/(v*m+b*g))}const x=w*n*f/r,C=-1*w*r*p/n,k=d*x-h*C+s/2,A=h*x+d*C+l/2;let S=Math.atan2((f-C)/r,(p-x)/n)-Math.atan2(0,1),E=S>=0?S:2*Math.PI+S;S=Math.atan2((-f-C)/r,(-p-x)/n)-Math.atan2((f-C)/r,(p-x)/n);let O=S>=0?S:2*Math.PI+S;0===a&&O>0?O-=2*Math.PI:0!==a&&O<0&&(O+=2*Math.PI);const T=2*O/Math.PI,_=Math.ceil(T<0?-1*T:T),M=O/_,N=8/3*Math.sin(M/4)*Math.sin(M/4)/Math.sin(M/2),P=d*n,L=d*r,D=h*n,j=h*r;let I=Math.cos(E),R=Math.sin(E),F=-N*(P*R+j*I),B=-N*(D*R-L*I),z=0,H=0;const V=[];for(let q=0;q<_;q+=1){E+=M,I=Math.cos(E),R=Math.sin(E),z=P*I-j*R+k,H=D*I+L*R+A;const n=-N*(P*R+j*I),r=-N*(D*R-L*I),i=6*q;V[i]=Number(F+t),V[i+1]=Number(B+e),V[i+2]=Number(z-n+t),V[i+3]=Number(H-r+e),V[i+4]=Number(z+t),V[i+5]=Number(H+e),F=z+n,B=H+r}return V.map(t=>+t.toFixed(2))}function ii(t,e,n,r,i=0,o=0,a=0,s,l){const c=[],u=ri(t,e,n,r,i,o,a,s,l);if(null!=u)for(let d=0,h=u.length;d<h;d+=6)c.push("C",u[d],u[d+1],u[d+2],u[d+3],u[d+4],u[d+5]);return c.join(" ")}class oi extends Lr{constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(Ir.isLine(t[0])||Br.isCurve(t[0])){let e=null;const n=t;n.forEach((t,n)=>{0===n&&this.appendSegment(oi.createSegment("M",t.start)),null==e||e.end.equals(t.start)||this.appendSegment(oi.createSegment("M",t.start)),Ir.isLine(t)?this.appendSegment(oi.createSegment("L",t.end)):Br.isCurve(t)&&this.appendSegment(oi.createSegment("C",t.controlPoint1,t.controlPoint2,t.end)),e=t})}else{const e=t;e.forEach(t=>{t.isSegment&&this.appendSegment(t)})}else null!=t&&(Ir.isLine(t)?(this.appendSegment(oi.createSegment("M",t.start)),this.appendSegment(oi.createSegment("L",t.end))):Br.isCurve(t)?(this.appendSegment(oi.createSegment("M",t.start)),this.appendSegment(oi.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):Fr.isPolyline(t)?t.points&&t.points.length&&t.points.forEach((t,e)=>{const n=0===e?oi.createSegment("M",t):oi.createSegment("L",t);this.appendSegment(n)}):t.isSegment&&this.appendSegment(t))}get[Symbol.toStringTag](){return oi.toStringTag}get start(){const t=this.segments,e=t.length;if(0===e)return null;for(let n=0;n<e;n+=1){const e=t[n];if(e.isVisible)return e.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(0===e)return null;for(let n=e-1;n>=0;n-=1){const e=t[n];if(e.isVisible)return e.end}return t[e-1].end}moveTo(...t){return this.appendSegment(qr.create.call(null,...t))}lineTo(...t){return this.appendSegment(Hr.create.call(null,...t))}curveTo(...t){return this.appendSegment(Ur.create.call(null,...t))}arcTo(t,e,n,r,i,o,a){const s=this.end||new Dr,l="number"===typeof o?ri(s.x,s.y,t,e,n,r,i,o,a):ri(s.x,s.y,t,e,n,r,i,o.x,o.y);if(null!=l)for(let c=0,u=l.length;c<u;c+=6)this.curveTo(l[c],l[c+1],l[c+2],l[c+3],l[c+4],l[c+5]);return this}quadTo(t,e,n,r){const i=this.end||new Dr,o=["M",i.x,i.y];if("number"===typeof t)o.push("Q",t,e,n,r);else{const n=e;o.push("Q",t.x,t.y,n.x,n.y)}const a=oi.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Vr.create())}drawPoints(t,e={}){const n=ni(t,e),r=oi.parse(n);r&&r.segments&&this.appendSegment(r.segments)}bbox(){const t=this.segments,e=t.length;if(0===e)return null;let n;for(let i=0;i<e;i+=1){const e=t[i];if(e.isVisible){const t=e.bbox();null!=t&&(n=n?n.union(t):t)}}if(null!=n)return n;const r=t[e-1];return new jr(r.end.x,r.end.y,0,0)}appendSegment(t){const e=this.segments.length;let n,r=0!==e?this.segments[e-1]:null;const i=null;if(Array.isArray(t))for(let o=0,a=t.length;o<a;o+=1){const e=t[o];n=this.prepareSegment(e,r,i),this.segments.push(n),r=n}else null!=t&&t.isSegment&&(n=this.prepareSegment(t,r,i),this.segments.push(n));return this}insertSegment(t,e){const n=this.segments.length;if(t<0&&(t=n+t+1),t>n||t<0)throw new Error("Index out of range.");let r,i=null,o=null;if(0!==n&&(t>=1?(i=this.segments[t-1],o=i.nextSegment):(i=null,o=this.segments[0])),Array.isArray(e))for(let a=0,s=e.length;a<s;a+=1){const n=e[a];r=this.prepareSegment(n,i,o),this.segments.splice(t+a,0,r),i=r}else r=this.prepareSegment(e,i,o),this.segments.splice(t,0,r);return this}removeSegment(t){const e=this.fixIndex(t),n=this.segments.splice(e,1)[0],r=n.previousSegment,i=n.nextSegment;return r&&(r.nextSegment=i),i&&(i.previousSegment=r),n.isSubpathStart&&i&&this.updateSubpathStartSegment(i),n}replaceSegment(t,e){const n=this.fixIndex(t);let r;const i=this.segments[n];let o=i.previousSegment;const a=i.nextSegment;let s=i.isSubpathStart;if(Array.isArray(e)){this.segments.splice(t,1);for(let n=0,i=e.length;n<i;n+=1){const i=e[n];r=this.prepareSegment(i,o,a),this.segments.splice(t+n,0,r),o=r,s&&r.isSubpathStart&&(s=!1)}}else r=this.prepareSegment(e,o,a),this.segments.splice(n,1,r),s&&r.isSubpathStart&&(s=!1);s&&a&&this.updateSubpathStartSegment(a)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(0===e)throw new Error("Path has no segments.");let n=t;while(n<0)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n}segmentAt(t,e={}){const n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null}segmentAtLength(t,e={}){const n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null}segmentIndexAt(t,e={}){if(0===this.segments.length)return null;const n=_r(t,0,1),r=this.getOptions(e),i=this.length(r),o=i*n;return this.segmentIndexAtLength(o,r)}segmentIndexAtLength(t,e={}){const n=this.segments.length;if(0===n)return null;let r=!0;t<0&&(r=!1,t=-t);const i=this.getPrecision(e),o=this.getSubdivisions(e);let a=0,s=null;for(let l=0;l<n;l+=1){const e=r?l:n-1-l,c=this.segments[e],u=o[e],d=c.length({precision:i,subdivisions:u});if(c.isVisible){if(t<=a+d)return e;s=e}a+=d}return s}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),n=[];for(let r=0,i=this.segments.length;r<i;r+=1){const t=this.segments[r],i=t.getSubdivisions({precision:e});n.push(i)}return n}updateSubpathStartSegment(t){let e=t.previousSegment,n=t;while(n&&!n.isSubpathStart)n.subpathStartSegment=null!=e?e.subpathStartSegment:null,e=n,n=n.nextSegment}prepareSegment(t,e,n){t.previousSegment=e,t.nextSegment=n,null!=e&&(e.nextSegment=t),null!=n&&(n.previousSegment=t);let r=t;return t.isSubpathStart&&(t.subpathStartSegment=t,r=n),null!=r&&this.updateSubpathStartSegment(r),t}closestPoint(t,e={}){const n=this.closestPointT(t,e);return n?this.pointAtT(n):null}closestPointLength(t,e={}){const n=this.getOptions(e),r=this.closestPointT(t,n);return r?this.lengthAtT(r,n):0}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),r=this.closestPointLength(t,n);if(0===r)return 0;const i=this.length(n);return 0===i?0:r/i}closestPointT(t,e={}){if(0===this.segments.length)return null;const n=this.getPrecision(e),r=this.getSubdivisions(e);let i,o=1/0;for(let a=0,s=this.segments.length;a<s;a+=1){const e=this.segments[a],s=r[a];if(e.isVisible){const r=e.closestPointT(t,{precision:n,subdivisions:s}),l=e.pointAtT(r),c=Pr(l,t);c<o&&(i={segmentIndex:a,value:r},o=c)}}return i||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(0===this.segments.length)return null;const n=this.getPrecision(e),r=this.getSubdivisions(e);let i,o=1/0;for(let a=0,s=this.segments.length;a<s;a+=1){const e=this.segments[a],s=r[a];if(e.isDifferentiable()){const r=e.closestPointT(t,{precision:n,subdivisions:s}),a=e.pointAtT(r),l=Pr(a,t);l<o&&(i=e.tangentAtT(r),o=l)}}return i||null}containsPoint(t,e={}){const n=this.toPolylines(e);if(!n)return!1;let r=0;for(let i=0,o=n.length;i<o;i+=1){const e=n[i];e.containsPoint(t)&&(r+=1)}return r%2===1}pointAt(t,e={}){if(0===this.segments.length)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.getOptions(e),r=this.length(n),i=r*t;return this.pointAtLength(i,n)}pointAtLength(t,e={}){if(0===this.segments.length)return null;if(0===t)return this.start.clone();let n=!0;t<0&&(n=!1,t=-t);const r=this.getPrecision(e),i=this.getSubdivisions(e);let o,a=0;for(let l=0,c=this.segments.length;l<c;l+=1){const e=n?l:c-1-l,s=this.segments[e],u=i[e],d=s.length({precision:r,subdivisions:u});if(s.isVisible){if(t<=a+d)return s.pointAtLength((n?1:-1)*(t-a),{precision:r,subdivisions:u});o=s}a+=d}if(o)return n?o.end:o.start;const s=this.segments[this.segments.length-1];return s.end.clone()}pointAtT(t){const e=this.segments,n=e.length;if(0===n)return null;const r=t.segmentIndex;if(r<0)return e[0].pointAtT(0);if(r>=n)return e[n-1].pointAtT(1);const i=_r(t.value,0,1);return e[r].pointAtT(i)}divideAt(t,e={}){if(0===this.segments.length)return null;const n=_r(t,0,1),r=this.getOptions(e),i=this.length(r),o=i*n;return this.divideAtLength(o,r)}divideAtLength(t,e={}){if(0===this.segments.length)return null;let n=!0;t<0&&(n=!1,t=-t);const r=this.getPrecision(e),i=this.getSubdivisions(e);let o,a,s,l,c,u=0;for(let w=0,x=this.segments.length;w<x;w+=1){const e=n?w:x-1-w,c=this.getSegment(e),d=i[e],h={precision:r,subdivisions:d},p=c.length(h);if(c.isDifferentiable()&&(s=c,l=e,t<=u+p)){a=e,o=c.divideAtLength((n?1:-1)*(t-u),h);break}u+=p}if(!s)return null;o||(a=l,c=n?1:0,o=s.divideAtT(c));const d=this.clone(),h=a;d.replaceSegment(h,o);const p=h;let f=h+1,g=h+2;o[0].isDifferentiable()||(d.removeSegment(p),f-=1,g-=1);const m=d.getSegment(f).start;d.insertSegment(f,oi.createSegment("M",m)),g+=1,o[1].isDifferentiable()||(d.removeSegment(g-1),g-=1);const v=g-p-1;for(let w=g,x=d.segments.length;w<x;w+=1){const t=this.getSegment(w-v),e=d.getSegment(w);if("Z"===e.type&&!t.subpathStartSegment.end.equals(e.subpathStartSegment.end)){const e=oi.createSegment("L",t.end);d.replaceSegment(w,e)}}const b=new oi(d.segments.slice(0,f)),y=new oi(d.segments.slice(f));return[b,y]}intersectsWithLine(t,e={}){const n=this.toPolylines(e);if(null==n)return null;let r=null;for(let i=0,o=n.length;i<o;i+=1){const e=n[i],o=t.intersect(e);o&&(null==r&&(r=[]),Array.isArray(o)?r.push(...o):r.push(o))}return r}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1){const e=this.segments[t];if(e.isDifferentiable())return!0}return!1}isValid(){const t=this.segments,e=0===t.length||"M"===t[0].type;return e}length(t={}){if(0===this.segments.length)return 0;const e=this.getSubdivisions(t);let n=0;for(let r=0,i=this.segments.length;r<i;r+=1){const t=this.segments[r],i=e[r];n+=t.length({subdivisions:i})}return n}lengthAtT(t,e={}){const n=this.segments.length;if(0===n)return 0;let r=t.segmentIndex;if(r<0)return 0;let i=_r(t.value,0,1);r>=n&&(r=n-1,i=1);const o=this.getPrecision(e),a=this.getSubdivisions(e);let s=0;for(let u=0;u<r;u+=1){const t=this.segments[u],e=a[u];s+=t.length({precision:o,subdivisions:e})}const l=this.segments[r],c=a[r];return s+=l.lengthAtT(i,{precision:o,subdivisions:c}),s}tangentAt(t,e={}){if(0===this.segments.length)return null;const n=_r(t,0,1),r=this.getOptions(e),i=this.length(r),o=i*n;return this.tangentAtLength(o,r)}tangentAtLength(t,e={}){if(0===this.segments.length)return null;let n=!0;t<0&&(n=!1,t=-t);const r=this.getPrecision(e),i=this.getSubdivisions(e);let o,a=0;for(let s=0,l=this.segments.length;s<l;s+=1){const e=n?s:l-1-s,c=this.segments[e],u=i[e],d=c.length({precision:r,subdivisions:u});if(c.isDifferentiable()){if(t<=a+d)return c.tangentAtLength((n?1:-1)*(t-a),{precision:r,subdivisions:u});o=c}a+=d}if(o){const t=n?1:0;return o.tangentAtT(t)}return null}tangentAtT(t){const e=this.segments.length;if(0===e)return null;const n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);const r=_r(t.value,0,1);return this.segments[n].tangentAtT(r)}getPrecision(t={}){return null==t.precision?this.PRECISION:t.precision}getSubdivisions(t={}){if(null==t.segmentSubdivisions){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),n=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:n}}toPoints(t={}){const e=this.segments,n=e.length;if(0===n)return null;const r=this.getSubdivisions(t),i=[];let o=[];for(let a=0;a<n;a+=1){const t=e[a];if(t.isVisible){const e=r[a];e.length>0?e.forEach(t=>o.push(t.start)):o.push(t.start)}else o.length>0&&(o.push(e[a-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i}toPolylines(t={}){const e=this.toPoints(t);return e?e.map(t=>new Fr(t)):null}scale(t,e,n){return this.segments.forEach(r=>r.scale(t,e,n)),this}rotate(t,e){return this.segments.forEach(n=>n.rotate(t,e)),this}translate(t,e){return"number"===typeof t?this.segments.forEach(n=>n.translate(t,e)):this.segments.forEach(e=>e.translate(t)),this}clone(){const t=new oi;return this.segments.forEach(e=>t.appendSegment(e.clone())),t}equals(t){if(null==t)return!1;const e=this.segments,n=t.segments,r=e.length;if(n.length!==r)return!1;for(let i=0;i<r;i+=1){const t=e[i],r=n[i];if(t.type!==r.type||!t.equals(r))return!1}return!0}toJSON(){return this.segments.map(t=>t.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(t=>t.serialize()).join(" ")}toString(){return this.serialize()}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return!(null!=n&&n!==t.toStringTag||!Array.isArray(r.segments)||"function"!==typeof r.moveTo||"function"!==typeof r.lineTo||"function"!==typeof r.curveTo)}t.toStringTag="X6.Geometry."+t.name,t.isPath=e})(oi||(oi={})),function(t){function e(e){if(!e)return new t;const r=new t,i=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=t.normalize(e).match(i);if(null!=o)for(let t=0,a=o.length;t<a;t+=1){const e=o[t],i=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,a=e.match(i);if(null!=a){const t=a[0],e=a.slice(1).map(t=>+t),i=n.call(null,t,...e);r.appendSegment(i)}}return r}function n(t,...e){if("M"===t)return qr.create.call(null,...e);if("L"===t)return Hr.create.call(null,...e);if("C"===t)return Ur.create.call(null,...e);if("z"===t||"Z"===t)return Vr.create();throw new Error(`Invalid path segment type "${t}"`)}t.parse=e,t.createSegment=n}(oi||(oi={})),function(t){t.normalize=Zr,t.isValid=Qr,t.drawArc=ii,t.drawPoints=ni,t.arcToCurves=ri}(oi||(oi={}));class ai{constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let r;if(ai.isVector(t))r=t.node;else if("string"===typeof t)if("svg"===t.toLowerCase())r=Pn();else if("<"===t[0]){const e=Pn(t);r=document.importNode(e.firstChild,!0)}else r=document.createElementNS(On.svg,t);else r=t;this.node=r,e&&this.setAttributes(e),n&&this.append(n)}get[Symbol.toStringTag](){return ai.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}transform(t,e){return null==t?uo(this.node):(uo(this.node,t,e),this)}translate(t,e=0,n={}){return null==t?ho(this.node):(ho(this.node,t,e,n),this)}rotate(t,e,n,r={}){return null==t?po(this.node):(po(this.node,t,e,n,r),this)}scale(t,e){return null==t?fo(this.node):(fo(this.node,t,e),this)}getTransformToElement(t){const e=ai.toNode(t);return to(this.node,e)}removeAttribute(t){return Xn(this.node,t),this}getAttribute(t){return Yn(this.node,t)}setAttribute(t,e){return Kn(this.node,t,e),this}setAttributes(t){return Zn(this.node,t),this}attr(t,e){return null==t?Jn(this.node):"string"===typeof t&&void 0===e?Jn(this.node,t):("object"===typeof t?Jn(this.node,t):Jn(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:ai.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?ai.create(e):ai.create("defs").appendTo(t)}text(t,e={}){return hi(this.node,t,e),this}tagName(){return Dn(this.node)}clone(){return ai.create(this.node.cloneNode(!0))}remove(){return zn(this.node),this}empty(){return Hn(this.node),this}append(t){return Vn(this.node,ai.toNodes(t)),this}appendTo(t){return Wn(this.node,ai.isVector(t)?t.node:t),this}prepend(t){return qn(this.node,ai.toNodes(t)),this}before(t){return Un(this.node,ai.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(ai.toNode(t),this.node),ai.create(t)}first(){return this.node.firstChild?ai.create(this.node.firstChild):null}last(){return this.node.lastChild?ai.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?ai.create(e):null}indexOf(t){const e=Array.prototype.slice.call(this.node.childNodes);return e.indexOf(ai.toNode(t))}find(t){const e=[],n=In(this.node,t);if(n)for(let r=0,i=n.length;r<i;r+=1)e.push(ai.create(n[r]));return e}findOne(t){const e=Rn(this.node,t);return e?ai.create(e):null}findParentByClass(t,e){const n=Fn(this.node,t,e);return n?ai.create(n):null}matches(t){const e=this.node,n=(this.node.matches,e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null);return n&&n.call(e,t)}contains(t){return Bn(this.node,ai.isVector(t)?t.node:t)}wrap(t){const e=ai.create(t),n=this.node.parentNode;return null!=n&&n.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(null==e.node.parentNode)return null;if(e=ai.create(e.node.parentNode),null==t)return e;do{if("string"===typeof t?e.matches(t):e instanceof t)return e}while(e=ai.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let n=0;n<t.length;n+=1){const r=t[n];1===r.nodeType&&e.push(ai.create(t[n]))}return e}eachChild(t,e){const n=this.children();for(let r=0,i=n.length;r<i;r+=1)t.call(n[r],n[r],r,n),e&&n[r].eachChild(t,e);return this}index(){return jn(this.node)}hasClass(t){return yn(this.node,t)}addClass(t){return wn(this.node,t),this}removeClass(t){return xn(this.node,t),this}toggleClass(t,e){return Cn(this.node,t,e),this}toLocalPoint(t,e){return eo(this.node,t,e)}toGeometryShape(){return no(this.node)}translateCenterToPoint(t){const e=this.getBBox({target:this.svg()}),n=e.getCenter();return this.translate(t.x-n.x,t.y-n.y),this}translateAndAutoOrient(t,e,n){return go(this.node,t,e,n),this}animate(t){return io(this.node,t)}animateTransform(t){return oo(this.node,t)}animateAlongPath(t,e){return lo(this.node,t,e)}normalizePath(){const t=this.tagName();return"path"===t&&this.attr("d",oi.normalize(this.attr("d"))),this}bbox(t,e){return Ki(this.node,t,e)}getBBox(t={}){return Zi(this.node,{recursive:t.recursive,target:t.target?ai.toNode(t.target):null})}sample(t=1){return this.node instanceof SVGPathElement?vi(this.node,t):[]}toPath(){return ai.create(Oi(this.node))}toPathData(){return Ti(this.node)}}function si(t,e){const n=ai.create(e),r=ai.create("textPath"),i=t.d;if(i&&void 0===t["xlink:href"]){const t=ai.create("path").attr("d",i).appendTo(n.defs());r.attr("xlink:href","#"+t.id)}return"object"===typeof t&&r.attr(t),r.node}function li(t,e,n){const r=n.eol,i=n.baseSize,o=n.lineHeight;let a,s=0;const l={},c=e.length-1;for(let u=0;u<=c;u+=1){let o=e[u],l=null;if("object"===typeof o){const t=o.attrs,e=ai.create("tspan",t);a=e.node;let d=o.t;r&&u===c&&(d+=r),a.textContent=d;const h=t.class;h&&e.addClass(h),n.includeAnnotationIndices&&e.attr("annotations",o.annotations.join(",")),l=parseFloat(t["font-size"]),void 0===l&&(l=i),l&&l>s&&(s=l)}else r&&u===c&&(o+=r),a=document.createTextNode(o||" "),i&&i>s&&(s=i);t.appendChild(a)}return s&&(l.maxFontSize=s),o?l.lineHeight=o:s&&(l.lineHeight=1.2*s),l}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&r.node instanceof SVGElement&&"function"===typeof r.animate&&"function"===typeof r.sample&&"function"===typeof r.normalizePath&&"function"===typeof r.toPath}function n(e,n,r){return new t(e,n,r)}function r(t){if("<"===t[0]){const e=Pn(t),r=[];for(let t=0,i=e.childNodes.length;t<i;t+=1){const i=e.childNodes[t];r.push(n(document.importNode(i,!0)))}return r}return[n(t)]}function i(t){return e(t)?t.node:t}function o(t){return Array.isArray(t)?t.map(t=>i(t)):[i(t)]}t.toStringTag="X6."+t.name,t.isVector=e,t.create=n,t.createVectors=r,t.toNode=i,t.toNodes=o})(ai||(ai={}));const ci=/em$/;function ui(t,e){const n=parseFloat(t);return ci.test(t)?n*e:n}function di(t,e,n,r){if(!Array.isArray(e))return 0;const i=e.length;if(!i)return 0;let o=e[0];const a=ui(o.maxFontSize,n)||n;let s=0;const l=ui(r,n);for(let d=1;d<i;d+=1){o=e[d];const t=ui(o.lineHeight,n)||l;s+=t}const c=ui(o.maxFontSize,n)||n;let u;switch(t){case"middle":u=a/2-.15*c-s/2;break;case"bottom":u=-.25*c-s;break;default:case"top":u=.8*a;break}return u}function hi(t,e,n={}){e=l.sanitize(e);const r=n.eol;let i=n.textPath;const o=n.textVerticalAnchor,a="middle"===o||"bottom"===o||"top"===o;let s=n.x;void 0===s&&(s=t.getAttribute("x")||0);const c=n.includeAnnotationIndices;let u=n.annotations;u&&!Array.isArray(u)&&(u=[u]);const d=n.lineHeight,h="auto"===d,p=h?"1.5em":d||"1em";Hn(t),Jn(t,{"xml:space":"preserve",display:e||n.displayEmpty?null:"none"});const f=Jn(t,"font-size");let g,m,v=parseFloat(f);v||(v=16,!a&&!u||f||Jn(t,"font-size",""+v)),i?("string"===typeof i&&(i={d:i}),g=si(i,t)):g=document.createDocumentFragment();let b,y=0;const w=e.split("\n"),x=[],C=w.length-1;for(let A=0;A<=C;A+=1){m=p;let t="v-line";const e=Nn("tspan");let n,o=w[A];if(o)if(u){const t=l.annotate(o,u,{offset:-y,includeAnnotationIndices:c});n=li(e,t,{eol:A!==C&&r,baseSize:v,lineHeight:h?null:p,includeAnnotationIndices:c});const i=n.lineHeight;i&&h&&0!==A&&(m=i),0===A&&(b=.8*n.maxFontSize)}else r&&A!==C&&(o+=r),e.textContent=o;else{e.textContent="-",t+=" v-empty-line";const r=e.style;r.fillOpacity=0,r.strokeOpacity=0,u&&(n={})}n&&x.push(n),A>0&&e.setAttribute("dy",m),(A>0||i)&&e.setAttribute("x",s),e.className.baseVal=t,g.appendChild(e),y+=o.length+1}if(a)if(u)m=di(o,x,v,p);else if("top"===o)m="0.8em";else{let t;switch(C>0?(t=parseFloat(p)||1,t*=C,ci.test(p)||(t/=v)):t=0,o){case"middle":m=.3-t/2+"em";break;case"bottom":m=-t-.3+"em";break;default:break}}else 0===o?m="0em":o?m=o:(m=0,null==t.getAttribute("y")&&t.setAttribute("y",""+(b||"0.8em")));const k=g.firstChild;k.setAttribute("dy",m),t.appendChild(g)}function pi(t,e,n,r){const i=[],o=[];if(null!=e){const n=t.split(e);if(i.push(...n),"string"===typeof e)for(let t=0,r=n.length-1;t<r;t+=1)o.push(e);else{const r=t.match(new RegExp(e,"g"));for(let t=0,e=n.length-1;t<e;t+=1)o.push(r?r[t]:"")}}else{let e="";for(let n=0,r=t.length;n<r;n+=1){const r=t[n];" "===r?(i.push(e),o.push(" "),e=""):r.match(/[^\x00-\xff]/)?(e.length&&(i.push(e),o.push("")),i.push(r),o.push(""),e=""):e+=r}e.length&&i.push(e)}for(let a=0;a<i.length;a+=1){const t=i[a];if(t.indexOf(n)>=0&&t.length>1){const e=t.split(n);for(let t=0,i=e.length-1;t<i;t+=1)e.splice(2*t+1,0,n);const r=e.filter(t=>""!==t);i.splice(a,1,...r);const s=r.map(()=>"");s.pop(),o.splice(a,0,...s)}}for(let a=0;a<i.length;a+=1){const t=i[a],e=t.search(r);e>0&&e<t.length-1&&(i.splice(a,1,t.substring(0,e+1),t.substring(e+1)),o.splice(a,0,""))}return{words:i,separators:o}}function fi(t,e,n={},r={}){const i=e.width,o=e.height,s=r.svgDocument||Nn("svg"),l=Nn("text"),c=Nn("tspan"),u=document.createTextNode("");Jn(l,n),l.appendChild(c),l.style.opacity="0",l.style.display="block",c.style.display="block",c.appendChild(u),s.appendChild(l);const d=null==s.parentNode;d&&document.body.appendChild(s);const h=r.eol||"\n",p=r.separator||" ",f=r.hyphen?new RegExp(r.hyphen):/[^\w\d]/,g=!1!==r.breakWord,m=[],v={};let b,y,w,x=[];const{words:C,separators:k}=pi(t,r.separator,h,f);for(let A=0,S=0,E=C.length;A<E;A+=1){const t=C[A];if(t)if(t!==h){if(null!=x[S]?(w=k[A-1]||"",u.data=`${x[S]}${w}${t}`):u.data=t,c.getComputedTextLength()<=i)x[S]=u.data,v[S]=k[A],b&&(m[S]=!0,S+=1,b=0);else{if(g){if(!x[S]||b){const e=!!b,n=1===t.length;if(b=t.length-1,e||n){if(n){if(!x[S]){x=[];break}C.splice(A,2,t+C[A+1]),k.splice(A+1,1),m[S]=!0,S+=1,E-=1,A-=1;continue}C[A]=t.substring(0,b),C[A+1]=t.substring(b)+C[A+1]}else C.splice(A,1,t.substring(0,b),t.substring(b)),k.splice(A,0,""),E+=1,S&&!m[S-1]&&(S-=1);A-=1;continue}}else if(!x[S]){x[S]=t,m[S]=!0,S+=1;continue}S+=1,A-=1}if(null!=o){if(null==y){let t;t="auto"===n.lineHeight?{value:1.5,unit:"em"}:a.parseCssNumeric(n.lineHeight,["em"])||{value:1,unit:"em"},y=t.value,"em"===t.unit&&(gt.IS_FIREFOX?y*=c.getBBox().height:y*=l.getBBox().height)}if(y*x.length>o){const t=Math.floor(o/y)-1,e=x[t],n=x[t+1];if(x.splice(t+1),null==e)break;let a=r.ellipsis;if(!a)break;"string"!==typeof a&&(a="…");let s=e;n&&g&&(s+=w+n);let l,d,h=s.length;do{if(d=s[h],l=s.substring(0,h),d?d.match(p)&&(l+=d):l+=v[t],l+=a,u.data=l,c.getComputedTextLength()<=i){x[t]=l;break}h-=1}while(h>=0);break}}}else m[S]=!0,S+=1,x[S]=""}return zn(d?s:l),x.join(h)}const gi=.551784;function mi(t,e,n=NaN){const r=t.getAttribute(e);if(null==r)return n;const i=parseFloat(r);return Number.isNaN(i)?n:i}function vi(t,e=1){const n=t.getTotalLength(),r=[];let i,o=0;while(o<n)i=t.getPointAtLength(o),r.push({distance:o,x:i.x,y:i.y}),o+=e;return r}function bi(t){return["M",mi(t,"x1"),mi(t,"y1"),"L",mi(t,"x2"),mi(t,"y2")].join(" ")}function yi(t){const e=Ci(t);return 0===e.length?null:xi(e)+" Z"}function wi(t){const e=Ci(t);return 0===e.length?null:xi(e)}function xi(t){const e=t.map(t=>`${t.x} ${t.y}`);return"M "+e.join(" L")}function Ci(t){const e=[],n=t.points;if(n)for(let r=0,i=n.numberOfItems;r<i;r+=1)e.push(n.getItem(r));return e}function ki(t){const e=mi(t,"cx",0),n=mi(t,"cy",0),r=mi(t,"r"),i=r*gi;return["M",e,n-r,"C",e+i,n-r,e+r,n-i,e+r,n,"C",e+r,n+i,e+i,n+r,e,n+r,"C",e-i,n+r,e-r,n+i,e-r,n,"C",e-r,n-i,e-i,n-r,e,n-r,"Z"].join(" ")}function Ai(t){const e=mi(t,"cx",0),n=mi(t,"cy",0),r=mi(t,"rx"),i=mi(t,"ry")||r,o=r*gi,a=i*gi,s=["M",e,n-i,"C",e+o,n-i,e+r,n-a,e+r,n,"C",e+r,n+a,e+o,n+i,e,n+i,"C",e-o,n+i,e-r,n+a,e-r,n,"C",e-r,n-a,e-o,n-i,e,n-i,"Z"].join(" ");return s}function Si(t){return Ei({x:mi(t,"x",0),y:mi(t,"y",0),width:mi(t,"width",0),height:mi(t,"height",0),rx:mi(t,"rx",0),ry:mi(t,"ry",0)})}function Ei(t){let e;const n=t.x,r=t.y,i=t.width,o=t.height,a=Math.min(t.rx||t["top-rx"]||0,i/2),s=Math.min(t.rx||t["bottom-rx"]||0,i/2),l=Math.min(t.ry||t["top-ry"]||0,o/2),c=Math.min(t.ry||t["bottom-ry"]||0,o/2);return e=a||s||l||c?["M",n,r+l,"v",o-l-c,"a",s,c,0,0,0,s,c,"h",i-2*s,"a",s,c,0,0,0,s,-c,"v",-(o-c-l),"a",a,l,0,0,0,-a,-l,"h",-(i-2*a),"a",a,l,0,0,0,-a,l,"Z"]:["M",n,r,"H",n+i,"V",r+o,"H",n,"V",r,"Z"],e.join(" ")}function Oi(t){const e=Nn("path");Jn(e,Jn(t));const n=Ti(t);return n&&e.setAttribute("d",n),e}function Ti(t){const e=t.tagName.toLowerCase();switch(e){case"path":return t.getAttribute("d");case"line":return bi(t);case"polygon":return yi(t);case"polyline":return wi(t);case"ellipse":return Ai(t);case"circle":return ki(t);case"rect":return Si(t);default:break}throw new Error(`"${e}" cannot be converted to svg path element.`)}function _i(t,e,n,r){const i=2*Math.PI-1e-6,o=t,a=e;let s=n,l=r;if(l<s){const t=s;s=l,l=t}const c=l-s,u=c<Math.PI?"0":"1",d=Math.cos(s),h=Math.sin(s),p=Math.cos(l),f=Math.sin(l);return c>=i?o?`M0,${a}A${a},${a} 0 1,1 0,${-a}A${a},${a} 0 1,1 0,${a}M0,${o}A${o},${o} 0 1,0 0,${-o}A${o},${o} 0 1,0 0,${o}Z`:`M0,${a}A${a},${a} 0 1,1 0,${-a}A${a},${a} 0 1,1 0,${a}Z`:o?`M${a*d},${a*h}A${a},${a} 0 ${u},1 ${a*p},${a*f}L${o*p},${o*f}A${o},${o} 0 ${u},0 ${o*d},${o*h}Z`:`M${a*d},${a*h}A${a},${a} 0 ${u},1 ${a*p},${a*f}L0,0Z`}const Mi=Nn("svg"),Ni=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,Pi=/[ ,]+/,Li=/^(\w+)\((.*)\)/;function Di(t,e){const n=Mi.createSVGPoint();return n.x=t,n.y=e,n}function ji(t){const e=Mi.createSVGMatrix();if(null!=t){const n=t,r=e;for(const t in n)r[t]=n[t]}return e}function Ii(t){return null!=t?(t instanceof DOMMatrix||(t=ji(t)),Mi.createSVGTransformFromMatrix(t)):Mi.createSVGTransform()}function Ri(t){let e=ji();const n=null!=t&&t.match(Ni);if(!n)return e;for(let r=0,i=n.length;r<i;r+=1){const t=n[r],i=t.match(Li);if(i){let t,n,r,o,a,s=ji();const l=i[2].split(Pi);switch(i[1].toLowerCase()){case"scale":t=parseFloat(l[0]),n=void 0===l[1]?t:parseFloat(l[1]),s=s.scaleNonUniform(t,n);break;case"translate":r=parseFloat(l[0]),o=parseFloat(l[1]),s=s.translate(r,o);break;case"rotate":a=parseFloat(l[0]),r=parseFloat(l[1])||0,o=parseFloat(l[2])||0,s=0!==r||0!==o?s.translate(r,o).rotate(a).translate(-r,-o):s.rotate(a);break;case"skewx":a=parseFloat(l[0]),s=s.skewX(a);break;case"skewy":a=parseFloat(l[0]),s=s.skewY(a);break;case"matrix":s.a=parseFloat(l[0]),s.b=parseFloat(l[1]),s.c=parseFloat(l[2]),s.d=parseFloat(l[3]),s.e=parseFloat(l[4]),s.f=parseFloat(l[5]);break;default:continue}e=e.multiply(s)}}return e}function Fi(t){const e=t||{},n=null!=e.a?e.a:1,r=null!=e.b?e.b:0,i=null!=e.c?e.c:0,o=null!=e.d?e.d:1,a=null!=e.e?e.e:0,s=null!=e.f?e.f:0;return`matrix(${n},${r},${i},${o},${a},${s})`}function Bi(t){let e,n,r;if(t){const i=Pi;if(t.trim().indexOf("matrix")>=0){const i=Ri(t),o=Hi(i);e=[o.translateX,o.translateY],n=[o.rotation],r=[o.scaleX,o.scaleY];const a=[];0===e[0]&&0===e[1]||a.push(`translate(${e.join(",")})`),1===r[0]&&1===r[1]||a.push(`scale(${r.join(",")})`),0!==n[0]&&a.push(`rotate(${n[0]})`),t=a.join(" ")}else{const o=t.match(/translate\((.*?)\)/);o&&(e=o[1].split(i));const a=t.match(/rotate\((.*?)\)/);a&&(n=a[1].split(i));const s=t.match(/scale\((.*?)\)/);s&&(r=s[1].split(i))}}const i=r&&r[0]?parseFloat(r[0]):1;return{raw:t||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:n&&n[0]?parseInt(n[0],10):0,cx:n&&n[1]?parseInt(n[1],10):void 0,cy:n&&n[2]?parseInt(n[2],10):void 0},scale:{sx:i,sy:r&&r[1]?parseFloat(r[1]):i}}}function zi(t,e){const n=e.x*t.a+e.y*t.c+0,r=e.x*t.b+e.y*t.d+0;return{x:n,y:r}}function Hi(t){const e=zi(t,{x:0,y:1}),n=zi(t,{x:1,y:0}),r=180/Math.PI*Math.atan2(e.y,e.x)-90,i=180/Math.PI*Math.atan2(n.y,n.x);return{skewX:r,skewY:i,translateX:t.e,translateY:t.f,scaleX:Math.sqrt(t.a*t.a+t.b*t.b),scaleY:Math.sqrt(t.c*t.c+t.d*t.d),rotation:r}}function Vi(t){let e,n,r,i;return t?(e=null==t.a?1:t.a,i=null==t.d?1:t.d,n=t.b,r=t.c):e=i=1,{sx:n?Math.sqrt(e*e+n*n):e,sy:r?Math.sqrt(r*r+i*i):i}}function qi(t){let e={x:0,y:1};return t&&(e=zi(t,e)),{angle:Er.normalize(Er.toDeg(Math.atan2(e.y,e.x))-90)}}function Ui(t){return{tx:t&&t.e||0,ty:t&&t.f||0}}function Wi(t,e){const n=Di(t.x,t.y).matrixTransform(e);return new Dr(n.x,n.y)}function $i(t,e){return new Ir(Wi(t.start,e),Wi(t.end,e))}function Gi(t,e){let n=t instanceof Fr?t.points:t;return Array.isArray(n)||(n=[]),new Fr(n.map(t=>Wi(t,e)))}function Yi(t,e){const n=Mi.createSVGPoint();n.x=t.x,n.y=t.y;const r=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y;const i=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y+t.height;const o=n.matrixTransform(e);n.x=t.x,n.y=t.y+t.height;const a=n.matrixTransform(e),s=Math.min(r.x,i.x,o.x,a.x),l=Math.max(r.x,i.x,o.x,a.x),c=Math.min(r.y,i.y,o.y,a.y),u=Math.max(r.y,i.y,o.y,a.y);return new jr(s,c,l-s,u-c)}var Xi=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function Ki(t,e,n){let r;const i=t.ownerSVGElement;if(!i)return new jr(0,0,0,0);try{r=t.getBBox()}catch(a){r={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(e)return jr.create(r);const o=to(t,n||i);return Yi(r,o)}function Zi(t,e={}){let n;const r=t.ownerSVGElement;if(!r||!En(t)){if($n(t)){const{left:e,top:n,width:r,height:i}=co(t);return new jr(e,n,r,i)}return new jr(0,0,0,0)}let i=e.target;const o=e.recursive;if(!o){try{n=t.getBBox()}catch(a){n={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(!i)return jr.create(n);const e=to(t,i);return Yi(n,e)}{const e=t.childNodes,r=e.length;if(0===r)return Zi(t,{target:i});i||(i=t);for(let t=0;t<r;t+=1){const r=e[t];let o;o=0===r.childNodes.length?Zi(r,{target:i}):Zi(r,{target:i,recursive:!0}),n=n?n.union(o):o}return n}}function Ji(t){let e=t,n=e?e.tagName.toLowerCase():"";while("g"===n)e=e.firstElementChild,n=e?e.tagName.toLowerCase():"";const r=t=>{const n=e.getAttribute(t),r=n?parseFloat(n):0;return Number.isNaN(r)?0:r};let i,o;switch(n){case"rect":o=new jr(r("x"),r("y"),r("width"),r("height"));break;case"circle":i=r("r"),o=new jr(r("cx")-i,r("cy")-i,2*i,2*i);break;default:break}return o}function Qi(t,e){let n=ji();if(En(e)&&En(t)){let r=t;const i=[];while(r&&r!==e){const t=r.getAttribute("transform")||null,e=Ri(t);i.push(e),r=r.parentNode}i.reverse().forEach(t=>{n=n.multiply(t)})}return n}function to(t,e){if(En(e)&&En(t)){const n=e.getScreenCTM(),r=t.getScreenCTM();if(n&&r)return n.inverse().multiply(r)}return ji()}function eo(t,e,n){const r=t instanceof SVGSVGElement?t:t.ownerSVGElement,i=r.createSVGPoint();i.x=e,i.y=n;try{const e=r.getScreenCTM(),n=i.matrixTransform(e.inverse()),o=to(t,r).inverse();return n.matrixTransform(o)}catch(o){return i}}function no(t){const e=e=>{const n=t.getAttribute(e),r=n?parseFloat(n):0;return Number.isNaN(r)?0:r};switch(t instanceof SVGElement&&t.nodeName.toLowerCase()){case"rect":return new jr(e("x"),e("y"),e("width"),e("height"));case"circle":return new Rr(e("cx"),e("cy"),e("r"),e("r"));case"ellipse":return new Rr(e("cx"),e("cy"),e("rx"),e("ry"));case"polyline":{const e=Ci(t);return new Fr(e)}case"polygon":{const e=Ci(t);return e.length>1&&e.push(e[0]),new Fr(e)}case"path":{let e=t.getAttribute("d");return oi.isValid(e)||(e=oi.normalize(e)),oi.parse(e)}case"line":return new Ir(e("x1"),e("y1"),e("x2"),e("y2"));default:break}return Zi(t)}function ro(t,e,n){const r=t instanceof SVGSVGElement?t:t.ownerSVGElement;n=n||r;const i=Zi(n),o=i.getCenter();if(!i.intersectsWithLineFromCenterToPoint(e))return null;let a=null;const s=t.tagName.toLowerCase();if("rect"===s){const i=new jr(parseFloat(t.getAttribute("x")||"0"),parseFloat(t.getAttribute("y")||"0"),parseFloat(t.getAttribute("width")||"0"),parseFloat(t.getAttribute("height")||"0")),s=to(t,n),l=Hi(s),c=r.createSVGTransform();c.setRotate(-l.rotation,o.x,o.y);const u=Yi(i,c.matrix.multiply(s));a=jr.create(u).intersectsWithLineFromCenterToPoint(e,l.rotation)}else if("path"===s||"polygon"===s||"polyline"===s||"circle"===s||"ellipse"===s){const r="path"===s?t:Oi(t),i=vi(r);let l=1/0,c=[];for(let a=0,s=i.length;a<s;a+=1){const r=i[a];let s=Di(r.x,r.y);s=s.matrixTransform(to(t,n));const u=Dr.create(s),d=u.distance(o),h=1.1*u.distance(e),p=d+h;p<l?(l=p,c=[{sample:r,refDistance:h}]):p<l+1&&c.push({sample:r,refDistance:h})}c.sort((t,e)=>t.refDistance-e.refDistance),c[0]&&(a=Dr.create(c[0].sample))}return a}function io(t,e){return ao(t,e,"animate")}function oo(t,e){return ao(t,e,"animateTransform")}function ao(t,e,n){const r=Nn(n);t.appendChild(r);try{return so(r,e)}catch(i){}return()=>{}}function so(t,e){const{start:n,complete:r,repeat:i}=e,o=Xi(e,["start","complete","repeat"]);Jn(t,o),n&&t.addEventListener("beginEvent",n),r&&t.addEventListener("endEvent",r),i&&t.addEventListener("repeatEvent",i);const a=t;return a.beginElement(),()=>a.endElement()}function lo(t,e,n){const r=Sn(n),i=Nn("animateMotion"),o=Nn("mpath");Jn(o,{"xlink:href":"#"+r}),i.appendChild(o),t.appendChild(i);try{return so(i,e)}catch(a){if("fake"===document.documentElement.getAttribute("smiling")){const t=i;t.animators=[];const e=window,n=t.getAttribute("id");n&&(e.id2anim[n]=t);const r=e.getTargets(t);for(let i=0,o=r.length;i<o;i+=1){const n=r[i],o=new e.Animator(t,n,i);e.animators.push(o),t.animators[i]=o,o.register()}}}return()=>{}}function co(t){let e=0,n=0,r=0,i=0;if(t){let o=t;while(o)e+=o.offsetLeft,n+=o.offsetTop,o=o.offsetParent,o&&(e+=parseInt(kr(o,"borderLeft"),10),n+=parseInt(kr(o,"borderTop"),10));r=t.offsetWidth,i=t.offsetHeight}return{left:e,top:n,width:r,height:i}}function uo(t,e,n={}){if(null==e)return Ri(Jn(t,"transform"));if(n.absolute)return void t.setAttribute("transform",Fi(e));const r=t.transform,i=Ii(e);r.baseVal.appendItem(i)}function ho(t,e,n=0,r={}){let i=Jn(t,"transform");const o=Bi(i);if(null==e)return o.translation;i=o.raw,i=i.replace(/translate\([^)]*\)/g,"").trim();const a=r.absolute?e:o.translation.tx+e,s=r.absolute?n:o.translation.ty+n,l=`translate(${a},${s})`;t.setAttribute("transform",`${l} ${i}`.trim())}function po(t,e,n,r,i={}){let o=Jn(t,"transform");const a=Bi(o);if(null==e)return a.rotation;o=a.raw,o=o.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const s=i.absolute?e:a.rotation.angle+e,l=null!=n&&null!=r?`,${n},${r}`:"",c=`rotate(${s}${l})`;t.setAttribute("transform",`${o} ${c}`.trim())}function fo(t,e,n){let r=Jn(t,"transform");const i=Bi(r);if(null==e)return i.scale;n=null==n?e:n,r=i.raw,r=r.replace(/scale\([^)]*\)/g,"").trim();const o=`scale(${e},${n})`;t.setAttribute("transform",`${r} ${o}`.trim())}function go(t,e,n,r){const i=Dr.create(e),o=Dr.create(n);if(!r){const e=t instanceof SVGSVGElement?t:t.ownerSVGElement;r=e}const a=fo(t);t.setAttribute("transform","");const s=Zi(t,{target:r}).scale(a.sx,a.sy),l=Ii();l.setTranslate(-s.x-s.width/2,-s.y-s.height/2);const c=Ii(),u=i.angleBetween(o,i.clone().translate(1,0));u&&c.setRotate(u,0,0);const d=Ii(),h=i.clone().move(o,s.width/2);d.setTranslate(2*i.x-h.x,2*i.y-h.y);const p=to(t,r),f=Ii();f.setMatrix(d.matrix.multiply(c.matrix.multiply(l.matrix.multiply(p.scale(a.sx,a.sy))))),t.setAttribute("transform",Fi(f.matrix))}class mo{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=gt.isEventSupported("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){gt.SUPPORT_PASSIVE?this.target.addEventListener(this.eventName,this.onWheel,{passive:!1}):pt()(this.target).on("mousewheel",this.onWheel)}disable(){gt.SUPPORT_PASSIVE?this.target.removeEventListener(this.eventName,this.onWheel):pt()(this.target).off("mousewheel")}onWheel(t){if(null!=this.onWheelGuard&&!this.onWheelGuard(t))return;let e;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault(),0===this.deltaX&&0===this.deltaY||(t.stopPropagation(),e=!0),!0===e&&0===this.animationFrameId&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(t)}))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}const vo=ai.isVector,bo=ai.create,yo=ai.createVectors;function wo(t,e=60){let n=null;return(...r)=>{n&&clearTimeout(n),n=window.setTimeout(()=>{t.apply(this,r)},e)}}function xo(t){let e=null,n=[];const r=()=>{if("static"===getComputedStyle(t).position){const e=t.style;e.position="relative"}const e=document.createElement("object");return e.onload=()=>{e.contentDocument.defaultView.addEventListener("resize",i),i()},e.style.display="block",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.height="100%",e.style.width="100%",e.style.overflow="hidden",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.opacity="0",e.setAttribute("tabindex","-1"),e.type="text/html",t.appendChild(e),e.data="about:blank",e},i=wo(()=>{n.forEach(e=>e(t))}),o=t=>{e||(e=r()),-1===n.indexOf(t)&&n.push(t)},a=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",i),e.parentNode.removeChild(e),e=null,n=[])},s=t=>{const r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&e&&a()};return{element:t,bind:o,destroy:a,unbind:s}}function Co(t){let e=null,n=[];const r=wo(()=>{n.forEach(e=>{e(t)})}),i=()=>{const e=new ResizeObserver(r);return e.observe(t),r(),e},o=t=>{e||(e=i()),-1===n.indexOf(t)&&n.push(t)},a=()=>{e&&(e.disconnect(),n=[],e=null)},s=t=>{const r=n.indexOf(t);-1!==r&&n.splice(r,1),0===n.length&&e&&a()};return{element:t,bind:o,destroy:a,unbind:s}}const ko="undefined"!==typeof ResizeObserver?Co:xo;var Ao,So;(function(t){const e=new WeakMap;function n(t){let n=e.get(t);return n||(n=ko(t),e.set(t,n),n)}function r(t){t.destroy(),e.delete(t.element)}t.bind=(t,e)=>{const r=n(t);return r.bind(e),()=>r.unbind(e)},t.clear=t=>{const e=n(t);r(e)}})(Ao||(Ao={})),function(t){const e=[],n=1e3/60,r=[];let i=0;const o=()=>performance.now(),a=t=>t[0],s=t=>1===r.push(t)&&l(),l=(()=>{const t=()=>r.splice(0,r.length).forEach(t=>t());if("undefined"!==typeof MessageChannel){const{port1:e,port2:n}=new MessageChannel;return e.onmessage=t,()=>n.postMessage(null)}return()=>setTimeout(t)})(),c=()=>{i=o()+n;let r=a(e);while(r&&!t.shouldYield()){const{callback:t,data:n}=r;r.callback=null;const i=t&&t(n);i?r.callback=i:e.shift(),r=a(e)}r&&s(c)};t.scheduleTask=(t,n)=>{const r={callback:t,data:n};e.push(r),s(c)},t.shouldYield=()=>{var t,e;return(null===(e=null===(t=navigator)||void 0===t?void 0:t.scheduling)||void 0===e?void 0:e.isInputPending())||o()>=i}}(So||(So={}));class Eo{constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,n=!1){if("object"===typeof t)return void Object.keys(t).forEach(n=>{this.register(n,t[n],e)});!this.exist(t)||n||gt.isApplyingHMR()||this.onDuplicated(t);const r=this.options.process,i=r?s.call(r,this,t,e):e;return this.data[t]=i,i}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return!!t&&null!=this.data[t]}onDuplicated(t){try{throw this.options.onConflict&&s.call(this.options.onConflict,this,t),new Error(`${o.upperFirst(this.options.type)} with name '${t}' already registered.`)}catch(e){throw e}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const n=this.getSpellingSuggestionForName(t),r=e?`${e} ${o.lowerFirst(this.options.type)}`:this.options.type;return`${o.upperFirst(r)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return o.getSpellingSuggestion(t,Object.keys(this.data),t=>t)}}(function(t){function e(e){return new t(e)}t.create=e})(Eo||(Eo={}));const Oo={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},To={},_o={position:Jo("x","width","origin")},Mo={position:Jo("y","height","origin")},No={position:Jo("x","width","corner")},Po={position:Jo("y","height","corner")},Lo={set:Qo("width","width")},Do={set:Qo("height","height")},jo={set:Qo("rx","width")},Io={set:Qo("ry","height")},Ro={set:(t=>{const e=Qo(t,"width"),n=Qo(t,"height");return function(t,r){const i=r.refBBox,o=i.height>i.width?e:n;return s.call(o,this,t,r)}})("r")},Fo={set(t,{refBBox:e}){let n=parseFloat(t);const r=a.isPercentage(t);r&&(n/=100);const i=Math.sqrt(e.height*e.height+e.width*e.width);let o;return Number.isFinite(n)&&(o=r||n>=0&&n<=1?n*i:Math.max(n+i,0)),{r:o}}},Bo={set:Qo("cx","width")},zo={set:Qo("cy","height")},Ho={set:ea({resetOffset:!0})},Vo={set:ea({resetOffset:!1})},qo={set:na({resetOffset:!0})},Uo={set:na({resetOffset:!1})},Wo=Ro,$o=Ho,Go=qo,Yo=_o,Xo=Mo,Ko=Lo,Zo=Do;function Jo(t,e,n){return(r,{refBBox:i})=>{if(null==r)return null;let o=parseFloat(r);const s=a.isPercentage(r);let l;if(s&&(o/=100),Number.isFinite(o)){const r=i[n];l=s||o>0&&o<1?r[t]+i[e]*o:r[t]+o}const c=new Dr;return c[t]=l||0,c}}function Qo(t,e){return function(n,{refBBox:r}){let i=parseFloat(n);const o=a.isPercentage(n);o&&(i/=100);const s={};if(Number.isFinite(i)){const n=o||i>=0&&i<=1?i*r[e]:Math.max(i+r[e],0);s[t]=n}return s}}function ta(t,e){const n="x6-shape",r=e&&e.resetOffset;return function(e,{view:i,elem:o,refBBox:a}){const s=i.$(o);let l=s.data(n);if(!l||l.value!==e){const r=t(e);l={value:e,shape:r,shapeBBox:r.bbox()},s.data(n,l)}const c=l.shape.clone(),u=l.shapeBBox.clone(),d=u.getOrigin(),h=a.getOrigin();u.x=h.x,u.y=h.y;const p=a.getMaxScaleToFit(u,h),f=0===u.width||0===a.width?1:p.sx,g=0===u.height||0===a.height?1:p.sy;return c.scale(f,g,d),r&&c.translate(-d.x,-d.y),c}}function ea(t){function e(t){return oi.parse(t)}const n=ta(e,t);return(t,e)=>{const r=n(t,e);return{d:r.serialize()}}}function na(t){const e=ta(t=>new Fr(t),t);return(t,n)=>{const r=e(t,n);return{points:r.serialize()}}}const ra={qualify:i.isPlainObject,set(t,{view:e}){return`url(#${e.graph.defineGradient(t)})`}},ia={qualify:i.isPlainObject,set(t,{view:e}){const n=e.cell,r=Object.assign({},t);if(n.isEdge()&&"linearGradient"===r.type){const t=e,i=t.sourcePoint,o=t.targetPoint;r.id=`gradient-${r.type}-${n.id}`,r.attrs=Object.assign(Object.assign({},r.attrs),{x1:i.x,y1:i.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(r.id)}return`url(#${e.graph.defineGradient(r)})`}},oa={qualify(t,{attrs:e}){return null==e.textWrap||!i.isPlainObject(e.textWrap)},set(t,{view:e,elem:n,attrs:r}){const i="x6-text",o=e.$(n),a=o.data(i),s=t=>{try{return JSON.parse(t)}catch(e){return t}},l={x:r.x,eol:r.eol,annotations:s(r.annotations),textPath:s(r["text-path"]||r.textPath),textVerticalAnchor:r["text-vertical-anchor"]||r.textVerticalAnchor,displayEmpty:"true"===(r["display-empty"]||r.displayEmpty),lineHeight:r["line-height"]||r.lineHeight},u=r["font-size"]||r.fontSize,d=JSON.stringify([t,l]);if(u&&n.setAttribute("font-size",u),null==a||a!==d){const r=l.textPath;if(null!=r&&"object"===typeof r){const t=r.selector;if("string"===typeof t){const n=e.find(t)[0];n instanceof SVGPathElement&&(c.ensureId(n),l.textPath=Object.assign({"xlink:href":"#"+n.id},r))}}c.text(n,""+t,l),o.data(i,d)}}},aa={qualify:i.isPlainObject,set(t,{view:e,elem:n,attrs:r,refBBox:i}){const o=t,l=o.width||0;a.isPercentage(l)?i.width*=parseFloat(l)/100:l<=0?i.width+=l:i.width=l;const u=o.height||0;let d;a.isPercentage(u)?i.height*=parseFloat(u)/100:u<=0?i.height+=u:i.height=u;let h=o.text;null==h&&(h=r.text),d=null!=h?c.breakText(""+h,i,{"font-weight":r["font-weight"]||r.fontWeight,"font-size":r["font-size"]||r.fontSize,"font-family":r["font-family"]||r.fontFamily,lineHeight:r.lineHeight},{svgDocument:e.graph.view.svg,ellipsis:o.ellipsis,hyphen:o.hyphen,breakWord:o.breakWord}):"",s.call(oa.set,this,d,{view:e,elem:n,attrs:r,refBBox:i,cell:e.cell})}},sa=(t,{attrs:e})=>void 0!==e.text,la={qualify:sa},ca={qualify:sa},ua={qualify:sa},da={qualify:sa},ha={qualify:sa},pa={qualify:sa},fa={qualify(t,{elem:e}){return e instanceof SVGElement},set(t,{view:e,elem:n}){const r="x6-title",i=""+t,o=e.$(n),a=o.data(r);if(null==a||a!==i){o.data(r,i);const t=n.firstChild;if(t&&"TITLE"===t.tagName.toUpperCase()){const e=t;e.textContent=i}else{const e=document.createElementNS(n.namespaceURI,"title");e.textContent=i,n.insertBefore(e,t)}}}},ga={offset:ba("x","width","right")},ma={offset:ba("y","height","bottom")},va={offset(t,{refBBox:e}){return t?{x:-e.x,y:-e.y}:{x:0,y:0}}};function ba(t,e,n){return(r,{refBBox:i})=>{const o=new Dr;let s;return s="middle"===r?i[e]/2:r===n?i[e]:"number"===typeof r&&Number.isFinite(r)?r>-1&&r<1?-i[e]*r:-r:a.isPercentage(r)?i[e]*parseFloat(r)/100:0,o[t]=-(i[t]+s),o}}const ya={qualify:i.isPlainObject,set(t,{view:e,elem:n}){e.$(n).css(t)}},wa={set(t,{view:e,elem:n}){e.$(n).html(""+t)}},xa={qualify:i.isPlainObject,set(t,{view:e}){return`url(#${e.graph.defineFilter(t)})`}},Ca={set(t){return null!=t&&"object"===typeof t&&t.id?t.id:t}};function ka(t,e,n){let r,i;"object"===typeof e?(r=e.x,i=e.y):(r=e,i=n);const o=oi.parse(t),a=o.bbox();if(a){let t=-a.height/2-a.y,e=-a.width/2-a.x;"number"===typeof r&&(e-=r),"number"===typeof i&&(t-=i),o.translate(e,t)}return o.serialize()}var Aa=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Sa=t=>{var{size:e,width:n,height:r,offset:i,open:o}=t,a=Aa(t,["size","width","height","offset","open"]);return Oa({size:e,width:n,height:r,offset:i},!0===o,!0,void 0,a)},Ea=t=>{var{size:e,width:n,height:r,offset:i,factor:o}=t,a=Aa(t,["size","width","height","offset","factor"]);return Oa({size:e,width:n,height:r,offset:i},!1,!1,o,a)};function Oa(t,e,n,r=3/4,i={}){const o=t.size||10,s=t.width||o,l=t.height||o,c=new oi,u={};if(e)c.moveTo(s,0).lineTo(0,l/2).lineTo(s,l),u.fill="none";else{if(c.moveTo(0,l/2),c.lineTo(s,0),!n){const t=a.clamp(r,0,1);c.lineTo(s*t,l/2)}c.lineTo(s,l),c.close()}return Object.assign(Object.assign(Object.assign({},u),i),{tagName:"path",d:ka(c.serialize(),{x:null!=t.offset?t.offset:-s/2})})}var Ta=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const _a=t=>{var{size:e,width:n,height:r,offset:i}=t,o=Ta(t,["size","width","height","offset"]);const a=e||10,s=n||a,l=r||a,c=new oi;return c.moveTo(0,l/2).lineTo(s/2,0).lineTo(s,l/2).lineTo(s/2,l).close(),Object.assign(Object.assign({},o),{tagName:"path",d:ka(c.serialize(),null==i?-s/2:i)})};var Ma=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Na=t=>{var{d:e,offsetX:n,offsetY:r}=t,i=Ma(t,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},i),{tagName:"path",d:ka(e,n,r)})};var Pa=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const La=t=>{var{size:e,width:n,height:r,offset:i}=t,o=Pa(t,["size","width","height","offset"]);const a=e||10,s=n||a,l=r||a,c=new oi;return c.moveTo(0,0).lineTo(s,l).moveTo(0,l).lineTo(s,0),Object.assign(Object.assign({},o),{tagName:"path",fill:"none",d:ka(c.serialize(),i||-s/2)})};var Da=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const ja=t=>{var{width:e,height:n,offset:r,open:i,flip:o}=t,a=Da(t,["width","height","offset","open","flip"]);let s=n||6;const l=e||10,c=!0===i,u=!0===o,d=Object.assign(Object.assign({},a),{tagName:"path"});u&&(s=-s);const h=new oi;return h.moveTo(0,s).lineTo(l,0),c?d.fill="none":(h.lineTo(l,s),h.close()),d.d=ka(h.serialize(),{x:r||-l/2,y:s/2}),d};var Ia=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Ra=t=>{var{r:e}=t,n=Ia(t,["r"]);const r=e||5;return Object.assign(Object.assign({cx:r},n),{tagName:"circle",r:r})},Fa=t=>{var{r:e}=t,n=Ia(t,["r"]);const r=e||5,i=new oi;return i.moveTo(r,0).lineTo(r,2*r),i.moveTo(0,r).lineTo(2*r,r),{children:[Object.assign(Object.assign({},Ra({r:r})),{fill:"none"}),Object.assign(Object.assign({},n),{tagName:"path",d:ka(i.serialize(),-r)})]}};var Ba=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const za=t=>{var{rx:e,ry:n}=t,r=Ba(t,["rx","ry"]);const i=e||5,o=n||5;return Object.assign(Object.assign({cx:i},r),{tagName:"ellipse",rx:i,ry:o})};var Ha;(function(t){t.presets=u,t.registry=Eo.create({type:"marker"}),t.registry.register(t.presets,!0)})(Ha||(Ha={})),function(t){t.normalize=ka}(Ha||(Ha={}));var Va=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function qa(t){return"string"===typeof t||i.isPlainObject(t)}const Ua={qualify:qa,set(t,{view:e,attrs:n}){return Ga("marker-start",t,e,n)}},Wa={qualify:qa,set(t,{view:e,attrs:n}){return Ga("marker-end",t,e,n,{transform:"rotate(180)"})}},$a={qualify:qa,set(t,{view:e,attrs:n}){return Ga("marker-mid",t,e,n)}};function Ga(t,e,n,r,i={}){const o="string"===typeof e?{name:e}:e,{name:a,args:s}=o,l=Va(o,["name","args"]);let c=l;if(a&&"string"===typeof a){const t=Ha.registry.get(a);if(!t)return Ha.registry.onNotFound(a);c=t(Object.assign(Object.assign({},l),s))}const u=Object.assign(Object.assign(Object.assign({},Ya(r,t)),i),c);return{[t]:`url(#${n.graph.defineMarker(u)})`}}function Ya(t,e){const n={},r=t.stroke;"string"===typeof r&&(n.stroke=r,n.fill=r);let i=t.strokeOpacity;if(null==i&&(i=t["stroke-opacity"]),null==i&&(i=t.opacity),null!=i&&(n["stroke-opacity"]=i,n["fill-opacity"]=i),"marker-mid"!==e){const r=parseFloat(t.strokeWidth||t["stroke-width"]);if(Number.isFinite(r)&&r>1){const t=Math.ceil(r/2);n.refX="marker-start"===e?t:-t}}return n}const Xa=(t,{view:e})=>e.cell.isEdge(),Ka={qualify:Xa,set(t,e){var n,r,i,o;const a=e.view,s=t.reverse||!1,l=t.stubs||0;let c;if(Number.isFinite(l)&&0!==l)if(s){let t,e;const s=a.getConnectionLength()||0;l<0?(t=(s+l)/2,e=-l):(t=l,e=s-2*l);const u=a.getConnection();c=null===(o=null===(i=null===(r=null===(n=null===u||void 0===u?void 0:u.divideAtLength(t))||void 0===n?void 0:n[1])||void 0===r?void 0:r.divideAtLength(e))||void 0===i?void 0:i[0])||void 0===o?void 0:o.serialize()}else{let t;if(l<0){const e=a.getConnectionLength()||0;t=(e+l)/2}else t=l;const e=a.getConnection();if(e){const n=e.divideAtLength(t),r=e.divideAtLength(-t);n&&r&&(c=`${n[0].serialize()} ${r[1].serialize()}`)}}return{d:c||a.getConnectionPathData()}}},Za={qualify:Xa,set:rs("getTangentAtLength",{rotate:!0})},Ja={qualify:Xa,set:rs("getTangentAtLength",{rotate:!1})},Qa={qualify:Xa,set:rs("getTangentAtRatio",{rotate:!0})},ts={qualify:Xa,set:rs("getTangentAtRatio",{rotate:!1})},es=Za,ns=Qa;function rs(t,e){const n={x:1,y:0};return(r,i)=>{let o,a;const s=i.view,l=s[t](Number(r));return l?(a=e.rotate?l.vector().vectorAngle(n):0,o=l.start):(o=s.path.start,a=0),0===a?{transform:`translate(${o.x},${o.y}')`}:{transform:`translate(${o.x},${o.y}') rotate(${a})`}}}var is;(function(t){function e(t,e,n){if(null!=t){if("string"===typeof t)return!0;if("function"!==typeof t.qualify||s.call(t.qualify,this,e,n))return!0}return!1}t.isValidDefinition=e})(is||(is={})),function(t){t.presets=Object.assign(Object.assign({},Oo),d),t.registry=Eo.create({type:"attribute definition"}),t.registry.register(t.presets,!0)}(is||(is={}));const os={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.thickness*e.sx,r=e.thickness*e.sy;c.attr(t,{width:n,height:r,rx:n,ry:r,fill:e.color})}},as={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.sx<=1?e.thickness*e.sx:e.thickness;c.attr(t,{width:n,height:n,rx:n,ry:n,fill:e.color})}},ss={color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const r=e.width,i=e.height,o=e.thickness;n=r-o>=0&&i-o>=0?["M",r,0,"H0 M0 0 V0",i].join(" "):"M 0 0 0 0",c.attr(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},ls=[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const r=e.width,i=e.height,o=e.thickness;n=r-o>=0&&i-o>=0?["M",r,0,"H0 M0 0 V0",i].join(" "):"M 0 0 0 0",c.attr(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(t,e){let n;const r=e.factor||1,i=e.width*r,o=e.height*r,a=e.thickness;n=i-a>=0&&o-a>=0?["M",i,0,"H0 M0 0 V0",o].join(" "):"M 0 0 0 0",e.width=i,e.height=o,c.attr(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}}];class cs{constructor(){this.patterns={},this.root=ai.create(c.createSvgDocument(),{width:"100%",height:"100%"},[c.createSvgElement("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,ai.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return null!=this.patterns[t]}}function us(t,e){return null!=t?t:e}function ds(t,e){return null!=t&&Number.isFinite(t)?t:e}function hs(t={}){const e=us(t.color,"blue"),n=ds(t.width,1),r=ds(t.margin,2),i=ds(t.opacity,1),o=r,a=r+n;return`\n <filter>\n <feFlood flood-color="${e}" flood-opacity="${i}" result="colored"/>\n <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${a}" />\n <feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${o}" />\n <feComposite result="morphedOuterColored" in="colored" in2="morphedOuter" operator="in"/>\n <feComposite operator="xor" in="morphedOuterColored" in2="morphedInner" result="outline"/>\n <feMerge>\n <feMergeNode in="outline"/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n `.trim()}function ps(t={}){const e=us(t.color,"red"),n=ds(t.blur,0),r=ds(t.width,1),i=ds(t.opacity,1);return`\n <filter>\n <feFlood flood-color="${e}" flood-opacity="${i}" result="colored"/>\n <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${r}"/>\n <feComposite result="composed" in="colored" in2="morphed" operator="in"/>\n <feGaussianBlur result="blured" in="composed" stdDeviation="${n}"/>\n <feBlend in="SourceGraphic" in2="blured" mode="normal"/>\n </filter>\n `.trim()}function fs(t={}){const e=ds(t.x,2),n=null!=t.y&&Number.isFinite(t.y)?[e,t.y]:e;return`\n <filter>\n <feGaussianBlur stdDeviation="${n}"/>\n </filter>\n `.trim()}function gs(t={}){const e=ds(t.dx,0),n=ds(t.dy,0),r=us(t.color,"black"),i=ds(t.blur,4),o=ds(t.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>\n <feDropShadow stdDeviation="${i}" dx="${e}" dy="${n}" flood-color="${r}" flood-opacity="${o}" />\n </filter>`.trim():`<filter>\n <feGaussianBlur in="SourceAlpha" stdDeviation="${i}" />\n <feOffset dx="${e}" dy="${n}" result="offsetblur" />\n <feFlood flood-color="${r}" />\n <feComposite in2="offsetblur" operator="in" />\n <feComponentTransfer>\n <feFuncA type="linear" slope="${o}" />\n </feComponentTransfer>\n <feMerge>\n <feMergeNode/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>`.trim()}function ms(t={}){const e=ds(t.amount,1),n=.2126+.7874*(1-e),r=.7152-.7152*(1-e),i=.0722-.0722*(1-e),o=.2126-.2126*(1-e),a=.7152+.2848*(1-e),s=.0722-.0722*(1-e),l=.2126-.2126*(1-e),c=.0722+.9278*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${r} ${i} 0 0 ${o} ${a} ${s} 0 0 ${l} ${r} ${c} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function vs(t={}){const e=ds(t.amount,1),n=.393+.607*(1-e),r=.769-.769*(1-e),i=.189-.189*(1-e),o=.349-.349*(1-e),a=.686+.314*(1-e),s=.168-.168*(1-e),l=.272-.272*(1-e),c=.534-.534*(1-e),u=.131+.869*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${r} ${i} 0 0 ${o} ${a} ${s} 0 0 ${l} ${c} ${u} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function bs(t={}){const e=ds(t.amount,1);return`\n <filter>\n <feColorMatrix type="saturate" values="${1-e}"/>\n </filter>\n `.trim()}function ys(t={}){const e=ds(t.angle,0);return`\n <filter>\n <feColorMatrix type="hueRotate" values="${e}"/>\n </filter>\n `.trim()}function ws(t={}){const e=ds(t.amount,1),n=1-e;return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="table" tableValues="${e} ${n}"/>\n <feFuncG type="table" tableValues="${e} ${n}"/>\n <feFuncB type="table" tableValues="${e} ${n}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}function xs(t={}){const e=ds(t.amount,1);return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="${e}"/>\n <feFuncG type="linear" slope="${e}"/>\n <feFuncB type="linear" slope="${e}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}function Cs(t={}){const e=ds(t.amount,1),n=.5-e/2;return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="${e}" intercept="${n}"/>\n <feFuncG type="linear" slope="${e}" intercept="${n}"/>\n <feFuncB type="linear" slope="${e}" intercept="${n}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}var ks;(function(t){t.presets=h,t.registry=Eo.create({type:"grid"}),t.registry.register(t.presets,!0)})(cs||(cs={})),function(t){t.presets=p,t.registry=Eo.create({type:"filter"}),t.registry.register(t.presets,!0)}(ks||(ks={}));const As=function(t){const e=document.createElement("canvas"),n=t.width,r=t.height;e.width=2*n,e.height=r;const i=e.getContext("2d");return i.drawImage(t,0,0,n,r),i.translate(2*n,0),i.scale(-1,1),i.drawImage(t,0,0,n,r),e},Ss=function(t){const e=document.createElement("canvas"),n=t.width,r=t.height;e.width=n,e.height=2*r;const i=e.getContext("2d");return i.drawImage(t,0,0,n,r),i.translate(0,2*r),i.scale(1,-1),i.drawImage(t,0,0,n,r),e},Es=function(t){const e=document.createElement("canvas"),n=t.width,r=t.height;e.width=2*n,e.height=2*r;const i=e.getContext("2d");return i.drawImage(t,0,0,n,r),i.setTransform(-1,0,0,-1,e.width,e.height),i.drawImage(t,0,0,n,r),i.setTransform(-1,0,0,1,e.width,0),i.drawImage(t,0,0,n,r),i.setTransform(1,0,0,-1,0,e.height),i.drawImage(t,0,0,n,r),e},Os=function(t,e){const n=t.width,r=t.height,i=document.createElement("canvas");i.width=3*n,i.height=3*r;const o=i.getContext("2d"),a=null!=e.angle?-e.angle:-20,s=Er.toRad(a),l=i.width/4,c=i.height/4;for(let u=0;u<4;u+=1)for(let e=0;e<4;e+=1)(u+e)%2>0&&(o.setTransform(1,0,0,1,(2*u-1)*l,(2*e-1)*c),o.rotate(s),o.drawImage(t,-n/2,-r/2,n,r));return i};var Ts;(function(t){t.presets=Object.assign({},f),t.presets["flip-x"]=As,t.presets["flip-y"]=Ss,t.presets["flip-xy"]=Es,t.registry=Eo.create({type:"background pattern"}),t.registry.register(t.presets,!0)})(Ts||(Ts={}));const _s={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,trackable:!1,trackInfo:{},track(t){_s.trackable=t}};var Ms;(function(t){function e(t){return`${_s.prefixCls}-${t}`}t.snapToGrid=Mr,t.normalizeMarker=ka,t.prefix=e})(Ms||(Ms={})),function(t){function e(t,e,n,r=[]){const i="function"===typeof e.children?e.children(t):t[e.children||"children"];return n||(n=e.createNode(t),r.push(n)),Array.isArray(i)&&i.forEach(t=>{const i=e.createNode(t),o=e.createEdge(n,i);r.push(i,o),this.makeTree(t,e,i,r)}),r}t.makeTree=e}(Ms||(Ms={}));const Ns="1.33.1",Ps=Ms.prefix("highlighted"),Ls={highlight(t,e,n){const r=n&&n.className||Ps;c.addClass(e,r)},unhighlight(t,e,n){const r=n&&n.className||Ps;c.removeClass(e,r)}},Ds=Ms.prefix("highlight-opacity"),js={highlight(t,e){c.addClass(e,Ds)},unhighlight(t,e){c.removeClass(e,Ds)}},Is={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},Rs={highlight(t,e,n){const r=Fs.getHighlighterId(e,n);if(Fs.hasCache(r))return;n=i.defaultsDeep({},n,Is);const o=ai.create(e);let a,s;try{a=o.toPathData()}catch(h){s=o.bbox(!0),a=c.rectToPathData(Object.assign(Object.assign({},n),s))}const l=c.createSvgElement("path");if(c.attr(l,Object.assign({d:a,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},n.attrs?c.kebablizeAttrs(n.attrs):null)),t.isEdgeElement(e))c.attr(l,"d",t.getConnectionPathData());else{let e=o.getTransformToElement(t.container);const r=n.padding;if(r){null==s&&(s=o.bbox(!0));const t=s.x+s.width/2,n=s.y+s.height/2;s=c.transformRectangle(s,e);const i=Math.max(s.width,1),a=Math.max(s.height,1),l=(i+r)/i,u=(a+r)/a,d=c.createSVGMatrix({a:l,b:0,c:0,d:u,e:t-l*t,f:n-u*n});e=e.multiply(d)}c.transform(l,e)}c.addClass(l,Ms.prefix("highlight-stroke"));const u=t.cell,d=()=>Fs.removeHighlighter(r);u.on("removed",d),u.model&&u.model.on("reseted",d),t.container.appendChild(l),Fs.setCache(r,l)},unhighlight(t,e,n){Fs.removeHighlighter(Fs.getHighlighterId(e,n))}};var Fs,Bs;function zs(t,e={}){return new Dr(a.normalizePercentage(e.x,t.width),a.normalizePercentage(e.y,t.height))}function Hs(t,e,n){return Object.assign({angle:e,position:t.toJSON()},n)}(function(t){function e(t,e){return c.ensureId(t),t.id+JSON.stringify(e)}t.getHighlighterId=e;const n={};function r(t,e){n[t]=e}function i(t){return null!=n[t]}function o(t){const e=n[t];e&&(c.remove(e),delete n[t])}t.setCache=r,t.hasCache=i,t.removeHighlighter=o})(Fs||(Fs={})),function(t){function e(t,e){if("function"!==typeof e.highlight)throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if("function"!==typeof e.unhighlight)throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}t.check=e}(Bs||(Bs={})),function(t){t.presets=g,t.registry=Eo.create({type:"highlighter"}),t.registry.register(t.presets,!0)}(Bs||(Bs={}));const Vs=(t,e)=>t.map(({x:t,y:n,angle:r})=>Hs(zs(e,{x:t,y:n}),r||0)),qs=(t,e,n)=>{const r=n.start||0,i=n.step||20;return Ws(t,e,r,(t,e)=>(t+.5-e/2)*i)},Us=(t,e,n)=>{const r=n.start||0,i=n.step||360/t.length;return Ws(t,e,r,t=>t*i)};function Ws(t,e,n,r){const i=e.getCenter(),o=e.getTopCenter(),a=e.width/e.height,s=Rr.fromRect(e),l=t.length;return t.map((t,e)=>{const c=n+r(e,l),u=o.clone().rotate(-c,i).scale(a,1,i),d=t.compensateRotate?-s.tangentTheta(u):0;return(t.dx||t.dy)&&u.translate(t.dx||0,t.dy||0),t.dr&&u.move(i,t.dr),Hs(u.round(),d,t)})}var $s=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Gs=(t,e,n)=>{const r=zs(e,n.start||e.getOrigin()),i=zs(e,n.end||e.getCorner());return Js(t,r,i,n)},Ys=(t,e,n)=>Js(t,e.getTopLeft(),e.getBottomLeft(),n),Xs=(t,e,n)=>Js(t,e.getTopRight(),e.getBottomRight(),n),Ks=(t,e,n)=>Js(t,e.getTopLeft(),e.getTopRight(),n),Zs=(t,e,n)=>Js(t,e.getBottomLeft(),e.getBottomRight(),n);function Js(t,e,n,r){const i=new Ir(e,n),o=t.length;return t.map((t,e)=>{var{strict:n}=t,a=$s(t,["strict"]);const s=n||r.strict?(e+1)/(o+1):(e+.5)/o,l=i.pointAt(s);return(a.dx||a.dy)&&l.translate(a.dx||0,a.dy||0),Hs(l.round(),0,a)})}var Qs;(function(t){t.presets=m,t.registry=Eo.create({type:"port layout"}),t.registry.register(t.presets,!0)})(Qs||(Qs={}));const tl={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function el(t,e){const{x:n,y:r,angle:o,attrs:a}=e||{};return i.defaultsDeep({},{angle:o,attrs:a,position:{x:n,y:r}},t,tl)}const nl=(t,e,n)=>el({position:e.getTopLeft()},n),rl=(t,e,n)=>el({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},n),il=(t,e,n)=>el({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},n),ol=(t,e,n)=>el({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},n),al=(t,e,n)=>el({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},n),sl=(t,e,n)=>dl(t,e,!1,n),ll=(t,e,n)=>dl(t,e,!0,n),cl=(t,e,n)=>hl(t,e,!1,n),ul=(t,e,n)=>hl(t,e,!0,n);function dl(t,e,n,r){const i=null!=r.offset?r.offset:15,o=e.getCenter().theta(t),a=pl(e);let s,l,c,u,d=0;return o<a[1]||o>a[2]?(s=".3em",l=i,c=0,u="start"):o<a[0]?(s="0",l=0,c=-i,n?(d=-90,u="start"):u="middle"):o<a[3]?(s=".3em",l=-i,c=0,u="end"):(s=".6em",l=0,c=i,n?(d=90,u="start"):u="middle"),el({position:{x:Math.round(l),y:Math.round(c)},angle:d,attrs:{".":{y:s,"text-anchor":u}}},r)}function hl(t,e,n,r){const i=null!=r.offset?r.offset:15,o=e.getCenter().theta(t),a=pl(e);let s,l,c,u,d=0;return o<a[1]||o>a[2]?(s=".3em",l=-i,c=0,u="end"):o<a[0]?(s=".6em",l=0,c=i,n?(d=90,u="start"):u="middle"):o<a[3]?(s=".3em",l=i,c=0,u="start"):(s="0em",l=0,c=-i,n?(d=-90,u="start"):u="middle"),el({position:{x:Math.round(l),y:Math.round(c)},angle:d,attrs:{".":{y:s,"text-anchor":u}}},r)}function pl(t){const e=t.getCenter(),n=e.theta(t.getTopLeft()),r=e.theta(t.getBottomLeft()),i=e.theta(t.getBottomRight()),o=e.theta(t.getTopRight());return[n,o,i,r]}const fl=(t,e,n)=>ml(t.diff(e.getCenter()),!1,n),gl=(t,e,n)=>ml(t.diff(e.getCenter()),!0,n);function ml(t,e,n){const r=null!=n.offset?n.offset:20,i=new Dr(0,0),o=-t.theta(i),a=t.clone().move(i,r).diff(t).round();let s,l=".3em",c=o;return(o+90)%180===0?(s=e?"end":"middle",e||-270!==o||(l="0em")):o>-270&&o<-90?(s="start",c=o-180):s="end",el({position:a.round().toJSON(),angle:e?c:0,attrs:{".":{y:l,"text-anchor":s}}},n)}var vl,bl;(function(t){t.presets=v,t.registry=Eo.create({type:"port label layout"}),t.registry.register(t.presets,!0)})(vl||(vl={}));class yl{constructor(t,e,n,r){return null==t?this.set(255,255,255,1):"number"===typeof t?this.set(t,e,n,r):"string"===typeof t?yl.fromString(t)||this:Array.isArray(t)?this.set(t):void this.set(t.r,t.g,t.b,null==t.a?1:t.a)}blend(t,e,n){this.set(t.r+(e.r-t.r)*n,t.g+(e.g-t.g)*n,t.b+(e.b-t.b)*n,t.a+(e.a-t.a)*n)}lighten(t){const e=yl.lighten(this.toArray(),t);this.r=e[0],this.g=e[1],this.b=e[2],this.a=e[3]}darken(t){this.lighten(-t)}set(t,e,n,r){const i=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,s=Array.isArray(t)?t[2]:n,l=Array.isArray(t)?t[3]:r;return this.r=Math.round(a.clamp(i,0,255)),this.g=Math.round(a.clamp(o,0,255)),this.b=Math.round(a.clamp(s,0,255)),this.a=null==l?1:a.clamp(l,0,1),this}toHex(){const t=["r","g","b"].map(t=>{const e=this[t].toString(16);return e.length<2?"0"+e:e});return"#"+t.join("")}toRGBA(){return this.toArray()}toHSLA(){return yl.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(t){const e=`${this.r},${this.g},${this.b},`;return t?`rgb(${e})`:`rgba(${e},${this.a})`}toGrey(){return yl.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(t){function e(e){return new t(e)}function n(e){return new t([...g(e),1])}function r(e){const n=e.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(n){const e=n[1].split(/\s*,\s*/).map(t=>parseInt(t,10));return new t(e)}return null}function i(t,e,n){n<0&&++n,n>1&&--n;const r=6*n;return r<1?t+(e-t)*r:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function o(e){const n=e.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(n){const e=n[2].split(/\s*,\s*/),r=(parseFloat(e[0])%360+360)%360/360,i=parseFloat(e[1])/100,o=parseFloat(e[2])/100,a=null==e[3]?1:parseInt(e[3],10);return new t(u(r,i,o,a))}return null}function s(e){if(e.startsWith("#"))return n(e);if(e.startsWith("rgb"))return r(e);const i=t.named[e];return i?n(i):o(e)}function l(e,n){return t.fromArray([e,e,e,n])}function c(t,e,n,r){const i=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,a=Array.isArray(t)?t[2]:n,s=Array.isArray(t)?t[3]:r,l=Math.max(i,o,a),c=Math.min(i,o,a),u=(l+c)/2;let d=0,h=0;if(c!==l){const t=l-c;switch(h=u>.5?t/(2-l-c):t/(l+c),l){case i:d=(o-a)/t+(o<a?6:0);break;case o:d=(a-i)/t+2;break;case a:d=(i-o)/t+4;break;default:break}d/=6}return[d,h,u,null==s?1:s]}function u(t,e,n,r){const o=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:e,s=Array.isArray(t)?t[2]:n,l=Array.isArray(t)?t[3]:r,c=s<=.5?s*(a+1):s+a-s*a,u=2*s-c;return[256*i(u,c,o+1/3),256*i(u,c,o),256*i(u,c,o-1/3),null==l?1:l]}function d(e){return new t(Math.round(256*Math.random()),Math.round(256*Math.random()),Math.round(256*Math.random()),e?void 0:parseFloat(Math.random().toFixed(2)))}function h(){const t="0123456789ABCDEF";let e="#";for(let n=0;n<6;n+=1)e+=t[Math.floor(16*Math.random())];return e}function p(t){return d(t).toString()}function f(t,e){if("string"===typeof t){const n="#"===t[0],[r,i,o]=g(t);return e?.299*r+.587*i+.114*o>186?"#000000":"#ffffff":`${n?"#":""}${m(255-r,255-i,255-o)}`}const n=t[0],r=t[1],i=t[2],o=t[3];return e?.299*n+.587*r+.114*i>186?[0,0,0,o]:[255,255,255,o]:[255-n,255-r,255-i,o]}function g(t){const e=0===t.indexOf("#")?t:"#"+t;let n=Number("0x"+e.substr(1));if(4!==e.length&&7!==e.length||Number.isNaN(n))throw new Error("Invalid hex color.");const r=4===e.length?4:8,i=(1<<r)-1,o=["b","g","r"].map(()=>{const t=n&i;return n>>=r,4===r?17*t:t});return[o[2],o[1],o[0]]}function m(t,e,n){const r=t=>t.length<2?"0"+t:t;return`${r(t.toString(16))}${r(e.toString(16))}${r(n.toString(16))}`}function v(t,e){return y(t,e)}function b(t,e){return y(t,-e)}function y(t,e){if("string"===typeof t){const n="#"===t[0],r=parseInt(n?t.substr(1):t,16),i=a.clamp((r>>16)+e,0,255),o=a.clamp((r>>8&255)+e,0,255),s=a.clamp((255&r)+e,0,255);return`${n?"#":""}${(s|o<<8|i<<16).toString(16)}`}const n=m(t[0],t[1],t[2]),r=g(y(n,e));return[r[0],r[1],r[2],t[3]]}t.fromArray=e,t.fromHex=n,t.fromRGBA=r,t.fromHSLA=o,t.fromString=s,t.makeGrey=l,t.rgba2hsla=c,t.hsla2rgba=u,t.random=d,t.randomHex=h,t.randomRGBA=p,t.invert=f,t.lighten=v,t.darken=b})(yl||(yl={})),function(t){t.named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(yl||(yl={}));class wl{constructor(){this.listeners={}}on(t,e,n){if(null==e)return this;this.listeners[t]||(this.listeners[t]=[]);const r=this.listeners[t];return r.push(e,n),this}once(t,e,n){const r=(...i)=>(this.off(t,r),bl.call([e,n],i));return this.on(t,r,this)}off(t,e,n){if(!(t||e||n))return this.listeners={},this;const r=this.listeners,i=t?[t]:Object.keys(r);return i.forEach(t=>{const i=r[t];if(i)if(e||n)for(let r=i.length-2;r>=0;r-=2)e&&i[r]!==e||n&&i[r+1]!==n||i.splice(r,2);else delete r[t]}),this}trigger(t,...e){let n=!0;if("*"!==t){const r=this.listeners[t];null!=r&&(n=bl.call([...r],e))}const r=this.listeners["*"];return null!=r?s.toAsyncBoolean([n,bl.call([...r],[t,...e])]):n}emit(t,...e){return this.trigger(t,...e)}}(function(t){function e(t,e){const n=[];for(let r=0;r<t.length;r+=2){const i=t[r],o=t[r+1],a=Array.isArray(e)?e:[e],l=s.apply(i,o,a);n.push(l)}return s.toAsyncBoolean(n)}t.call=e})(bl||(bl={}));class xl{get disposed(){return!0===this._disposed}dispose(){this._disposed=!0}}(function(t){function e(){return(t,e,n)=>{const r=n.value,i=t.__proto__;n.value=function(){this.disposed||(r.call(this),i.dispose.call(this))}}}t.dispose=e})(xl||(xl={}));class Cl{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(t=>{t.dispose()}),this.items.clear())}contains(t){return this.items.has(t)}add(t){this.items.add(t)}remove(t){this.items.delete(t)}clear(){this.items.clear()}}(function(t){function e(e){const n=new t;return e.forEach(t=>{n.add(t)}),n}t.from=e})(Cl||(Cl={}));class kl extends wl{}(function(t){t.dispose=xl.dispose})(kl||(kl={})),i.applyMixins(kl,xl);class Al extends kl{get disabled(){return!0===this._disabled}enable(){delete this._disabled}disable(){this._disabled=!0}}var Sl,El,Ol,Tl,_l,Ml=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Nl extends xl{constructor(){super(),this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const n=this.map.get(t);return this.map.delete(t),n}each(t){this.arr.forEach(e=>{const n=this.map.get(e);t(n,e)})}dispose(){this.clear()}}Ml([xl.dispose()],Nl.prototype,"dispose",null);class Pl{constructor(t={}){this.comparator=t.comparator||Pl.defaultComparator,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return 0===this.data.length}insert(t,e,n){const r={priority:t,value:e},i=this.data.length-1;return n&&(r.id=n,this.index[n]=i),this.data.push(r),this.bubbleUp(i),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const n=this.index[t];if("undefined"===typeof n)throw new Error(`Node with id '${t}' was not found in the heap.`);const r=this.data,i=r[n].priority,o=this.comparator(e,i);o<0?(r[n].priority=e,this.bubbleUp(n)):o>0&&(r[n].priority=e,this.bubbleDown(n))}remove(){const t=this.data,e=t[0],n=t.pop();return delete this.index[t.length],t.length>0&&(t[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let n,r,i=t;while(i>0){if(r=i-1>>>1,!(this.comparator(e[i].priority,e[r].priority)<0))break;{n=e[r],e[r]=e[i];let t=e[i].id;null!=t&&(this.index[t]=r),e[i]=n,t=e[i].id,null!=t&&(this.index[t]=i),i=r}}}bubbleDown(t){const e=this.data,n=e.length-1;let r=t;while(1){const t=1+(r<<1),i=t+1;let o=r;if(t<=n&&this.comparator(e[t].priority,e[o].priority)<0&&(o=t),i<=n&&this.comparator(e[i].priority,e[o].priority)<0&&(o=i),o===r)break;{const t=e[o];e[o]=e[r];let n=e[r].id;null!=n&&(this.index[n]=o),e[r]=t,n=e[r].id,null!=n&&(this.index[n]=r),r=o}}}}(function(t){t.defaultComparator=(t,e)=>t-e})(Pl||(Pl={})),function(t){function e(t,e,n=((t,e)=>1)){const r={},i={},o={},a=new Pl;r[e]=0,Object.keys(t).forEach(t=>{t!==e&&(r[t]=1/0),a.insert(r[t],t,t)});while(!a.isEmpty()){const e=a.remove();o[e]=!0;const s=t[e]||[];for(let t=0;t<s.length;t+=1){const l=s[t];if(!o[l]){const t=r[e]+n(e,l);t<r[l]&&(r[l]=t,i[l]=e,a.updatePriority(l,t))}}}return i}t.run=e}(Sl||(Sl={})),function(t){t.linear=t=>t,t.quad=t=>t*t,t.cubic=t=>t*t*t,t.inout=t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)},t.exponential=t=>Math.pow(2,10*(t-1)),t.bounce=t=>{for(let e=0,n=1;1;e+=n,n/=2)if(t>=(7-4*e)/11){const r=(11-6*e-11*t)/4;return-r*r+n*n}}}(El||(El={})),function(t){t.decorators={reverse(t){return e=>1-t(1-e)},reflect(t){return e=>.5*(e<.5?t(2*e):2-t(2-2*e))},clamp(t,e=0,n=1){return r=>{const i=t(r);return i<e?e:i>n?n:i}},back(t=1.70158){return e=>e*e*((t+1)*e-t)},elastic(t=1.5){return e=>Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}}}(El||(El={})),function(t){function e(t){return-1*Math.cos(t*(Math.PI/2))+1}function n(t){return Math.sin(t*(Math.PI/2))}function r(t){return-.5*(Math.cos(Math.PI*t)-1)}function i(t){return t*t}function o(t){return t*(2-t)}function a(t){return t<.5?2*t*t:(4-2*t)*t-1}function s(t){return t*t*t}function l(t){const e=t-1;return e*e*e+1}function c(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}function u(t){return t*t*t*t}function d(t){const e=t-1;return 1-e*e*e*e}function h(t){const e=t-1;return t<.5?8*t*t*t*t:1-8*e*e*e*e}function p(t){return t*t*t*t*t}function f(t){const e=t-1;return 1+e*e*e*e*e}function g(t){const e=t-1;return t<.5?16*t*t*t*t*t:1+16*e*e*e*e*e}function m(t){return 0===t?0:Math.pow(2,10*(t-1))}function v(t){return 1===t?1:1-Math.pow(2,-10*t)}function b(t){if(0===t||1===t)return t;const e=2*t,n=e-1;return e<1?.5*Math.pow(2,10*n):.5*(2-Math.pow(2,-10*n))}function y(t){const e=t/1;return-1*(Math.sqrt(1-e*t)-1)}function w(t){const e=t-1;return Math.sqrt(1-e*e)}function x(t){const e=2*t,n=e-2;return e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-n*n)+1)}function C(t,e=1.70158){return t*t*((e+1)*t-e)}function k(t,e=1.70158){const n=t/1-1;return n*n*((e+1)*n+e)+1}function A(t,e=1.70158){const n=2*t,r=n-2,i=1.525*e;return n<1?.5*n*n*((i+1)*n-i):.5*(r*r*((i+1)*r+i)+2)}function S(t,e=.7){if(0===t||1===t)return t;const n=t/1,r=n-1,i=1-e,o=i/(2*Math.PI)*Math.asin(1);return-Math.pow(2,10*r)*Math.sin((r-o)*(2*Math.PI)/i)}function E(t,e=.7){const n=1-e,r=2*t;if(0===t||1===t)return t;const i=n/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*r)*Math.sin((r-i)*(2*Math.PI)/n)+1}function O(t,e=.65){const n=1-e;if(0===t||1===t)return t;const r=2*t,i=r-1,o=n/(2*Math.PI)*Math.asin(1);return r<1?Math.pow(2,10*i)*Math.sin((i-o)*(2*Math.PI)/n)*-.5:Math.pow(2,-10*i)*Math.sin((i-o)*(2*Math.PI)/n)*.5+1}function T(t){const e=t/1;if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const t=e-1.5/2.75;return 7.5625*t*t+.75}if(e<2.5/2.75){const t=e-2.25/2.75;return 7.5625*t*t+.9375}{const t=e-2.625/2.75;return 7.5625*t*t+.984375}}function _(t){return 1-T(1-t)}function M(t){return t<.5?.5*_(2*t):.5*T(2*t-1)+.5}t.easeInSine=e,t.easeOutSine=n,t.easeInOutSine=r,t.easeInQuad=i,t.easeOutQuad=o,t.easeInOutQuad=a,t.easeInCubic=s,t.easeOutCubic=l,t.easeInOutCubic=c,t.easeInQuart=u,t.easeOutQuart=d,t.easeInOutQuart=h,t.easeInQuint=p,t.easeOutQuint=f,t.easeInOutQuint=g,t.easeInExpo=m,t.easeOutExpo=v,t.easeInOutExpo=b,t.easeInCirc=y,t.easeOutCirc=w,t.easeInOutCirc=x,t.easeInBack=C,t.easeOutBack=k,t.easeInOutBack=A,t.easeInElastic=S,t.easeOutElastic=E,t.easeInOutElastic=O,t.easeOutBounce=T,t.easeInBounce=_,t.easeInOutBounce=M}(El||(El={})),function(t){t.number=(t,e)=>{const n=e-t;return e=>t+n*e},t.object=(t,e)=>{const n=Object.keys(t);return r=>{const i={};for(let o=n.length-1;-1!==o;o-=1){const a=n[o];i[a]=t[a]+(e[a]-t[a])*r}return i}},t.unit=(t,e)=>{const n=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,r=n.exec(t),i=n.exec(e),o=i?i[1]:"",a=r?+r[1]:0,s=i?+i[1]:0,l=o.indexOf("."),c=l>0?o[1].length-l-1:0,u=s-a,d=r?r[2]:"";return t=>(a+u*t).toFixed(c)+d},t.color=(t,e)=>{const n=parseInt(t.slice(1),16),r=parseInt(e.slice(1),16),i=255&n,o=(255&r)-i,a=65280&n,s=(65280&r)-a,l=16711680&n,c=(16711680&r)-l;return t=>{const e=i+o*t&255,n=a+s*t&65280,r=l+c*t&16711680;return"#"+(1<<24|e|n|r).toString(16).slice(1)}}}(Ol||(Ol={})),function(t){const e=_s.prefixCls+".storage";function n(t,e,n){const r=e.id||o.uniqueId("doc-"),i=u(t);i.keys.push(r),l(d(t,r),e),l(h(t),i),a(n,null,Object.assign(Object.assign({},e),{id:r}))}function r(t,e,n){const r=u(t),i=[];if(null==e)r.keys.forEach(e=>{const r=c(d(t,e));r?i.push(r):a(n,new Error(`No document found for an ID '${e}' from index.`))}),a(n,null,i);else if(e.id){const r=c(d(t,e.id));a(n,null,r?[r]:[])}else a(n,null,[])}function i(t,e,n){const r=u(t);if(null==e)r.keys.forEach(e=>{localStorage.removeItem(d(t,e))}),localStorage.removeItem(h(t)),a(n,null);else if(e.id){const i=r.keys.indexOf(e.id);i>=0&&r.keys.splice(i,1),localStorage.removeItem(d(t,e.id)),l(h(t),r),a(n,null)}}function a(t,e,n){t&&s.defer(()=>{t(e,n)})}function l(t,e){localStorage.setItem(t,JSON.stringify(e))}function c(t){const e=localStorage.getItem(t);return e?JSON.parse(e):null}function u(t){const e=c(h(t));return e?(null==e.keys&&(e.keys=[]),e):{keys:[]}}function d(t,n){return`${e}.${t}.docs.${n}`}function h(t){return`${e}.${t}.index`}t.insert=n,t.find=r,t.remove=i}(Tl||(Tl={}));class Ll extends kl{constructor(){super(),this.cid=_l.uniqueId(),Ll.views[this.cid]=this}get priority(){return 2}confirmUpdate(t,e){return 0}$(t){return Ll.$(t)}empty(t=this.container){return this.$(t).empty(),this}unmount(t=this.container){return this.$(t).remove(),this}remove(t=this.container){return t===this.container&&(this.removeEventListeners(document),this.onRemove(),delete Ll.views[this.cid]),this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return this.$(e).addClass(Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return this.$(e).removeClass(Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return this.$(e).css(t),this}setAttrs(t,e=this.container){return null!=t&&null!=e&&(e instanceof SVGElement?c.attr(e,t):this.$(e).attr(t)),this}findAttr(t,e=this.container){let n=e;while(n&&1===n.nodeType){const e=n.getAttribute(t);if(null!=e)return e;if(n===this.container)return null;n=n.parentNode}return null}find(t,e=this.container,n=this.selectors){return Ll.find(t,e,n).elems}findOne(t,e=this.container,n=this.selectors){const r=this.find(t,e,n);return r.length>0?r[0]:null}findByAttr(t,e=this.container){let n=e;while(n&&n.getAttribute){const e=n.getAttribute(t);if((null!=e||n===this.container)&&"false"!==e)return n;n=n.parentNode}return null}getSelector(t,e){let n;if(t===this.container)return"string"===typeof e&&(n="> "+e),n;if(t){const r=c.index(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${r})`,e&&(n+=" > "+e),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return Ms.prefix(t)}delegateEvents(t,e){if(null==t)return this;e||this.undelegateEvents();const n=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach(e=>{const r=e.match(n);if(null==r)return;const i=this.getEventHandler(t[e]);"function"===typeof i&&this.delegateEvent(r[1],r[2],i)}),this}undelegateEvents(){return this.$(this.container).off(this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,n){return this.$(this.container).on(t+this.getEventNamespace(),e,n),this}undelegateEvent(t,e,n){const r=t+this.getEventNamespace();return null==e?this.$(this.container).off(r):"string"===typeof e?this.$(this.container).off(r,e,n):this.$(this.container).off(r,e),this}addEventListeners(t,e,n){if(null==e)return this;const r=this.getEventNamespace(),i=this.$(t);return Object.keys(e).forEach(t=>{const o=this.getEventHandler(e[t]);"function"===typeof o&&i.on(t+r,n,o)}),this}removeEventListeners(t){return null!=t&&this.$(t).off(this.getEventNamespace()),this}getEventNamespace(){return`.${_s.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if("string"===typeof t){const n=this[t];"function"===typeof n&&(e=(...t)=>n.call(this,...t))}else e=(...e)=>t.call(this,...e);return e}getEventTarget(t,e={}){const{target:n,type:r,clientX:i=0,clientY:o=0}=t;return e.fromPoint||"touchmove"===r||"touchend"===r?document.elementFromPoint(i,o):n}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return!0===this.getEventData(t).propagationStopped}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(null==t)throw new TypeError("Event object required");let n=t.data;const r=`__${this.cid}__`;return null==e?null==n?{}:n[r]||{}:(null==n&&(n=t.data={}),null==n[r]?n[r]=Object.assign({},e):n[r]=Object.assign(Object.assign({},n[r]),e),n[r])}normalizeEvent(t){return Ll.normalizeEvent(t)}}(function(t){function e(t){return pt()(t)}function n(t,e){return e?c.createSvgElement(t||"g"):c.createElementNS(t||"div")}function r(t,n,r){if(!t||"."===t)return{elems:[n]};if(r){const e=r[t];if(e)return{elems:Array.isArray(e)?e:[e]}}return _s.useCSSSelector?{isCSSSelector:!0,elems:e(n).find(t).toArray()}:{elems:[]}}function i(t){let e=t;const n=t.originalEvent,r=n&&n.changedTouches&&n.changedTouches[0];if(r){for(const e in t)void 0===r[e]&&(r[e]=t[e]);e=r}const i=e.target;if(i){const t=i.correspondingUseElement;t&&(e.target=t)}return e}t.$=e,t.createElement=n,t.find=r,t.normalizeEvent=i})(Ll||(Ll={})),function(t){function e(e){return t.views[e]||null}t.views={},t.getView=e}(Ll||(Ll={})),function(t){let e=0;function n(){const t="v"+e;return e+=1,t}t.uniqueId=n}(_l||(_l={}));const Dl=t=>t;function jl(t,e){return 0===e?"0%":Math.round(t/e*100)+"%"}function Il(t){const e=(e,n,r,i)=>n.isEdgeElement(r)?Fl(t,e,n,r,i):Rl(t,e,n,r,i);return e}function Rl(t,e,n,r,i){const o=n.cell,a=o.getAngle(),s=n.getUnrotatedBBoxOfElement(r),l=o.getBBox().getCenter(),c=Dr.create(i).rotate(a,l);let u=c.x-s.x,d=c.y-s.y;return t&&(u=jl(u,s.width),d=jl(d,s.height)),e.anchor={name:"topLeft",args:{dx:u,dy:d,rotate:!0}},e}function Fl(t,e,n,r,i){const o=n.getConnection();if(!o)return e;const a=o.closestPointLength(i);if(t){const t=o.length();e.anchor={name:"ratio",args:{ratio:a/t}}}else e.anchor={name:"length",args:{length:a}};return e}const Bl=Il(!0),zl=Il(!1);var Hl,Vl;(function(t){t.presets=b,t.registry=Eo.create({type:"connection strategy"}),t.registry.register(t.presets,!0)})(Hl||(Hl={}));class ql{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Nl,this.pathCache={}}get(t){const e=this.elemCache;return e.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(null==e.matrix){const n=this.view.rotatableNode||this.view.container;e.matrix=c.getTransformToElement(t,n)}return c.createSVGMatrix(e.matrix)}getShape(t){const e=this.get(t);return null==e.shape&&(e.shape=c.toGeometryShape(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return null==e.boundingRect&&(e.boundingRect=c.getBBox(t)),e.boundingRect.clone()}}(function(t){function e(t){return null!=t&&!n(t)}function n(t){return null!=t&&"string"===typeof t}function r(t){return null==t||n(t)?t:i.cloneDeep(t)}function a(t){return(""+t).trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function s(t){const e=document.createDocumentFragment(),n={},r={},i=a(t),s=o.sanitizeHTML(i,{raw:!0});return s.forEach(t=>{e.appendChild(t)}),{fragment:e,selectors:r,groups:n}}function l(t,e={ns:c.ns.svg}){const n=document.createDocumentFragment(),r={},i={},o=[{markup:Array.isArray(t)?t:[t],parent:n,ns:e.ns}];while(o.length>0){const t=o.pop();let e=t.ns||c.ns.svg;const n=t.markup,a=t.parent;n.forEach(t=>{const n=t.tagName;if(!n)throw new TypeError("Invalid tagName");t.ns&&(e=t.ns);const s=e===c.ns.svg,l=e?c.createElementNS(n,e):c.createElement(n),u=t.attrs;u&&(s?c.attr(l,c.kebablizeAttrs(u)):pt()(l).attr(u));const d=t.style;d&&pt()(l).css(d);const h=t.className;null!=h&&l.setAttribute("class",Array.isArray(h)?h.join(" "):h),t.textContent&&(l.textContent=t.textContent);const p=t.selector;if(null!=p){if(i[p])throw new TypeError("Selector must be unique");i[p]=l}if(t.groupSelector){let e=t.groupSelector;Array.isArray(e)||(e=[e]),e.forEach(t=>{r[t]||(r[t]=[]),r[t].push(l)})}a.appendChild(l);const f=t.children;Array.isArray(f)&&o.push({ns:e,markup:f,parent:l})})}return Object.keys(r).forEach(t=>{if(i[t])throw new Error("Ambiguous group selector");i[t]=r[t]}),{fragment:n,selectors:i,groups:r}}function u(t){return t instanceof SVGElement?c.createSvgElement("g"):c.createElement("div")}function d(t){if(n(t)){const e=ai.createVectors(t),n=e.length;if(1===n)return{elem:e[0].node};if(n>1){const t=u(e[0].node);return e.forEach(e=>{t.appendChild(e.node)}),{elem:t}}return{}}const e=l(t),r=e.fragment;let i=null;return r.childNodes.length>1?(i=u(r.firstChild),i.appendChild(r)):i=r.firstChild,{elem:i,selectors:e.selectors}}function h(t){const e=ai.createVectors(t),n=document.createDocumentFragment();for(let r=0,i=e.length;r<i;r+=1){const t=e[r].node;n.appendChild(t)}return{fragment:n,selectors:{}}}t.isJSONMarkup=e,t.isStringMarkup=n,t.clone=r,t.sanitize=a,t.parseStringMarkup=s,t.parseJSONMarkup=l,t.renderMarkup=d,t.parseLabelStringMarkup=h})(Vl||(Vl={})),function(t){function e(t,n,r){if(null!=t){let i;const o=t.tagName.toLowerCase();if(t===n)return i="string"===typeof r?`> ${o} > ${r}`:"> "+o,i;const a=t.parentNode;if(a&&a.childNodes.length>1){const e=c.index(t)+1;i=`${o}:nth-child(${e})`}else i=o;return r&&(i+=" > "+r),e(t.parentNode,n,i)}return r}function n(t,n,r){if("#text"===t.nodeName)return null;let i=null,o=null,a=null,s=!1;const l={tagName:t.tagName};if(t.attributes){a={};for(let e=0,n=t.attributes.length;e<n;e+=1){const n=t.attributes[e],r=n.nodeName,s=n.nodeValue;"selector"===r?i=s:"groupSelector"===r?o=s:"class"===r?l.attrs={class:s}:a[r]=s}}return null==i&&(s=!0,i=e(t,n)),t.namespaceURI&&(l.ns=t.namespaceURI),null==l.ns&&(["body","div","section","main","nav","footer","span","p","h1","h2","h3","h4","h5","h6","ul","ol","dl","center","strong","pre","form","select","textarea","fieldset","marquee","bgsound","iframe","frameset"].includes(t.tagName)?l.ns=c.ns.xhtml:r&&(l.ns=r)),i&&(l.selector=i),null!=o&&(l.groupSelector=o),{markup:l,attrs:a,isCSSSelector:s}}function r(e){const r=t.sanitize(e),i=c.parseXML(r,{mimeType:"image/svg+xml"}),o=Array.prototype.slice.call(i.childNodes),a={},s=new WeakMap,l=(t,e,r)=>{const i=n(t,e,r);if(null!=i){const{markup:n,attrs:r,isCSSSelector:o}=i;if(s.set(t,n),n.selector&&null!=r&&(Object.keys(r).length&&(a[n.selector]=r),o&&delete n.selector),t.childNodes&&t.childNodes.length>0)for(let i=0,a=t.childNodes.length;i<a;i+=1){const r=t.childNodes[i],o=l(r,e,n.ns);o&&(null==n.children&&(n.children=[]),n.children.push(o))}return n}{const e=s.get(t.parentNode);e&&t.textContent&&(e.textContent=t.textContent)}},u=o.map(t=>l(t,t)).filter(t=>null!=t);return{markup:u,attrs:a}}t.getSelector=e,t.xml2json=r}(Vl||(Vl={})),function(t){function e(){return"g"}function n(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}function r(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}t.getPortContainerMarkup=e,t.getPortMarkup=n,t.getPortLabelMarkup=r}(Vl||(Vl={})),function(t){function e(){return t.sanitize('\n <path class="connection" stroke="black" d="M 0 0 0 0"/>\n <path class="source-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="target-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="connection-wrap" d="M 0 0 0 0"/>\n <g class="labels"/>\n <g class="vertices"/>\n <g class="arrowheads"/>\n <g class="tools"/>\n ')}function n(){return t.sanitize('\n <g class="edge-tool">\n <g class="tool-remove" event="edge:remove">\n <circle r="11" />\n <path transform="scale(.8) translate(-16, -16)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z" />\n <title>Remove edge.</title>\n </g>\n <g class="tool-options" event="edge:options">\n <circle r="11" transform="translate(25)"/>\n <path fill="white" transform="scale(.55) translate(29, -16)" d="M31.229,17.736c0.064-0.571,0.104-1.148,0.104-1.736s-0.04-1.166-0.104-1.737l-4.377-1.557c-0.218-0.716-0.504-1.401-0.851-2.05l1.993-4.192c-0.725-0.91-1.549-1.734-2.458-2.459l-4.193,1.994c-0.647-0.347-1.334-0.632-2.049-0.849l-1.558-4.378C17.165,0.708,16.588,0.667,16,0.667s-1.166,0.041-1.737,0.105L12.707,5.15c-0.716,0.217-1.401,0.502-2.05,0.849L6.464,4.005C5.554,4.73,4.73,5.554,4.005,6.464l1.994,4.192c-0.347,0.648-0.632,1.334-0.849,2.05l-4.378,1.557C0.708,14.834,0.667,15.412,0.667,16s0.041,1.165,0.105,1.736l4.378,1.558c0.217,0.715,0.502,1.401,0.849,2.049l-1.994,4.193c0.725,0.909,1.549,1.733,2.459,2.458l4.192-1.993c0.648,0.347,1.334,0.633,2.05,0.851l1.557,4.377c0.571,0.064,1.148,0.104,1.737,0.104c0.588,0,1.165-0.04,1.736-0.104l1.558-4.377c0.715-0.218,1.399-0.504,2.049-0.851l4.193,1.993c0.909-0.725,1.733-1.549,2.458-2.458l-1.993-4.193c0.347-0.647,0.633-1.334,0.851-2.049L31.229,17.736zM16,20.871c-2.69,0-4.872-2.182-4.872-4.871c0-2.69,2.182-4.872,4.872-4.872c2.689,0,4.871,2.182,4.871,4.872C20.871,18.689,18.689,20.871,16,20.871z"/>\n <title>Edge options.</title>\n </g>\n </g>\n ')}function r(){return t.sanitize('\n <g class="vertex-group" transform="translate(<%= x %>, <%= y %>)">\n <circle class="vertex" data-index="<%= index %>" r="10" />\n <path class="vertex-remove-area" data-index="<%= index %>" d="M16,5.333c-7.732,0-14,4.701-14,10.5c0,1.982,0.741,3.833,2.016,5.414L2,25.667l5.613-1.441c2.339,1.317,5.237,2.107,8.387,2.107c7.732,0,14-4.701,14-10.5C30,10.034,23.732,5.333,16,5.333z" transform="translate(5, -33)"/>\n <path class="vertex-remove" data-index="<%= index %>" transform="scale(.8) translate(9.5, -37)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z">\n <title>Remove vertex.</title>\n </path>\n </g>\n ')}function i(){return t.sanitize('\n <g class="arrowhead-group arrowhead-group-<%= end %>">\n <path class="arrowhead" data-terminal="<%= end %>" d="M 26 0 L 0 13 L 26 26 z" />\n </g>\n ')}t.getEdgeMarkup=e,t.getEdgeToolMarkup=n,t.getEdgeVertexMarkup=r,t.getEdgeArrowheadMarkup=i}(Vl||(Vl={})),function(t){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:c.ns.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:c.ns.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}t.getForeignObjectMarkup=e}(Vl||(Vl={}));class Ul{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let n,r,i,a,l;const u=[];return Object.keys(e).forEach(r=>{const i=e[r],a=this.getDefinition(r),l=s.call(is.isValidDefinition,this.view,a,i,{elem:t,attrs:e,cell:this.cell,view:this.view});if(a&&l)"string"===typeof a?(null==n&&(n={}),n[a]=i):null!==i&&u.push({name:r,definition:a});else{null==n&&(n={});const t=Ul.CASE_SENSITIVE_ATTR.includes(r)?r:o.kebabCase(r);n[t]=i}}),u.forEach(({name:n,definition:o})=>{const s=e[n],u=o;"function"===typeof u.set&&(!c.isHTMLElement(t)&&Ul.DELAY_ATTRS.includes(n)?(null==l&&(l={}),l[n]=s):(null==r&&(r={}),r[n]=s));const d=o;"function"===typeof d.offset&&(null==i&&(i={}),i[n]=s);const h=o;"function"===typeof h.position&&(null==a&&(a={}),a[n]=s)}),{raw:e,normal:n,set:r,offset:i,position:a,delay:l}}mergeProcessedAttrs(t,e){t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const n=t.normal&&t.normal.transform;null!=n&&e.normal&&(e.normal.transform=n),t.normal=e.normal}findAttrs(t,e,n,o){const a=[],s=new Nl;return Object.keys(t).forEach(l=>{const c=t[l];if(!i.isPlainObject(c))return;const{isCSSSelector:u,elems:d}=Ll.find(l,e,o);n[l]=d;for(let t=0,e=d.length;t<e;t+=1){const n=d[t],i=o&&o[l]===n,h=s.get(n);if(h){h.array||(a.push(n),h.array=!0,h.attrs=[h.attrs],h.priority=[h.priority]);const t=h.attrs,o=h.priority;if(i)t.unshift(c),o.unshift(-1);else{const n=r.sortedIndex(o,u?-1:e);t.splice(n,0,c),o.splice(n,0,e)}}else s.set(n,{elem:n,attrs:c,priority:i?-1:e,array:!1})}}),a.forEach(t=>{const e=s.get(t),n=e.attrs;e.attrs=n.reduceRight((t,e)=>i.merge(t,e),{})}),s}updateRelativeAttrs(t,e,n,r){const i=e.raw||{};let o=e.normal||{};const a=e.set,l=e.position,u=e.offset,d=e.delay,h=()=>({elem:t,cell:this.cell,view:this.view,attrs:i,refBBox:n.clone()});if(null!=a&&Object.keys(a).forEach(t=>{const e=a[t],n=this.getDefinition(t);if(null!=n){const r=s.call(n.set,this.view,e,h());"object"===typeof r?o=Object.assign(Object.assign({},o),r):null!=r&&(o[t]=r)}}),c.isHTMLElement(t))return void this.view.setAttrs(o,t);const p=o.transform,f=p?""+p:null,g=c.transformStringToMatrix(f),m=new Dr(g.e,g.f);p&&(delete o.transform,g.e=0,g.f=0);let v=1,b=1;if(l||u){const e=this.view.getScaleOfElement(t,r.scalableNode);v=e.sx,b=e.sy}let y=!1;null!=l&&Object.keys(l).forEach(t=>{const e=l[t],n=this.getDefinition(t);if(null!=n){const t=s.call(n.position,this.view,e,h());null!=t&&(y=!0,m.translate(Dr.create(t).scale(v,b)))}}),this.view.setAttrs(o,t);let w=!1;if(null!=u){const e=this.view.getBoundingRectOfElement(t);if(e.width>0&&e.height>0){const n=c.transformRectangle(e,g).scale(1/v,1/b);Object.keys(u).forEach(e=>{const r=u[e],o=this.getDefinition(e);if(null!=o){const e=s.call(o.offset,this.view,r,{elem:t,cell:this.cell,view:this.view,attrs:i,refBBox:n});null!=e&&(w=!0,m.translate(Dr.create(e).scale(v,b)))}})}}(null!=p||y||w)&&(m.round(1),g.e=m.x,g.f=m.y,t.setAttribute("transform",c.matrixToTransformString(g)));const x=()=>{null!=d&&Object.keys(d).forEach(e=>{const n=d[e],r=this.getDefinition(e);if(null!=r){const i=s.call(r.set,this.view,n,h());"object"===typeof i?this.view.setAttrs(i,t):null!=i&&this.view.setAttrs({[e]:i},t)}})};r.forceSync?x():So.scheduleTask(x)}update(t,e,n){const r={},i=this.findAttrs(n.attrs||e,t,r,n.selectors),o=n.attrs?this.findAttrs(e,t,r,n.selectors):i,a=[];i.each(e=>{const i=e.elem,s=e.attrs,l=this.processAttrs(i,s);if(null==l.set&&null==l.position&&null==l.offset&&null==l.delay)this.view.setAttrs(l.normal,i);else{const e=o.get(i),c=e?e.attrs:null,u=c&&null==s.ref?c.ref:s.ref;let d;if(u){if(d=(r[u]||this.view.find(u,t,n.selectors))[0],!d)throw new Error(`"${u}" reference does not exist.`)}else d=null;const h={node:i,refNode:d,attributes:c,processedAttributes:l},p=a.findIndex(t=>t.refNode===i);p>-1?a.splice(p,0,h):a.push(h)}});const s=new Nl;let l;a.forEach(e=>{const r=e.node,i=e.refNode;let o;const u=null!=i&&null!=n.rotatableNode&&c.contains(n.rotatableNode,i);if(i&&(o=s.get(i)),!o){const e=u?n.rotatableNode:t;o=i?c.getBBox(i,{target:e}):n.rootBBox,i&&s.set(i,o)}let d;n.attrs&&e.attributes?(d=this.processAttrs(r,e.attributes),this.mergeProcessedAttrs(d,e.processedAttributes)):d=e.processedAttributes;let h=o;u&&null!=n.rotatableNode&&!n.rotatableNode.contains(r)&&(l||(l=c.transformStringToMatrix(c.attr(n.rotatableNode,"transform"))),h=c.transformRectangle(o,l));const p=a.find(t=>t.refNode===r);p&&(n.forceSync=!0),this.updateRelativeAttrs(r,d,h,n)})}}(function(t){t.CASE_SENSITIVE_ATTR=["viewBox"],t.DELAY_ATTRS=["text","textWrap","sourceMarker","targetMarker"]})(Ul||(Ul={}));class Wl{constructor(t,e,n=[]){this.view=t;const r={},i={};let o=0;Object.keys(e).forEach(t=>{let n=e[t];Array.isArray(n)||(n=[n]),n.forEach(e=>{let n=r[e];n||(o+=1,n=r[e]=1<<o),i[t]|=n})});let a=n;if(Array.isArray(a)||(a=[a]),a.forEach(t=>{r[t]||(o+=1,r[t]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=r,this.attrs=i,this.bootstrap=n}get cell(){return this.view.cell}getFlag(t){const e=this.flags;return null==e?0:Array.isArray(t)?t.reduce((t,n)=>t|e[n],0):0|e[t]}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs?(Object.keys(this.attrs).forEach(e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])}),t):t}}var $l=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Gl extends Ll{constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new Ul(this),this.flag=new Wl(this,this.options.actions,this.options.bootstrap),this.cache=new ql(this),this.setContainer(this.ensureContainer()),this.setup(),this.$(this.container).data("view",this),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){const e=(t,e)=>null!=e?r.uniq([...Array.isArray(t)?t:[t],...Array.isArray(e)?e:[e]]):Array.isArray(t)?[...t]:[t],n=i.cloneDeep(this.getDefaults()),{bootstrap:o,actions:a,events:s,documentEvents:l}=t,c=$l(t,["bootstrap","actions","events","documentEvents"]);return o&&(n.bootstrap=e(n.bootstrap,o)),a&&Object.keys(a).forEach(t=>{const r=a[t],i=n.actions[t];r&&i?n.actions[t]=e(i,r):r&&(n.actions[t]=e(r))}),s&&(n.events=Object.assign(Object.assign({},n.events),s)),t.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),l)),i.merge(n,c)}get[Symbol.toStringTag](){return Gl.toStringTag}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return Ll.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,null!=this.options.events&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();null!=e&&this.setAttrs(e,t);const n=this.getContainerStyle();null!=n&&this.setStyle(n,t);const r=this.getContainerClassName();null!=r&&this.addClass(r,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,n,r){if(this.hasAction(t,e)){n();const i=[e];return r&&("string"===typeof r?i.push(r):i.push(...r)),this.removeAction(t,i)}return t}setup(){this.cell.on("changed",({options:t})=>this.onAttrsChange(t))}onAttrsChange(t){let e=this.flag.getChangedFlag();!t.updated&&e&&(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),null!=this.graph&&this.graph.renderer.requestViewUpdate(this,e,this.priority,t))}parseJSONMarkup(t,e){const n=Vl.parseJSONMarkup(t),r=n.selectors,i=this.rootSelector;if(e&&i){if(r[i])throw new Error("Invalid root selector");r[i]=e}return n}can(t){let e=this.graph.options.interacting;if("function"===typeof e&&(e=s.call(e,this.graph,this)),"object"===typeof e){let n=e[t];return"function"===typeof n&&(n=s.call(n,this.graph,this)),!1!==n}return"boolean"===typeof e&&e}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getScaleOfElement(t,e){let n,r;if(e&&e.contains(t)){const t=c.scale(e);n=1/t.sx,r=1/t.sy}else n=1,r=1;return{sx:n,sy:r}}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),r=this.getRootRotatedMatrix(),i=this.getRootTranslatedMatrix();return c.transformRectangle(e,i.multiply(r).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),r=this.getRootTranslatedMatrix();return c.transformRectangle(e,r.multiply(n))}getBBox(t={}){let e;if(t.useCellGeometry){const t=this.cell,n=t.isNode()?t.getAngle():0;e=t.getBBox().bbox(n)}else e=this.getBBoxOfElement(this.container);return this.graph.localToGraph(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return c.createSVGMatrix().translate(e.x,e.y)}getRootRotatedMatrix(){let t=c.createSVGMatrix();const e=this.cell,n=e.isNode()?e.getAngle():0;if(n){const r=e.getBBox(),i=r.width/2,o=r.height/2;t=t.translate(i,o).rotate(n).translate(-i,-o)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,n={}){null==n.rootBBox&&(n.rootBBox=new jr),null==n.selectors&&(n.selectors=this.selectors),this.attr.update(t,e,n)}isEdgeElement(t){return this.cell.isEdge()&&(null==t||t===this.container)}prepareHighlight(t,e={}){const n=t&&this.$(t)[0]||this.container;return e.partial=n===this.container,n}highlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:highlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}),this}unhighlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:unhighlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,n,r,i){const o=this.cell,a=this.findAttr("port",t),s=t.getAttribute("data-selector"),l={cell:o.id};return null!=s&&(l.magnet=s),null!=a?(l.port=a,o.isNode()&&(o.hasPort(a)||null!=s||(l.selector=this.getSelector(t)))):null==s&&this.container!==t&&(l.selector=this.getSelector(t)),this.customizeEdgeTerminal(l,t,e,n,r,i)}customizeEdgeTerminal(t,e,n,r,i,o){const a=i.getStrategy()||this.graph.options.connecting.strategy;if(a){const l="string"===typeof a?a:a.name,c="string"===typeof a?{}:a.args||{},u=Hl.registry;if(l){const a=u.get(l);if(null==a)return u.onNotFound(l);const d=s.call(a,this.graph,t,this,e,new Dr(n,r),i,o,c);if(d)return d}}return t}getMagnetFromEdgeTerminal(t){const e=this.cell,n=this.container,r=t.port;let i,o=t.magnet;return null!=r&&e.isNode()&&e.hasPort(r)?i=this.findPortElem(r,o)||n:(o||(o=t.selector),o||null==r||(o=`[port="${r}"]`),i=this.findOne(o,n,this.selectors)),i}animate(t,e){const n="string"===typeof t?this.findOne(t):t;if(null==n)throw new Error("Invalid animation element.");const r=n.parentNode,i=()=>{r||c.remove(n)},o=ai.create(n);r||o.appendTo(this.graph.view.stage);const a=e.complete;return e.complete=t=>{i(),a&&a(t)},o.animate(e)}animateTransform(t,e){const n="string"===typeof t?this.findOne(t):t;if(null==n)throw new Error("Invalid animation element.");const r=n.parentNode,i=()=>{r||c.remove(n)},o=ai.create(n);r||o.appendTo(this.graph.view.stage);const a=e.complete;return e.complete=t=>{i(),a&&a(t)},o.animateTransform(e)}hasTools(t){const e=this.tools;return null!=e&&(null==t||e.name===t)}addTools(t){if(!this.can("toolsAddable"))return this;if(this.removeTools(),t){const e=Yl.isToolsView(t)?t:new Yl(t);this.tools=e,this.graph.on("tools:hide",this.hideTools,this),this.graph.on("tools:show",this.showTools,this),this.graph.on("tools:remove",this.removeTools,this),e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.graph.off("tools:hide",this.hideTools,this),this.graph.off("tools:show",this.showTools,this),this.graph.off("tools:remove",this.removeTools,this),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,n){const r=this,i=r.cell;return null==e||null==n?{e:t,view:r,cell:i}:{e:t,x:e,y:n,view:r,cell:i}}onClick(t,e,n){this.notify("cell:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){this.notify("cell:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){this.notify("cell:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,n))}onMouseUp(t,e,n){this.notify("cell:mouseup",this.getEventArgs(t,e,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,n){this.notify("cell:mousemove",this.getEventArgs(t,e,n))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,r){this.notify("cell:mousewheel",Object.assign({delta:r},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,r){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,n,r))),this.notify(e,Object.assign({},this.getEventArgs(t,n,r)))}onMagnetMouseDown(t,e,n,r){}onMagnetDblClick(t,e,n,r){}onMagnetContextMenu(t,e,n,r){}onLabelMouseDown(t,e,n){}checkMouseleave(t){const e=this.graph;e.renderer.isAsync()&&e.renderer.dumpView(this);const n=this.getEventTarget(t,{fromPoint:!0}),r=e.renderer.findViewByElem(n);r!==this&&(this.onMouseLeave(t),r&&r.onMouseEnter(t))}}Gl.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(t){t.Flag=Wl,t.Attr=Ul}(Gl||(Gl={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"===typeof r.isNodeView&&"function"===typeof r.isEdgeView&&"function"===typeof r.confirmUpdate}t.toStringTag="X6."+t.name,t.isCellView=e}(Gl||(Gl={})),function(t){function e(t){return function(e){e.config({priority:t})}}function n(t){return function(e){e.config({bootstrap:t})}}t.priority=e,t.bootstrap=n}(Gl||(Gl={})),function(t){t.registry=Eo.create({type:"view"})}(Gl||(Gl={}));class Yl extends Ll{constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Yl.toStringTag}createContainer(t,e){const n=t?Ll.createElement("g",!0):Ll.createElement("div",!1);return c.addClass(n,this.prefixClassName("cell-tools")),e.className&&c.addClass(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!Gl.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(c.addClass(this.svgContainer,this.prefixClassName("edge-tools")),c.addClass(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(c.addClass(this.svgContainer,this.prefixClassName("node-tools")),c.addClass(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const n=[];e.forEach(t=>{if(Yl.ToolItem.isToolItem(t))"vertices"===t.name?n.unshift(t):n.push(t);else{const e="object"===typeof t?t.name:t;"vertices"===e?n.unshift(t):n.push(t)}});for(let r=0;r<n.length;r+=1){const t=n[r];let e;if(Yl.ToolItem.isToolItem(t))e=t;else{const n="object"===typeof t?t.name:t,r="object"===typeof t&&t.args||{};if(n)if(this.cell.isNode()){const t=uc.registry.get(n);if(!t)return uc.registry.onNotFound(n);e=new t(r)}else if(this.cell.isEdge()){const t=dc.registry.get(n);if(!t)return dc.registry.onNotFound(n);e=new t(r)}}if(e){e.config(this.cellView,this),e.render();const t=!1!==e.options.isSVGElement?this.svgContainer:this.htmlContainer;t.appendChild(e.container),this.tools.push(e)}}return this}update(t={}){const e=this.tools;return e&&e.forEach(e=>{t.toolId!==e.cid&&e.isVisible()&&e.update()}),this}focus(t){const e=this.tools;return e&&e.forEach(e=>{t===e?e.show():e.hide()}),this}blur(t){const e=this.tools;return e&&e.forEach(e=>{e===t||e.isVisible()||(e.show(),e.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach(t=>t.remove()),this.tools=null),c.remove(this.svgContainer),c.remove(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const n=t.some(t=>!1!==t.options.isSVGElement),r=t.some(t=>!1===t.options.isSVGElement);if(n){const t=this.options.local?e.container:e.graph.view.decorator;t.appendChild(this.svgContainer)}r&&this.graph.container.appendChild(this.htmlContainer)}return this}}function Xl(t,e,n,r){const i=s.call(Hl.presets.pinRelative,this.graph,{},e,n,t,this.cell,r,{});return i.anchor}function Kl(t,e){return e?t.cell.getBBox():t.cell.isEdge()?t.getConnection().bbox():t.getUnrotatedBBoxOfElement(t.container)}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&null!=r.graph&&null!=r.cell&&"function"===typeof r.config&&"function"===typeof r.update&&"function"===typeof r.focus&&"function"===typeof r.blur&&"function"===typeof r.show&&"function"===typeof r.hide}t.toStringTag="X6."+t.name,t.isToolsView=e})(Yl||(Yl={})),function(t){class e extends Ll{constructor(t={}){super(),this.visible=!0,this.options=this.getOptions(t),this.container=Ll.createElement(this.options.tagName||"g",!1!==this.options.isSVGElement),c.addClass(this.container,this.prefixClassName("cell-tool")),"string"===typeof this.options.className&&c.addClass(this.container,this.options.className),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return i.merge(i.cloneDeep(this.getDefaults()),t)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}init(){}getOptions(t){const e=this.constructor;return e.getOptions(t)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(t,e){return this.cellView=t,this.parent=e,this.stamp(this.container),this.cell.isEdge()?c.addClass(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&c.addClass(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const t=this.options.markup;if(t){const e=Vl.isStringMarkup(t)?Vl.parseStringMarkup(t):Vl.parseJSONMarkup(t);this.container.appendChild(e.fragment),this.childNodes=e.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(t=this.container){t&&t.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return!!this.visible}focus(){const t=this.options.focusOpacity;return null!=t&&Number.isFinite(t)&&(this.container.style.opacity=""+t),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(t){return null==this.graph||null==this.cellView||this.graph.view.guard(t,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},t.ToolItem=e,function(t){let e=0;function n(t){return t?o.pascalCase(t):(e+=1,"CustomTool"+e)}function r(t){const e=i.createClass(n(t.name),this);return e.config(t),e}t.define=r}(e=t.ToolItem||(t.ToolItem={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&null!=r.graph&&null!=r.cell&&"function"===typeof r.config&&"function"===typeof r.update&&"function"===typeof r.focus&&"function"===typeof r.blur&&"function"===typeof r.show&&"function"===typeof r.hide&&"function"===typeof r.isVisible}t.toStringTag="X6."+t.name,t.isToolItem=e}(e=t.ToolItem||(t.ToolItem={}))}(Yl||(Yl={}));class Zl extends Yl.ToolItem{onRender(){c.addClass(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView,e=t.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();c.transform(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:n=0,y:r=0}=e;const{offset:i,useCellGeometry:o,rotate:s}=e;let l=Kl(t,o);const u=t.cell.getAngle();s||(l=l.bbox(u));let d=0,h=0;"number"===typeof i?(d=i,h=i):"object"===typeof i&&(d=i.x,h=i.y),n=a.normalizePercentage(n,l.width),r=a.normalizePercentage(r,l.height);let p=c.createSVGMatrix().translate(l.x+l.width/2,l.y+l.height/2);return s&&(p=p.rotate(u)),p=p.translate(n+d-l.width/2,r+h-l.height/2),p}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:n=0,distance:r=0,rotate:i}=e;let o,s,l;o=a.isPercentage(r)?t.getTangentAtRatio(parseFloat(r)/100):t.getTangentAtLength(r),o?(s=o.start,l=o.vector().vectorAngle(new Dr(1,0))||0):(s=t.getConnection().start,l=0);let u=c.createSVGMatrix().translate(s.x,s.y).rotate(l);return u="object"===typeof n?u.translate(n.x||0,n.y||0):u.translate(0,n),i||(u=u.rotate(-l)),u}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;"function"===typeof e&&s.call(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(t){t.config({name:"button",events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(Zl||(Zl={})),function(t){t.Remove=t.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,onClick({view:t,btn:e}){e.parent.remove(),t.cell.remove({ui:!0,toolId:e.cid})}})}(Zl||(Zl={}));var Jl=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Ql extends Yl.ToolItem{onRender(){if(c.addClass(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=Jl(t,["class"]);c.attr(this.container,c.kebablizeAttrs(n)),e&&c.addClass(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:r}=e,i=a.normalizeSides(e.padding);let o=Kl(t,n).moveAndExpand({x:-i.left,y:-i.top,width:i.left+i.right,height:i.top+i.bottom});const s=t.cell;if(s.isNode()){const t=s.getAngle();if(t)if(r){const e=s.getBBox().getCenter();c.rotate(this.container,t,e.x,e.y,{absolute:!0})}else o=o.bbox(t)}return c.attr(this.container,o.toJSON()),this}}(function(t){t.config({name:"boundary",tagName:"rect",padding:10,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(Ql||(Ql={}));class tc extends Yl.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){const t=this.vertices;return t.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],r=this.options.createHandle,i=this.options.processHandle,o=r({index:e,graph:this.graph,guard:t=>this.guard(t),attrs:this.options.attrs||{}});i&&i(o),this.graph.hook.onToolItemCreated({name:"vertices",cell:this.cell,view:this.cellView,tool:o}),o.updatePosition(n.x,n.y),this.stamp(o.container),this.container.appendChild(o.container),this.handles.push(o),this.startHandleListening(o)}}updateHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],r=this.handles[e];r&&r.updatePosition(n.x,n.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.on("remove",this.onHandleRemove,this)}stopHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.off("remove",this.onHandleRemove,this)}getNeighborPoints(t){const e=this.cellView,n=this.vertices,r=t>0?n[t-1]:e.sourceAnchor,i=t<n.length-1?n[t+1]:e.targetAnchor;return{prev:Dr.create(r),next:Dr.create(i)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:n,y:r}=this.graph.snapToGrid(e.clientX,e.clientY);return{e:e,x:n,y:r}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:n,x:r,y:i}=this.getMouseEventArgs(t);e.notifyMouseDown(n,r,i)}}onHandleChanging({handle:t,e:e}){const n=this.cellView,r=t.options.index,{e:i,x:o,y:a}=this.getMouseEventArgs(e),s={x:o,y:a};this.snapVertex(s,r),n.cell.setVertexAt(r,s,{ui:!0,toolId:this.cid}),t.updatePosition(s.x,s.y),this.options.stopPropagation||n.notifyMouseMove(i,o,a)}onHandleChanged({e:t}){const e=this.options,n=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies)return;const r=n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});r&&this.render(),this.blur(),n.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),this.eventData(t).vertexAdded&&n.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid});const{e:i,x:o,y:a}=this.getMouseEventArgs(t);this.options.stopPropagation||n.notifyMouseUp(i,o,a),n.checkMouseleave(i),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}snapVertex(t,e){const n=this.options.snapRadius||0;if(n>0){const r=this.getNeighborPoints(e),i=r.prev,o=r.next;Math.abs(t.x-i.x)<n?t.x=i.x:Math.abs(t.x-o.x)<n&&(t.x=o.x),Math.abs(t.y-i.y)<n?t.y=r.prev.y:Math.abs(t.y-o.y)<n&&(t.y=o.y)}}onHandleRemove({handle:t,e:e}){if(this.options.removable){const n=t.options.index,r=this.cellView;r.cell.removeVertexAt(n,{ui:!0}),this.options.addable&&this.updatePath(),r.checkMouseleave(this.normalizeEvent(e))}}onPathMouseDown(t){const e=this.cellView;if(this.guard(t)||!this.options.addable||!e.can("vertexAddable"))return;t.stopPropagation(),t.preventDefault();const n=this.normalizeEvent(t),r=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const i=e.getVertexIndex(r.x,r.y);this.snapVertex(r,i),e.cell.insertVertex(r,i,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[i];this.eventData(n,{vertexAdded:!0}),o.onMouseDown(n)}onRemove(){this.resetHandles()}}(function(t){class e extends Ll{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}get graph(){return this.options.graph}render(){this.container=Ll.createElement("circle",!0);const e=this.options.attrs;if("function"===typeof e){const n=t.getDefaults();this.setAttrs(Object.assign(Object.assign({},n.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(t,e){this.setAttrs({cx:t,cy:e})}onMouseDown(t){this.options.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data),this.emit("change",{e:t,handle:this}))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(t){this.emit("remove",{e:t,handle:this})}}t.Handle=e})(tc||(tc={})),function(t){const e=Ms.prefix("edge-tool-vertex-path");t.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:e=>new t.Handle(e),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{["mousedown ."+e]:"onPathMouseDown",["touchstart ."+e]:"onPathMouseDown"}})}(tc||(tc={}));class ec extends Yl.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){c.addClass(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.vertices];e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let n=0,r=e.length;n<r-1;n+=1){const t=e[n],r=e[n+1],i=this.renderHandle(t,r,n);this.stamp(i.container),this.handles.push(i)}return this}renderHandle(t,e,n){const r=this.options.createHandle({index:n,graph:this.graph,guard:t=>this.guard(t),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(r),this.graph.hook.onToolItemCreated({name:"segments",cell:this.cell,view:this.cellView,tool:r}),this.updateHandle(r,t,e),this.container.appendChild(r.container),this.startHandleListening(r),r}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(t){const e=this.handles;for(let n=0,r=e.length;n<r;n+=1)e[n].options.index+=t}resetAnchor(t,e){const n=this.cellView.cell,r={ui:!0,toolId:this.cid};e?n.prop([t,"anchor"],e,r):n.removeProp([t,"anchor"],r)}snapHandle(t,e,n){const r=t.options.axis,i=t.options.index,o=this.cellView,a=o.cell,s=a.getVertices(),l=s[i-2]||n.sourceAnchor,c=s[i+1]||n.targetAnchor,u=this.options.snapRadius;return Math.abs(e[r]-l[r])<u?e[r]=l[r]:Math.abs(e[r]-c[r])<u&&(e[r]=c[r]),e}onHandleChanging({handle:t,e:e}){const n=this.graph,r=this.options,o=this.cellView,a=r.anchor,l=t.options.axis,c=t.options.index-1,u=this.getEventData(e),d=this.normalizeEvent(e),h=n.snapToGrid(d.clientX,d.clientY),p=this.snapHandle(t,h.clone(),u),f=i.cloneDeep(this.vertices);let g=f[c],m=f[c+1];const v=o.sourceView,b=o.sourceBBox;let y=!1,w=!1;if(g?0===c?b.containsPoint(g)?(f.shift(),this.shiftHandleIndexes(-1),y=!0):(g[l]=p[l],w=!0):g[l]=p[l]:(g=o.sourceAnchor.toJSON(),g[l]=p[l],b.containsPoint(g)?y=!0:(f.unshift(g),this.shiftHandleIndexes(1),w=!0)),"function"===typeof a&&v){if(y){const t=u.sourceAnchor.clone();t[l]=p[l];const e=s.call(a,o,t,v,o.sourceMagnet||v.container,"source",o,this);this.resetAnchor("source",e)}w&&this.resetAnchor("source",u.sourceAnchorDef)}const x=o.targetView,C=o.targetBBox;let k=!1,A=!1;if(m?c===f.length-2?C.containsPoint(m)?(f.pop(),k=!0):(m[l]=p[l],A=!0):m[l]=p[l]:(m=o.targetAnchor.toJSON(),m[l]=p[l],C.containsPoint(m)?k=!0:(f.push(m),A=!0)),"function"===typeof a&&x){if(k){const t=u.targetAnchor.clone();t[l]=p[l];const e=s.call(a,o,t,x,o.targetMagnet||x.container,"target",o,this);this.resetAnchor("target",e)}A&&this.resetAnchor("target",u.targetAnchorDef)}Dr.equalPoints(f,this.vertices)||this.cellView.cell.setVertices(f,{ui:!0,toolId:this.cid}),this.updateHandle(t,g,m,0),r.stopPropagation||o.notifyMouseMove(d,h.x,h.y)}onHandleChange({handle:t,e:e}){const n=this.options,r=this.handles,o=this.cellView,a=t.options.index;if(Array.isArray(r)){for(let t=0,e=r.length;t<e;t+=1)t!==a&&r[t].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:o.sourceAnchor.clone(),targetAnchor:o.targetAnchor.clone(),sourceAnchorDef:i.cloneDeep(this.cell.prop(["source","anchor"])),targetAnchorDef:i.cloneDeep(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!n.stopPropagation){const t=this.normalizeEvent(e),n=this.graph.snapToGrid(t.clientX,t.clientY);o.notifyMouseDown(t,n.x,n.y)}}}onHandleChanged({e:t}){const e=this.options,n=this.cellView;e.removeRedundancies&&n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const r=this.normalizeEvent(t),i=this.graph.snapToGrid(r.clientX,r.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||n.notifyMouseUp(r,i.x,i.y),n.checkMouseleave(r),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}updateHandle(t,e,n,r=0){const i=this.options.precision||0,o=Math.abs(e.x-n.x)<i,a=Math.abs(e.y-n.y)<i;if(o||a){const i=new Ir(e,n),a=i.length();if(a<this.options.threshold)t.hide();else{const e=i.getCenter(),n=o?"x":"y";e[n]+=r||0;const a=i.vector().vectorAngle(new Dr(1,0));t.updatePosition(e.x,e.y,a,this.cellView),t.show(),t.options.axis=n}}else t.hide()}onRemove(){this.resetHandles()}}(function(t){class e extends Ll{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=Ll.createElement("rect",!0);const e=this.options.attrs;if("function"===typeof e){const n=t.getDefaults();this.setAttrs(Object.assign(Object.assign({},n.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(t,e,n,r){const i=r.getClosestPoint(new Dr(t,e))||new Dr(t,e);let o=c.createSVGMatrix().translate(i.x,i.y);if(i.equals({x:t,y:e}))o=o.rotate(n);else{const n=new Ir(t,e,i.x,i.y);let r=n.vector().vectorAngle(new Dr(1,0));0!==r&&(r+=90),o=o.rotate(r)}this.setAttrs({transform:c.matrixToTransformString(o),cursor:n%180===0?"row-resize":"col-resize"})}onMouseDown(t){this.options.guard(t)||(this.trigger("change",{e:t,handle:this}),t.stopPropagation(),t.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}t.Handle=e})(ec||(ec={})),function(t){t.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new t.Handle(e),anchor:Xl})}(ec||(ec={}));class nc extends Yl.ToolItem{get type(){return this.options.type}onRender(){c.addClass(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type,e=this.cellView,n=e.getTerminalView(t);return n?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const n=this.type,r=this.cellView,i=this.options,o=r.getTerminalAnchor(n),a=r.cell.prop([n,"anchor"]);e.setAttribute("transform",`translate(${o.x}, ${o.y})`);const s=a?i.customAnchorAttrs:i.defaultAnchorAttrs;s&&Object.keys(s).forEach(t=>{e.setAttribute(t,s[t])})}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const n=this.type,r=this.cellView,i=r.getTerminalView(n);if(i){const t=i.cell,o=r.getTerminalMagnet(n);let a,s,l,u=this.options.areaPadding||0;Number.isFinite(u)||(u=0),i.isEdgeElement(o)?(a=i.getBBox(),s=0,l=a.getCenter()):(a=i.getUnrotatedBBoxOfElement(o),s=t.getAngle(),l=a.getCenter(),s&&l.rotate(-s,t.getBBox().getCenter())),a.inflate(u),c.attr(e,{x:-a.width/2,y:-a.height/2,width:a.width,height:a.height,transform:`translate(${l.x}, ${l.y}) rotate(${s})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(t){this.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(t){const e=this.type,n=this.cell;t?n.prop([e,"anchor"],t,{rewrite:!0,ui:!0,toolId:this.cid}):n.removeProp([e,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(t){const e=this.type,n=this.cellView,r=n.getTerminalView(e);if(null==r)return;const i=this.normalizeEvent(t),o=r.cell,a=n.getTerminalMagnet(e);let l=this.graph.clientToLocal(i.clientX,i.clientY);const c=this.options.snap;if("function"===typeof c){const t=s.call(c,n,l,r,a,e,n,this);l=Dr.create(t)}if(this.options.restrictArea)if(r.isEdgeElement(a)){const t=r.getClosestPoint(l);t&&(l=t)}else{const t=r.getUnrotatedBBoxOfElement(a),e=o.getAngle(),n=o.getBBox().getCenter(),i=l.clone().rotate(e,n);t.containsPoint(i)||(l=t.getNearestPointToPoint(i).rotate(-e,n))}let u;const d=this.options.anchor;"function"===typeof d&&(u=s.call(d,n,l,r,a,e,n,this)),this.resetAnchor(u),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(!0===t?void 0:t),this.update()}}(function(t){t.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:Xl,snap(t,e,n,r,i,o){const a=o.options.snapRadius||0,s="source"===r,l=s?0:-1,c=this.cell.getVertexAt(l)||this.getTerminalAnchor(s?"target":"source");return c&&(Math.abs(c.x-t.x)<a&&(t.x=c.x),Math.abs(c.y-t.y)<a&&(t.y=c.y)),t}})})(nc||(nc={}));const rc=nc.define({name:"source-anchor",type:"source"}),ic=nc.define({name:"target-anchor",type:"target"});var oc=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class ac extends Yl.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,n=oc(t,["class"]);this.setAttrs(n,this.container),e&&c.addClass(this.container,e)}}onRender(){c.addClass(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,n=e.getTangentAtRatio(t),r=n?n.start:e.getPointAtRatio(t),i=n&&n.vector().vectorAngle(new Dr(1,0))||0;if(!r)return this;const o=c.createSVGMatrix().translate(r.x,r.y).rotate(i);return c.transform(this.container,o,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const n=this.graph.snapToGrid(t.clientX,t.clientY),r=e.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:{toolId:this.cid}});this.cellView.setEventData(t,r),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,n.x,n.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.cellView,r=this.graph.snapToGrid(e.clientX,e.clientY);n.onMouseUp(e,r.x,r.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(t){t.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(ac||(ac={}));const sc=ac.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),lc=ac.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class cc extends Yl.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5}render(){return this.createElement(),this.update(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents),this}createElement(){const{cell:t}=this,e=[this.prefixClassName((t.isEdge()?"edge":"node")+"-tool-editor"),this.prefixClassName("cell-tool-editor")];this.editor=Yl.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}update(){const{graph:t,cell:e,editor:n}=this,r=n.style;let i=new Dr,o=20;if(e.isNode())i=e.getBBox().center,o=e.size().width-4;else if(e.isEdge()){const e=this.options.event,n=e.target,r=n.parentElement,a=r&&c.hasClass(r,this.prefixClassName("edge-label"));if(a){const t=r.getAttribute("data-index")||"0";this.labelIndex=parseInt(t,10);const e=r.getAttribute("transform"),{translation:a}=c.parseTransformString(e);i=new Dr(a.tx,a.ty),o=c.getBBox(n).width}else{if(!this.options.labelAddable)return this;i=t.clientToLocal(Dr.create(e.clientX,e.clientY));const n=this.cellView,r=n.path.closestPointLength(i);this.distance=r}}i=t.localToGraph(i),r.left=i.x+"px",r.top=i.y+"px",r.minWidth=o+"px";const a=t.scale();r.transform=`scale(${a.sx}, ${a.sy}) translate(-50%, -50%)`;const l=this.options.attrs;r.fontSize=l.fontSize+"px",r.fontFamily=l.fontFamily,r.color=l.color,r.backgroundColor=l.backgroundColor;const u=this.options.getText;let d;return"function"===typeof u&&(d=s.call(u,this.cellView,{cell:this.cell,index:this.labelIndex})),n.innerText=d||"",this}onDocumentMouseDown(t){if(t.target!==this.editor){const t=this.cell,e=this.editor.innerText.replace(/\n$/,"")||"",n=this.options.setText;"function"===typeof n&&s.call(n,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance}),t.removeTool(t.isEdge()?"edge-editor":"node-editor"),this.undelegateDocumentEvents()}}onDblClick(t){t.stopPropagation()}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor.focus(),this.selectText()})}selectText(){if(window.getSelection){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}}(function(t){t.config({tagName:"div",isSVGElement:!1,events:{dblclick:"onDblClick",mousedown:"onMouseDown"},documentEvents:{mousedown:"onDocumentMouseDown"}})})(cc||(cc={})),function(t){t.NodeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText({cell:t}){return t.attr("text/text")},setText({cell:t,value:e}){t.attr("text/text",e)}}),t.EdgeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText({cell:t,index:e}){return-1===e?"":t.prop(`labels/${e}/attrs/label/text`)},setText({cell:t,value:e,index:n,distance:r}){const i=t;-1===n?i.appendLabel({position:{distance:r},attrs:{label:{text:e}}}):e?i.prop(`labels/${n}/attrs/label/text`,e):"number"===typeof n&&i.removeLabelAt(n)}})}(cc||(cc={}));var uc,dc,hc=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};(function(t){t.presets={boundary:Ql,button:Zl,"button-remove":Zl.Remove,"node-editor":cc.NodeEditor},t.registry=Eo.create({type:"node tool",process(t,e){if("function"===typeof e)return e;let n=Yl.ToolItem;const{inherit:r}=e,i=hc(e,["inherit"]);if(r){const t=this.get(r);null==t?this.onNotFound(r,"inherited"):n=t}return null==i.name&&(i.name=t),n.define.call(n,i)}}),t.registry.register(t.presets,!0)})(uc||(uc={})),function(t){t.presets={boundary:Ql,vertices:tc,segments:ec,button:Zl,"button-remove":Zl.Remove,"source-anchor":rc,"target-anchor":ic,"source-arrowhead":sc,"target-arrowhead":lc,"edge-editor":cc.EdgeEditor},t.registry=Eo.create({type:"edge tool",process(t,e){if("function"===typeof e)return e;let n=Yl.ToolItem;const{inherit:r}=e,i=hc(e,["inherit"]);if(r){const t=this.get(r);null==t?this.onNotFound(r,"inherited"):n=t}return null==i.name&&(i.name=t),n.define.call(n,i)}}),t.registry.register(t.presets,!0)}(dc||(dc={}));const pc=Cc("center"),fc=Cc("topCenter"),gc=Cc("bottomCenter"),mc=Cc("leftMiddle"),vc=Cc("rightMiddle"),bc=Cc("topLeft"),yc=Cc("topRight"),wc=Cc("bottomLeft"),xc=Cc("bottomRight");function Cc(t){return function(e,n,r,i={}){const o=i.rotate?e.getUnrotatedBBoxOfElement(n):e.getBBoxOfElement(n),s=o[t];s.x+=a.normalizePercentage(i.dx,o.width),s.y+=a.normalizePercentage(i.dy,o.height);const l=e.cell;return i.rotate?s.rotate(-l.getAngle(),l.getBBox().getCenter()):s}}function kc(t){return function(e,n,r,i){if(r instanceof Element){const o=this.graph.renderer.findViewByElem(r);let a;if(o)if(o.isEdgeElement(r)){const t=null!=i.fixedAt?i.fixedAt:"50%";a=Ac(o,t)}else a=o.getBBoxOfElement(r).getCenter();else a=new Dr;return t.call(this,e,n,a,i)}return t.apply(this,arguments)}}function Ac(t,e){const n=a.isPercentage(e),r="string"===typeof e?parseFloat(e):e;return n?t.getPointAtRatio(r/100):t.getPointAtLength(r)}const Sc=function(t,e,n,r){const i=t.cell.getAngle(),o=t.getBBoxOfElement(e),a=o.getCenter(),s=o.getTopLeft(),l=o.getBottomRight();let c=r.padding;if(Number.isFinite(c)||(c=0),s.y+c<=n.y&&n.y<=l.y-c){const t=n.y-a.y;a.x+=0===i||180===i?0:1*t/Math.tan(Er.toRad(i)),a.y+=t}else if(s.x+c<=n.x&&n.x<=l.x-c){const t=n.x-a.x;a.y+=90===i||270===i?0:t*Math.tan(Er.toRad(i)),a.x+=t}return a},Ec=kc(Sc),Oc=function(t,e,n,r,i){const o=t.cell.getConnectionPoint(this.cell,i);return(r.dx||r.dy)&&o.translate(r.dx||0,r.dy||0),o},Tc=function(t,e,n,r){let i,o,a=0;const s=t.cell;r.rotate?(i=t.getUnrotatedBBoxOfElement(e),o=s.getBBox().getCenter(),a=s.getAngle()):i=t.getBBoxOfElement(e);const l=r.padding;null!=l&&Number.isFinite(l)&&i.inflate(l),r.rotate&&n.rotate(a,o);const c=i.getNearestSideToPoint(n);let u;switch(c){case"left":u=i.getLeftMiddle();break;case"right":u=i.getRightMiddle();break;case"top":u=i.getTopCenter();break;case"bottom":u=i.getBottomCenter();break;default:break}const d=r.direction;return"H"===d?"top"!==c&&"bottom"!==c||(u=n.x<=i.x+i.width?i.getLeftMiddle():i.getRightMiddle()):"V"===d&&(u=n.y<=i.y+i.height?i.getTopCenter():i.getBottomCenter()),r.rotate?u.rotate(-a,o):u},_c=kc(Tc);var Mc;(function(t){t.presets=y,t.registry=Eo.create({type:"node endpoint"}),t.registry.register(t.presets,!0)})(Mc||(Mc={}));const Nc=function(t,e,n,r){let i=null!=r.ratio?r.ratio:.5;return i>1&&(i/=100),t.getPointAtRatio(i)},Pc=function(t,e,n,r){const i=null!=r.length?r.length:20;return t.getPointAtLength(i)},Lc=function(t,e,n,r){const i=t.getClosestPoint(n);return null!=i?i:new Dr},Dc=kc(Lc),jc=function(t,e,n,r){const i=1e6,o=t.getConnection(),a=t.getConnectionSubdivisions(),l=new Ir(n.clone().translate(0,i),n.clone().translate(0,-i)),c=new Ir(n.clone().translate(i,0),n.clone().translate(-i,0)),u=l.intersect(o,{segmentSubdivisions:a}),d=c.intersect(o,{segmentSubdivisions:a}),h=[];return u&&h.push(...u),d&&h.push(...d),h.length>0?n.closest(h):null!=r.fallbackAt?Ac(t,r.fallbackAt):s.call(Lc,this,t,e,n,r)},Ic=kc(jc);var Rc;function Fc(t,e,n){let r;if("object"===typeof n){if(Number.isFinite(n.y)){const r=new Ir(e,t),{start:i,end:o}=r.parallel(n.y);e=i,t=o}r=n.x}else r=n;if(null==r||!Number.isFinite(r))return t;const i=t.distance(e);return 0===r&&i>0?t:t.move(e,-Math.min(r,i-1))}function Bc(t){const e=t.getAttribute("stroke-width");return null===e?0:parseFloat(e)||0}function zc(t){if(null==t)return null;let e=t;do{let t=e.tagName;if("string"!==typeof t)return null;if(t=t.toUpperCase(),"G"===t)e=e.firstElementChild;else{if("TITLE"!==t)break;e=e.nextElementSibling}}while(e);return e}(function(t){t.presets=w,t.registry=Eo.create({type:"edge endpoint"}),t.registry.register(t.presets,!0)})(Rc||(Rc={}));const Hc=function(t,e,n,r){const i=e.getBBoxOfElement(n);r.stroked&&i.inflate(Bc(n)/2);const o=t.intersect(i),a=o&&o.length?t.start.closest(o):t.end;return Fc(a,t.start,r.offset)},Vc=function(t,e,n,r,i){const o=e.cell,a=o.isNode()?o.getAngle():0;if(0===a)return s.call(Hc,this,t,e,n,r,i);const l=e.getUnrotatedBBoxOfElement(n);r.stroked&&l.inflate(Bc(n)/2);const c=l.getCenter(),u=t.clone().rotate(a,c),d=u.setLength(1e6).intersect(l),h=d&&d.length?u.start.closest(d).rotate(-a,c):t.end;return Fc(h,t.start,r.offset)},qc=function(t,e,n,r){let o,a;const s=t.end,l=r.selector;if(o="string"===typeof l?e.findOne(l):Array.isArray(l)?i.getByPath(n,l):zc(n),!c.isSVGGraphicsElement(o)){if(o===n||!c.isSVGGraphicsElement(n))return s;o=n}const u=e.getShapeOfElement(o),d=e.getMatrixOfElement(o),h=e.getRootTranslatedMatrix(),p=e.getRootRotatedMatrix(),f=h.multiply(p).multiply(d),g=f.inverse(),m=c.transformLine(t,g),v=m.start.clone(),b=e.getDataOfElement(o);if(!1===r.insideout){null==b.shapeBBox&&(b.shapeBBox=u.bbox());const t=b.shapeBBox;if(null!=t&&t.containsPoint(v))return s}let y;if(!0===r.extrapolate&&m.setLength(1e6),oi.isPath(u)){const t=r.precision||2;null==b.segmentSubdivisions&&(b.segmentSubdivisions=u.getSegmentSubdivisions({precision:t})),y={precision:t,segmentSubdivisions:b.segmentSubdivisions},a=m.intersect(u,y)}else a=m.intersect(u);a?Array.isArray(a)&&(a=v.closest(a)):!0===r.sticky&&(a=jr.isRectangle(u)?u.getNearestPointToPoint(v):Rr.isEllipse(u)?u.intersectsWithLineFromCenterToPoint(v):u.closestPoint(v,y));const w=a?c.transformPoint(a,f):s;let x=r.offset||0;return!1!==r.stroked&&("object"===typeof x?(x=Object.assign({},x),null==x.x&&(x.x=0),x.x+=Bc(o)/2):x+=Bc(o)/2),Fc(w,t.start,x)};function Uc(t,e,n=0){const{start:r,end:i}=t;let o,a,s,l;switch(e){case"left":l="x",o=i,a=r,s=-1;break;case"right":l="x",o=r,a=i,s=1;break;case"top":l="y",o=i,a=r,s=-1;break;case"bottom":l="y",o=r,a=i,s=1;break;default:return}r[l]<i[l]?o[l]=a[l]:a[l]=o[l],Number.isFinite(n)&&(o[l]+=s*n,a[l]+=s*n)}const Wc=function(t,e,n,r){const{alignOffset:i,align:o}=r;return o&&Uc(t,o,i),Fc(t.end,t.start,r.offset)};var $c;(function(t){t.presets=x,t.registry=Eo.create({type:"connection point"}),t.registry.register(t.presets,!0)})($c||($c={}));const Gc=function(t){return[...t]},Yc=function(t,e,n){const r=e.side||"bottom",i=a.normalizeSides(e.padding||40),o=n.sourceBBox,s=n.targetBBox,l=o.getCenter(),c=s.getCenter();let u,d,h;switch(r){case"top":h=-1,u="y",d="height";break;case"left":h=-1,u="x",d="width";break;case"right":h=1,u="x",d="width";break;case"bottom":default:h=1,u="y",d="height";break}return l[u]+=h*(o[d]/2+i[r]),c[u]+=h*(s[d]/2+i[r]),h*(l[u]-c[u])>0?c[u]=l[u]:l[u]=c[u],[l.toJSON(),...t,c.toJSON()]};function Xc(t){return new jr(t.x,t.y,0,0)}function Kc(t={}){const e=a.normalizeSides(t.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Zc(t,e={}){return t.sourceBBox.clone().moveAndExpand(Kc(e))}function Jc(t,e={}){return t.targetBBox.clone().moveAndExpand(Kc(e))}function Qc(t,e={}){if(t.sourceAnchor)return t.sourceAnchor;const n=Zc(t,e);return n.getCenter()}function tu(t,e={}){if(t.targetAnchor)return t.targetAnchor;const n=Jc(t,e);return n.getCenter()}const eu=function(t,e,n){let r=Zc(n,e),i=Jc(n,e);const o=Qc(n,e),a=tu(n,e);r=r.union(Xc(o)),i=i.union(Xc(a));const s=t.map(t=>Dr.create(t));s.unshift(o),s.push(a);let l=null;const c=[];for(let u=0,d=s.length-1;u<d;u+=1){let t=null;const n=s[u],o=s[u+1],a=null!=nu.getBearing(n,o);if(0===u)u+1===d?r.intersectsWithRect(i.clone().inflate(1))?t=nu.insideNode(n,o,r,i):a||(t=nu.nodeToNode(n,o,r,i)):r.containsPoint(o)?t=nu.insideNode(n,o,r,Xc(o).moveAndExpand(Kc(e))):a||(t=nu.nodeToVertex(n,o,r));else if(u+1===d){const r=a&&nu.getBearing(o,n)===l;i.containsPoint(n)||r?t=nu.insideNode(n,o,Xc(n).moveAndExpand(Kc(e)),i,l):a||(t=nu.vertexToNode(n,o,i,l))}else a||(t=nu.vertexToVertex(n,o,l));t?(c.push(...t.points),l=t.direction):l=nu.getBearing(n,o),u+1<d&&c.push(o)}return c};var nu;(function(t){const e={N:"S",S:"N",E:"W",W:"E"},n={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function i(t,e,n){let r=new Dr(t.x,e.y);return n.containsPoint(r)&&(r=new Dr(e.x,t.y)),r}function o(t,e){return t["W"===e||"E"===e?"width":"height"]}function a(t,e){return t.x===e.x?t.y>e.y?"N":"S":t.y===e.y?t.x>e.x?"W":"E":null}function s(t,n,r){const i=new Dr(t.x,n.y),o=new Dr(n.x,t.y),s=a(t,i),l=a(t,o),c=r?e[r]:null,u=s===r||s!==c&&(l===c||l!==r)?i:o;return{points:[u],direction:a(u,n)}}function l(t,e,n){const r=i(t,e,n);return{points:[r],direction:a(r,e)}}function c(t,e,n,s){const l=[new Dr(t.x,e.y),new Dr(e.x,t.y)],c=l.filter(t=>!n.containsPoint(t)),u=c.filter(e=>a(e,t)!==s);let d;if(u.length>0)return d=u.filter(e=>a(t,e)===s).pop(),d=d||u[0],{points:[d],direction:a(d,e)};{d=r.difference(l,c)[0];const u=Dr.create(e).move(d,-o(n,s)/2),h=i(u,t,n);return{points:[h,u],direction:a(u,e)}}}function u(t,e,n,r){let i=l(e,t,r);const c=i.points[0];if(n.containsPoint(c)){i=l(t,e,n);const u=i.points[0];if(r.containsPoint(u)){const d=Dr.create(t).move(u,-o(n,a(t,u))/2),h=Dr.create(e).move(c,-o(r,a(e,c))/2),p=new Ir(d,h).getCenter(),f=l(t,p,n),g=s(p,e,f.direction);i.points=[f.points[0],g.points[0]],i.direction=g.direction}}return i}function d(t,e,r,o,s){const l=r.union(o).inflate(1),c=l.getCenter(),u=c.distance(e)>c.distance(t),d=u?e:t,h=u?t:e;let p,f,g,m;s?(p=Dr.fromPolar(l.width+l.height,n[s],d),p=l.getNearestPointToPoint(p).move(p,-1)):p=l.getNearestPointToPoint(d).move(d,1),f=i(p,h,l),p.round().equals(f.round())?(f=Dr.fromPolar(l.width+l.height,Er.toRad(p.theta(d))+Math.PI/2,h),f=l.getNearestPointToPoint(f).move(h,1).round(),g=i(p,f,l),m=u?[f,g,p]:[p,g,f]):m=u?[f,p]:[p,f];const v=a(u?p:f,e);return{points:m,direction:v}}t.getBBoxSize=o,t.getBearing=a,t.vertexToVertex=s,t.nodeToVertex=l,t.vertexToNode=c,t.nodeToNode=u,t.insideNode=d})(nu||(nu={}));const ru={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeShapes:[],excludeNodes:[],excludeHiddenNodes:!1,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){const t=iu(this.step,this);return t},directions(){const t=iu(this.step,this),e=iu(this.cost,this);return[{cost:e,offsetX:t,offsetY:0},{cost:e,offsetX:-t,offsetY:0},{cost:e,offsetX:0,offsetY:t},{cost:e,offsetX:0,offsetY:-t}]},penalties(){const t=iu(this.step,this);return{0:0,45:t/2,90:t/2}},paddingBox(){const t=iu(this.step,this);return{x:-t,y:-t,width:2*t,height:2*t}},fallbackRouter:eu,draggingRouter:null};function iu(t,e){return"function"===typeof t?t.call(e):t}function ou(t){const e=Object.keys(t).reduce((e,n)=>{const r=e;return r[n]="fallbackRouter"===n||"draggingRouter"===n||"fallbackRoute"===n?t[n]:iu(t[n],t),e},{});if(e.padding){const t=a.normalizeSides(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const e=new Dr(0,0),n=new Dr(t.offsetX,t.offsetY);t.angle=Er.normalize(e.theta(n))}),e}const au=1,su=2;class lu{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=au,this.values[t]=e;const n=r.sortedIndexBy(this.items,t,t=>this.values[t]);this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=su),t}isOpen(t){return this.hash[t]===au}isClose(t){return this.hash[t]===su}isEmpty(){return 0===this.items.length}}class cu{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const n=this.options,i=n.excludeTerminals.reduce((n,r)=>{const i=e[r];if(i){const e=t.getCell(i.cell);e&&n.push(e)}return n},[]);let o=[];const a=t.getCell(e.getSourceCellId());a&&(o=r.union(o,a.getAncestors().map(t=>t.id)));const s=t.getCell(e.getTargetCellId());s&&(o=r.union(o,s.getAncestors().map(t=>t.id)));const l=this.mapGridSize;return t.getNodes().reduce((t,e)=>{const r=e.shape,a=n.excludeShapes,s=!!r&&a.includes(r),c=i.some(t=>t.id===e.id),u=n.excludeNodes.includes(e),d=o.includes(e.id),h=n.excludeHiddenNodes&&!e.isVisible(),p=s||c||u||d||h;if(!p){const r=e.getBBox().moveAndExpand(n.paddingBox),i=r.getOrigin().snapToGrid(l),o=r.getCorner().snapToGrid(l);for(let e=i.x;e<=o.x;e+=l)for(let n=i.y;n<=o.y;n+=l){const i=new Dr(e,n).toString();null==t[i]&&(t[i]=[]),t[i].push(r)}}return t},this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[e];return!n||n.every(e=>!e.containsPoint(t))}}function uu(t,e){const n=t.sourceBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function du(t,e){const n=t.targetBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function hu(t,e){if(t.sourceAnchor)return t.sourceAnchor;const n=uu(t,e);return n.getCenter()}function pu(t,e){if(t.targetAnchor)return t.targetAnchor;const n=du(t,e);return n.getCenter()}function fu(t,e,n,r,i){const o=360/n,a=t.theta(gu(t,e,r,i)),s=Er.normalize(a+o/2);return o*Math.floor(s/o)}function gu(t,e,n,r){const i=r.step,o=e.x-t.x,a=e.y-t.y,s=o/n.x,l=a/n.y,c=s*i,u=l*i;return new Dr(t.x+c,t.y+u)}function mu(t,e){const n=Math.abs(t-e);return n>180?360-n:n}function vu(t,e){const n=e.step;return e.directions.forEach(e=>{e.gridOffsetX=e.offsetX/n*t.x,e.gridOffsetY=e.offsetY/n*t.y}),e.directions}function bu(t,e,n){return{source:e.clone(),x:yu(n.x-e.x,t),y:yu(n.y-e.y,t)}}function yu(t,e){if(!t)return e;const n=Math.abs(t),r=Math.round(n/e);if(!r)return n;const i=r*e,o=n-i,a=o/r;return e+a}function wu(t,e){const n=e.source,r=Ms.snapToGrid(t.x-n.x,e.x)+n.x,i=Ms.snapToGrid(t.y-n.y,e.y)+n.y;return new Dr(r,i)}function xu(t,e){return t.round(e)}function Cu(t,e,n){return xu(wu(t.clone(),e),n)}function ku(t){return t.toString()}function Au(t){return new Dr(0===t.x?0:Math.abs(t.x)/t.x,0===t.y?0:Math.abs(t.y)/t.y)}function Su(t,e){let n=1/0;for(let r=0,i=e.length;r<i;r+=1){const i=t.manhattanDistance(e[r]);i<n&&(n=i)}return n}function Eu(t,e,n,r,i){const o=i.precision,a=i.directionMap,s=t.diff(e.getCenter()),l=Object.keys(a).reduce((i,l)=>{if(n.includes(l)){const n=a[l],c=new Dr(t.x+n.x*(Math.abs(s.x)+e.width),t.y+n.y*(Math.abs(s.y)+e.height)),u=new Ir(t,c),d=u.intersect(e)||[];let h,p=null;for(let e=0;e<d.length;e+=1){const n=d[e],r=t.squaredDistance(n);(null==h||r>h)&&(h=r,p=n)}if(p){let t=Cu(p,r,o);e.containsPoint(t)&&(t=Cu(t.translate(n.x*r.x,n.y*r.y),r,o)),i.push(t)}}return i},[]);return e.containsPoint(t)||l.push(Cu(t,r,o)),l}function Ou(t,e,n,r,i){const o=[];let a,s=Au(i.diff(n)),l=ku(n),c=t[l];while(c){a=e[l];const n=Au(a.diff(c));n.equals(s)||(o.unshift(a),s=n),l=ku(c),c=t[l]}const u=e[l],d=Au(u.diff(r));return d.equals(s)||o.unshift(u),o}function Tu(t,e,n,r,i){const o=i.precision;let a,l;a=jr.isRectangle(e)?xu(hu(t,i).clone(),o):xu(e.clone(),o),l=jr.isRectangle(n)?xu(pu(t,i).clone(),o):xu(n.clone(),o);const c=bu(i.step,a,l),u=a,d=l;let h,p;if(h=jr.isRectangle(e)?Eu(u,e,i.startDirections,c,i):[u],p=jr.isRectangle(n)?Eu(l,n,i.endDirections,c,i):[d],h=h.filter(t=>r.isAccessible(t)),p=p.filter(t=>r.isAccessible(t)),h.length>0&&p.length>0){const t=new lu,e={},n={},a={};for(let r=0,i=h.length;r<i;r+=1){const n=h[r],i=ku(n);t.add(i,Su(n,p)),e[i]=n,a[i]=0}const s=i.previousDirectionAngle,l=void 0===s;let f,g;const m=vu(c,i),v=m.length,b=p.reduce((t,e)=>{const n=ku(e);return t.push(n),t},[]),y=Dr.equalPoints(h,p);let w=i.maxLoopCount;while(!t.isEmpty()&&w>0){const h=t.pop(),x=e[h],C=n[h],k=a[h],A=x.equals(u),S=null==C;let E;E=S?l?A?null:fu(u,x,v,c,i):s:fu(C,x,v,c,i);const O=S&&y;if(!O&&b.indexOf(h)>=0)return i.previousDirectionAngle=E,Ou(n,e,x,u,d);for(let s=0;s<v;s+=1){f=m[s];const u=f.angle;if(g=mu(E,u),(!l||!A)&&g>i.maxDirectionChange)continue;const h=Cu(x.clone().translate(f.gridOffsetX||0,f.gridOffsetY||0),c,o),y=ku(h);if(t.isClose(y)||!r.isAccessible(h))continue;if(b.indexOf(y)>=0){const t=h.equals(d);if(!t){const t=fu(h,d,v,c,i),e=mu(u,t);if(e>i.maxDirectionChange)continue}}const w=f.cost,C=A?0:i.penalties[g],S=k+w+C;(!t.isOpen(y)||S<a[y])&&(e[y]=h,n[y]=x,a[y]=S,t.add(y,S+Su(h,p)))}w-=1}}return i.fallbackRoute?s.call(i.fallbackRoute,this,u,d,i):null}const _u=function(t,e,n){const r=ou(e),i=uu(n,r),o=du(n,r),a=hu(n,r),l=new cu(r).build(n.graph.model,n.cell),c=t.map(t=>Dr.create(t)),u=[];let d,h,p=a;for(let f=0,g=c.length;f<=g;f+=1){let e=null;if(d=h||i,h=c[f],null==h){h=o;const t=n.cell,l=null==t.getSourceCellId()||null==t.getTargetCellId();if(l&&"function"===typeof r.draggingRouter){const t=d===i?a:d,o=h.getOrigin();e=s.call(r.draggingRouter,n,t,o,r)}}if(null==e&&(e=Tu(n,d,h,l,r)),null===e)return s.call(r.fallbackRouter,this,t,r,n);const g=e[0];g&&g.equals(p)&&e.shift(),p=e[e.length-1]||p,u.push(...e)}return u},Mu=function(t,e,n){return s.call(_u,this,t,Object.assign(Object.assign({},ru),e),n)},Nu={maxDirectionChange:45,directions(){const t=iu(this.step,this),e=iu(this.cost,this),n=Math.ceil(Math.sqrt(t*t<<1));return[{cost:e,offsetX:t,offsetY:0},{cost:n,offsetX:t,offsetY:t},{cost:e,offsetX:0,offsetY:t},{cost:n,offsetX:-t,offsetY:t},{cost:e,offsetX:-t,offsetY:0},{cost:n,offsetX:-t,offsetY:-t},{cost:e,offsetX:0,offsetY:-t},{cost:n,offsetX:t,offsetY:-t}]},fallbackRoute(t,e,n){const r=t.theta(e),i=[];let o={x:e.x,y:t.y},a={x:t.x,y:e.y};if(r%180>90){const t=o;o=a,a=t}const s=r%90<45?o:a,l=new Ir(t,s),c=90*Math.ceil(r/90),u=Dr.fromPolar(l.squaredLength(),Er.toRad(c+135),s),d=new Ir(e,u),h=l.intersectsWithLine(d),p=h||e,f=h?p:t,g=360/n.directions.length,m=f.theta(e),v=Er.normalize(m+g/2),b=g*Math.floor(v/g);return n.previousDirectionAngle=b,p&&i.push(p.round()),i.push(e),i}},Pu=function(t,e,n){return s.call(Mu,this,t,Object.assign(Object.assign({},Nu),e),n)},Lu=function(t,e,n){const r=e.offset||32,i=null==e.min?16:e.min;let o=0,a=e.direction;const s=n.sourceBBox,l=n.targetBBox,c=s.getCenter(),u=l.getCenter();if("number"===typeof r&&(o=r),null==a){let t=l.left-s.right,e=l.top-s.bottom;t>=0&&e>=0?a=t>=e?"L":"T":t<=0&&e>=0?(t=s.left-l.right,a=t>=0&&t>=e?"R":"T"):t>=0&&e<=0?(e=s.top-l.bottom,a=e>=0?t>=e?"L":"B":"L"):(t=s.left-l.right,e=s.top-l.bottom,a=t>=0&&e>=0?t>=e?"R":"B":t<=0&&e>=0?"B":t>=0&&e<=0||Math.abs(t)>Math.abs(e)?"R":"B")}let d,h,p;"H"===a?a=u.x-c.x>=0?"L":"R":"V"===a&&(a=u.y-c.y>=0?"T":"B"),"center"===r&&("L"===a?o=(l.left-s.right)/2:"R"===a?o=(s.left-l.right)/2:"T"===a?o=(l.top-s.bottom)/2:"B"===a&&(o=(s.top-l.bottom)/2));const f="L"===a||"R"===a;if(f){if(u.y===c.y)return[...t];p="L"===a?1:-1,d="x",h="width"}else{if(u.x===c.x)return[...t];p="T"===a?1:-1,d="y",h="height"}const g=c.clone(),m=u.clone();if(g[d]+=p*(s[h]/2+o),m[d]-=p*(l[h]/2+o),f){const t=g.x,e=m.x,n=s.width/2+i,r=l.width/2+i;u.x>c.x?e<=t&&(g.x=Math.max(e,c.x+n),m.x=Math.min(t,u.x-r)):e>=t&&(g.x=Math.min(e,c.x-n),m.x=Math.max(t,u.x+r))}else{const t=g.y,e=m.y,n=s.height/2+i,r=l.height/2+i;u.y>c.y?e<=t&&(g.y=Math.max(e,c.y+n),m.y=Math.min(t,u.y-r)):e>=t&&(g.y=Math.min(e,c.y-n),m.y=Math.max(t,u.y+r))}return[g.toJSON(),...t,m.toJSON()]};function Du(t,e){if(null!=e&&!1!==e){const n="boolean"===typeof e?0:e;if(n>0){const e=Dr.create(t[1]).move(t[2],n),r=Dr.create(t[1]).move(t[0],n);return[e.toJSON(),...t,r.toJSON()]}{const e=t[1];return[Object.assign({},e),...t,Object.assign({},e)]}}return t}const ju=function(t,e,n){const r=e.width||50,i=e.height||80,o=i/2,a=e.angle||"auto",s=n.sourceAnchor,l=n.targetAnchor,c=n.sourceBBox,u=n.targetBBox;if(s.equals(l)){const t=t=>{const e=Er.toRad(t),n=Math.sin(e),i=Math.cos(e),a=new Dr(s.x+i*r,s.y+n*r),l=new Dr(a.x-i*o,a.y-n*o),c=l.clone().rotate(-90,a),u=l.clone().rotate(90,a);return[c.toJSON(),a.toJSON(),u.toJSON()]},n=t=>{const e=s.clone().move(t,-1),n=new Ir(e,t);return!c.containsPoint(t)&&!c.intersectsWithLine(n)},i=[0,90,180,270,45,135,225,315];if("number"===typeof a)return Du(t(a),e.merge);const l=c.getCenter();if(l.equals(s))return Du(t(0),e.merge);const u=l.angleBetween(s,l.clone().translate(1,0));let d=t(u);if(n(d[1]))return Du(d,e.merge);for(let r=1,o=i.length;r<o;r+=1)if(d=t(u+i[r]),n(d[1]))return Du(d,e.merge);return Du(d,e.merge)}{const t=new Ir(s,l);let i=t.parallel(-r),a=i.getCenter(),d=i.start.clone().move(i.end,o),h=i.end.clone().move(i.start,o);const p=t.parallel(-1),f=new Ir(p.start,a),g=new Ir(p.end,a);if((c.containsPoint(a)||u.containsPoint(a)||c.intersectsWithLine(f)||c.intersectsWithLine(g)||u.intersectsWithLine(f)||u.intersectsWithLine(g))&&(i=t.parallel(r),a=i.getCenter(),d=i.start.clone().move(i.end,o),h=i.end.clone().move(i.start,o)),e.merge){const t=new Ir(s,l),e=new Ir(a,t.center).setLength(Number.MAX_SAFE_INTEGER),r=c.intersectsWithLine(e),i=u.intersectsWithLine(e),o=r?Array.isArray(r)?r:[r]:[];i&&(Array.isArray(i)?o.push(...i):o.push(i));const d=t.center.closest(o);d?(n.sourceAnchor=d.clone(),n.targetAnchor=d.clone()):(n.sourceAnchor=t.center.clone(),n.targetAnchor=t.center.clone())}return Du([d.toJSON(),a.toJSON(),h.toJSON()],e.merge)}};var Iu;(function(t){t.presets=C,t.registry=Eo.create({type:"router"}),t.registry.register(t.presets,!0)})(Iu||(Iu={}));const Ru=function(t,e,n,r={}){const i=[t,...n,e],o=new Fr(i),a=new oi(o);return r.raw?a:a.serialize()},Fu=function(t,e,n,r={}){const i=3===n.length?0:1,o=Dr.create(n[0+i]),a=Dr.create(n[2+i]),s=Dr.create(n[1+i]);if(!Dr.equals(t,e)){const n=new Dr((t.x+e.x)/2,(t.y+e.y)/2),r=n.angleBetween(Dr.create(t).rotate(90,n),s);r>1&&(o.rotate(180-r,n),a.rotate(180-r,n),s.rotate(180-r,n))}const l=`\n M ${t.x} ${t.y}\n Q ${o.x} ${o.y} ${s.x} ${s.y}\n Q ${a.x} ${a.y} ${e.x} ${e.y}\n `;return r.raw?oi.parse(l):l},Bu=function(t,e,n,r={}){const i=new oi;i.appendSegment(oi.createSegment("M",t));const o=1/3,a=2/3,s=r.radius||10;let l,c;for(let u=0,d=n.length;u<d;u+=1){const r=Dr.create(n[u]),d=n[u-1]||t,h=n[u+1]||e;l=c||r.distance(d)/2,c=r.distance(h)/2;const p=-Math.min(s,l),f=-Math.min(s,c),g=r.clone().move(d,p).round(),m=r.clone().move(h,f).round(),v=new Dr(o*g.x+a*r.x,a*r.y+o*g.y),b=new Dr(o*m.x+a*r.x,a*r.y+o*m.y);i.appendSegment(oi.createSegment("L",g)),i.appendSegment(oi.createSegment("C",v,b,m))}return i.appendSegment(oi.createSegment("L",e)),r.raw?i:i.serialize()},zu=function(t,e,n,r={}){let i,o=r.direction;if(n&&0!==n.length){const r=[t,...n,e],o=Br.throughPoints(r);i=new oi(o)}else if(i=new oi,i.appendSegment(oi.createSegment("M",t)),o||(o=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y)?"H":"V"),"H"===o){const n=(t.x+e.x)/2;i.appendSegment(oi.createSegment("C",n,t.y,n,e.y,e.x,e.y))}else{const n=(t.y+e.y)/2;i.appendSegment(oi.createSegment("C",t.x,n,e.x,n,e.x,e.y))}return r.raw?i:i.serialize()},Hu=1,Vu=1/3,qu=2/3;function Uu(t){let e=t.graph._jumpOverUpdateList;if(null==e&&(e=t.graph._jumpOverUpdateList=[],t.graph.on("cell:mouseup",()=>{const e=t.graph._jumpOverUpdateList;for(let t=0;t<e.length;t+=1)e[t].update()}),t.graph.on("model:reseted",()=>{e=t.graph._jumpOverUpdateList=[]})),e.indexOf(t)<0){e.push(t);const n=()=>e.splice(e.indexOf(t),1);t.cell.once("change:connector",n),t.cell.once("removed",n)}}function Wu(t,e,n=[]){const r=[t,...n,e],i=[];return r.forEach((t,e)=>{const n=r[e+1];null!=n&&i.push(new Ir(t,n))}),i}function $u(t,e){const n=[];return e.forEach(e=>{const r=t.intersectsWithLine(e);r&&n.push(r)}),n}function Gu(t,e){return new Ir(t,e).squaredLength()}function Yu(t,e,n){return e.reduce((r,i,o)=>{if(Ju.includes(i))return r;const a=r.pop()||t,s=Dr.create(i).move(a.start,-n);let l=Dr.create(i).move(a.start,+n);const c=e[o+1];if(null!=c){const t=l.distance(c);t<=n&&(l=c.move(a.start,t),Ju.push(c))}else{const t=s.distance(a.end);if(t<2*n+Hu)return r.push(a),r}const u=l.distance(a.start);if(u<2*n+Hu)return r.push(a),r;const d=new Ir(s,l);return Zu.push(d),r.push(new Ir(a.start,s),d,new Ir(l,a.end)),r},[])}function Xu(t,e,n,r){const i=new oi;let o;return o=oi.createSegment("M",t[0].start),i.appendSegment(o),t.forEach((a,s)=>{if(Zu.includes(a)){let t,r,s,l;if("arc"===n){t=-90,r=a.start.diff(a.end);const e=r.x<0||0===r.x&&r.y<0;e&&(t+=180);const n=a.getCenter(),c=new Ir(n,a.end).rotate(t,n);let u;u=new Ir(a.start,n),s=u.pointAt(2/3).rotate(t,a.start),l=c.pointAt(1/3).rotate(-t,c.end),o=oi.createSegment("C",s,l,c.end),i.appendSegment(o),u=new Ir(n,a.end),s=c.pointAt(1/3).rotate(t,c.end),l=u.pointAt(1/3).rotate(-t,a.end),o=oi.createSegment("C",s,l,a.end),i.appendSegment(o)}else if("gap"===n)o=oi.createSegment("M",a.end),i.appendSegment(o);else if("cubic"===n){t=a.start.theta(a.end);const n=.6*e;let c=1.35*e;r=a.start.diff(a.end);const u=r.x<0||0===r.x&&r.y<0;u&&(c*=-1),s=new Dr(a.start.x+n,a.start.y+c).rotate(t,a.start),l=new Dr(a.end.x-n,a.end.y+c).rotate(t,a.end),o=oi.createSegment("C",s,l,a.end),i.appendSegment(o)}}else{const e=t[s+1];0===r||!e||Zu.includes(e)?(o=oi.createSegment("L",a.end),i.appendSegment(o)):Ku(r,i,a.end,a.start,e.end)}}),i}function Ku(t,e,n,r,i){const o=n.distance(r)/2,a=n.distance(i)/2,s=-Math.min(t,o),l=-Math.min(t,a),c=n.clone().move(r,s).round(),u=n.clone().move(i,l).round(),d=new Dr(Vu*c.x+qu*n.x,qu*n.y+Vu*c.y),h=new Dr(Vu*u.x+qu*n.x,qu*n.y+Vu*u.y);let p;p=oi.createSegment("L",c),e.appendSegment(p),p=oi.createSegment("C",d,h,u),e.appendSegment(p)}let Zu,Ju;const Qu=function(t,e,n,r={}){Zu=[],Ju=[],Uu(this);const i=r.size||5,o=r.type||"arc",a=r.radius||0,s=r.ignoreConnectors||["smooth"],l=this.graph,c=l.model,u=c.getEdges();if(1===u.length)return Xu(Wu(t,e,n),i,o,a);const d=this.cell,h=u.indexOf(d),p=l.options.connecting.connector||{},f=u.filter((t,e)=>{const n=t.getConnector()||p;return!s.includes(n.name)&&(!(e>h)||"jumpover"!==n.name)}),g=f.map(t=>l.renderer.findViewByCell(t)),m=Wu(t,e,n),v=g.map(t=>null==t?[]:t===this?m:Wu(t.sourcePoint,t.targetPoint,t.routePoints)),b=[];m.forEach(t=>{const e=f.reduce((e,n,r)=>{if(n!==d){const n=$u(t,v[r]);e.push(...n)}return e},[]).sort((e,n)=>Gu(t.start,e)-Gu(t.start,n));e.length>0?b.push(...Yu(t,e,i)):b.push(t)});const y=Xu(b,i,o,a);return Zu=[],Ju=[],r.raw?y:y.serialize()};var td;(function(t){t.presets=k,t.registry=Eo.create({type:"connector"}),t.registry.register(t.presets,!0)})(td||(td={}));Eo.create;class ed{constructor(t){this.cell=t,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(t,e,n={},r="/"){const o=this.cell.getPropByPath(t),a=i.defaults(n,ed.defaultOptions),s=this.getTiming(a.timing),l=this.getInterp(a.interp,o,e);let u=0;const d=Array.isArray(t)?t.join(r):t,h=Array.isArray(t)?t:t.split(r),p=()=>{const t=(new Date).getTime();0===u&&(u=t);const e=t-u;let r=e/a.duration;r<1?this.ids[d]=c.requestAnimationFrame(p):r=1;const i=l(s(r));this.cell.setPropByPath(h,i),n.progress&&n.progress(Object.assign({progress:r,currentValue:i},this.getArgs(d))),1===r&&(this.cell.notify("transition:end",this.getArgs(d)),this.cell.notify("transition:complete",this.getArgs(d)),n.complete&&n.complete(this.getArgs(d)),this.cell.notify("transition:finish",this.getArgs(d)),n.finish&&n.finish(this.getArgs(d)),this.clean(d))};return setTimeout(()=>{this.stop(t,void 0,r),this.cache[d]={startValue:o,targetValue:e,options:a},this.ids[d]=c.requestAnimationFrame(p),this.cell.notify("transition:begin",this.getArgs(d)),this.cell.notify("transition:start",this.getArgs(d)),n.start&&n.start(this.getArgs(d))},n.delay),this.stop.bind(this,t,r,n)}stop(t,e={},n="/"){const r=Array.isArray(t)?t:t.split(n);return Object.keys(this.ids).filter(t=>i.isEqual(r,t.split(n).slice(0,r.length))).forEach(t=>{c.cancelAnimationFrame(this.ids[t]);const n=this.cache[t],r=this.getArgs(t),i=Object.assign(Object.assign({},n.options),e),o=i.jumpedToEnd;o&&null!=n.targetValue&&(this.cell.setPropByPath(t,n.targetValue),this.cell.notify("transition:end",Object.assign({},r)),this.cell.notify("transition:complete",Object.assign({},r)),i.complete&&i.complete(Object.assign({},r)));const a=Object.assign({jumpedToEnd:o},r);this.cell.notify("transition:stop",Object.assign({},a)),i.stop&&i.stop(Object.assign({},a)),this.cell.notify("transition:finish",Object.assign({},r)),i.finish&&i.finish(Object.assign({},r)),this.clean(t)}),this}clean(t){delete this.ids[t],delete this.cache[t]}getTiming(t){return"string"===typeof t?El[t]:t}getInterp(t,e,n){return t?t(e,n):"number"===typeof n?Ol.number(e,n):"string"===typeof n?"#"===n[0]?Ol.color(e,n):Ol.unit(e,n):Ol.object(e,n)}getArgs(t){const e=this.cache[t];return{path:t,startValue:e.startValue,targetValue:e.targetValue,cell:this.cell}}}(function(t){t.defaultOptions={delay:10,duration:100,timing:"linear"}})(ed||(ed={}));var nd=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class rd extends kl{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(i.cloneDeep(t)),this.changed={}}mutate(t,e={}){const n=!0===e.unset,r=!0===e.silent,o=[],a=this.changing;this.changing=!0,a||(this.previous=i.cloneDeep(this.data),this.changed={});const s=this.data,l=this.previous,c=this.changed;if(Object.keys(t).forEach(e=>{const r=e,a=t[r];i.isEqual(s[r],a)||o.push(r),i.isEqual(l[r],a)?delete c[r]:c[r]=a,n?delete s[r]:s[r]=a}),!r&&o.length>0&&(this.pending=!0,this.pendingOptions=e,o.forEach(t=>{this.emit("change:*",{key:t,options:e,store:this,current:s[t],previous:l[t]})})),a)return this;if(!r)while(this.pending)this.pending=!1,this.emit("changed",{current:s,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(t,e){if(null==t)return this.data;const n=this.data[t];return null==n?e:n}getPrevious(t){if(this.previous){const e=this.previous[t];return null==e?void 0:e}}set(t,e,n){return null!=t&&("object"===typeof t?this.mutate(t,e):this.mutate({[t]:e},n)),this}remove(t,e){const n=void 0,r={};let i;if("string"===typeof t)r[t]=n,i=e;else if(Array.isArray(t))t.forEach(t=>r[t]=n),i=e;else{for(const t in this.data)r[t]=n;i=t}return this.mutate(r,Object.assign(Object.assign({},i),{unset:!0})),this}getByPath(t){return i.getByPath(this.data,t,"/")}setByPath(t,e,n={}){const r="/",o=Array.isArray(t)?[...t]:t.split(r),a=Array.isArray(t)?t.join(r):t,s=o[0],l=o.length;if(n.propertyPath=a,n.propertyValue=e,n.propertyPathArray=o,1===l)this.set(s,e,n);else{const a={};let c=a,u=s;for(let t=1;t<l;t+=1){const e=o[t],n=Number.isFinite(Number(e));c=c[u]=n?[]:{},u=e}i.setByPath(a,o,e,r);const d=i.cloneDeep(this.data);n.rewrite&&i.unsetByPath(d,t,r);const h=i.merge(d,a);this.set(s,h[s],n)}return this}removeByPath(t,e){const n=Array.isArray(t)?t:t.split("/"),r=n[0];if(1===n.length)this.remove(r,e);else{const t=n.slice(1),o=i.cloneDeep(this.get(r));o&&i.unsetByPath(o,t),this.set(r,o,e)}return this}hasChanged(t){return null==t?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(null==t)return this.hasChanged()?i.cloneDeep(this.changed):null;const e=this.changing?this.previous:this.data,n={};let r;for(const o in t){const a=t[o];i.isEqual(e[o],a)||(n[o]=a,r=!0)}return r?i.cloneDeep(n):null}toJSON(){return i.cloneDeep(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}nd([kl.dispose()],rd.prototype,"dispose",null);var id,od=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ad=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class sd extends kl{constructor(t={}){super();const e=this.constructor,n=e.getDefaults(!0),r=i.merge({},this.preprocess(n),this.preprocess(t));this.id=r.id||o.uuid(),this.store=new rd(r),this.animation=new ed(this),this.setup(),this.init(),this.postprocess(t)}static config(t){const{markup:e,propHooks:n,attrHooks:r}=t,o=ad(t,["markup","propHooks","attrHooks"]);null!=e&&(this.markup=e),n&&(this.propHooks=this.propHooks.slice(),Array.isArray(n)?this.propHooks.push(...n):"function"===typeof n?this.propHooks.push(n):Object.keys(n).forEach(t=>{const e=n[t];"function"===typeof e&&this.propHooks.push(e)})),r&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),r)),this.defaults=i.merge({},this.defaults,o)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:i.cloneDeep(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce((e,n)=>n?s.call(n,t,e):e,e)}get[Symbol.toStringTag](){return sd.toStringTag}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const n=t.id,r=this.constructor,i=r.applyPropHooks(this,t);return null==n&&!0!==e&&(i.id=o.uuid()),i}postprocess(t){}setup(){this.store.on("change:*",t=>{const{key:e,current:n,previous:r,options:i}=t;this.notify("change:*",{key:e,options:i,current:n,previous:r,cell:this}),this.notify("change:"+e,{options:i,current:n,previous:r,cell:this});const o=e;"source"!==o&&"target"!==o||this.notify("change:terminal",{type:o,current:n,previous:r,options:i,cell:this})}),this.store.on("changed",({options:t})=>this.notify("changed",{options:t,cell:this}))}notify(t,e){this.trigger(t,e);const n=this.model;return n&&(n.notify("cell:"+t,e),this.isNode()?n.notify("node:"+t,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&n.notify("edge:"+t,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return null==t?this.store.get():this.store.get(t,e)}setProp(t,e,n){if("string"===typeof t)this.store.set(t,e,n);else{const n=this.preprocess(t,!0);this.store.set(i.merge({},this.getProp(),n),e),this.postprocess(t)}return this}removeProp(t,e){return"string"===typeof t||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return null==t?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,n={}){return this.model&&("children"===t?this._children=e?e.map(t=>this.model.getCell(t)).filter(t=>null!=t):null:"parent"===t&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,n),this}removePropByPath(t,e={}){const n=Array.isArray(t)?t:t.split("/");return"attrs"===n[0]&&(e.dirty=!0),this.store.removeByPath(n,e),this}prop(t,e,n){return null==t?this.getProp():"string"===typeof t||Array.isArray(t)?1===arguments.length?this.getPropByPath(t):null==e?this.removePropByPath(t,n||{}):this.setPropByPath(t,e,n||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){null==t?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let n,r=e.getMaxZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0}),n.unshift(this)):n=[this],r=r-n.length+1;const i=e.total();let o=e.indexOf(this)!==i-n.length;o||(o=n.some((t,e)=>t.getZIndex()!==r+e)),o&&this.batchUpdate("to-front",()=>{r+=n.length,n.forEach((e,n)=>{e.setZIndex(r+n,t)})})}return this}toBack(t={}){const e=this.model;if(e){let n,r=e.getMinZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0}),n.unshift(this)):n=[this];let i=0!==e.indexOf(this);i||(i=n.some((t,e)=>t.getZIndex()!==r+e)),i&&this.batchUpdate("to-back",()=>{r-=n.length,n.forEach((e,n)=>{e.setZIndex(r+n,t)})})}return this}get markup(){return this.getMarkup()}set markup(t){null==t?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");if(null==t){const e=this.constructor;t=e.getMarkup()}return t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){null==t?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(null==t)this.removeAttrs(e);else{const n=t=>this.store.set("attrs",t,e);if(!0===e.overwrite)n(t);else{const r=this.getAttrs();!1===e.deep?n(Object.assign(Object.assign({},r),t)):n(i.merge({},r,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const e=this.constructor,n=e.getAttrHooks()||{};let r=n[t]||is.registry.get(t);if(!r){const e=o.camelCase(t);r=n[e]||is.registry.get(e)}return r||null}getAttrByPath(t){return null==t||""===t?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,n={}){return this.setPropByPath(this.prefixAttrPath(t),e,n),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):"attrs/"+t}attr(t,e,n){return null==t?this.getAttrByPath():"string"===typeof t||Array.isArray(t)?1===arguments.length?this.getAttrByPath(t):null==e?this.removeAttrByPath(t,n||{}):this.setAttrByPath(t,e,n||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return!1!==this.store.get("visible")}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const n="boolean"===typeof t?t:!this.isVisible(),r="boolean"===typeof t?e:t;return n?this.show(r):this.hide(r),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(null==t)this.removeData(e);else{const n=t=>this.store.set("data",t,e);if(!0===e.overwrite)n(t);else{const r=this.getData();!1===e.deep?n("object"===typeof t?Object.assign(Object.assign({},r),t):t):n(i.merge({},r,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map(t=>{var e;return null===(e=this.model)||void 0===e?void 0:e.getCell(t)}).filter(t=>null!=t);return this._children=e,[...e]}return null}hasParent(){return null!=this.parent}isParentOf(t){return null!=t&&t.getParent()===this}isChildOf(t){return null!=t&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return null==this.children?0:this.children.length}getChildIndex(t){return null==this.children?-1:this.children.indexOf(t)}getChildAt(t){return null!=this.children&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let n=this.getParent();while(n)e.push(n),n=!1!==t.deep?n.getParent():null;return e}getDescendants(t={}){if(!1!==t.deep){if(t.breadthFirst){const t=[],e=this.getChildren()||[];while(e.length>0){const n=e.shift(),r=n.getChildren();t.push(n),r&&e.push(...r)}return t}{const e=this.getChildren()||[];return e.forEach(n=>{e.push(...n.getDescendants(t))}),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(null==t)return!1;if(!1!==e.deep){let e=this.getParent();while(e){if(e===t)return!0;e=e.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return null!=t&&t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return sd.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,null!=t?this.store.set("children",t.map(t=>t.id),e):this.store.remove("children",e),this}unembed(t,e={}){const n=this.children;if(null!=n&&null!=t){const r=this.getChildIndex(t);-1!==r&&(n.splice(r,1),t.setParent(null,e),this.setChildren(n,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return sd.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,n={}){return t.insertChild(this,e,n),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,n={}){if(null!=t&&t!==this){const r=t.getParent(),i=this!==r;let o=e;if(null==o&&(o=this.getChildCount(),i||(o-=1)),r){const e=r.getChildren();if(e){const i=e.indexOf(t);i>=0&&(t.setParent(null,n),e.splice(i,1),r.setChildren(e,n))}}let a=this.children;if(null==a?(a=[],a.push(t)):a.splice(o,0,t),t.setParent(this,n),this.setChildren(a,n),i&&this.model){const t=this.model.getIncomingEdges(this),e=this.model.getOutgoingEdges(this);t&&t.forEach(t=>t.updateParent(n)),e&&e.forEach(t=>t.updateParent(n))}this.model&&this.model.addCell(t,n)}return this}removeFromParent(t={}){const e=this.getParent();if(null!=e){const n=e.getChildIndex(this);e.removeChildAt(n,t)}return this}removeChild(t,e={}){const n=this.getChildIndex(t);return this.removeChildAt(n,e)}removeChildAt(t,e={}){const n=this.getChildAt(t),r=this.children;return null!=r&&null!=n&&(this.unembed(n,e),n.remove(e)),n}remove(t={}){return this.batchUpdate("remove",()=>{const e=this.getParent();e&&e.removeChild(this,t),!1!==t.deep&&this.eachChild(e=>e.remove(t)),this.model&&this.model.removeCell(this,t)}),this}transition(t,e,n={},r="/"){return this.animation.start(t,e,n,r)}stopTransition(t,e,n="/"){return this.animation.stop(t,e,n),this}getTransitions(){return this.animation.get()}translate(t,e,n){return this}scale(t,e,n,r){return this}addTools(t,e,n){const r=Array.isArray(t)?t:[t],o="string"===typeof e?e:null,a="object"===typeof e?e:"object"===typeof n?n:{};if(a.reset)return this.setTools({name:o,items:r,local:a.local},a);let s=i.cloneDeep(this.getTools());return null==s||null==o||s.name===o?(null==s&&(s={}),s.items||(s.items=[]),s.name=o,s.items=[...s.items,...r],this.setTools(Object.assign({},s),a)):void 0}setTools(t,e={}){return null==t?this.removeTools():this.store.set("tools",sd.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return null!=e&&(null==t||e.name===t)}hasTool(t){const e=this.getTools();return null!=e&&e.items.some(e=>"string"===typeof e?e===t:e.name===t)}removeTool(t,e={}){const n=i.cloneDeep(this.getTools());if(n){let r=!1;const i=n.items.slice(),o=t=>{i.splice(t,1),r=!0};if("number"===typeof t)o(t);else for(let e=i.length-1;e>=0;e-=1){const n=i[e],r="string"===typeof n?n===t:n.name===t;r&&o(e)}r&&(n.items=i,this.setTools(n,e))}return this}getBBox(t){return new jr}getConnectionPoint(t,e){return new Dr}toJSON(t={}){const e=Object.assign({},this.store.get()),n=Object.prototype.toString,r=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const t=this.constructor;throw new Error(`Unable to serialize ${r} missing "shape" prop, check the ${r} "${t.name||n.call(t)}"`)}const o=this.constructor,a=!0===t.diff,s=e.attrs||{},l=o.getDefaults(!0),c=a?this.preprocess(l,!0):l,u=c.attrs||{},d={};Object.keys(e).forEach(t=>{const o=e[t];if(null!=o&&!Array.isArray(o)&&"object"===typeof o&&!i.isPlainObject(o))throw new Error(`Can only serialize ${r} with plain-object props, but got a "${n.call(o)}" type of key "${t}" on ${r} "${this.id}"`);if("attrs"!==t&&"shape"!==t&&a){const n=c[t];i.isEqual(o,n)&&delete e[t]}}),Object.keys(s).forEach(t=>{const e=s[t],n=u[t];Object.keys(e).forEach(r=>{const o=e[r],a=n?n[r]:null;null==o||"object"!==typeof o||Array.isArray(o)?null!=n&&i.isEqual(a,o)||(null==d[t]&&(d[t]={}),d[t][r]=o):Object.keys(o).forEach(e=>{const s=o[e];if(null==n||null==a||!i.isObject(a)||!i.isEqual(a[e],s)){null==d[t]&&(d[t]={}),null==d[t][r]&&(d[t][r]={});const n=d[t][r];n[e]=s}})})});const h=Object.assign(Object.assign({},e),{attrs:i.isEmpty(d)?void 0:d});null==h.attrs&&delete h.attrs;const p=h;return 0===p.angle&&delete p.angle,i.cloneDeep(p)}clone(t={}){if(!t.deep){const e=Object.assign({},this.store.get());t.keepId||delete e.id,delete e.parent,delete e.children;const n=this.constructor;return new n(e)}const e=sd.deepClone(this);return e[this.id]}findView(t){return t.renderer.findViewByCell(this)}startBatch(t,e={},n=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),n&&n.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},n=this.model){return n&&n.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,n){const r=this.model;this.startBatch(t,n,r);const i=e();return this.stopBatch(t,n,r),i}dispose(){this.removeFromParent(),this.store.dispose()}}sd.defaults={},sd.attrHooks={},sd.propHooks=[],od([kl.dispose()],sd.prototype,"dispose",null),function(t){function e(t){return"string"===typeof t?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}t.normalizeTools=e}(sd||(sd={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"===typeof r.isNode&&"function"===typeof r.isEdge&&"function"===typeof r.prop&&"function"===typeof r.attr}t.toStringTag="X6."+t.name,t.isCell=e}(sd||(sd={})),function(t){function e(...t){const e=t.filter(t=>null!=t).map(t=>t.getAncestors()).sort((t,e)=>t.length-e.length),n=e.shift();return n.find(t=>e.every(e=>e.includes(t)))||null}function n(t,e={}){let n=null;for(let r=0,i=t.length;r<i;r+=1){const i=t[r];let o=i.getBBox(e);if(o){if(i.isNode()){const t=i.getAngle();null!=t&&0!==t&&(o=o.bbox(t))}n=null==n?o:n.union(o)}}return n}function i(e){const n=[e,...e.getDescendants({deep:!0})];return t.cloneCells(n)}function o(t){const e=r.uniq(t),n=e.reduce((t,e)=>(t[e.id]=e.clone(),t),{});return e.forEach(t=>{const e=n[t.id];if(e.isEdge()){const t=e.getSourceCellId(),r=e.getTargetCellId();t&&n[t]&&e.setSource(Object.assign(Object.assign({},e.getSource()),{cell:n[t].id})),r&&n[r]&&e.setTarget(Object.assign(Object.assign({},e.getTarget()),{cell:n[r].id}))}const r=t.getParent();r&&n[r.id]&&e.setParent(n[r.id]);const i=t.getChildren();if(i&&i.length){const t=i.reduce((t,e)=>(n[e.id]&&t.push(n[e.id]),t),[]);t.length>0&&e.setChildren(t)}}),n}t.getCommonAncestor=e,t.getCellsBBox=n,t.deepClone=i,t.cloneCells=o}(sd||(sd={})),function(t){t.config({propHooks(e){var{tools:n}=e,r=ad(e,["tools"]);return n&&(r.tools=t.normalizeTools(n)),r}})}(sd||(sd={})),function(t){let e,n;function r(t,r){return r?null!=e&&e.exist(t):null!=n&&n.exist(t)}function i(t){e=t}function o(t){n=t}t.exist=r,t.setEdgeRegistry=i,t.setNodeRegistry=o}(id||(id={}));class ld{constructor(t){this.ports=[],this.groups={},this.init(i.cloneDeep(t))}getPorts(){return this.ports}getGroup(t){return null!=t?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter(e=>e.group===t||null==e.group&&null==t)}getPortsLayoutByGroup(t,e){const n=this.getPortsByGroup(t),r=t?this.getGroup(t):null,i=r?r.position:null,o=i?i.name:null;let a;if(null!=o){const t=Qs.registry.get(o);if(null==t)return Qs.registry.onNotFound(o);a=t}else a=Qs.presets.left;const s=n.map(t=>t&&t.position&&t.position.args||{}),l=i&&i.args||{},c=a(s,e,l);return c.map((t,r)=>{const i=n[r];return{portLayout:t,portId:i.id,portSize:i.size,portAttrs:i.attrs,labelSize:i.label.size,labelLayout:this.getPortLabelLayout(i,Dr.create(t.position),e)}})}init(t){const{groups:e,items:n}=t;null!=e&&Object.keys(e).forEach(t=>{this.groups[t]=this.parseGroup(e[t])}),Array.isArray(n)&&n.forEach(t=>{this.ports.push(this.parsePort(t))})}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),n=this.getGroup(t.group)||{};return e.markup=e.markup||n.markup,e.attrs=i.merge({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=i.merge({},n.label,this.getLabel(e)),e.zIndex=this.getZIndex(n,e),e.size=Object.assign(Object.assign({},n.size),e.size),e}getZIndex(t,e){return"number"===typeof e.zIndex?e.zIndex:"number"===typeof t.zIndex||"auto"===t.zIndex?t.zIndex:"auto"}createPosition(t,e){return i.merge({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(null==t){if(e)return{name:"left",args:{}}}else{if("string"===typeof t)return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if("object"===typeof t)return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(null==t){if(e)return{name:"left",args:{}}}else{if("string"===typeof t)return{name:t,args:{}};if("object"===typeof t)return t}return{args:{}}}getLabel(t,e=!1){const n=t.label||{};return n.position=this.getPortLabelPosition(n.position,e),n}getPortLabelLayout(t,e,n){const r=t.label.position.name||"left",i=t.label.position.args||{},o=vl.registry.get(r)||vl.presets.left;return o?o(e,n,i):null}}var cd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class ud extends sd{constructor(t={}){super(t),this.initPorts()}get[Symbol.toStringTag](){return ud.toStringTag}preprocess(t,e){const{x:n,y:r,width:i,height:o}=t,a=cd(t,["x","y","width","height"]);if(null!=n||null!=r){const t=a.position;a.position=Object.assign(Object.assign({},t),{x:null!=n?n:t?t.x:0,y:null!=r?r:t?t.y:0})}if(null!=i||null!=o){const t=a.size;a.size=Object.assign(Object.assign({},t),{width:null!=i?i:t?t.width:0,height:null!=o?o:t?t.height:0})}return super.preprocess(a,e)}isNode(){return!0}size(t,e,n){return void 0===t?this.getSize():"number"===typeof t?this.setSize(t,e,n):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,n){return"object"===typeof t?this.resize(t.width,t.height,e):this.resize(t,e,n),this}resize(t,e,n={}){this.startBatch("resize",n);const r=n.direction;if(r){const i=this.getSize();switch(r){case"left":case"right":e=i.height;break;case"top":case"bottom":t=i.width;break;default:break}const o={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3};let a=o[r];const s=Er.normalize(this.getAngle()||0);n.absolute&&(a+=Math.floor((s+45)/90),a%=4);const l=this.getBBox();let c;c=0===a?l.getBottomLeft():1===a?l.getCorner():2===a?l.getTopRight():l.getOrigin();const u=c.clone().rotate(-s,l.getCenter()),d=Math.sqrt(t*t+e*e)/2;let h=a*Math.PI/2;h+=Math.atan(a%2===0?e/t:t/e),h-=Er.toRad(s);const p=Dr.fromPolar(d,h,u),f=p.clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(f.x,f.y,n)}else this.store.set("size",{width:t,height:e},n);return this.stopBatch("resize",n),this}scale(t,e,n,r={}){const i=this.getBBox().scale(t,e,null==n?void 0:n);return this.startBatch("scale",r),this.setPosition(i.x,i.y,r),this.resize(i.width,i.height,r),this.stopBatch("scale"),this}position(t,e,n){return"number"===typeof t?this.setPosition(t,e,n):this.getPosition(t)}getPosition(t={}){if(t.relative){const t=this.getParent();if(null!=t&&t.isNode()){const e=this.getPosition(),n=t.getPosition();return{x:e.x-n.x,y:e.y-n.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,n={}){let r,i,o;if("object"===typeof t?(r=t.x,i=t.y,o=e||{}):(r=t,i=e,o=n||{}),o.relative){const t=this.getParent();if(null!=t&&t.isNode()){const e=t.getPosition();r+=e.x,i+=e.y}}if(o.deep){const t=this.getPosition();this.translate(r-t.x,i-t.y,o)}else this.store.set("position",{x:r,y:i},o);return this}translate(t=0,e=0,n={}){if(0===t&&0===e)return this;n.translateBy=n.translateBy||this.id;const r=this.getPosition();if(null!=n.restrict&&n.translateBy===this.id){const i=this.getBBox({deep:!0}),o=n.restrict,a=r.x-i.x,s=r.y-i.y,l=Math.max(o.x+a,Math.min(o.x+o.width+a-i.width,r.x+t)),c=Math.max(o.y+s,Math.min(o.y+o.height+s-i.height,r.y+e));t=l-r.x,e=c-r.y}const i={x:r.x+t,y:r.y+e};return n.tx=t,n.ty=e,n.transition?("object"!==typeof n.transition&&(n.transition={}),this.transition("position",i,Object.assign(Object.assign({},n.transition),{interp:Ol.object})),this.eachChild(r=>{var i;const o=null===(i=n.exclude)||void 0===i?void 0:i.includes(r);o||r.translate(t,e,n)})):(this.startBatch("translate",n),this.store.set("position",i,n),this.eachChild(r=>{var i;const o=null===(i=n.exclude)||void 0===i?void 0:i.includes(r);o||r.translate(t,e,n)}),this.stopBatch("translate",n)),this}angle(t,e){return null==t?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const n=this.getAngle();if(e.center){const r=this.getSize(),i=this.getPosition(),o=this.getBBox().getCenter();o.rotate(n-t,e.center);const a=o.x-r.width/2-i.x,s=o.y-r.height/2-i.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(i.x+a,i.y+s,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(n+t)%360,e);return this}getBBox(t={}){if(t.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),sd.getCellsBBox(t)}return jr.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const n=this.getBBox(),r=n.getCenter(),i=t.getTerminal(e);if(null==i)return r;const o=i.port;if(!o||!this.hasPort(o))return r;const a=this.getPort(o);if(!a||!a.group)return r;const s=this.getPortsPosition(a.group),l=s[o].position,c=Dr.create(l).translate(n.getOrigin()),u=this.getAngle();return u&&c.rotate(-u,r),c}fit(t={}){const e=this.getChildren()||[],n=e.filter(t=>t.isNode());if(0===n.length)return this;this.startBatch("fit-embeds",t),t.deep&&n.forEach(e=>e.fit(t));let{x:r,y:i,width:o,height:s}=sd.getCellsBBox(n);const l=a.normalizeSides(t.padding);return r-=l.left,i-=l.top,o+=l.left+l.right,s+=l.bottom+l.top,this.store.set({position:{x:r,y:i},size:{width:o,height:s}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Vl.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",Vl.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Vl.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",Vl.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Vl.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",Vl.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return null==t.items&&(t.items=[]),t}getPorts(){return i.cloneDeep(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter(e=>e.group===t)}getPort(t){return i.cloneDeep(this.ports.items.find(e=>e.id&&e.id===t))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return-1!==this.getPortIndex(t)}getPortIndex(t){const e="string"===typeof t?t:t.id;return null!=e?this.ports.items.findIndex(t=>t.id===e):-1}getPortsPosition(t){const e=this.getSize(),n=this.port.getPortsLayoutByGroup(t,new jr(0,0,e.width,e.height));return n.reduce((t,e)=>{const n=e.portLayout;return t[e.portId]={position:Object.assign({},n.position),angle:n.angle||0},t},{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,n,r){if("string"===typeof e||Array.isArray(e)){const i=this.prefixPortPath(t,e),o=n;return this.setPropByPath(i,o,r)}const i=this.prefixPortPath(t),o=e;return this.setPropByPath(i,o,n)}removePortProp(t,e,n){return"string"===typeof e||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),n):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,n,r){return null==e?this.getPortProp(t):"string"===typeof e||Array.isArray(e)?2===arguments.length?this.getPortProp(t,e):null==n?this.removePortProp(t,e,r):this.setPortProp(t,e,n,r):this.setPortProp(t,e,n)}prefixPortPath(t,e){const n=this.getPortIndex(t);if(-1===n)throw new Error(`Unable to find port with id: "${t}"`);return null==e||""===e?["ports","items",""+n]:Array.isArray(e)?["ports","items",""+n,...e]:`ports/items/${n}/${e}`}addPort(t,e){const n=[...this.ports.items];return n.push(t),this.setPropByPath("ports/items",n,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,n){const r=[...this.ports.items];return r.splice(t,0,e),this.setPropByPath("ports/items",r,n),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const n=[...this.ports.items];n.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",n,e)}return this}removePorts(t,e){let n;if(Array.isArray(t)){if(n=e||{},t.length){n.rewrite=!0;const e=[...this.ports.items],r=e.filter(e=>!t.some(t=>{const n="string"===typeof t?t:t.id;return e.id===n}));this.setPropByPath("ports/items",r,n)}}else n=t||{},n.rewrite=!0,this.setPropByPath("ports/items",[],n);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const t=this.ports,e={};t.items.forEach(t=>{t.id&&(e[t.id]=!0)});const n={},r=this.store.getPrevious("ports")||{items:[]};r.items.forEach(t=>{t.id&&!e[t.id]&&(n[t.id]=!0)});const o=this.model;if(o&&!i.isEmpty(n)){const t=o.getConnectedEdges(this,{incoming:!0});t.forEach(t=>{const e=t.getTargetPortId();e&&n[e]&&t.remove()});const e=o.getConnectedEdges(this,{outgoing:!0});e.forEach(t=>{const e=t.getSourcePortId();e&&n[e]&&t.remove()})}}validatePorts(){const t={},e=[];return this.ports.items.forEach(n=>{"object"!==typeof n&&e.push(`Invalid port ${n}.`),null==n.id&&(n.id=this.generatePortId()),t[n.id]&&e.push("Duplicitied port id."),t[n.id]=!0}),e}generatePortId(){return o.uuid()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new ld(this.ports);const n=this.port.getPorts(),r=e?n.filter(t=>e.find(e=>e.id===t.id)?null:t):[...n],i=e?e.filter(t=>n.find(e=>e.id===t.id)?null:t):[];r.length>0&&this.notify("ports:added",{added:r,cell:this,node:this}),i.length>0&&this.notify("ports:removed",{removed:i,cell:this,node:this})}}ud.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"===typeof r.isNode&&"function"===typeof r.isEdge&&"function"===typeof r.prop&&"function"===typeof r.attr&&"function"===typeof r.size&&"function"===typeof r.position}t.toStringTag="X6."+t.name,t.isNode=e}(ud||(ud={})),function(t){t.config({propHooks(t){var{ports:e}=t,n=cd(t,["ports"]);return e&&(n.ports=Array.isArray(e)?{items:e}:e),n}})}(ud||(ud={})),function(t){t.registry=Eo.create({type:"node",process(e,n){if(id.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if("function"===typeof n)return n.config({shape:e}),n;let r=t;const{inherit:i}=n,o=cd(n,["inherit"]);if(i)if("string"===typeof i){const t=this.get(i);null==t?this.onNotFound(i,"inherited"):r=t}else r=i;null==o.constructorName&&(o.constructorName=e);const a=r.define.call(r,o);return a.config({shape:e}),a}}),id.setNodeRegistry(t.registry)}(ud||(ud={})),function(t){let e=0;function n(t){return t?o.pascalCase(t):(e+=1,"CustomNode"+e)}function r(e){const{constructorName:r,overwrite:o}=e,a=cd(e,["constructorName","overwrite"]),s=i.createClass(n(r||a.shape),this);return s.config(a),a.shape&&t.registry.register(a.shape,s,o),s}function a(e){const n=e.shape||"rect",r=t.registry.get(n);return r?new r(e):t.registry.onNotFound(n)}t.define=r,t.create=a}(ud||(ud={}));var dd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class hd extends ud{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return null==t?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}}(function(t){t.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},t.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},t.config({attrs:{text:Object.assign({},t.labelAttr)},propHooks(t){const{label:e}=t,n=dd(t,["label"]);return e&&i.setByPath(n,"attrs/text/text",e),n},visible:!0})})(hd||(hd={}));var pd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function fd(t,e=!1){return`<g class="rotatable"><g class="scalable"><${t}/></g>${e?"":"<text/>"}</g>`}function gd(t){return"basic."+t}function md(t="xlink:href"){const e=e=>{const{imageUrl:n,imageWidth:r,imageHeight:i}=e,o=pd(e,["imageUrl","imageWidth","imageHeight"]);if(null!=n||null!=r||null!=i){const e=()=>{if(o.attrs){const e=o.attrs.image;null!=n&&(e[t]=n),null!=r&&(e.width=r),null!=i&&(e.height=i),o.attrs.image=e}};o.attrs?(null==o.attrs.image&&(o.attrs.image={}),e()):(o.attrs={image:{}},e())}return o};return e}function vd(t,e,n={}){const r=gd(t),o={constructorName:r,attrs:{".":{fill:"#ffffff",stroke:"none"},[t]:{fill:"#ffffff",stroke:"#000000"}}};n.ignoreMarkup||(o.markup=fd(t,!0===n.noText));const a=n.parent||hd;return a.define(i.merge(o,e,{shape:r}))}vd("rect",{attrs:{rect:{width:100,height:60}}}),vd("circle",{width:60,height:60,attrs:{circle:{r:30,cx:30,cy:30}}}),vd("ellipse",{width:60,height:40,attrs:{ellipse:{rx:30,ry:20,cx:30,cy:20}}}),vd("polygon",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),vd("polyline",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),vd("image",{attrs:{text:{refY:null,refDy:16}},propHooks:md()});var bd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const yd=vd("path",{width:60,height:60,attrs:{text:{ref:"path",refY:null,refDy:16}},propHooks(t){const{d:e}=t,n=bd(t,["d"]);return null!=e&&i.setByPath(n,"attrs/path/d",e),n}});vd("rhombus",{d:"M 30 0 L 60 30 30 60 0 30 z",attrs:{text:{refY:.5,refDy:null}}},{parent:yd,ignoreMarkup:!0}),vd("cylinder",{width:40,height:40,attrs:{path:{fill:"#FFFFFF",stroke:"#cbd2d7",strokeWidth:3,d:["M 0 10 C 10 5, 30 5, 40 10 C 30 15, 10 15, 0 10","L 0 20","C 10 25, 30 25, 40 20","L 40 10"].join(" ")},text:{refY:.7,refDy:null,fill:"#435460"}}},{parent:yd,ignoreMarkup:!0});var wd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class xd extends sd{constructor(t={}){super(t)}get[Symbol.toStringTag](){return xd.toStringTag}preprocess(t,e){const{source:n,sourceCell:r,sourcePort:i,sourcePoint:o,target:a,targetCell:s,targetPort:l,targetPoint:c}=t,u=wd(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),d=u,h=t=>"string"===typeof t||"number"===typeof t;if(null!=n)if(sd.isCell(n))d.source={cell:n.id};else if(h(n))d.source={cell:n};else if(Dr.isPoint(n))d.source=n.toJSON();else if(Array.isArray(n))d.source={x:n[0],y:n[1]};else{const t=n.cell;sd.isCell(t)?d.source=Object.assign(Object.assign({},n),{cell:t.id}):d.source=n}if(null!=r||null!=i){let t=d.source;if(null!=r){const e=h(r)?r:r.id;t?t.cell=e:t=d.source={cell:e}}null!=i&&t&&(t.port=i)}else null!=o&&(d.source=Dr.create(o).toJSON());if(null!=a)if(sd.isCell(a))d.target={cell:a.id};else if(h(a))d.target={cell:a};else if(Dr.isPoint(a))d.target=a.toJSON();else if(Array.isArray(a))d.target={x:a[0],y:a[1]};else{const t=a.cell;sd.isCell(t)?d.target=Object.assign(Object.assign({},a),{cell:t.id}):d.target=a}if(null!=s||null!=l){let t=d.target;if(null!=s){const e=h(s)?s:s.id;t?t.cell=e:t=d.target={cell:e}}null!=l&&t&&(t.port=l)}else null!=c&&(d.target=Dr.create(c).toJSON());return super.preprocess(d,e)}setup(){super.setup(),this.on("change:labels",t=>this.onLabelsChanged(t)),this.on("change:vertices",t=>this.onVertexsChanged(t))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,n={}){return this.setTerminal("source",t,e,n)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,n={}){return this.setTerminal("target",t,e,n)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,n,r={}){if(sd.isCell(e))return this.store.set(t,i.merge({},n,{cell:e.id}),r),this;const o=e;return Dr.isPoint(e)||null!=o.x&&null!=o.y?(this.store.set(t,i.merge({},n,{x:o.x,y:o.y}),r),this):(this.store.set(t,i.cloneDeep(e),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(Dr.isPointLike(e))return Dr.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new Dr}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e="source"===t?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const n={};while(e&&e.isEdge()){if(n[e.id])return null;n[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){null==t?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,n){return"object"===typeof t?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},n),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){null==t?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,n){return"object"===typeof t?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},n),this}removeConnector(t={}){return this.store.remove("connector",t)}get strategy(){return this.getStrategy()}set strategy(t){null==t?this.removeStrategy():this.setStrategy(t)}getStrategy(){return this.store.get("strategy")}setStrategy(t,e,n){return"object"===typeof t?this.store.set("strategy",t,e):this.store.set("strategy",{name:t,args:e},n),this}removeStrategy(t={}){return this.store.remove("strategy",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return i.cloneDeep(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map(t=>this.parseLabel(t))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,n={}){const r=this.getLabels(),i=r.length;let o=null!=e&&Number.isFinite(e)?e:i;return o<0&&(o=i+o+1),r.splice(o,0,this.parseLabel(t)),this.setLabels(r,n)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return null!=t&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,n={}){if(null!=t&&Number.isFinite(t)){const r=this.getLabels();r[t]=this.parseLabel(e),this.setLabels(r,n)}return this}removeLabelAt(t,e={}){const n=this.getLabels(),r=null!=t&&Number.isFinite(t)?t:-1,i=n.splice(r,1);return this.setLabels(n,e),i.length?i[0]:null}parseLabel(t){if("string"===typeof t){const e=this.constructor;return e.parseStringLabel(t)}return t}onLabelsChanged({previous:t,current:e}){const n=t&&e?e.filter(e=>t.find(t=>e===t||i.isEqual(e,t))?null:e):e?[...e]:[],r=t&&e?t.filter(t=>e.find(e=>t===e||i.isEqual(t,e))?null:t):t?[...t]:[];n.length>0&&this.notify("labels:added",{added:n,cell:this,edge:this}),r.length>0&&this.notify("labels:removed",{removed:r,cell:this,edge:this})}get vertexMarkup(){return this.getVertexMarkup()}set vertexMarkup(t){this.setVertexMarkup(t)}getDefaultVertexMarkup(){return this.store.get("defaultVertexMarkup")||Vl.getEdgeVertexMarkup()}getVertexMarkup(){return this.store.get("vertexMarkup")||this.getDefaultVertexMarkup()}setVertexMarkup(t,e={}){return this.store.set("vertexMarkup",Vl.clone(t),e),this}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const n=Array.isArray(t)?t:[t];return this.store.set("vertices",n.map(t=>Dr.toJSON(t)),e),this}insertVertex(t,e,n={}){const r=this.getVertices(),i=r.length;let o=null!=e&&Number.isFinite(e)?e:i;return o<0&&(o=i+o+1),r.splice(o,0,Dr.toJSON(t)),this.setVertices(r,n)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){if(null!=t&&Number.isFinite(t)){const e=this.getVertices();return e[t]}return null}setVertexAt(t,e,n={}){if(null!=t&&Number.isFinite(t)){const r=this.getVertices();r[t]=e,this.setVertices(r,n)}return this}removeVertexAt(t,e={}){const n=this.getVertices(),r=null!=t&&Number.isFinite(t)?t:-1;return n.splice(r,1),this.setVertices(n,e)}onVertexsChanged({previous:t,current:e}){const n=t&&e?e.filter(e=>t.find(t=>Dr.equals(e,t))?null:e):e?[...e]:[],r=t&&e?t.filter(t=>e.find(e=>Dr.equals(t,e))?null:t):t?[...t]:[];n.length>0&&this.notify("vertexs:added",{added:n,cell:this,edge:this}),r.length>0&&this.notify("vertexs:removed",{removed:r,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||Vl.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}get toolMarkup(){return this.getToolMarkup()}set toolMarkup(t){this.setToolMarkup(t)}getDefaultToolMarkup(){return this.store.get("defaultToolMarkup")||Vl.getEdgeToolMarkup()}getToolMarkup(){return this.store.get("toolMarkup")||this.getDefaultToolMarkup()}setToolMarkup(t,e={}){return this.store.set("toolMarkup",t,e),this}get doubleToolMarkup(){return this.getDoubleToolMarkup()}set doubleToolMarkup(t){this.setDoubleToolMarkup(t)}getDefaultDoubleToolMarkup(){return this.store.get("defaultDoubleToolMarkup")}getDoubleToolMarkup(){return this.store.get("doubleToolMarkup")||this.getDefaultDoubleToolMarkup()}setDoubleToolMarkup(t,e={}){return this.store.set("doubleToolMarkup",t,e),this}get arrowheadMarkup(){return this.getArrowheadMarkup()}set arrowheadMarkup(t){this.setArrowheadMarkup(t)}getDefaultArrowheadMarkup(){return this.store.get("defaultArrowheadMarkup")||Vl.getEdgeArrowheadMarkup()}getArrowheadMarkup(){return this.store.get("arrowheadMarkup")||this.getDefaultArrowheadMarkup()}setArrowheadMarkup(t,e={}){return this.store.set("arrowheadMarkup",t,e),this}translate(t,e,n={}){return n.translateBy=n.translateBy||this.id,n.tx=t,n.ty=e,this.applyToPoints(n=>({x:(n.x||0)+t,y:(n.y||0)+e}),n)}scale(t,e,n,r={}){return this.applyToPoints(r=>Dr.create(r).scale(t,e,n).toJSON(),r)}applyToPoints(t,e={}){const n={},r=this.getSource(),i=this.getTarget();Dr.isPointLike(r)&&(n.source=t(r)),Dr.isPointLike(i)&&(n.target=t(i));const o=this.getVertices();return o.length>0&&(n.vertices=o.map(t)),this.store.set(n,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map(t=>Dr.create(t)),this.getTargetPoint()];return new Fr(t)}updateParent(t){let e=null;const n=this.getSourceCell(),r=this.getTargetCell(),i=this.getParent();return n&&r&&(e=n===r||n.isDescendantOf(r)?r:r.isDescendantOf(n)?n:sd.getCommonAncestor(n,r)),!i||e&&e.id===i.id||i.unembed(this,t),e&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),n=this.getTarget(),r=e.cell,i=n.cell;if(!r||!i)return!1;let o=r===i;if(!o&&t.deep&&this._model){const e=this.getSourceCell(),n=this.getTargetCell();e&&n&&(o=e.isAncestorOf(n,t)||n.isAncestorOf(e,t))}return o}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>null!=t);return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}}xd.defaults={},function(t){function e(t,e){const n=t,r=e;return n.cell===r.cell&&(n.port===r.port||null==n.port&&null==r.port)}t.equalTerminals=e}(xd||(xd={})),function(t){function e(t){return{attrs:{label:{text:t}}}}t.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}},t.parseStringLabel=e}(xd||(xd={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"===typeof r.isNode&&"function"===typeof r.isEdge&&"function"===typeof r.prop&&"function"===typeof r.attr&&"function"===typeof r.disconnect&&"function"===typeof r.getSource&&"function"===typeof r.getTarget}t.toStringTag="X6."+t.name,t.isEdge=e}(xd||(xd={})),function(t){t.registry=Eo.create({type:"edge",process(e,n){if(id.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if("function"===typeof n)return n.config({shape:e}),n;let r=t;const{inherit:i="edge"}=n,o=wd(n,["inherit"]);if("string"===typeof i){const t=this.get(i||"edge");null==t&&i?this.onNotFound(i,"inherited"):r=t}else r=i;null==o.constructorName&&(o.constructorName=e);const a=r.define.call(r,o);return a.config({shape:e}),a}}),id.setEdgeRegistry(t.registry)}(xd||(xd={})),function(t){let e=0;function n(t){return t?o.pascalCase(t):(e+=1,"CustomEdge"+e)}function r(e){const{constructorName:r,overwrite:o}=e,a=wd(e,["constructorName","overwrite"]),s=i.createClass(n(r||a.shape),this);return s.config(a),a.shape&&t.registry.register(a.shape,s,o),s}function a(e){const n=e.shape||"edge",r=t.registry.get(n);return r?new r(e):t.registry.onNotFound(n)}t.define=r,t.create=a}(xd||(xd={})),function(t){const e="basic.edge";t.config({shape:e,propHooks(e){const{label:n,vertices:r}=e,i=wd(e,["label","vertices"]);if(n){null==i.labels&&(i.labels=[]);const e="string"===typeof n?t.parseStringLabel(n):n;i.labels.push(e)}return r&&Array.isArray(r)&&(i.vertices=r.map(t=>Dr.create(t).toJSON())),i}}),t.registry.register(e,t)}(xd||(xd={}));var Cd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class kd extends Gl{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.markerCache={}}get[Symbol.toStringTag](){return kd.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const t=this.cell.getSource();return new jr(t.x,t.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new jr(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const t=this.cell.getTarget();return new jr(t.x,t.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new jr(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let n=t;if(this.hasAction(n,"source")){if(!this.updateTerminalProperties("source"))return n;n=this.removeAction(n,"source")}if(this.hasAction(n,"target")){if(!this.updateTerminalProperties("target"))return n;n=this.removeAction(n,"target")}const r=this.graph,i=this.sourceView,o=this.targetView;return r&&(i&&!r.renderer.isViewMounted(i)||o&&!r.renderer.isViewMounted(o))?n:this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","vertices","labels","tools","widget"]),n):(n=this.handleAction(n,"vertices",()=>this.renderVertexMarkers()),n=this.handleAction(n,"update",()=>this.update(null,e)),n=this.handleAction(n,"labels",()=>this.onLabelsChange(e)),n=this.handleAction(n,"tools",()=>{this.renderTools(),this.updateToolsPosition()}),n=this.handleAction(n,"widget",()=>this.renderExternalTools()),n)}onLabelsChange(t={}){this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(null==e)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const n=t.propertyPathArray||[],r=n.length;if(r>1){const o=n[1];if(e[o]){if(2===r)return"object"===typeof t.propertyValue&&i.has(t.propertyValue,"markup");if("markup"!==n[2])return!1}}}return!0}render(){return this.empty(),this.containers={},this.renderMarkup(),this.renderLabels(),this.update(),this.renderExternalTools(),this}renderMarkup(){const t=this.cell.markup;if(t)return"string"===typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}renderStringMarkup(t){const e=this.containers,n=ai.createVectors(t);n.forEach(t=>{const n=t.attr("class");n&&(e[o.camelCase(n)]=t.node)}),this.renderTools(),this.renderVertexMarkers(),this.renderArrowheadMarkers(),c.append(this.container,n.map(t=>t.node))}renderLabels(){const t=this.cell,e=t.getLabels(),n=e.length;let r=this.containers.labels;if(this.labelCache={},this.labelSelectors={},n<=0)return r&&r.parentNode&&r.parentNode.removeChild(r),this;r?this.empty(r):(r=c.createSvgElement("g"),this.addClass(this.prefixClassName("edge-labels"),r),this.containers.labels=r);for(let i=0,o=e.length;i<o;i+=1){const n=e[i],o=this.normalizeLabelMarkup(this.parseLabelMarkup(n.markup));let a,s;if(o)a=o.node,s=o.selectors;else{const e=t.getDefaultLabel(),n=this.normalizeLabelMarkup(this.parseLabelMarkup(e.markup));a=n.node,s=n.selectors}a.setAttribute("data-index",""+i),r.appendChild(a);const l=this.rootSelector;if(s[l])throw new Error("Ambiguous label root selector.");s[l]=a,this.labelCache[i]=a,this.labelSelectors[i]=s}return null==r.parentNode&&this.container.appendChild(r),this.updateLabels(),this.customizeLabels(),this}parseLabelMarkup(t){return t?"string"===typeof t?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=ai.createVectors(t),n=document.createDocumentFragment();for(let r=0,i=e.length;r<i;r+=1){const t=e[r].node;n.appendChild(t)}return{fragment:n,selectors:{}}}normalizeLabelMarkup(t){if(null==t)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let n;const r=e.childNodes;return n=r.length>1||"G"!==r[0].nodeName.toUpperCase()?ai.create("g").append(e):ai.create(r[0]),n.addClass(this.prefixClassName("edge-label")),{node:n.node,selectors:t.selectors}}updateLabels(){if(this.containers.labels){const t=this.cell,e=t.labels,n=this.can("edgeLabelMovable"),r=t.getDefaultLabel();for(let o=0,a=e.length;o<a;o+=1){const t=this.labelCache[o],a=this.labelSelectors[o];t.setAttribute("cursor",n?"move":"default");const s=e[o],l=i.merge({},r.attrs,s.attrs);this.updateAttrs(t,l,{selectors:a,rootBBox:s.size?jr.fromSize(s.size):void 0})}}}mergeLabelAttrs(t,e,n){if(null===e)return null;if(void 0===e){if(null===n)return null;if(void 0===n)return;return t?n:i.merge({},n)}return t?i.merge({},n,e):void 0}customizeLabels(){if(this.containers.labels){const t=this.cell,e=t.labels;for(let n=0,r=e.length;n<r;n+=1){const r=e[n],i=this.labelCache[n],o=this.labelSelectors[n];this.graph.hook.onEdgeLabelRendered({edge:t,label:r,container:i,selectors:o})}}}renderTools(){const t=this.containers.tools;if(null==t)return this;const e=this.cell.toolMarkup,n=this.$(t).empty();if(Vl.isStringMarkup(e)){let t=o.template(e);const r=ai.create(t());if(n.append(r.node),this.toolCache=r.node,this.options.doubleTools){let e;const i=this.cell.doubleToolMarkup;Vl.isStringMarkup(i)?(t=o.template(i),e=ai.create(t())):e=r.clone(),n.append(e.node),this.tool2Cache=e.node}}return this}renderExternalTools(){const t=this.cell.getTools();return this.addTools(t),this}renderVertexMarkers(){const t=this.containers.vertices;if(null==t)return this;const e=this.cell.vertexMarkup,n=this.$(t).empty();if(Vl.isStringMarkup(e)){const t=o.template(e);this.cell.getVertices().forEach((e,r)=>{n.append(ai.create(t(Object.assign({index:r},e))).node)})}return this}renderArrowheadMarkers(){const t=this.containers.arrowheads;if(null==t)return this;const e=this.cell.arrowheadMarkup,n=this.$(t).empty();if(Vl.isStringMarkup(e)){const t=o.template(e),r=ai.create(t({end:"source"})).node,i=ai.create(t({end:"target"})).node;this.containers.sourceArrowhead=r,this.containers.targetArrowhead=i,n.append(r,i)}return this}update(t,e={}){this.cleanCache(),this.updateConnection(e);const n=this.cell.getAttrs();return null!=n&&this.updateAttrs(this.container,n,{attrs:t===n?null:t,selectors:this.selectors}),this.updateConnectionPath(),this.updateLabelPositions(),this.updateToolsPosition(),this.updateArrowheadMarkers(),this.updateTools(e),this}removeRedundantLinearVertices(t={}){const e=this.cell,n=e.getVertices(),r=[this.sourceAnchor,...n,this.targetAnchor],i=r.length,o=new Fr(r);o.simplify({threshold:.01});const a=o.points.map(t=>t.toJSON()),s=a.length;return i===s?0:(e.setVertices(a.slice(1,s-1),t),i-s)}updateConnectionPath(){const t=this.containers;if(t.connection){const e=this.getConnectionPathData();t.connection.setAttribute("d",e)}if(t.connectionWrap){const e=this.getConnectionPathData();t.connectionWrap.setAttribute("d",e)}t.sourceMarker&&t.targetMarker&&this.translateAndAutoOrientArrows(t.sourceMarker,t.targetMarker)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return Dr.create(this.sourceAnchor);case"target":return Dr.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return Dr.create(this.sourcePoint);case"target":return Dr.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const t=this.sourceView;return t?this.sourceMagnet||t.container:null}case"target":{if(e.raw)return this.targetMagnet;const t=this.targetView;return t?this.targetMagnet||t.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const e=t.tx||0,n=t.ty||0;this.routePoints=new Fr(this.routePoints).translate(e,n).points,this.translateConnectionPoints(e,n),this.path.translate(e,n)}else{const t=e.getVertices(),n=this.findAnchors(t);this.sourceAnchor=n.source,this.targetAnchor=n.target,this.routePoints=this.findRoutePoints(t);const r=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=r.source,this.targetPoint=r.target;const i=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,i.source||this.sourcePoint,i.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,n=e.source,r=e.target,i=t[0],o=t[t.length-1];return r.priority&&!n.priority?this.findAnchorsOrdered("target",o,"source",i):this.findAnchorsOrdered("source",i,"target",o)}findAnchorsOrdered(t,e,n,r){let i,o;const a=this.cell,s=a[t],l=a[n],c=this.getTerminalView(t),u=this.getTerminalView(n),d=this.getTerminalMagnet(t),h=this.getTerminalMagnet(n);if(c){let n;n=e?Dr.create(e):u?h:Dr.create(l),i=this.getAnchor(s.anchor,c,d,n,t)}else i=Dr.create(s);if(u){const t=Dr.create(r||i);o=this.getAnchor(l.anchor,u,h,t,n)}else o=Dr.isPointLike(l)?Dr.create(l):new Dr;return{[t]:i,[n]:o}}getAnchor(t,e,n,r,i){const o=e.isEdgeElement(n),a=this.graph.options.connecting;let l,c="string"===typeof t?{name:t}:t;if(!c){const t=o?("source"===i?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:("source"===i?a.sourceAnchor:a.targetAnchor)||a.anchor;c="string"===typeof t?{name:t}:t}if(!c)throw new Error("Anchor should be specified.");const u=c.name;if(o){const t=Rc.registry.get(u);if("function"!==typeof t)return Rc.registry.onNotFound(u);l=s.call(t,this,e,n,r,c.args||{},i)}else{const t=Mc.registry.get(u);if("function"!==typeof t)return Mc.registry.onNotFound(u);l=s.call(t,this,e,n,r,c.args||{},i)}return l?l.round(this.POINT_ROUNDING):new Dr}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||Iu.presets.normal,n=this.cell.getRouter()||e;let r;if("function"===typeof n)r=s.call(n,this,t,{},this);else{const e="string"===typeof n?n:n.name,i="string"===typeof n?{}:n.args||{},o=e?Iu.registry.get(e):Iu.presets.normal;if("function"!==typeof o)return Iu.registry.onNotFound(e);r=s.call(o,this,t,i,this)}return null==r?t.map(t=>Dr.create(t)):r.map(t=>Dr.create(t))}findConnectionPoints(t,e,n){const r=this.cell,i=this.graph.options.connecting,o=r.getSource(),a=r.getTarget(),s=this.sourceView,l=this.targetView,c=t[0],u=t[t.length-1];let d,h;if(s&&!s.isEdgeElement(this.sourceMagnet)){const t=this.sourceMagnet||s.container,r=c||n,a=new Ir(r,e),l=o.connectionPoint||i.sourceConnectionPoint||i.connectionPoint;d=this.getConnectionPoint(l,s,t,a,"source")}else d=e;if(l&&!l.isEdgeElement(this.targetMagnet)){const t=this.targetMagnet||l.container,r=a.connectionPoint||i.targetConnectionPoint||i.connectionPoint,o=u||e,s=new Ir(o,n);h=this.getConnectionPoint(r,l,t,s,"target")}else h=n;return{source:d,target:h}}getConnectionPoint(t,e,n,r,i){const o=r.end;if(null==t)return o;const a="string"===typeof t?t:t.name,l="string"===typeof t?{}:t.args,c=$c.registry.get(a);if("function"!==typeof c)return $c.registry.onNotFound(a);const u=s.call(c,this,r,e,n,l||{},i);return u?u.round(this.POINT_ROUNDING):o}updateMarkerAttr(t){const e=this.cell.getAttrs(),n=`.${t}-marker`,r=e&&e[n];r&&this.updateAttrs(this.container,{},{attrs:{[n]:r},selectors:this.selectors})}findMarkerPoints(t,e,n){const r=t=>{const e=this.cell.getAttrs(),n=Object.keys(e);for(let r=0,i=n.length;r<i;r+=1){const i=e[n[r]];if(i[t+"Marker"]||i[t+"-marker"]){const t=i.strokeWidth||i["stroke-width"];if(t)return parseFloat(t);break}}return null},i=t[0],o=t[t.length-1],a=this.containers.sourceMarker,s=this.containers.targetMarker,l=this.markerCache;let u,d;if(a){if(this.updateMarkerAttr("source"),l.sourceBBox=l.sourceBBox||c.getBBox(a),l.sourceBBox.width>0){const t=c.scale(a);u=e.clone().move(i||n,l.sourceBBox.width*t.sx*-1)}}else{const t=r("source");t&&(u=e.clone().move(i||n,-t))}if(s){if(this.updateMarkerAttr("target"),l.targetBBox=l.targetBBox||c.getBBox(s),l.targetBBox.width>0){const t=c.scale(s);d=n.clone().move(o||e,l.targetBBox.width*t.sx*-1)}}else{const t=r("target");t&&(d=n.clone().move(o||e,-t))}return l.sourcePoint=u||e.clone(),l.targetPoint=d||n.clone(),{source:u,target:d}}findPath(t,e,n){const r=this.cell.getConnector()||this.graph.options.connecting.connector;let i,o,a;if("string"===typeof r?i=r:(i=r.name,o=r.args),i){const t=td.registry.get(i);if("function"!==typeof t)return td.registry.onNotFound(i);a=t}else a=td.presets.normal;const l=s.call(a,this,e,n,t,Object.assign(Object.assign({},o),{raw:!0}),this);return"string"===typeof l?oi.parse(l):l}translateConnectionPoints(t,e){const n=this.markerCache;n.sourcePoint&&n.sourcePoint.translate(t,e),n.targetPoint&&n.targetPoint.translate(t,e),this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e)}updateLabelPositions(){if(null==this.containers.labels)return this;const t=this.path;if(!t)return this;const e=this.cell,n=e.getLabels();if(0===n.length)return this;const r=e.getDefaultLabel(),o=this.normalizeLabelPosition(r.position);for(let a=0,s=n.length;a<s;a+=1){const t=n[a],e=this.normalizeLabelPosition(t.position),r=i.merge({},o,e),s=this.getLabelTransformationMatrix(r);this.labelCache[a].setAttribute("transform",c.matrixToTransformString(s))}return this}updateToolsPosition(){if(null==this.containers.tools)return this;let t="",e=this.options.toolsOffset;const n=this.getConnectionLength();if(null!=n){n<this.options.shortLength&&(t="scale(.5)",e/=2);let r=this.getPointAtLength(e);if(null!=r&&c.attr(this.toolCache,"transform",`translate(${r.x},${r.y}) ${t}`),this.options.doubleTools&&n>=this.options.longLength){const i=this.options.doubleToolsOffset||e;r=this.getPointAtLength(n-i),null!=r&&c.attr(this.tool2Cache,"transform",`translate(${r.x},${r.y}) ${t}`),c.attr(this.tool2Cache,"visibility","visible")}else this.options.doubleTools&&c.attr(this.tool2Cache,"visibility","hidden")}return this}updateArrowheadMarkers(){const t=this.containers.arrowheads;if(null==t)return this;if("none"===t.style.display)return this;const e=this.containers.sourceArrowhead,n=this.containers.targetArrowhead;if(e&&n){const t=this.getConnectionLength()||0,r=t<this.options.shortLength?.5:1;c.scale(e,r),c.scale(n,r),this.translateAndAutoOrientArrows(e,n)}return this}updateTerminalProperties(t){const e=this.cell,n=this.graph,r=e[t],i=r&&r.cell,o=t+"View";if(!i)return this[o]=null,this.updateTerminalMagnet(t),!0;const a=n.getCellById(i);if(!a)throw new Error(`Edge's ${t} node with id "${i}" not exists`);const s=a.findView(n);return!!s&&(this[o]=s,this.updateTerminalMagnet(t),!0)}updateTerminalMagnet(t){const e=t+"Magnet",n=this.getTerminalView(t);if(n){let r=n.getMagnetFromEdgeTerminal(this.cell[t]);r===n.container&&(r=null),this[e]=r}else this[e]=null}translateAndAutoOrientArrows(t,e){const n=this.routePoints;t&&c.translateAndAutoOrient(t,this.sourcePoint,n[0]||this.targetPoint,this.graph.view.stage),e&&c.translateAndAutoOrient(e,this.targetPoint,n[n.length-1]||this.sourcePoint,this.graph.view.stage)}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&"object"===typeof e.position&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&"object"===typeof e.position)return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&"object"===typeof t.position)return t.position.options}mergeLabelPositionArgs(t,e){return null===t?null:void 0===t?null===e?null:e:i.merge({},e,t)}addLabel(t,e,n,r){let i,o,a,s=0;"number"!==typeof t?(i=t.x,o=t.y,"number"===typeof e?(s=e,a=n):a=e):(i=t,o=e,"number"===typeof n?(s=n,a=r):a=n);const l=this.getDefaultLabelPositionArgs(),c=a,u=this.mergeLabelPositionArgs(c,l),d={position:this.getLabelPosition(i,o,s,u)},h=-1;return this.cell.insertLabel(d,h,a),h}addVertex(t,e,n){const r="number"!==typeof t,i=r?t.x:t,o=r?t.y:e,a=r?e:n,s={x:i,y:o},l=this.getVertexIndex(i,o);return this.cell.insertVertex(s,l,a),l}sendToken(t,e,n){let r,i,o,a,s="linear";"object"===typeof e?(r=e.duration,i=!0===e.reversed,o=e.selector,!1===e.rotate?a="":!0===e.rotate?a="auto":null!=e.rotate&&(a=""+e.rotate),e.timing&&(s=e.timing)):(r=e,i=!1,o=null),r=r||1e3;const l={dur:r+"ms",repeatCount:"1",calcMode:s,fill:"freeze"};if(a&&(l.rotate=a),i&&(l.keyPoints="1;0",l.keyTimes="0;1"),"object"===typeof e){const{duration:t,reversed:n,selector:r,rotate:i,timing:o}=e,a=Cd(e,["duration","reversed","selector","rotate","timing"]);Object.keys(a).forEach(t=>{l[t]=a[t]})}let u;if(u="string"===typeof o?this.findOne(o,this.container,this.selectors):this.containers.connection?this.containers.connection:this.container.querySelector("path"),!(u instanceof SVGPathElement))throw new Error("Token animation requires a valid connection path.");const d="string"===typeof t?this.findOne(t):t;if(null==d)throw new Error("Token animation requires a valid token element.");const h=d.parentNode,p=()=>{h||c.remove(d)},f=ai.create(d);h||f.appendTo(this.graph.view.stage);const g=l.complete;l.complete=t=>{p(),n&&n(),g&&g(t)};const m=f.animateAlongPath(l,u);return()=>{p(),m()}}getConnection(){return null!=this.path?this.path.clone():null}getConnectionPathData(){if(null==this.path)return"";const t=this.cache.pathCache;return i.has(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(null==this.path)return null;const t=this.cache.pathCache;return i.has(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(null==this.path)return 0;const t=this.cache.pathCache;return i.has(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return null==this.path?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return null==this.path?null:(a.isPercentage(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return null==this.path?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return null==this.path?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return null==this.path?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return null==this.path?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return null==this.path?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,n,r){const i={distance:0};let o,a=0;"number"===typeof n?(a=n,o=r):o=n,null!=o&&(i.options=o);const s=o&&o.absoluteOffset,l=!(o&&o.absoluteDistance),c=o&&o.absoluteDistance&&o.reverseDistance,u=this.path,d={segmentSubdivisions:this.getConnectionSubdivisions()},h=new Dr(t,e),p=u.closestPointT(h,d),f=this.getConnectionLength()||0;let g,m,v=u.lengthAtT(p,d);if(l&&(v=f>0?v/f:0),c&&(v=-1*(f-v)||1),i.distance=v,s||(g=u.tangentAtT(p)),g)m=g.pointOffset(h);else{const t=u.pointAtT(p),e=h.diff(t);m={x:e.x,y:e.y}}return i.offset=m,i.angle=a,i}normalizeLabelPosition(t){return"number"===typeof t?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),n=e.options||{},r=e.angle||0,i=e.distance,o=i>0&&i<=1;let a=0;const s={x:0,y:0},l=e.offset;l&&("number"===typeof l?a=l:(null!=l.x&&(s.x=l.x),null!=l.y&&(s.y=l.y)));const u=0!==s.x||0!==s.y||0===a,d=n.keepGradient,h=n.ensureLegibility,p=this.path,f={segmentSubdivisions:this.getConnectionSubdivisions()},g=o?i*this.getConnectionLength():i,m=p.tangentAtLength(g,f);let v,b=r;if(m){if(u)v=m.start,v.translate(s);else{const t=m.clone();t.rotate(-90,m.start),t.setLength(a),v=t.end}d&&(b=m.angle()+r,h&&(b=Er.normalize((b+90)%180-90)))}else v=p.start,u&&v.translate(s);return c.createSVGMatrix().translate(v.x,v.y).rotate(b)}getLabelCoordinates(t){const e=this.getLabelTransformationMatrix(t);return new Dr(e.e,e.f)}getVertexIndex(t,e){const n=this.cell,r=n.getVertices(),i=this.getClosestPointLength(new Dr(t,e));let o=0;if(null!=i)for(const a=r.length;o<a;o+=1){const t=r[o],e=this.getClosestPointLength(t);if(null!=e&&i<e)break}return o}getEventArgs(t,e,n){const r=this,i=r.cell,o=i;return null==e||null==n?{e:t,view:r,edge:i,cell:o}:{e:t,x:e,y:n,view:r,edge:i,cell:o}}notifyUnhandledMouseDown(t,e,n){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("edge:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("edge:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("edge:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("edge:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("edge:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("edge:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.notifyMouseDown(t,e,n);const r=t.target.getAttribute("class");switch(r){case"vertex":return void this.startVertexDragging(t,e,n);case"vertex-remove":case"vertex-remove-area":return void this.handleVertexRemoving(t,e,n);case"connection":case"connection-wrap":return void this.handleVertexAdding(t,e,n);case"arrowhead":return void this.startArrowheadDragging(t,e,n);case"source-marker":case"target-marker":return void this.notifyUnhandledMouseDown(t,e,n);default:break}this.startEdgeDragging(t,e,n)}onMouseMove(t,e,n){const r=this.getEventData(t);switch(r.action){case"drag-vertex":this.dragVertex(t,e,n);break;case"drag-label":this.dragLabel(t,e,n);break;case"drag-arrowhead":this.dragArrowhead(t,e,n);break;case"drag-edge":this.dragEdge(t,e,n);break;default:break}return this.notifyMouseMove(t,e,n),r}onMouseUp(t,e,n){const r=this.getEventData(t);switch(r.action){case"drag-vertex":this.stopVertexDragging(t,e,n);break;case"drag-label":this.stopLabelDragging(t,e,n);break;case"drag-arrowhead":this.stopArrowheadDragging(t,e,n);break;case"drag-edge":this.stopEdgeDragging(t,e,n);break;default:break}return this.notifyMouseUp(t,e,n),this.checkMouseleave(t),r}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,r){super.onMouseWheel(t,e,n,r),this.notify("edge:mousewheel",Object.assign({delta:r},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,r){const i=c.findParentByClass(t.target,"edge-tool",this.container);if(i){if(t.stopPropagation(),this.can("useEdgeTools")){if("edge:remove"===e)return void this.cell.remove({ui:!0});this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,r)))}this.notifyMouseDown(t,n,r)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,r))),super.onCustomEvent(t,e,n,r)}onLabelMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startLabelDragging(t,e,n);const r=this.getEventData(t).stopPropagation;r&&t.stopPropagation()}startEdgeDragging(t,e,n){this.can("edgeMovable")?this.setEventData(t,{x:e,y:n,moving:!1,action:"drag-edge"}):this.notifyUnhandledMouseDown(t,e,n)}dragEdge(t,e,n){const r=this.getEventData(t);r.moving||(r.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(e-r.x,n-r.y,{ui:!0}),this.setEventData(t,{x:e,y:n}),this.notify("edge:moving",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(t,e,n){const r=this.getEventData(t);r.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),r.moving=!1}prepareArrowheadDragging(t,e){const n=this.getTerminalMagnet(t),r={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:!0===e.isNewEdge,terminalType:t,initialMagnet:n,initialTerminal:i.clone(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(r),r}createValidateConnectionArgs(t){const e=[];let n;e[4]=t,e[5]=this;let r=0,i=0;"source"===t?(r=2,n="target"):(i=2,n="source");const o=this.cell[n],a=o.cell;if(a){let t;const n=e[r]=this.graph.renderer.findViewByCell(a);n&&(t=n.getMagnetFromEdgeTerminal(o),t===n.container&&(t=void 0)),e[r+1]=t}return(t,n)=>(e[i]=t,e[i+1]=t.container===n?void 0:n,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){null!=t.zIndex&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}arrowheadDragging(t,e,n,r){r.x=e,r.y=n,r.currentTarget!==t&&(r.currentMagnet&&r.currentView&&r.currentView.unhighlight(r.currentMagnet,{type:"magnetAdsorbed"}),r.currentView=this.graph.renderer.findViewByElem(t),r.currentView?(r.currentMagnet=r.currentView.findMagnet(t),r.currentMagnet&&this.graph.hook.validateConnection(...r.getValidateConnectionArgs(r.currentView,r.currentMagnet),r.currentView.getEdgeTerminal(r.currentMagnet,e,n,this.cell,r.terminalType))?r.currentView.highlight(r.currentMagnet,{type:"magnetAdsorbed"}):r.currentMagnet=null):r.currentMagnet=null),r.currentTarget=t,this.cell.prop(r.terminalType,{x:e,y:n},Object.assign(Object.assign({},r.options),{ui:!0}))}arrowheadDragged(t,e,n){const r=t.currentView,i=t.currentMagnet;if(!i||!r)return;r.unhighlight(i,{type:"magnetAdsorbed"});const o=t.terminalType,a=r.getEdgeTerminal(i,e,n,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(t,e,n){const r=this.graph,{snap:i,allowEdge:o}=r.options.connecting,a="object"===typeof i&&i.radius||50,s={x:t-a,y:e-a,width:2*a,height:2*a},l=r.renderer.findViewsInArea(s);if(o){const t=r.renderer.findEdgeViewsInArea(s).filter(t=>t!==this);l.push(...t)}const c=n.closestView||null,u=n.closestMagnet||null;let d;n.closestView=null,n.closestMagnet=null;let h=Number.MAX_SAFE_INTEGER;const p=new Dr(t,e);let f;l.forEach(i=>{"false"!==i.container.getAttribute("magnet")&&(d=i.cell.getBBox().getCenter().distance(p),d<a&&d<h&&(u===i.container||r.hook.validateConnection(...n.getValidateConnectionArgs(i,null),i.getEdgeTerminal(i.container,t,e,this.cell,n.terminalType)))&&(h=d,n.closestView=i,n.closestMagnet=i.container)),i.container.querySelectorAll("[magnet]").forEach(o=>{if("false"!==o.getAttribute("magnet")){const s=i.getBBoxOfElement(o);d=p.distance(s.getCenter()),d<a&&d<h&&(u===o||r.hook.validateConnection(...n.getValidateConnectionArgs(i,o),i.getEdgeTerminal(o,t,e,this.cell,n.terminalType)))&&(h=d,n.closestView=i,n.closestMagnet=o)}})});const g=n.terminalType,m=n.closestView,v=n.closestMagnet,b=u!==v;if(c&&b&&c.unhighlight(u,{type:"magnetAdsorbed"}),m){if(!b)return;m.highlight(v,{type:"magnetAdsorbed"}),f=m.getEdgeTerminal(v,t,e,this.cell,g)}else f={x:t,y:e};this.cell.setTerminal(g,f,{},Object.assign(Object.assign({},n.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,n=t.closestMagnet;e&&n&&(e.unhighlight(n,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(n)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const n=t.terminalType,r=t.initialTerminal,i=this.cell[n],o=i&&!xd.equalTerminals(r,i);if(o){const o=this.graph,a=r,s=a.cell?o.getCellById(a.cell):null,l=a.port,c=s?o.findViewByCell(s):null,u=s||t.isNewEdge?null:Dr.create(r).toJSON(),d=i,h=d.cell?o.getCellById(d.cell):null,p=d.port,f=h?o.findViewByCell(h):null,g=h?null:Dr.create(i).toJSON();this.notify("edge:connected",{e:e,previousCell:s,previousPort:l,previousView:c,previousPoint:u,currentCell:h,currentView:f,currentPort:p,currentPoint:g,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:n,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,n=e.model.getCells();t.marked={};for(let r=0,i=n.length;r<i;r+=1){const i=e.renderer.findViewByCell(n[r]);if(!i)continue;const o=Array.prototype.slice.call(i.container.querySelectorAll("[magnet]"));"false"!==i.container.getAttribute("magnet")&&o.push(i.container);const a=o.filter(n=>e.hook.validateConnection(...t.getValidateConnectionArgs(i,n),i.getEdgeTerminal(n,t.x,t.y,this.cell,t.terminalType)));if(a.length>0){for(let t=0,e=a.length;t<e;t+=1)i.highlight(a[t],{type:"magnetAvailable"});i.highlight(null,{type:"nodeAvailable"}),t.marked[i.cell.id]=a}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach(t=>{const n=this.graph.renderer.findViewByCell(t);if(n){const r=e[t];r.forEach(t=>{n.unhighlight(t,{type:"magnetAvailable"})}),n.unhighlight(null,{type:"nodeAvailable"})}}),t.marked=null}startArrowheadDragging(t,e,n){if(!this.can("arrowheadMovable"))return void this.notifyUnhandledMouseDown(t,e,n);const r=t.target,i=r.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(i,{x:e,y:n});this.setEventData(t,o)}dragArrowhead(t,e,n){const r=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,n,r):this.arrowheadDragging(this.getEventTarget(t),e,n,r)}stopArrowheadDragging(t,e,n){const r=this.graph,i=this.getEventData(t);r.options.connecting.snap?this.snapArrowheadEnd(i):this.arrowheadDragged(i,e,n);const o=r.hook.validateEdge(this.cell,i.terminalType,i.initialTerminal);o?(this.finishEmbedding(i),this.notifyConnectionEvent(i,t)):this.fallbackConnection(i),this.afterArrowheadDragging(i)}startLabelDragging(t,e,n){if(this.can("edgeLabelMovable")){const e=t.currentTarget,n=parseInt(e.getAttribute("data-index"),10),r=this.getLabelPositionAngle(n),i=this.getLabelPositionArgs(n),o=this.getDefaultLabelPositionArgs(),a=this.mergeLabelPositionArgs(i,o);this.setEventData(t,{index:n,positionAngle:r,positionArgs:a,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,n){const r=this.getEventData(t),o=this.cell.getLabelAt(r.index),a=i.merge({},o,{position:this.getLabelPosition(e,n,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,a)}stopLabelDragging(t,e,n){}handleVertexAdding(t,e,n){if(!this.can("vertexAddable"))return void this.notifyUnhandledMouseDown(t,e,n);const r=this.addVertex({x:e,y:n},{ui:!0});this.setEventData(t,{index:r,action:"drag-vertex"})}handleVertexRemoving(t,e,n){if(!this.can("vertexDeletable"))return void this.notifyUnhandledMouseDown(t,e,n);const r=t.target,i=parseInt(r.getAttribute("idx"),10);this.cell.removeVertexAt(i)}startVertexDragging(t,e,n){if(!this.can("vertexMovable"))return void this.notifyUnhandledMouseDown(t,e,n);const r=t.target,i=parseInt(r.getAttribute("idx"),10);this.setEventData(t,{index:i,action:"drag-vertex"})}dragVertex(t,e,n){const r=this.getEventData(t);this.cell.setVertexAt(r.index,{x:e,y:n},{ui:!0})}stopVertexDragging(t,e,n){}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"===typeof r.isNodeView&&"function"===typeof r.isEdgeView&&"function"===typeof r.confirmUpdate&&"function"===typeof r.update&&"function"===typeof r.getConnection}t.toStringTag="X6."+t.name,t.isEdgeView=e})(kd||(kd={})),kd.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],vertices:["vertices","update"],vertexMarkup:["vertices"],toolMarkup:["tools"],tools:["widget"]},shortLength:105,longLength:155,toolsOffset:40,doubleTools:!1,doubleToolsOffset:65,sampleInterval:50}),kd.registry.register("edge",kd,!0);class Ad extends Gl{constructor(){super(...arguments),this.scalableNode=null,this.rotatableNode=null,this.scalableSelector="scalable",this.rotatableSelector="rotatable",this.defaultPortMarkup=Vl.getPortMarkup(),this.defaultPortLabelMarkup=Vl.getPortLabelMarkup(),this.defaultPortContainerMarkup=Vl.getPortContainerMarkup(),this.portsCache={}}get[Symbol.toStringTag](){return Ad.toStringTag}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const t=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?c.removeClass(e,t):c.addClass(e,t)}else{const t=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(t):this.addClass(t)}}isNodeView(){return!0}confirmUpdate(t,e={}){let n=t;return this.hasAction(n,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","resize","translate","rotate","ports","tools"])):(n=this.handleAction(n,"resize",()=>this.resize(e),"update"),n=this.handleAction(n,"update",()=>this.update(),_s.useCSSSelector?"ports":null),n=this.handleAction(n,"translate",()=>this.translate()),n=this.handleAction(n,"rotate",()=>this.rotate()),n=this.handleAction(n,"ports",()=>this.renderPorts()),n=this.handleAction(n,"tools",()=>this.renderTools())),n}update(t){this.cleanCache(),_s.useCSSSelector&&this.removePorts();const e=this.cell,n=e.getSize(),r=e.getAttrs();this.updateAttrs(this.container,r,{attrs:t===r?null:t,rootBBox:new jr(0,0,n.width,n.height),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode}),_s.useCSSSelector&&this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t)return"string"===typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container),n=t=>Array.isArray(t)?t[0]:t;this.selectors=e.selectors,this.rotatableNode=n(this.selectors[this.rotatableSelector]),this.scalableNode=n(this.selectors[this.scalableSelector]),this.container.appendChild(e.fragment)}renderStringMarkup(t){c.append(this.container,ai.toNodes(ai.createVectors(t))),this.rotatableNode=c.findOne(this.container,"."+this.rotatableSelector),this.scalableNode=c.findOne(this.container,"."+this.scalableSelector),this.selectors={},this.rootSelector&&(this.selectors[this.rootSelector]=this.container)}render(){return this.empty(),this.renderMarkup(),this.scalableNode&&this.update(),this.resize(),this.rotatableNode?(this.rotate(),this.translate()):this.updateTransform(),_s.useCSSSelector||this.renderPorts(),this.renderTools(),this}resize(t={}){if(this.scalableNode)return this.updateSize(t);this.cell.getAngle()&&this.rotate(),this.update()}translate(){if(this.rotatableNode)return this.updateTranslation();this.updateTransform()}rotate(){if(this.rotatableNode)return this.updateRotation(),void this.update();this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=" "+e),this.container.setAttribute("transform",t)}updateRotation(){if(null!=this.rotatableNode){const t=this.getRotationString();null!=t?this.rotatableNode.setAttribute("transform",t):this.rotatableNode.removeAttribute("transform")}}updateTranslation(){this.container.setAttribute("transform",this.getTranslationString())}updateSize(t={}){const e=this.cell,n=e.getSize(),r=e.getAngle(),i=this.scalableNode;let o=!1;i.getElementsByTagName("path").length>0&&(o=!0);const a=c.getBBox(i,{recursive:o}),s=n.width/(a.width||1),l=n.height/(a.height||1);i.setAttribute("transform",`scale(${s},${l})`);const u=this.rotatableNode;if(null!=u){const o=u.getAttribute("transform");if(o){u.setAttribute("transform",`${o} rotate(${-r},${n.width/2},${n.height/2})`);const a=c.getBBox(i,{target:this.graph.view.stage});e.prop("position",{x:a.x,y:a.y},Object.assign({updated:!0},t)),this.translate(),this.rotate()}}this.update()}findPortElem(t,e){const n=t?this.portsCache[t]:null;if(!n)return null;const r=n.portContentElement,i=n.portContentSelectors||{};return this.findOne(e,r,i)}initializePorts(){this.cleanPortsCache()}refreshPorts(){this.removePorts(),this.cleanPortsCache(),this.renderPorts()}cleanPortsCache(){this.portsCache={}}removePorts(){Object.keys(this.portsCache).forEach(t=>{const e=this.portsCache[t];c.remove(e.portElement)})}renderPorts(){const t=this.getPortsContainer(),e=[];t.childNodes.forEach(t=>{e.push(t)});const n=r.groupBy(this.cell.getParsedPorts(),"zIndex"),i="auto";n[i]&&n[i].forEach(n=>{const r=this.getPortElement(n);t.append(r),e.push(r)}),Object.keys(n).forEach(t=>{if(t!==i){const r=parseInt(t,10);this.appendPorts(n[t],r,e)}}),this.updatePorts()}getPortsContainer(){return this.rotatableNode||this.container}appendPorts(t,e,n){const r=t.map(t=>this.getPortElement(t));n[e]||e<0?c.before(n[Math.max(e,0)],r):c.append(this.getPortsContainer(),r)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=Vl.renderMarkup(this.getPortContainerMarkup());const n=e.elem;if(null==n)throw new Error("Invalid port container markup.");e=Vl.renderMarkup(this.getPortMarkup(t));const r=e.elem,i=e.selectors;if(null==r)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},r),e=Vl.renderMarkup(this.getPortLabelMarkup(t.label));const o=e.elem,a=e.selectors;if(null==o)throw new Error("Invalid port label markup.");let s;if(i&&a){for(const t in a)if(i[t]&&t!==this.rootSelector)throw new Error("Selectors within port must be unique.");s=Object.assign(Object.assign({},i),a)}else s=i||a;let l="x6-port";return t.group&&(l+=" x6-port-"+t.group),c.addClass(n,l),c.addClass(r,"x6-port-body"),c.addClass(o,"x6-port-label"),n.appendChild(r),n.appendChild(o),this.portsCache[t.id]={portElement:n,portSelectors:s,portLabelElement:o,portLabelSelectors:a,portContentElement:r,portContentSelectors:i},this.graph.hook.onPortRendered({port:t,node:this.cell,container:n,selectors:s,labelContainer:o,labelSelectors:a,contentContainer:r,contentSelectors:i}),n}updatePorts(){this.updatePortGroup();const t=this.cell.getParsedGroups();Object.keys(t).forEach(t=>this.updatePortGroup(t))}updatePortGroup(t){const e=jr.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(t,e);for(let r=0,i=n.length;r<i;r+=1){const t=n[r],e=t.portId,i=this.portsCache[e]||{},o=t.portLayout;if(this.applyPortTransform(i.portElement,o),null!=t.portAttrs){const e={selectors:i.portSelectors||{}};t.portSize&&(e.rootBBox=jr.fromSize(t.portSize)),this.updateAttrs(i.portElement,t.portAttrs,e)}const a=t.labelLayout;if(a&&(this.applyPortTransform(i.portLabelElement,a,-(o.angle||0)),a.attrs)){const e={selectors:i.portLabelSelectors||{}};t.labelSize&&(e.rootBBox=jr.fromSize(t.labelSize)),this.updateAttrs(i.portLabelElement,a.attrs,e)}}}applyPortTransform(t,e,n=0){const r=e.angle,i=e.position,o=c.createSVGMatrix().rotate(n).translate(i.x||0,i.y||0).rotate(r||0);c.transform(t,o,{absolute:!0})}getPortContainerMarkup(){return this.cell.getPortContainerMarkup()||this.defaultPortContainerMarkup}getPortMarkup(t){return t.markup||this.cell.portMarkup||this.defaultPortMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup||this.defaultPortLabelMarkup}getEventArgs(t,e,n){const r=this,i=r.cell,o=i;return null==e||null==n?{e:t,view:r,node:i,cell:o}:{e:t,x:e,y:n,view:r,node:i,cell:o}}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("node:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("node:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("node:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("node:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("node:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("node:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,n),this.startNodeDragging(t,e,n))}onMouseMove(t,e,n){const r=this.getEventData(t),i=r.action;if("magnet"===i)this.dragMagnet(t,e,n);else{if("move"===i){const i=r,o=i.targetView||this;o.dragNode(t,e,n),o.notify("node:moving",{e:t,x:e,y:n,view:o,cell:o.cell,node:o.cell})}this.notifyMouseMove(t,e,n)}this.setEventData(t,r)}onMouseUp(t,e,n){const r=this.getEventData(t),i=r.action;if("magnet"===i)this.stopMagnetDragging(t,e,n);else if(this.notifyMouseUp(t,e,n),"move"===i){const i=r,o=i.targetView||this;o.stopNodeDragging(t,e,n)}const o=r.targetMagnet;o&&this.onMagnetClick(t,o,e,n),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,r){super.onMouseWheel(t,e,n,r),this.notify("node:mousewheel",Object.assign({delta:r},this.getEventArgs(t,e,n)))}onMagnetClick(t,e,n,r){const i=this.graph.view.getMouseMovedCount(t);i>this.graph.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,n,r)))}onMagnetDblClick(t,e,n,r){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,n,r)))}onMagnetContextMenu(t,e,n,r){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,n,r)))}onMagnetMouseDown(t,e,n,r){this.startMagnetDragging(t,n,r)}onCustomEvent(t,e,n,r){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,n,r))),super.onCustomEvent(t,e,n,r)}prepareEmbedding(t){const e=this.getEventData(t),n=e.cell||this.cell,r=this.graph.findViewByCell(n),i=this.graph.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:n,view:r,cell:n,x:i.x,y:i.y,currentParent:n.getParent()})}processEmbedding(t,e){const n=e.cell||this.cell,i=e.graph||this.graph,o=i.options.embedding,a=o.findParent;let l="function"===typeof a?s.call(a,i,{view:this,node:this.cell}).filter(t=>sd.isCell(t)&&this.cell.id!==t.id&&!t.isDescendantOf(this.cell)):i.model.getNodesUnderNode(n,{by:a});if(o.frontOnly&&l.length>0){const t=r.groupBy(l,"zIndex"),e=r.max(Object.keys(t));e&&(l=t[e])}l=l.filter(t=>t.visible);let c=null;const u=e.candidateEmbedView,d=o.validate;for(let r=l.length-1;r>=0;r-=1){const t=l[r];if(u&&u.cell.id===t.id){c=u;break}{const e=t.findView(i);if(s.call(d,i,{child:this.cell,parent:e.cell,childView:this,parentView:e})){c=e;break}}}this.clearEmbedding(e),c&&c.highlight(null,{type:"embedding"}),e.candidateEmbedView=c;const h=i.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:n,node:n,view:i.findViewByCell(n),x:h.x,y:h.y,currentParent:n.getParent(),candidateParent:c?c.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){const n=e.cell||this.cell,r=e.graph||this.graph,i=r.findViewByCell(n),o=n.getParent(),a=e.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,null!=o&&o.id===a.cell.id||a.cell.insertChild(n,void 0,{ui:!0})):o&&o.unembed(n,{ui:!0}),r.model.getConnectedEdges(n,{deep:!0}).forEach(t=>{t.updateParent({ui:!0})}),i&&a){const e=r.snapToGrid(t.clientX,t.clientY);i.notify("node:embedded",{e:t,cell:n,x:e.x,y:e.y,node:n,view:r.findViewByCell(n),previousParent:o,currentParent:n.getParent()})}}getDelegatedView(){let t=this.cell,e=this;while(e){if(t.isEdge())break;if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.renderer.findViewByCell(t)}return null}startMagnetDragging(t,e,n){if(!this.can("magnetConnectable"))return;t.stopPropagation();const r=t.currentTarget,i=this.graph;this.setEventData(t,{targetMagnet:r}),i.hook.validateMagnet(this,r,t)?(i.options.magnetThreshold<=0&&this.startConnectting(t,r,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):((c.hasClass(r,"x6-port-body")||pt()(r).closest(".x6-port-body").length>0)&&this.stopPropagation(t),this.onMouseDown(t,e,n)),i.view.delegateDragEvents(t,this)}startConnectting(t,e,n,r){this.graph.model.startBatch("add-edge");const i=this.createEdgeFromMagnet(e,n,r);i.notifyMouseDown(t,n,r),i.setEventData(t,i.prepareArrowheadDragging("target",{x:n,y:r,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:i})}createEdgeFromMagnet(t,e,n){const r=this.graph,i=r.model,o=r.hook.getDefaultEdge(this,t);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(t,e,n,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:e,y:n})),o.addTo(i,{async:!1,ui:!0}),o.findView(r)}dragMagnet(t,e,n){const r=this.getEventData(t),i=r.edgeView;if(i)i.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{const i=this.graph,o=i.options.magnetThreshold,a=this.getEventTarget(t),s=r.targetMagnet;if("onleave"===o){if(s===a||s.contains(a))return}else if(i.view.getMouseMovedCount(t)<=o)return;this.startConnectting(t,s,e,n)}}stopMagnetDragging(t,e,n){const r=this.eventData(t),i=r.edgeView;i&&(i.onMouseUp(t,e,n),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,n){this.notify("node:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,n,r,i){let o=[i];const a=this.graph.selection.widget;if(a&&a.options.movable){const t=this.graph.getSelectedCells();t.includes(i)&&(o=t.filter(t=>t.isNode()))}o.forEach(i=>{this.notify(t,{e:e,x:n,y:r,cell:i,node:i,view:i.findView(this.graph)})})}startNodeDragging(t,e,n){const r=this.getDelegatedView();if(null==r||!r.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,n);this.setEventData(t,{targetView:r,action:"move"});const i=Dr.create(r.cell.getPosition());r.setEventData(t,{moving:!1,offset:i.diff(e,n),restrict:this.graph.hook.getRestrictArea(r)})}dragNode(t,e,n){const r=this.cell,i=this.graph,o=i.getGridSize(),a=this.getEventData(t),s=a.offset,l=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,n,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const c=Ms.snapToGrid(e+s.x,o),u=Ms.snapToGrid(n+s.y,o);r.setPosition(c,u,{restrict:l,deep:!0,ui:!0}),i.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(t),a.embedding=!0),this.processEmbedding(t,a))}stopNodeDragging(t,e,n){const r=this.getEventData(t);r.embedding&&this.finalizeEmbedding(t,r),r.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,n,this.cell)),r.moving=!1,r.embedding=!1}autoScrollGraph(t,e){const n=this.graph.scroller.widget;n&&n.autoScroll(t,e)}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"===typeof r.isNodeView&&"function"===typeof r.isEdgeView&&"function"===typeof r.confirmUpdate&&"function"===typeof r.update&&"function"===typeof r.findPortElem&&"function"===typeof r.resize&&"function"===typeof r.rotate&&"function"===typeof r.translate}t.toStringTag="X6."+t.name,t.isNodeView=e})(Ad||(Ad={})),Ad.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),Ad.registry.register("node",Ad,!0);const Sd=gd("text");class Ed extends(vd("text",{view:Sd,attrs:{text:{fontSize:18,fill:"#000000",stroke:null,refX:.5,refY:.5}}},{noText:!0})){}(function(t){class e extends Ad{confirmUpdate(t,e={}){let n=super.confirmUpdate(t,e);return this.hasAction(n,"scale")&&(this.resize(),n=this.removeAction(n,"scale")),n}}t.View=e,e.config({actions:{attrs:["scale"]}}),Ad.registry.register(Sd,e)})(Ed||(Ed={}));class Od extends kl{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map(t=>t.toJSON())}add(t,e,n){let r,i;"number"===typeof e?(r=e,i=Object.assign({merge:!1},n)):(r=this.length,i=Object.assign({merge:!1},e)),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const o=Array.isArray(t)?t:[t],a=this.comparator&&"number"!==typeof e&&!1!==i.sort,s=this.comparator||null;let l=!1;const c=[],u=[];return o.forEach(t=>{const e=this.get(t);e?i.merge&&!t.isSameStore(e)&&(e.setProp(t.getProp(),n),u.push(e),a&&!l&&(l=null==s||"function"===typeof s?e.hasChanged():"string"===typeof s?e.hasChanged(s):s.some(t=>e.hasChanged(t)))):(c.push(t),this.reference(t))}),c.length&&(a&&(l=!0),this.cells.splice(r,0,...c),this.length=this.cells.length),l&&this.sort({silent:!0}),i.silent||(c.forEach((t,e)=>{const n={cell:t,index:r+e,options:i};this.trigger("added",n),i.dryrun||t.notify("added",Object.assign({},n))}),l&&this.trigger("sorted"),(c.length||u.length)&&this.trigger("updated",{added:c,merged:u,removed:[],options:i})),this}remove(t,e={}){const n=Array.isArray(t)?t:[t],r=this.removeCells(n,e);return!e.silent&&r.length>0&&this.trigger("updated",{options:e,removed:r,added:[],merged:[]}),Array.isArray(t)?r:r[0]}removeCells(t,e){const n=[];for(let r=0;r<t.length;r+=1){const i=this.get(t[r]);if(null==i)continue;const o=this.cells.indexOf(i);this.cells.splice(o,1),this.length-=1,delete this.map[i.id],n.push(i),this.unreference(i),e.dryrun||i.remove(),e.silent||(this.trigger("removed",{cell:i,index:o,options:e}),e.dryrun||i.notify("removed",{cell:i,index:o,options:e}))}return n}reset(t,e={}){const n=this.cells.slice();if(n.forEach(t=>this.unreference(t)),this.clean(),this.add(t,Object.assign({silent:!0},e)),!e.silent){const t=this.cells.slice();this.trigger("reseted",{options:e,previous:n,current:t});const r=[],i=[];t.forEach(t=>{const e=n.some(e=>e.id===t.id);e||r.push(t)}),n.forEach(e=>{const n=t.some(t=>t.id===e.id);n||i.push(e)}),this.trigger("updated",{options:e,added:r,removed:i,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return this.remove(e,t)}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return this.remove(e,t)}get(t){if(null==t)return null;const e="string"===typeof t||"number"===typeof t?t:t.id;return this.map[e]||null}has(t){return null!=this.get(t)}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return null!=this.comparator&&(this.cells=r.sortBy(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const n=e.cell;this.trigger("cell:"+t,e),n&&(n.isNode()?this.trigger("node:"+t,Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.trigger("edge:"+t,Object.assign(Object.assign({},e),{edge:n})))}clean(){this.length=0,this.cells=[],this.map={}}}class Td extends kl{constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new Od(t),this.setup()}get[Symbol.toStringTag](){return Td.toStringTag}notify(t,e){this.trigger(t,e);const n=this.graph;return n&&("sorted"===t||"reseted"===t||"updated"===t?n.trigger("model:"+t,e):n.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",()=>this.notify("sorted",null)),t.on("updated",t=>this.notify("updated",t)),t.on("cell:change:zIndex",()=>this.sortOnChangeZ()),t.on("added",({cell:t})=>{this.onCellAdded(t)}),t.on("removed",t=>{const e=t.cell;this.onCellRemoved(e,t.options),this.notify("cell:removed",t),e.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:e})):e.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:e}))}),t.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),t.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),t.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const n=t.id;if(t.isEdge()){delete this.edges[n];const e=t.getSource(),r=t.getTarget();if(e&&e.cell){const t=this.outgoings[e.cell],r=t?t.indexOf(n):-1;r>=0&&(t.splice(r,1),0===t.length&&delete this.outgoings[e.cell])}if(r&&r.cell){const t=this.incomings[r.cell],e=t?t.indexOf(n):-1;e>=0&&(t.splice(e,1),0===t.length&&delete this.incomings[r.cell])}}else delete this.nodes[n];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(t,e){const n="source"===e?this.outgoings:this.incomings,r=t.previous(e);if(r&&r.cell){const e=sd.isCell(r.cell)?r.cell.id:r.cell,i=n[e],o=i?i.indexOf(t.id):-1;o>=0&&(i.splice(o,1),0===i.length&&delete n[e])}const i=t.getTerminal(e);if(i&&i.cell){const e=sd.isCell(i.cell)?i.cell.id:i.cell,r=n[e]||[],o=r.indexOf(t.id);-1===o&&r.push(t.id),n[e]=r}}prepareCell(t,e){return t.model||e&&e.dryrun||(t.model=this),null==t.zIndex&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map(t=>this.prepareCell(t,Object.assign(Object.assign({},e),{dryrun:!0}))),this.collection.reset(t,e),t.map(t=>this.prepareCell(t,{options:e})),this}clear(t={}){const e=this.getCells();if(0===e.length)return this;const n=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",()=>{const t=e.sort((t,e)=>{const n=t.isEdge()?1:2,r=e.isEdge()?1:2;return n-r});while(t.length>0){const e=t.shift();e&&e.remove(n)}},n),this}addNode(t,e={}){const n=ud.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}createNode(t){return ud.create(t)}addEdge(t,e={}){const n=xd.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return xd.create(t)}addCell(t,e={}){return Array.isArray(t)?this.addCells(t,e):(this.collection.has(t)||this.addings.has(t)||(this.addings.set(t,!0),this.collection.add(this.prepareCell(t,e),e),t.eachChild(t=>this.addCell(t,e)),this.addings.delete(t)),this)}addCells(t,e={}){const n=t.length;if(0===n)return this;const r=Object.assign(Object.assign({},e),{position:n-1,maxPosition:n-1});return this.startBatch("add",Object.assign(Object.assign({},r),{cells:t})),t.forEach(t=>{this.addCell(t,r),r.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},r),{cells:t})),this}removeCell(t,e={}){const n="string"===typeof t?this.getCell(t):t;return n&&this.has(n)?this.collection.remove(n,e):null}updateCellId(t,e){this.startBatch("update",{id:e}),t.prop("id",e);const n=t.clone({keepId:!0});this.addCell(n);const r=this.getConnectedEdges(t);return r.forEach(n=>{const r=n.getSourceCell(),i=n.getTargetCell();r===t&&n.setSource(Object.assign(Object.assign({},n.getSource()),{cell:e})),i===t&&n.setTarget(Object.assign(Object.assign({},n.getTarget()),{cell:e}))}),this.removeCell(t),this.stopBatch("update",{id:e}),n}removeCells(t,e={}){return t.length?this.batchUpdate("remove",()=>t.map(t=>this.removeCell(t,e))):[]}removeConnectedEdges(t,e={}){const n=this.getConnectedEdges(t);return n.forEach(t=>{t.remove(e)}),n}disconnectConnectedEdges(t,e={}){const n="string"===typeof t?t:t.id;this.getConnectedEdges(t).forEach(t=>{const r=t.getSourceCell(),i=t.getTargetCell();r&&r.id===n&&t.setSource({x:0,y:0},e),i&&i.id===n&&t.setTarget({x:0,y:0},e)})}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map(t=>this.getCell(t)).filter(t=>null!=t):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e="string"===typeof t?t:t.id,n=this.outgoings[e];return n?n.map(t=>this.getCell(t)).filter(t=>t&&t.isEdge()):null}getIncomingEdges(t){const e="string"===typeof t?t:t.id,n=this.incomings[e];return n?n.map(t=>this.getCell(t)).filter(t=>t&&t.isEdge()):null}getConnectedEdges(t,e={}){const n=[],r="string"===typeof t?this.getCell(t):t;if(null==r)return n;const i={},o=e.indirect;let a=e.incoming,s=e.outgoing;null==a&&null==s&&(a=s=!0);const l=(t,e)=>{const r=e?this.getOutgoingEdges(t):this.getIncomingEdges(t);if(null!=r&&r.forEach(t=>{i[t.id]||(n.push(t),i[t.id]=!0,o&&(a&&l(t,!1),s&&l(t,!0)))}),o&&t.isEdge()){const r=e?t.getTargetCell():t.getSourceCell();r&&r.isEdge()&&(i[r.id]||(n.push(r),l(r,e)))}};if(s&&l(r,!0),a&&l(r,!1),e.deep){const t=r.getDescendants({deep:!0}),o={};t.forEach(t=>{t.isNode()&&(o[t.id]=!0)});const l=(t,r)=>{const a=r?this.getOutgoingEdges(t.id):this.getIncomingEdges(t.id);null!=a&&a.forEach(t=>{if(!i[t.id]){const r=t.getSourceCell(),a=t.getTargetCell();if(!e.enclosed&&r&&o[r.id]&&a&&o[a.id])return;n.push(t),i[t.id]=!0}})};t.forEach(t=>{t.isEdge()||(s&&l(t,!0),a&&l(t,!1))})}return n}isBoundary(t,e){const n="string"===typeof t?this.getCell(t):t,r=e?this.getIncomingEdges(n):this.getOutgoingEdges(n);return null==r||0===r.length}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach(n=>{if(this.isBoundary(n,t)){const t=this.getCell(n);t&&e.push(t)}}),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let n=e.incoming,r=e.outgoing;null==n&&null==r&&(n=r=!0);const i=this.getConnectedEdges(t,e),o=i.reduce((i,o)=>{const a=o.hasLoop(e),s=o.getSourceCell(),l=o.getTargetCell();return n&&s&&s.isNode()&&!i[s.id]&&(!a&&(s===t||e.deep&&s.isDescendantOf(t))||(i[s.id]=s)),r&&l&&l.isNode()&&!i[l.id]&&(!a&&(l===t||e.deep&&l.isDescendantOf(t))||(i[l.id]=l)),i},{});if(t.isEdge()){if(n){const e=t.getSourceCell();e&&e.isNode()&&!o[e.id]&&(o[e.id]=e)}if(r){const e=t.getTargetCell();e&&e.isNode()&&!o[e.id]&&(o[e.id]=e)}}return Object.keys(o).map(t=>o[t])}isNeighbor(t,e,n={}){let r=n.incoming,i=n.outgoing;return null==r&&null==i&&(r=i=!0),this.getConnectedEdges(t,n).some(t=>{const n=t.getSourceCell(),o=t.getTargetCell();return!(!r||!n||n.id!==e.id)||!(!i||!o||o.id!==e.id)})}getSuccessors(t,e={}){const n=[];return this.search(t,(r,i)=>{r!==t&&this.matchDistance(i,e.distance)&&n.push(r)},Object.assign(Object.assign({},e),{outgoing:!0})),n}isSuccessor(t,e,n={}){let r=!1;return this.search(t,(i,o)=>{if(i===e&&i!==t&&this.matchDistance(o,n.distance))return r=!0,!1},Object.assign(Object.assign({},n),{outgoing:!0})),r}getPredecessors(t,e={}){const n=[];return this.search(t,(r,i)=>{r!==t&&this.matchDistance(i,e.distance)&&n.push(r)},Object.assign(Object.assign({},e),{incoming:!0})),n}isPredecessor(t,e,n={}){let r=!1;return this.search(t,(i,o)=>{if(i===e&&i!==t&&this.matchDistance(o,n.distance))return r=!0,!1},Object.assign(Object.assign({},n),{incoming:!0})),r}matchDistance(t,e){return null==e||("function"===typeof e?e(t):!(!Array.isArray(e)||!e.includes(t))||t===e)}getCommonAncestor(...t){const e=[];return t.forEach(t=>{t&&(Array.isArray(t)?e.push(...t):e.push(t))}),sd.getCommonAncestor(...e)}getSubGraph(t,e={}){const n=[],r={},i=[],o=[],a=t=>{r[t.id]||(n.push(t),r[t.id]=t,t.isEdge()&&o.push(t),t.isNode()&&i.push(t))};return t.forEach(t=>{if(a(t),e.deep){const e=t.getDescendants({deep:!0});e.forEach(t=>a(t))}}),o.forEach(t=>{const e=t.getSourceCell(),o=t.getTargetCell();e&&!r[e.id]&&(n.push(e),r[e.id]=e,e.isNode()&&i.push(e)),o&&!r[o.id]&&(n.push(o),r[o.id]=o,o.isNode()&&i.push(o))}),i.forEach(t=>{const i=this.getConnectedEdges(t,e);i.forEach(t=>{const e=t.getSourceCell(),i=t.getTargetCell();!r[t.id]&&e&&r[e.id]&&i&&r[i.id]&&(n.push(t),r[t.id]=t)})}),n}cloneSubGraph(t,e={}){const n=this.getSubGraph(t,e);return this.cloneCells(n)}cloneCells(t){return sd.cloneCells(t)}getNodesFromPoint(t,e){const n="number"===typeof t?{x:t,y:e||0}:t;return this.getNodes().filter(t=>t.getBBox().containsPoint(n))}getNodesInArea(t,e,n,r,i){const o="number"===typeof t?new jr(t,e,n,r):jr.create(t),a="number"===typeof t?i:e,s=a&&a.strict;return this.getNodes().filter(t=>{const e=t.getBBox();return s?o.containsRect(e):o.isIntersectWithRect(e)})}getEdgesInArea(t,e,n,r,i){const o="number"===typeof t?new jr(t,e,n,r):jr.create(t),a="number"===typeof t?i:e,s=a&&a.strict;return this.getEdges().filter(t=>{const e=t.getBBox();return 0===e.width?e.inflate(1,0):0===e.height&&e.inflate(0,1),s?o.containsRect(e):o.isIntersectWithRect(e)})}getNodesUnderNode(t,e={}){const n=t.getBBox(),r=null==e.by||"bbox"===e.by?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by]);return r.filter(e=>t.id!==e.id&&!e.isDescendantOf(t))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return sd.getCellsBBox(t,e)}search(t,e,n={}){n.breadthFirst?this.breadthFirstSearch(t,e,n):this.depthFirstSearch(t,e,n)}breadthFirstSearch(t,e,n={}){const r=[],i={},o={};r.push(t),o[t.id]=0;while(r.length>0){const t=r.shift();if(null==t||i[t.id])continue;if(i[t.id]=!0,!1===s.call(e,this,t,o[t.id]))continue;const a=this.getNeighbors(t,n);a.forEach(e=>{o[e.id]=o[t.id]+1,r.push(e)})}}depthFirstSearch(t,e,n={}){const r=[],i={},o={};r.push(t),o[t.id]=0;while(r.length>0){const t=r.pop();if(null==t||i[t.id])continue;if(i[t.id]=!0,!1===s.call(e,this,t,o[t.id]))continue;const a=this.getNeighbors(t,n),l=r.length;a.forEach(e=>{o[e.id]=o[t.id]+1,r.splice(l,0,e)})}}getShortestPath(t,e,n={}){const r={};this.getEdges().forEach(t=>{const e=t.getSourceCellId(),i=t.getTargetCellId();e&&i&&(r[e]||(r[e]=[]),r[i]||(r[i]=[]),r[e].push(i),n.directed||r[i].push(e))});const i="string"===typeof t?t:t.id,o=Sl.run(r,i,n.weight),a=[];let s="string"===typeof e?e:e.id;o[s]&&a.push(s);while(s=o[s])a.unshift(s);return a}translate(t,e,n){return this.getCells().filter(t=>!t.hasParent()).forEach(r=>r.translate(t,e,n)),this}resize(t,e,n){return this.resizeCells(t,e,this.getCells(),n)}resizeCells(t,e,n,r={}){const i=this.getCellsBBox(n);if(i){const o=Math.max(t/i.width,0),a=Math.max(e/i.height,0),s=i.getOrigin();n.forEach(t=>t.scale(o,a,s,r))}return this}toJSON(t={}){return Td.toJSON(this.getCells(),t)}parseJSON(t){return Td.fromJSON(t)}fromJSON(t,e={}){const n=this.parseJSON(t);return this.resetCells(n,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,n={}){this.startBatch(t,n);const r=e();return this.stopBatch(t,n),r}hasActiveBatch(t=Object.keys(this.batches)){const e=Array.isArray(t)?t:[t];return e.some(t=>this.batches[t]>0)}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"===typeof r.addNode&&"function"===typeof r.addEdge&&null!=r.collection}t.toStringTag="X6."+t.name,t.isModel=e})(Td||(Td={})),function(t){function e(t,e={}){return{cells:t.map(t=>t.toJSON(e))}}function n(t){const e=[];return Array.isArray(t)?e.push(...t):(t.cells&&e.push(...t.cells),t.nodes&&t.nodes.forEach(t=>{null==t.shape&&(t.shape="rect"),e.push(t)}),t.edges&&t.edges.forEach(t=>{null==t.shape&&(t.shape="edge"),e.push(t)})),e.map(t=>{const e=t.shape;if(e){if(ud.registry.exist(e))return ud.create(t);if(xd.registry.exist(e))return xd.create(t)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}t.toJSON=e,t.fromJSON=n}(Td||(Td={}));const _d=".text-block-content",Md=gd("text-block");class Nd extends ud{get content(){return this.getContent()}set content(t){this.setContent(t)}getContent(){return this.store.get("content","")}setContent(t,e={}){this.store.set("content",t,e)}setup(){super.setup(),this.store.on("change:*",t=>{const e=t.key;"content"===e?this.updateContent(this.getContent()):"size"===e&&this.updateSize(this.getSize())}),this.updateSize(this.getSize()),this.updateContent(this.getContent())}updateSize(t){gt.SUPPORT_FOREIGNOBJECT&&this.setAttrs({foreignObject:Object.assign({},t),[_d]:{style:Object.assign({},t)}})}updateContent(t){gt.SUPPORT_FOREIGNOBJECT?this.setAttrs({[_d]:{html:t?o.sanitizeHTML(t):""}}):this.setAttrs({[_d]:{text:t}})}}(function(t){t.config({type:Md,view:Md,markup:['<g class="rotatable">','<g class="scalable"><rect/></g>',gt.SUPPORT_FOREIGNOBJECT?["<foreignObject>",'<body xmlns="http://www.w3.org/1999/xhtml">',`<div class="${_d.substr(1)}" />`,"</body>","</foreignObject>"].join(""):`<text class="${_d.substr(1)}"/>`,"</g>"].join(""),attrs:{".":{fill:"#ffffff",stroke:"none"},rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000",fontSize:14,fontFamily:"Arial, helvetica, sans-serif"},body:{style:{background:"transparent",position:"static",margin:0,padding:0}},foreignObject:{style:{overflow:"hidden"}},[_d]:{refX:.5,refY:.5,yAlign:"middle",xAlign:"middle",style:{textAlign:"center",verticalAlign:"middle",display:"table-cell",padding:"0 5px",margin:0}}}}),ud.registry.register(Md,t)})(Nd||(Nd={})),function(t){const e="content";class n extends Ad{confirmUpdate(t,n={}){let r=super.confirmUpdate(t,n);return this.hasAction(r,e)&&(this.updateContent(),r=this.removeAction(r,e)),r}update(t){if(gt.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=Object.assign({},t||e.getAttrs());delete n[_d],super.update(n),t&&!i.has(t,_d)||this.updateContent(t)}}updateContent(t){if(gt.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=(t||e.getAttrs())[_d],r=c.breakText(e.getContent(),e.getSize(),n,{svgDocument:this.graph.view.svg}),o={[_d]:i.merge({},n,{text:r})};super.update(o)}}}t.View=n,function(t){t.config({bootstrap:["render",e],actions:gt.SUPPORT_FOREIGNOBJECT?{}:{size:e,content:e}}),Ad.registry.register(Md,t)}(n=t.View||(t.View={}))}(Nd||(Nd={}));const Pd=hd.define({shape:"empty"});function Ld(t,e="body"){return[{tagName:t,selector:e},{tagName:"text",selector:"label"}]}function Dd(t,e,n={}){const r={constructorName:t,markup:Ld(t,n.selector),attrs:{[t]:Object.assign({},hd.bodyAttr)}},o=n.parent||hd;return o.define(i.merge(r,e,{shape:t}))}const jd=Dd("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}}),Id=ud.define({shape:"rect-headered",markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}],attrs:{body:Object.assign(Object.assign({},hd.bodyAttr),{refWidth:"100%",refHeight:"100%"}),header:Object.assign(Object.assign({},hd.bodyAttr),{refWidth:"100%",height:30,stroke:"#000000"}),headerText:Object.assign(Object.assign({},hd.labelAttr),{refX:"50%",refY:15,fontSize:16}),bodyText:Object.assign(Object.assign({},hd.labelAttr),{refY2:15})}}),Rd=Dd("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}}),Fd=10,Bd=hd.define({shape:"cylinder",overwrite:!0,markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],attrs:{body:Object.assign(Object.assign({},hd.bodyAttr),{lateral:Fd}),top:Object.assign(Object.assign({},hd.bodyAttr),{refCx:"50%",refRx:"50%",cy:Fd,ry:Fd})},attrHooks:{lateral:{set(t,{refBBox:e}){const n=a.isPercentage(t);n&&(t=parseFloat(t)/100);const r=e.x,i=e.y,o=e.width,s=e.height,l=o/2,c=n?s*t:t,u=.551784,d=u*l,h=u*c,p=r,f=r+o/2,g=r+o,m=i+c,v=m-c,b=i+s-c,y=i+s,w=["M",p,m,"L",p,b,"C",r,b+h,f-d,y,f,y,"C",f+d,y,g,b+h,g,b,"L",g,m,"C",g,m-h,f+d,v,f,v,"C",f-d,v,p,m-h,p,m,"Z"];return{d:w.join(" ")}}}},knob:{enabled:!0,position({node:t}){const e=t.attr("body/lateral");return{x:0,y:e}},onMouseMove({node:t,data:e,deltaY:n}){if(0!==n){const r=t.getBBox(),i=t.attr("body/lateral");null==e.round&&(e.round=i);const o=0,s=r.height/2,l=a.clamp(e.round+n,o,s);l!==i&&t.attr({body:{lateral:l},top:{cy:l,ry:l}})}}}}),zd=Dd("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var Hd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Vd extends hd{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return null==t?this.removePoints():this.setAttrByPath("body/refPoints",Vd.pointsToString(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(t){function e(t){return"string"===typeof t?t:t.map(t=>Array.isArray(t)?t.join(","):Dr.isPointLike(t)?`${t.x}, ${t.y}`:"").join(" ")}t.pointsToString=e,t.config({propHooks(t){const{points:n}=t,r=Hd(t,["points"]);if(n){const t=e(n);t&&i.setByPath(r,"attrs/body/refPoints",t)}return r}})})(Vd||(Vd={}));const qd=Dd("polygon",{},{parent:Vd}),Ud=Dd("polyline",{},{parent:Vd});var Wd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const $d=hd.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(t){const{path:e}=t,n=Wd(t,["path"]);return e&&i.setByPath(n,"attrs/body/refD",e),n}});var Gd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Yd=hd.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},gt.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:c.ns.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},hd.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(t){const{text:e}=t,n=Gd(t,["text"]);return e&&i.setByPath(n,"attrs/label/text",e),n},attrHooks:{text:{set(t,{cell:e,view:n,refBBox:r,elem:i,attrs:o}){if(!(i instanceof HTMLElement)){const a=o.style||{},l={text:t,width:-5,height:"100%"},c=Object.assign({textVerticalAnchor:"middle"},a),u=is.presets.textWrap;return s.call(u.set,this,l,{cell:e,view:n,elem:i,refBBox:r,attrs:c}),{fill:a.color||null}}i.textContent=t},position(t,{refBBox:e,elem:n}){if(n instanceof SVGElement)return e.getCenter()}}}}),Xd=Dd("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:md()},{selector:"image"}),Kd=Dd("image-bordered",{markup:[{tagName:"rect",selector:"background",attrs:{stroke:"none"}},{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{background:{refWidth:-1,refHeight:-1,x:.5,y:.5,fill:"#ffffff"},border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5}},propHooks:md()}),Zd=Dd("image-embedded",{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}],attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"}},propHooks:md()}),Jd=Dd("image-inscribed",{propHooks:md(),markup:[{tagName:"ellipse",selector:"background"},{tagName:"image",selector:"image"},{tagName:"ellipse",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{border:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",stroke:"#333333",strokeWidth:2},background:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",fill:"#ffffff"},image:{refWidth:"68%",refHeight:"68%",refX:"16%",refY:"16%",preserveAspectRatio:"xMidYMid"}}}),Qd=xd.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}}),th=xd.define({shape:"shadow-edge",markup:[{tagName:"path",selector:"shadow",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}}}}),eh=xd.define({shape:"double-edge",markup:[{tagName:"path",selector:"outline",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#dddddd",strokeWidth:4,strokeLinejoin:"round",targetMarker:{tagName:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}});class nh extends hd{get html(){return this.getHTML()}set html(t){this.setHTML(t)}getHTML(){return this.store.get("html")}setHTML(t,e={}){return null==t?this.removeHTML(e):this.store.set("html",t,e),this}removeHTML(t={}){return this.store.remove("html",t)}}(function(t){class e extends Ad{init(){super.init(),this.cell.on("change:*",()=>{const t=this.graph.hook.shouldUpdateHTMLComponent(this.cell);t&&this.renderHTMLComponent()})}confirmUpdate(t){const n=super.confirmUpdate(t);return this.handleAction(n,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const t=this.selectors.foContent;if(t){const e=this.$(t).empty(),n=this.graph.hook.getHTMLComponent(this.cell);n&&("string"===typeof n?e.html(n):e.append(n))}}}t.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),Ad.registry.register("html-view",t)}(e=t.View||(t.View={}))})(nh||(nh={})),function(t){t.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Vl.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),ud.registry.register("html",t)}(nh||(nh={})),function(t){t.componentRegistry=Eo.create({type:"html componnet"})}(nh||(nh={}));var rh=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class ih extends Al{constructor(t){super(),this.delay=10,this.throttle=2,this.threshold=5,this.changeCount=0,this.timestamp=0,this.options=Object.assign(Object.assign({},ih.defaultOptions),t),this.graph.model.on("cell:change:*",this.onModelChanged,this)}get graph(){return this.options.graph}onModelChanged(){if(this.disabled)return;const t=(new Date).getTime(),e=(t-this.timestamp)/1e3;e>this.delay||this.changeCount>=this.threshold&&e>this.throttle?(this.save(),this.reset()):this.changeCount+=1}save(){this.trigger("save")}reset(){this.changeCount=0,this.timestamp=(new Date).getTime()}dispose(){this.graph.model.off("cell:change:*",this.onModelChanged,this)}}rh([Al.dispose()],ih.prototype,"dispose",null),function(t){t.defaultOptions={delay:10,throttle:2,threshold:5}}(ih||(ih={}));class oh extends xl{constructor(t){super(),this.graph=t,this.init()}get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}init(){}}var ah,sh=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class lh extends Ll{constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=Vl.parseJSONMarkup(lh.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=lh.snapshoot(this.container),this.$(this.container).addClass(this.prefixClassName("graph")).append(n),this.delegateEvents()}get model(){return this.graph.model}get options(){return this.graph.options}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return"mousedown"===t.type&&2===t.button||(!(!this.options.guard||!this.options.guard(t,e))||(t.data&&void 0!==t.data.guarded?t.data.guarded:!(e&&e.cell&&sd.isCell(e.cell))&&(this.svg!==t.target&&this.container!==t.target&&!pt.a.contains(this.svg,t.target))))}findView(t){return this.graph.renderer.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onDblClick(e,r.x,r.y):this.graph.trigger("blank:dblclick",{e:e,x:r.x,y:r.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onClick(e,r.x,r.y):this.graph.trigger("blank:click",{e:e,x:r.x,y:r.y})}}isPreventDefaultContextMenu(t,e){let n=this.options.preventDefaultContextMenu;return"function"===typeof n&&(n=s.call(n,this.graph,{view:e})),n}onContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.isPreventDefaultContextMenu(e,n)&&t.preventDefault(),this.guard(e,n))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onContextMenu(e,r.x,r.y):this.graph.trigger("blank:contextmenu",{e:e,x:r.x,y:r.y})}delegateDragEvents(t,e){null==t.data&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const n=this.constructor;this.delegateDocumentEvents(n.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){const e=this.getEventData(t);return e.mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;this.options.preventDefaultMouseDown&&e.preventDefault();const r=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onMouseDown(e,r.x,r.y):(this.options.preventDefaultBlankAction&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:e,x:r.x,y:r.y})),this.delegateDragEvents(e,n)}onMouseMove(t){const e=this.getEventData(t),n=e.startPosition;if(n&&n.x===t.clientX&&n.y===t.clientY)return;null==e.mouseMovedCount&&(e.mouseMovedCount=0),e.mouseMovedCount+=1;const r=e.mouseMovedCount;if(r<=this.options.moveThreshold)return;const i=this.normalizeEvent(t),o=this.graph.snapToGrid(i.clientX,i.clientY),a=e.currentView;a?a.onMouseMove(i,o.x,o.y):this.graph.trigger("blank:mousemove",{e:i,x:o.x,y:o.y}),this.setEventData(i,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),r=this.getEventData(t),i=r.currentView;i?i.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e:e,x:n.x,y:n.y}),t.isPropagationStopped()||this.onClick(pt.a.Event(t,{type:"click",data:t.data})),t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOver(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseover",{e:e})}}onMouseOut(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOut(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseout",{e:e})}}onMouseEnter(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const r=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(r===n)return;n.onMouseEnter(e)}else{if(r)return;this.graph.trigger("graph:mouseenter",{e:e})}}onMouseLeave(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const r=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(r===n)return;n.onMouseLeave(e)}else{if(r)return;this.graph.trigger("graph:mouseleave",{e:e})}}onMouseWheel(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const r=e.originalEvent,i=this.graph.snapToGrid(r.clientX,r.clientY),o=Math.max(-1,Math.min(1,r.wheelDelta||-r.detail));n?n.onMouseWheel(e,i.x,i.y,o):this.graph.trigger("blank:mousewheel",{e:e,delta:o,x:i.x,y:i.y})}onCustomEvent(t){const e=t.currentTarget,n=e.getAttribute("event")||e.getAttribute("data-event");if(n){const r=this.findView(e);if(r){const e=this.normalizeEvent(t);if(this.guard(e,r))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);r.onCustomEvent(e,n,i.x,i.y)}}}handleMagnetEvent(t,e){const n=t.currentTarget,r=n.getAttribute("magnet");if(r&&"false"!==r.toLowerCase()){const r=this.findView(n);if(r){const i=this.normalizeEvent(t);if(this.guard(i,r))return;const o=this.graph.snapToGrid(i.clientX,i.clientY);s.call(e,this.graph,r,i,n,o.x,o.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,(t,e,n,r,i)=>{t.onMagnetMouseDown(e,n,r,i)})}onMagnetDblClick(t){this.handleMagnetEvent(t,(t,e,n,r,i)=>{t.onMagnetDblClick(e,n,r,i)})}onMagnetContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);this.isPreventDefaultContextMenu(e,n)&&e.preventDefault(),this.handleMagnetEvent(e,(t,e,n,r,i)=>{t.onMagnetContextMenu(e,n,r,i)})}onLabelMouseDown(t){const e=t.currentTarget,n=this.findView(e);if(n){const e=this.normalizeEvent(t);if(this.guard(e,n))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);n.onLabelMouseDown(e,r.x,r.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}sh([Ll.dispose()],lh.prototype,"dispose",null),function(t){const e=_s.prefixCls+"-graph";function n(t){const e=t.cloneNode();return t.childNodes.forEach(t=>e.appendChild(t)),()=>{c.empty(t);while(t.attributes.length>0)t.removeAttribute(t.attributes[0].name);for(let n=0,r=e.attributes.length;n<r;n+=1){const r=e.attributes[n];t.setAttribute(r.name,r.value)}e.childNodes.forEach(e=>t.appendChild(e))}}t.markup=[{ns:c.ns.xhtml,tagName:"div",selector:"background",className:e+"-background"},{ns:c.ns.xhtml,tagName:"div",selector:"grid",className:e+"-grid"},{ns:c.ns.svg,tagName:"svg",selector:"svg",className:e+"-svg",attrs:{width:"100%",height:"100%","xmlns:xlink":c.ns.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:e+"-svg-viewport",children:[{tagName:"g",selector:"primer",className:e+"-svg-primer"},{tagName:"g",selector:"stage",className:e+"-svg-stage"},{tagName:"g",selector:"decorator",className:e+"-svg-decorator"},{tagName:"g",selector:"overlay",className:e+"-svg-overlay"}]}]}],t.snapshoot=n}(lh||(lh={})),function(t){const e=_s.prefixCls;t.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(lh||(lh={})),function(t){function e(t,e){return(n,r,i)=>{const o=i.value;i.value=function(...n){const i=this.scroller.widget;if(null==i){const n=`Shoule enable scroller to use method '${r}'`;if(!1!==t)throw console.error(n),new Error(n);return!1!==e&&console.warn(n),this}return o.call(this,...n)}}}t.checkScroller=e}(ah||(ah={}));const ch=".x6-graph {\n position: relative;\n outline: none;\n}\n.x6-graph-background,\n.x6-graph-grid,\n.x6-graph-svg {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-background-stage,\n.x6-graph-grid-stage,\n.x6-graph-svg-stage {\n user-select: none;\n}\n.x6-graph.x6-graph-pannable {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph.x6-graph-panning {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-node {\n cursor: move;\n /* stylelint-disable-next-line */\n}\n.x6-node.x6-node-immovable {\n cursor: default;\n}\n.x6-node * {\n -webkit-user-drag: none;\n}\n.x6-node .scalable * {\n vector-effect: non-scaling-stroke;\n}\n.x6-node [magnet='true'] {\n cursor: crosshair;\n transition: opacity 0.3s;\n}\n.x6-node [magnet='true']:hover {\n opacity: 0.7;\n}\n.x6-node foreignObject {\n display: block;\n overflow: visible;\n background-color: transparent;\n}\n.x6-node foreignObject > body {\n position: static;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: visible;\n background-color: transparent;\n}\n.x6-edge .source-marker,\n.x6-edge .target-marker {\n vector-effect: non-scaling-stroke;\n}\n.x6-edge .connection {\n stroke-linejoin: round;\n fill: none;\n}\n.x6-edge .connection-wrap {\n cursor: move;\n opacity: 0;\n fill: none;\n stroke: #000;\n stroke-width: 15;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.x6-edge .connection-wrap:hover {\n opacity: 0.4;\n stroke-opacity: 0.4;\n}\n.x6-edge .vertices {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .vertices .vertex {\n fill: #1abc9c;\n}\n.x6-edge .vertices .vertex :hover {\n fill: #34495e;\n stroke: none;\n}\n.x6-edge .vertices .vertex-remove {\n cursor: pointer;\n fill: #fff;\n}\n.x6-edge .vertices .vertex-remove-area {\n cursor: pointer;\n opacity: 0.1;\n}\n.x6-edge .vertices .vertex-group:hover .vertex-remove-area {\n opacity: 1;\n}\n.x6-edge .arrowheads {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .arrowheads .arrowhead {\n fill: #1abc9c;\n}\n.x6-edge .arrowheads .arrowhead :hover {\n fill: #f39c12;\n stroke: none;\n}\n.x6-edge .tools {\n cursor: pointer;\n opacity: 0;\n}\n.x6-edge .tools .tool-options {\n display: none;\n}\n.x6-edge .tools .tool-remove circle {\n fill: #f00;\n}\n.x6-edge .tools .tool-remove path {\n fill: #fff;\n}\n.x6-edge:hover .vertices,\n.x6-edge:hover .arrowheads,\n.x6-edge:hover .tools {\n opacity: 1;\n}\n.x6-highlight-opacity {\n opacity: 0.3;\n}\n@keyframes halo-pie-visibility {\n 0% {\n visibility: hidden;\n }\n 100% {\n visibility: visible;\n }\n}\n@keyframes halo-pie-opening {\n 0% {\n transform: scale(0.4) rotate(-20deg);\n }\n 100% {\n transform: scale(1) rotate(0);\n }\n}\n.x6-widget-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n background-size: 20px 20px;\n cursor: pointer;\n user-select: none;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle.hidden {\n display: none;\n}\n.x6-widget-handle-selected {\n background-color: rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n}\n.x6-widget-handle-remove {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%20M4.152%2C14.598C1.273%2C11.719%2C1.273%2C7.035%2C4.153%2C4.154%20c2.88-2.88%2C7.563-2.88%2C10.443%2C0c2.881%2C2.88%2C2.881%2C7.562%2C0%2C10.443C11.716%2C17.477%2C7.032%2C17.477%2C4.152%2C14.598L4.152%2C14.598z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: pointer;\n}\n.x6-widget-handle-remove:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-rotate {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-rotate:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-resize {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%236A6C8A%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n cursor: se-resize;\n}\n.x6-widget-handle-resize:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%23FD6EB6%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-clone {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.85%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-clone:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.849%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%20M15.172%2C16.328%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-link {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n}\n.x6-widget-handle-link:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-fork {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%236A6C8A%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20C7.552%2C9.82%2C7.602%2C9.589%2C7.602%2C9.344c0-0.25-0.051-0.487-0.129-0.71l4.097-2.364c0.393%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.014%2C0.149%2C0.021%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.982%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.014%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-fork:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23FD6EB6%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20c0.075-0.22%2C0.125-0.452%2C0.125-0.697c0-0.25-0.051-0.487-0.129-0.71l4.097-2.365c0.394%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.015%2C0.148%2C0.022%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.981%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.013%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-direction {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%236A6C8A%3Bstroke%3A%236A6C8A%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%236A6C8A%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-direction:hover {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%23FD6EB6%3Bstroke%3A%23FD6EB6%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%23FD6EB6%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-surround .x6-widget-handle-animate .x6-widget-handle {\n transition: background-size 80ms, width 80ms, height 80ms, top 150ms, left 150ms, bottom 150ms, right 150ms;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-se {\n right: -25px;\n bottom: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-nw {\n top: -21px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-n {\n top: -22px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-e {\n top: -webkit-calc(40%);\n top: calc(50% - 10px);\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-ne {\n top: -21px;\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-w {\n top: 50%;\n left: -25px;\n margin-top: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-sw {\n bottom: -25px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-s {\n bottom: -24px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle {\n width: 15px;\n height: 15px;\n font-size: 15px;\n background-size: 15px 15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-se {\n right: -19px;\n bottom: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-nw {\n top: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-n {\n top: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-e {\n top: -webkit-calc(42%);\n top: calc(50% - 8px);\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-ne {\n top: -19px;\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-w {\n left: -19px;\n margin-top: -8px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-sw {\n bottom: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-s {\n bottom: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle {\n width: 10px;\n height: 10px;\n font-size: 10px;\n background-size: 10px 10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-se {\n right: -15px;\n bottom: -13px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-nw {\n top: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-n {\n top: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-e {\n top: -webkit-calc(45%);\n top: calc(50% - 5px);\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-ne {\n top: -13px;\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-w {\n left: -15px;\n margin-top: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-sw {\n bottom: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-s {\n bottom: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-toolbar {\n position: absolute;\n top: -50px;\n display: table-row;\n padding: 7px 5px;\n}\n.x6-widget-handle-toolbar::after {\n position: absolute;\n top: 100%;\n left: 10px;\n width: 0;\n height: 0;\n margin-top: 4px;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n content: '';\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n position: relative;\n display: table-cell;\n min-width: 20px;\n margin: 0 2px;\n background-position: 3px 3px;\n background-size: 16px 16px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle::after {\n position: absolute;\n bottom: -11px;\n width: 100%;\n content: '';\n}\n.x6-widget-handle-pie {\n position: absolute;\n top: -webkit-calc(0%);\n top: calc(50% - 50px);\n right: -50px;\n z-index: 1;\n display: none;\n width: 100px;\n height: 100px;\n margin: -2px -2px 0 0;\n border-radius: 50%;\n cursor: default;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie .x6-widget-handle {\n width: 1px;\n height: auto;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie-slice-svg {\n width: 100%;\n height: 100%;\n overflow: visible !important;\n}\n.x6-widget-handle-pie-slice-img,\n.x6-widget-handle-pie-slice-txt {\n display: none;\n pointer-events: none;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='e'] {\n top: calc(50% - 50px);\n right: -50px;\n left: auto;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='w'] {\n top: calc(50% - 50px);\n right: auto;\n left: -52px;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='n'] {\n top: -50px;\n right: auto;\n bottom: auto;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie[data-pie-toggle-position='s'] {\n top: auto;\n right: auto;\n bottom: -52px;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie-opened {\n display: block;\n animation: halo-pie-visibility 0.1s, halo-pie-opening 0.1s;\n animation-timing-function: step-end, ease;\n animation-delay: 0s, 0.1s;\n}\n.x6-widget-handle-pie-toggle {\n position: absolute;\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n z-index: 2;\n display: block;\n box-sizing: border-box;\n width: 30px;\n height: 30px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 20px 20px;\n border-radius: 50%;\n cursor: pointer;\n user-select: none;\n pointer-events: visiblePainted;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle-pie-toggle-pos-e {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n bottom: auto;\n left: auto;\n}\n.x6-widget-handle-pie-toggle-pos-w {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: auto;\n bottom: auto;\n left: -15px;\n}\n.x6-widget-handle-pie-toggle-pos-n {\n top: -15px;\n right: auto;\n bottom: auto;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-pos-s {\n top: auto;\n right: auto;\n bottom: -15px;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-opened {\n transition: 0.1s background-image;\n}\n.x6-widget-handle-toolbar {\n position: static;\n display: inline-block;\n margin-top: -50px;\n margin-left: 45px;\n white-space: nowrap;\n vertical-align: top;\n background-color: #f5f5f5;\n border-bottom: 3px solid #333;\n border-radius: 5px;\n box-shadow: 0 1px 2px #222;\n}\n.x6-widget-handle-toolbar::after {\n top: -12px;\n left: 55px;\n margin-top: 0;\n border-top: 6px solid #333;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n display: inline-block;\n vertical-align: top;\n}\n.x6-widget-handle-toolbar .x6-widget-handle:hover::after {\n border-bottom: 4px solid #fc6cb8;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-rotate {\n position: absolute;\n top: 100%;\n right: 100%;\n margin-top: 3px;\n margin-right: 6px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-remove:hover::after,\n.x6-widget-handle-toolbar .x6-widget-handle-rotate:hover::after {\n border-bottom: none;\n}\n.x6-widget-handle-toolbar .x6-widget-handle + .x6-widget-handle {\n margin-left: 4px;\n}\n.x6-widget-handle-pie {\n box-sizing: content-box;\n background-color: #f5f5f5;\n border: 2px solid #404040;\n}\n.x6-widget-handle-pie-slice {\n fill: transparent;\n stroke: #e9e9e9;\n stroke-width: 1;\n}\n.x6-widget-handle-pie-slice:hover {\n fill: #fff;\n}\n.x6-widget-handle-pie-slice-img {\n display: block;\n}\n.x6-widget-handle-selected .x6-widget-handle-pie-slice {\n fill: #fff;\n}\n.x6-widget-handle-pie-toggle {\n background-color: #f6f6f6;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n background-size: 16px 16px;\n border: 2px solid #3b425f;\n}\n.x6-widget-handle-pie-toggle:hover {\n background-color: #fff;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n border-color: #fd6eb6;\n}\n.x6-widget-handle-pie-toggle-opened {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%236a6c8a%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-pie-toggle-opened:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%23FD6EB6%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-halo {\n position: absolute;\n pointer-events: none;\n}\n.x6-widget-halo-content {\n position: absolute;\n top: 100%;\n padding: 6px;\n font-size: 10px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-halo-handles + .x6-widget-halo-content {\n right: -20px;\n left: -20px;\n margin-top: 30px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 25px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 20px;\n}\n.x6-widget-halo-handles.x6-widget-handle-pie + .x6-widget-halo-content {\n right: 0;\n left: 0;\n margin-top: 10px;\n}\n.x6-widget-halo-content {\n color: #fff;\n background-color: #6a6b8a;\n}\n.x6-widget-halo.type-node .x6-widget-handle-toolbar .x6-widget-handle-remove {\n position: absolute;\n right: 100%;\n bottom: 100%;\n margin-right: 6px;\n margin-bottom: 3px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-surround .x6-widget-handle-remove {\n background-color: #fff;\n border-radius: 50%;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar {\n margin-top: -60px;\n margin-left: -18px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar::after {\n top: -22px;\n left: -9px;\n}\n.x6-widget-minimap {\n position: relative;\n display: table-cell;\n box-sizing: border-box;\n overflow: hidden;\n text-align: center;\n vertical-align: middle;\n background-color: #fff;\n user-select: none;\n}\n.x6-widget-minimap .x6-graph {\n display: inline-block;\n box-shadow: 0 0 4px 0 #eee;\n cursor: pointer;\n}\n.x6-widget-minimap .x6-graph > svg {\n pointer-events: none;\n shape-rendering: optimizeSpeed;\n}\n.x6-widget-minimap .x6-graph .x6-node * {\n /* stylelint-disable-next-line */\n vector-effect: initial;\n}\n.x6-widget-minimap-viewport {\n position: absolute;\n box-sizing: content-box !important;\n margin: -2px 0 0 -2px;\n border: 2px solid #31d0c6;\n cursor: move;\n}\n.x6-widget-minimap-viewport-zoom {\n position: absolute;\n right: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 12px;\n height: 12px;\n margin: 0 -6px -6px 0;\n background-color: #fff;\n border: 2px solid #31d0c6;\n border-radius: 50%;\n cursor: nwse-resize;\n}\n.x6-graph-scroller {\n position: relative;\n box-sizing: border-box;\n overflow: scroll;\n outline: none;\n}\n.x6-graph-scroller-content {\n position: relative;\n}\n.x6-graph-scroller-background {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-scroller .x6-graph {\n position: absolute;\n display: inline-block;\n margin: 0;\n box-shadow: none;\n}\n.x6-graph-scroller .x6-graph > svg {\n display: block;\n}\n.x6-graph-scroller.x6-graph-scroller-paged .x6-graph {\n box-shadow: 0 0 4px 0 #eee;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='false'] {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='true'] {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-graph-pagebreak {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-pagebreak-vertical {\n position: absolute;\n top: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 1px;\n border-left: 1px dashed #bdbdbd;\n}\n.x6-graph-pagebreak-horizontal {\n position: absolute;\n right: 0;\n left: 0;\n box-sizing: border-box;\n height: 1px;\n border-top: 1px dashed #bdbdbd;\n}\n.x6-widget-selection {\n position: absolute;\n display: none;\n width: 0;\n height: 0;\n touch-action: none;\n}\n.x6-widget-selection-rubberband {\n display: block;\n overflow: visible;\n opacity: 0.3;\n}\n.x6-widget-selection-selected {\n display: block;\n}\n.x6-widget-selection-box {\n cursor: move;\n}\n.x6-widget-selection-inner[data-selection-length='0'],\n.x6-widget-selection-inner[data-selection-length='1'] {\n display: none;\n}\n.x6-widget-selection-content {\n position: absolute;\n top: 100%;\n right: -20px;\n left: -20px;\n margin-top: 30px;\n padding: 6px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-selection-content:empty {\n display: none;\n}\n.x6-widget-selection-rubberband {\n background-color: #3498db;\n border: 2px solid #2980b9;\n}\n.x6-widget-selection-box {\n box-sizing: content-box !important;\n margin-top: -4px;\n margin-left: -4px;\n padding-right: 4px;\n padding-bottom: 4px;\n border: 2px dashed #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-inner {\n box-sizing: content-box !important;\n margin-top: -8px;\n margin-left: -8px;\n padding-right: 12px;\n padding-bottom: 12px;\n border: 2px solid #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-content {\n color: #fff;\n font-size: 10px;\n background-color: #6a6b8a;\n}\n.x6-widget-snapline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n.x6-widget-snapline-vertical,\n.x6-widget-snapline-horizontal {\n stroke: #2ecc71;\n stroke-width: 1px;\n}\n.x6-widget-stencil {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-widget-stencil::after {\n position: absolute;\n top: 0;\n display: block;\n width: 100%;\n height: 20px;\n padding: 8px 0;\n line-height: 20px;\n text-align: center;\n opacity: 0;\n transition: top 0.1s linear, opacity 0.1s linear;\n content: ' ';\n pointer-events: none;\n}\n.x6-widget-stencil-content {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: auto;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.x6-widget-stencil .x6-node [magnet]:not([magnet='passive']) {\n pointer-events: none;\n}\n.x6-widget-stencil-group {\n padding: 0;\n padding-bottom: 8px;\n overflow: hidden;\n user-select: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n padding-bottom: 0;\n}\n.x6-widget-stencil-group-title {\n position: relative;\n margin-top: 0;\n margin-bottom: 0;\n padding: 4px;\n cursor: pointer;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n user-select: none;\n}\n.x6-widget-stencil .unmatched {\n opacity: 0.3;\n}\n.x6-widget-stencil .x6-node.unmatched {\n display: none;\n}\n.x6-widget-stencil-group.unmatched {\n display: none;\n}\n.x6-widget-stencil-search-text {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n width: 100%;\n height: 30px;\n max-height: 30px;\n line-height: 30px;\n outline: 0;\n}\n.x6-widget-stencil.not-found::after {\n opacity: 1;\n content: attr(data-not-found-text);\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 30px;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 50px;\n}\n.x6-widget-stencil {\n color: #333;\n background: #f5f5f5;\n}\n.x6-widget-stencil-content {\n position: absolute;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-content {\n top: 32px;\n}\n.x6-widget-stencil.searchable > .x6-widget-stencil-content {\n top: 80px;\n}\n.x6-widget-stencil.not-found::after {\n position: absolute;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 80px;\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 60px;\n}\n.x6-widget-stencil-group {\n height: auto;\n margin-bottom: 1px;\n padding: 0;\n transition: none;\n}\n.x6-widget-stencil-group .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n max-height: 31px;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n position: relative;\n left: 0;\n box-sizing: border-box;\n width: 100%;\n height: 32px;\n padding: 0 5px 0 8px;\n color: #666;\n font-weight: 700;\n font-size: 12px;\n line-height: 32px;\n cursor: default;\n transition: all 0.3;\n}\n.x6-widget-stencil-title:hover,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title:hover {\n color: #444;\n}\n.x6-widget-stencil-title {\n background: #e9e9e9;\n}\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n background: #ededed;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title {\n padding-left: 32px;\n cursor: pointer;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n position: absolute;\n top: 6px;\n left: 8px;\n display: block;\n width: 18px;\n height: 18px;\n margin: 0;\n padding: 0;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n border: none;\n content: ' ';\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48L2c+PC9zdmc+');\n opacity: 0.4;\n transition: all 0.3s;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48cGF0aCBkPSJNOC44MTcgNS42MjN2Ni43NTZhLjU1OC41NTggMCAwMDEuMTE2IDBWNS42MjNhLjU1OC41NTggMCAxMC0xLjExNiAweiIvPjwvZz48L3N2Zz4=');\n opacity: 0.4;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil input[type='search'] {\n -webkit-appearance: textfield;\n}\n.x6-widget-stencil input[type='search']::-webkit-search-cancel-button,\n.x6-widget-stencil input[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n.x6-widget-stencil-search-text {\n display: block;\n width: 90%;\n margin: 8px 5%;\n padding-left: 8px;\n color: #333;\n background: #fff;\n border: 1px solid #e9e9e9;\n border-radius: 12px;\n outline: 0;\n}\n.x6-widget-stencil-search-text:focus {\n outline: 0;\n}\n.x6-widget-stencil::after {\n color: #808080;\n font-weight: 600;\n font-size: 12px;\n background: 0 0;\n}\n.x6-widget-transform {\n position: absolute;\n box-sizing: content-box !important;\n margin: -5px 0 0 -5px;\n padding: 4px;\n border: 1px dashed #000;\n border-radius: 5px;\n user-select: none;\n pointer-events: none;\n}\n.x6-widget-transform > div {\n position: absolute;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #000;\n transition: background-color 0.2s;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-transform > div:hover {\n background-color: #d3d3d3;\n}\n.x6-widget-transform-cursor-n {\n cursor: n-resize;\n}\n.x6-widget-transform-cursor-s {\n cursor: s-resize;\n}\n.x6-widget-transform-cursor-e {\n cursor: e-resize;\n}\n.x6-widget-transform-cursor-w {\n cursor: w-resize;\n}\n.x6-widget-transform-cursor-ne {\n cursor: ne-resize;\n}\n.x6-widget-transform-cursor-nw {\n cursor: nw-resize;\n}\n.x6-widget-transform-cursor-se {\n cursor: se-resize;\n}\n.x6-widget-transform-cursor-sw {\n cursor: sw-resize;\n}\n.x6-widget-transform-resize {\n width: 10px;\n height: 10px;\n border-radius: 6px;\n}\n.x6-widget-transform-resize[data-position='top-left'] {\n top: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='top-right'] {\n top: -5px;\n right: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-left'] {\n bottom: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-right'] {\n right: -5px;\n bottom: -5px;\n}\n.x6-widget-transform-resize[data-position='top'] {\n top: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom'] {\n bottom: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='left'] {\n top: 50%;\n left: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform-resize[data-position='right'] {\n top: 50%;\n right: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='top'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='right'] {\n display: none;\n}\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='right'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='top'] {\n display: none;\n}\n.x6-widget-transform.no-resize .x6-widget-transform-resize {\n display: none;\n}\n.x6-widget-transform-rotate {\n top: -20px;\n left: -20px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n cursor: crosshair;\n}\n.x6-widget-transform.no-rotate .x6-widget-transform-rotate {\n display: none;\n}\n.x6-widget-transform-active {\n border-color: transparent;\n pointer-events: all;\n}\n.x6-widget-transform-active > div {\n display: none;\n}\n.x6-widget-transform-active > .x6-widget-transform-active-handle {\n display: block;\n background-color: #808080;\n}\n.x6-widget-knob {\n position: absolute;\n box-sizing: border-box;\n width: 16px;\n height: 16px;\n margin-top: -8px;\n margin-left: -8px;\n cursor: pointer;\n user-select: none;\n}\n.x6-widget-knob::before,\n.x6-widget-knob::after {\n position: absolute;\n transform: rotate(45deg);\n content: '';\n}\n.x6-widget-knob::before {\n top: 4px;\n left: 4px;\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n background-color: #fff;\n}\n.x6-widget-knob::after {\n top: 5px;\n left: 5px;\n box-sizing: border-box;\n width: 6px;\n height: 6px;\n background-color: #fca000;\n}\n.x6-graph-print {\n position: relative;\n}\n.x6-graph-print .x6-graph-print-ready {\n display: none;\n}\n.x6-graph-print .x6-graph-print-preview {\n overflow: hidden !important;\n background: #fff !important;\n}\n@media print {\n html,\n html > body.x6-graph-printing {\n position: relative !important;\n width: 100% !important;\n height: 100% !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n html > body.x6-graph-printing > * {\n display: none !important;\n }\n html > body.x6-graph-printing > .x6-graph-print {\n display: block !important;\n }\n .x6-graph-print {\n top: 0 !important;\n left: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n overflow: hidden !important;\n page-break-after: always;\n background: #fff !important;\n }\n .x6-graph-print .x6-graph-print-ready {\n display: none;\n }\n}\n.x6-cell-tool-editor {\n position: relative;\n display: inline-block;\n min-height: 1em;\n margin: 0;\n padding: 0;\n line-height: 1;\n white-space: normal;\n text-align: center;\n vertical-align: top;\n overflow-wrap: normal;\n outline: none;\n transform-origin: 0 0;\n -webkit-user-drag: none;\n}\n.x6-edge-tool-editor {\n border: 1px solid #275fc5;\n border-radius: 2px;\n}\n";var uh=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class dh extends oh{init(){_s.autoInsertCSS&&dh.ensure()}dispose(){dh.clean()}}uh([dh.dispose()],dh.prototype,"dispose",null),function(t){let e,n=0;function r(){if(n+=1,!(n>1)&&!gt.isApplyingHMR()){e=document.createElement("style"),e.setAttribute("type","text/css"),e.textContent=ch;const t=document.querySelector("head");t&&t.insertBefore(e,t.firstChild)}}function i(){n-=1,n>0||(e&&e.parentNode&&e.parentNode.removeChild(e),e=null)}t.ensure=r,t.clean=i}(dh||(dh={}));var hh,ph=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class fh{get handleClassName(){return hh.handle}get pie(){return Object.assign(Object.assign({},fh.defaultPieOptions),this.handleOptions.pie)}initHandles(){if(this.handles=[],this.handleOptions.handles&&this.handleOptions.handles.forEach(t=>this.addHandle(t)),"pie"===this.handleOptions.type){if(this.pie.toggles){const t=hh.pieToggle;this.$pieToggles={},this.pie.toggles.forEach(e=>{const n=this.$("<div/>");this.applyAttrs(n,e.attrs),n.addClass(t).addClass(`${t}-pos-${e.position||"e"}`).attr("data-name",e.name).appendTo(this.container),this.$pieToggles[e.name]=n})}this.setPieIcons()}if(this.$handleContainer){const t=this.handleOptions.type||"surround";this.$handleContainer.addClass(hh.wrap).addClass(hh.animate).addClass(`${hh.handle}-${t}`)}this.delegateEvents({["mousedown ."+hh.handle]:"onHandleMouseDown",["touchstart ."+hh.handle]:"onHandleMouseDown",["mousedown ."+hh.pieToggle]:"onPieToggleMouseDown",["touchstart ."+hh.pieToggle]:"onPieToggleMouseDown"})}onHandleMouseDown(t){const e=this.$(t.currentTarget).closest("."+hh.handle).attr("data-action");e&&(t.preventDefault(),t.stopPropagation(),this.setEventData(t,{action:e,clientX:t.clientX,clientY:t.clientY,startX:t.clientX,startY:t.clientY}),"mousedown"===t.type&&2===t.button?this.triggerHandleAction(e,"contextmenu",t):(this.triggerHandleAction(e,"mousedown",t),this.delegateDocumentEvents({mousemove:"onHandleMouseMove",touchmove:"onHandleMouseMove",mouseup:"onHandleMouseUp",touchend:"onHandleMouseUp",touchcancel:"onHandleMouseUp"},t.data)))}onHandleMouseMove(t){const e=this.getEventData(t),n=e.action;n&&this.triggerHandleAction(n,"mousemove",t)}onHandleMouseUp(t){const e=this.getEventData(t),n=e.action;n&&(this.triggerHandleAction(n,"mouseup",t),this.undelegateDocumentEvents())}triggerHandleAction(t,e,n,r){n.preventDefault(),n.stopPropagation();const i=this.normalizeEvent(n),o=this.getEventData(i),a=this.graph.snapToGrid(i.clientX,i.clientY),s=this.graph.snapToGrid(o.clientX,o.clientY),l=a.x-s.x,c=a.y-s.y;this.trigger(`action:${t}:${e}`,Object.assign({e:i,dx:l,dy:c,x:a.x,y:a.y,offsetX:n.clientX-o.startX,offsetY:n.clientY-o.startY},r)),o.clientX=n.clientX,o.clientY=n.clientY}onPieToggleMouseDown(t){t.stopPropagation();const e=this.$(t.target).closest("."+hh.pieToggle).attr("data-name");this.isOpen(e)||this.isOpen()&&this.toggleState(),this.toggleState(e)}setPieIcons(){"pie"===this.handleOptions.type&&this.$handleContainer.find("."+hh.handle).each((t,e)=>{const n=this.$(e),r=n.attr("data-action"),i=hh.pieSlice,o=this.getHandle(r);if(!o||!o.icon){const t=window.getComputedStyle(e,":before").getPropertyValue("content");if(t&&"none"!==t){const e=n.find(`.${i}-txt`);e.length&&ai.create(e[0]).text(t.replace(/['"]/g,""))}const r=n.css("background-image");if(r){const t=r.match(/url\(['"]?([^'"]+)['"]?\)/);if(t){const e=t[1],r=n.find(`.${i}-img`);r.length>0&&ai.create(r[0]).attr("xlink:href",e)}}}})}getHandleIdx(t){return this.handles.findIndex(e=>e.name===t)}hasHandle(t){return this.getHandleIdx(t)>=0}getHandle(t){return this.handles.find(e=>e.name===t)}renderHandle(t){const e=this.$("<div/>").addClass(`${hh.handle} ${hh.handle}-${t.name}`).attr("data-action",t.name).prop("draggable",!1);if("pie"===this.handleOptions.type){const n=this.getHandleIdx(t.name),r=this.pie,i=r.outerRadius,o=r.innerRadius,a=(i+o)/2,s=new Dr(i,i),l=Er.toRad(r.sliceAngle),u=n*l+Er.toRad(r.startAngle),d=u+l,h=c.createSlicePathData(o,i,u,d),p=ai.create("svg").addClass(hh.pieSlice+"-svg"),f=ai.create("path").addClass(hh.pieSlice).attr("d",h).translate(i,i),g=Dr.fromPolar(a,-u-l/2,s).toJSON(),m=r.iconSize,v=ai.create("image").attr(g).addClass(hh.pieSlice+"-img");g.y=g.y+m-2;const b=ai.create("text",{"font-size":m}).attr(g).addClass(hh.pieSlice+"-txt");v.attr({width:m,height:m}),v.translate(-m/2,-m/2),b.translate(-m/2,-m/2),p.append([f,v,b]),e.append(p.node)}else e.addClass(`${hh.handle}-pos-${t.position}`),t.content&&("string"===typeof t.content?e.html(t.content):e.append(t.content));return this.updateHandleIcon(e,t.icon),this.applyAttrs(e,t.attrs),e}addHandle(t){if(!this.hasHandle(t.name)){this.handles.push(t);const e=t.events;e&&Object.keys(e).forEach(n=>{const r=e[n],i=`action:${t.name}:${n}`;"string"===typeof r?this.on(i,this[r],this):this.on(i,r)}),this.$handleContainer&&this.$handleContainer.append(this.renderHandle(t))}return this}addHandles(t){return t.forEach(t=>this.addHandle(t)),this}removeHandles(){while(this.handles.length)this.removeHandle(this.handles[0].name);return this}removeHandle(t){const e=this.getHandleIdx(t),n=this.handles[e];return n&&(n.events&&Object.keys(n.events).forEach(e=>{this.off(`action:${t}:${e}`)}),this.getHandleElem(t).remove(),this.handles.splice(e,1)),this}changeHandle(t,e){const n=this.getHandle(t);return n&&(this.removeHandle(t),this.addHandle(Object.assign(Object.assign({},n),e))),this}toggleHandle(t,e){const n=this.getHandle(t);if(n){const r=this.getHandleElem(t),i=hh.handle+"-selected";void 0===e&&(e=!r.hasClass(i)),r.toggleClass(i,e);const o=e?n.iconSelected:n.icon;o&&this.updateHandleIcon(r,o)}return this}selectHandle(t){return this.toggleHandle(t,!0)}deselectHandle(t){return this.toggleHandle(t,!1)}deselectAllHandles(){return this.handles.forEach(t=>this.deselectHandle(t.name)),this}getHandleElem(t){return this.$handleContainer.find(`.${hh.handle}-${t}`)}updateHandleIcon(t,e){if("pie"===this.handleOptions.type){const n=t.find("."+hh.pieSliceImg);this.$(n[0]).attr("xlink:href",e||"")}else t.css("background-image",e?`url(${e})`:"")}isRendered(){return null!=this.$handleContainer}isOpen(t){return!!this.isRendered()&&(t?this.$pieToggles[t].hasClass(hh.pieToggleOpened):this.$handleContainer.hasClass(""+hh.pieOpended))}toggleState(t){if(this.isRendered()){const e=this.$handleContainer;if(Object.keys(this.$pieToggles).forEach(t=>{const e=this.$pieToggles[t];e.removeClass(hh.pieToggleOpened)}),this.isOpen())this.trigger("pie:close",{name:t}),e.removeClass(hh.pieOpended);else{if(this.trigger("pie:open",{name:t}),t){const n=this.pie.toggles,r=n&&n.find(e=>e.name===t);r&&e.attr({"data-pie-toggle-name":r.name,"data-pie-toggle-position":r.position}),this.$pieToggles[t].addClass(hh.pieToggleOpened)}e.addClass(hh.pieOpended)}}}applyAttrs(t,e){if(e){const n=Ll.$(t);Object.keys(e).forEach(t=>{const r=n.find(t).addBack().filter(t),i=e[t],{class:o}=i,a=ph(i,["class"]);o&&r.addClass(o),r.attr(a)})}}}(function(t){t.defaultPieOptions={innerRadius:20,outerRadius:50,sliceAngle:45,startAngle:0,iconSize:14,toggles:[{name:"default",position:"e"}]}})(fh||(fh={})),function(t){t.handle=Ll.prototype.prefixClassName("widget-handle"),t.wrap=t.handle+"-wrap",t.animate=t.handle+"-animate",t.pieOpended=t.handle+"-pie-opened",t.pieToggle=t.handle+"-pie-toggle",t.pieToggleOpened=t.handle+"-pie-toggle-opened",t.pieSlice=t.handle+"-pie-slice",t.pieSliceImg=t.handle+"-pie-slice-img"}(hh||(hh={}));var gh,mh=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},vh=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class bh extends Ll{constructor(t){super();const e=t,{view:n,cell:r,node:i,edge:o,graph:a}=e,s=vh(e,["view","cell","node","edge","graph"]);n?(this.view=n,this.cell=n.cell,this.graph=n.graph,this.model=this.graph.model):(r||o||i)&&a&&(this.cell=i||o||r,this.view=a.renderer.findViewByCell(this.cell),this.graph=a,this.model=this.graph.model);const l=this.constructor;!1!==t.clearAll&&l.removeInstances(this.graph),l.register(this),this.init(s)}static ensureCache(){return this.instanceCache.has(this)||this.instanceCache.set(this,{}),this.instanceCache.get(this)}static register(t,e){null==e&&(e=t.graph);const n=this.ensureCache();let r=n[e.view.cid];null==r&&(r=n[e.view.cid]={}),r[t.cid]=t}static unregister(t,e){null==e&&(e=t.graph);const n=this.ensureCache();n[e.view.cid]&&delete n[e.view.cid][t.cid]}static removeInstances(t){const e=this.ensureCache(),n=e[t.view.cid];n&&Object.keys(n).forEach(t=>{const e=n[t];e&&e.remove()})}static getInstances(t){const e=this.ensureCache();return e[t.view.cid]||{}}init(t){}render(){return this}startListening(){!1!==this.options.clearOnBlankMouseDown&&this.graph.on("blank:mousedown",this.remove,this)}stopListening(){!1!==this.options.clearOnBlankMouseDown&&this.graph.off("blank:mousedown",this.remove,this)}remove(){this.stopListening();const t=this.constructor;return t.unregister(this),super.remove()}dispose(){this.remove()}}bh.instanceCache=new WeakMap,mh([Ll.dispose()],bh.prototype,"dispose",null);class yh extends bh{get node(){return this.cell}get metadata(){const t=this.cell.prop("knob");return Array.isArray(t)?null!=this.options.index?t[this.options.index]:null:t}init(t){this.options=Object.assign({},t),this.render(),this.startListening()}startListening(){this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.model.on("reseted",this.remove,this),this.node.on("removed",this.remove,this),this.view.on("node:resize:mousedown",this.onTransform,this),this.view.on("node:rotate:mousedown",this.onTransform,this),this.view.on("node:resize:mouseup",this.onTransformed,this),this.view.on("node:rotate:mouseup",this.onTransformed,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),super.startListening()}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.model.off("reseted",this.remove,this),this.node.off("removed",this.remove,this),this.view.off("node:resize:mousedown",this.onTransform,this),this.view.off("node:rotate:mousedown",this.onTransform,this),this.view.off("node:resize:mouseup",this.onTransformed,this),this.view.off("node:rotate:mouseup",this.onTransformed,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),super.stopListening()}render(){return this.container=document.createElement("div"),c.addClass(this.container,this.prefixClassName("widget-knob")),this.options.className&&c.addClass(this.container,this.options.className),this.view.addClass(gh.KNOB),this.graph.container.appendChild(this.container),this.update(),this}remove(){return this.view.removeClass(gh.KNOB),super.remove()}update(){if(this.metadata){const{update:t,position:e}=this.metadata,n={knob:this,cell:this.cell,node:this.node};if(e){const t=e.call(this.graph,Object.assign({},n));if(t){const e=this.graph.matrix(),n=this.node.getBBox(),r=Er.normalize(this.node.getAngle()),i=Dr.create(t);0!==r&&i.rotate(-r,{x:n.width/2,y:n.height/2}),i.translate(n).scale(e.a,e.d).translate(e.e,e.f),this.container.style.left=i.x+"px",this.container.style.top=i.y+"px"}}t&&t.call(this.graph,Object.assign({},n))}}hide(){this.container.style.display="none"}show(){this.container.style.display=""}onTransform(){this.hide()}onTransformed(){this.show()}onKnobMouseDown({knob:t}){this.cid!==t.cid&&this.hide()}onKnobMouseUp(){this.show()}notify(t,e){if(this.view){const n=this.view.normalizeEvent(e),r=this.graph.snapToGrid(n.clientX,n.clientY);this.view.notify("cell:"+t,{e:n,view:this.view,node:this.node,cell:this.cell,x:r.x,y:r.y,knob:this}),this.cell.isNode()?this.view.notify("node:"+t,{e:n,view:this.view,node:this.node,cell:this.cell,x:r.x,y:r.y,knob:this}):this.cell.isEdge()&&this.view.notify("edge:"+t,{e:n,view:this.view,edge:this.cell,cell:this.cell,x:r.x,y:r.y,knob:this})}}onMouseDown(t){t.stopPropagation(),this.setEventData(t,{knobbing:!1,originX:t.clientX,originY:t.clientY,clientX:t.clientX,clientY:t.clientY}),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(gh.documentEvents,t.data),this.metadata&&this.metadata.onMouseDown&&this.metadata.onMouseDown.call(this.graph,{e:t,data:this.getEventData(t),knob:this,cell:this.cell,node:this.node}),this.notify("knob:mousedown",t)}onMouseMove(t){const e=this.getEventData(t),n=this.graph.findViewByCell(this.node);if(e.knobbing||(e.knobbing=!0,n&&(n.addClass(gh.KNOBBING),this.notify("knob",t)),this.model.startBatch("knob",{cid:this.cid})),e.clientX=t.clientX,e.clientY=t.clientY,this.metadata&&this.metadata.onMouseMove){const n=this.graph.matrix(),r=(t.clientX-e.originX)/n.a,i=(t.clientY-e.originY)/n.d,o=this.node.getAngle(),a=new Dr(r,i).rotate(o);this.metadata.onMouseMove.call(this.graph,{e:t,data:e,deltaX:a.x,deltaY:a.y,knob:this,cell:this.cell,node:this.node})}this.notify("knobbing",t),this.notify("knob:mousemove",t)}onMouseUp(t){this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.getEventData(t),n=this.graph.findViewByCell(this.node);e.knobbing&&(n&&n.removeClass(gh.KNOBBING),this.metadata&&this.metadata.onMouseUp&&this.metadata.onMouseUp.call(this.graph,{e:t,data:e,knob:this,cell:this.cell,node:this.node}),this.model.stopBatch("knob",{cid:this.cid}),this.notify("knobbed",t)),this.notify("knob:mouseup",t)}}(function(t){t.KNOB="has-widget-knob",t.KNOBBING="node-knobbing",t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"}})(gh||(gh={}));var wh,xh,Ch=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};(function(t){t.root="widget-minimap",t.viewport=t.root+"-viewport",t.zoom=t.viewport+"-zoom"})(wh||(wh={}));class kh extends Ll{constructor(t){super(),this.options=Object.assign(Object.assign({},xh.defaultOptions),t),this.updateViewport=s.debounce(this.updateViewport.bind(this),0),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(wh.root));const e=document.createElement("div");this.container.appendChild(e),this.$viewport=this.$("<div>").addClass(this.prefixClassName(wh.viewport)),this.options.scalable&&(this.zoomHandle=this.$("<div>").addClass(this.prefixClassName(wh.zoom)).appendTo(this.$viewport).get(0)),this.$container.append(this.$viewport).css({width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const n=Object.assign(Object.assign({},this.options.graphOptions),{container:e,model:this.sourceGraph.model,frozen:!0,async:this.sourceGraph.isAsync(),interacting:!1,grid:!1,background:!1,rotating:!1,resizing:!1,embedding:!1,selecting:!1,snapline:!1,clipboard:!1,history:!1,scroller:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(n):new Ip(n),this.targetGraph.renderer.unfreeze(),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}get graph(){return this.options.graph}get scroller(){return this.graph.scroller.widget}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}get $graphContainer(){return this.scroller?this.scroller.$container:this.$(this.graph.container)}startListening(){this.scroller?this.$graphContainer.on("scroll"+this.getEventNamespace(),this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",["mousedown ."+this.prefixClassName("graph")]:"scrollTo",["touchstart ."+this.prefixClassName("graph")]:"scrollTo"})}stopListening(){this.scroller?this.$graphContainer.off(this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.targetGraph.view.remove(),this.stopListening(),this.targetGraph.dispose()}onTransform(t){(t.ui||this.targetGraphTransforming)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(t,e){let n,r;"object"===typeof t?(n=t.width,r=t.height):(n=t,r=e);const i=this.sourceGraph.options,o=this.sourceGraph.transform.getScale(),a=this.options.width-2*this.options.padding,s=this.options.height-2*this.options.padding;n/=o.sx,r/=o.sy,this.ratio=Math.min(a/n,s/r);const l=this.ratio,c=i.x*l/o.sx,u=i.y*l/o.sy;return n*=l,r*=l,this.targetGraph.resizeGraph(n,r),this.targetGraph.translate(c,u),this.scroller?this.targetGraph.scale(l,l):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const t=this.sourceGraph.transform.getScale(),e=this.targetGraph.transform.getScale();let n=null;n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0);const r=this.$(this.targetGraph.container).position(),i=this.targetGraph.translate();i.ty=i.ty||0,this.geometry={top:r.top+n.y*e.sy+i.ty,left:r.left+n.x*e.sx+i.tx,width:this.$graphContainer.innerWidth()*e.sx/t.sx,height:this.$graphContainer.innerHeight()*e.sy/t.sy},this.$viewport.css(this.geometry)}startAction(t){const e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",{tx:r,ty:i}=this.sourceGraph.translate(),o={action:n,clientX:e.clientX,clientY:e.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:r,translateY:i};this.targetGraphTransforming=!0,this.delegateDocumentEvents(xh.documentEvents,o)}doAction(t){const e=this.normalizeEvent(t),n=e.clientX,r=e.clientY,i=e.data;switch(i.action){case"panning":{const t=this.sourceGraph.transform.getScale(),e=(n-i.clientX)*t.sx,o=(r-i.clientY)*t.sy;this.scroller?(this.graphContainer.scrollLeft=i.scrollLeft+e/this.ratio,this.graphContainer.scrollTop=i.scrollTop+o/this.ratio):this.sourceGraph.translate(i.translateX-e/this.ratio,i.translateY-o/this.ratio);break}case"zooming":{const t=i.scale,e=i.geometry,r=1+(i.clientX-n)/e.width/t.sx;i.frameId&&cancelAnimationFrame(i.frameId),i.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(r*i.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})});break}default:break}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(t){const e=this.normalizeEvent(t);let n,r;const i=this.targetGraph.translate();if(i.ty=i.ty||0,null==e.offsetX){const t=this.$(this.targetGraph.container).offset();n=e.pageX-t.left,r=e.pageY-t.top}else n=e.offsetX,r=e.offsetY;const o=(n-i.tx)/this.ratio,a=(r-i.ty)/this.ratio;this.sourceGraph.centerPoint(o,a)}dispose(){this.remove()}}Ch([Ll.dispose()],kh.prototype,"dispose",null),function(t){t.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:t=>new Ip(t)},t.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}}(xh||(xh={}));var Ah=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Sh=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Eh extends Ll{constructor(t){super();const{graph:e}=t,n=Sh(t,["graph"]);this.graph=e,this.options=Object.assign({tolerance:10},n),this.offset={x:0,y:0},this.render(),this.parseFilter(),this.disabled||this.startListening()}get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return this.containerClassName+"-vertical"}get horizontalClassName(){return this.containerClassName+"-horizontal"}get disabled(){return!0!==this.options.enabled||!0!==this.graph.options.snapline.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.graph.options.snapline.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.snapline.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t,this.parseFilter()}render(){const t=this.containerWrapper=new ai("svg"),e=this.horizontal=new ai("path"),n=this.vertical=new ai("path");t.addClass(this.containerClassName),e.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),t.setAttribute("width","100%"),t.setAttribute("height","100%"),e.setAttribute("display","none"),n.setAttribute("display","none"),t.append([e,n]),this.options.className&&t.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}parseFilter(){this.filterShapes={},this.filterCells={},this.filterFunction=null;const t=this.options.filter;Array.isArray(t)?t.forEach(t=>{"string"===typeof t?this.filterShapes[t]=!0:this.filterCells[t.id]=!0}):"function"===typeof t&&(this.filterFunction=t)}onBatchStop({name:t,data:e}){"resize"===t&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:n}){const r=t.getDelegatedView();if(r&&this.isNodeMovable(r)){const r=t.cell.getPosition();this.offset={x:e-r.x,y:n-r.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const n=this.graph.renderer.findViewByCell(t);if(n&&n.cell.isNode()){const i=t.getBBox(),o=i.bbox(t.getAngle()),a=o.getTopLeft(),s=o.getBottomRight(),l=Er.normalize(t.getAngle()),c=this.options.tolerance||0;let u,d,h,p,f,g;const m={vertical:0,horizontal:0},v=e.direction,b=e.trueDirection,y=e.relativeDirection;-1!==b.indexOf("right")?m.vertical=s.x:m.vertical=a.x,-1!==b.indexOf("bottom")?m.horizontal=s.y:m.horizontal=a.y,this.model.getNodes().some(e=>{if(this.isIgnored(t,e))return!1;const n=e.getBBox().bbox(e.getAngle()),i=n.getTopLeft(),a=n.getBottomRight(),l={vertical:[i.x,a.x],horizontal:[i.y,a.y]},v={};return Object.keys(l).forEach(t=>{const e=t,n=l[e].map(t=>({position:t,distance:Math.abs(t-m[e])})).filter(t=>t.distance<=c);v[e]=r.sortBy(n,t=>t.distance)}),null==u&&v.vertical.length>0&&(u=v.vertical[0].position,d=Math.min(o.y,n.y),h=Math.max(s.y,a.y)-d),null==p&&v.horizontal.length>0&&(p=v.horizontal[0].position,f=Math.min(o.x,n.x),g=Math.max(s.x,a.x)-f),null!=u&&null!=p}),this.hide();let w=0,x=0;null==p&&null==u||(null!=u&&(w=-1!==b.indexOf("right")?u-s.x:a.x-u),null!=p&&(x=-1!==b.indexOf("bottom")?p-s.y:a.y-p));let C=0,k=0;if(l%90===0)90===l||270===l?(C=x,k=w):(C=w,k=x);else{const t=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;null!=p&&null!=u&&(w<x?(x=0,p=void 0):(w=0,u=void 0));const e=Er.toRad(l%90);w&&(C=3===t?w/Math.cos(e):w/Math.sin(e)),x&&(k=3===t?x/Math.cos(e):x/Math.sin(e));const n=1===t||3===t;switch(y){case"top":case"bottom":k=x?x/(n?Math.cos(e):Math.sin(e)):w/(n?Math.sin(e):Math.cos(e));break;case"left":case"right":C=w?w/(n?Math.cos(e):Math.sin(e)):x/(n?Math.sin(e):Math.cos(e));break;default:break}}switch(y){case"top":case"bottom":C=0;break;case"left":case"right":k=0;break;default:break}const A=this.graph.getGridSize();let S=Math.max(i.width+C,A),E=Math.max(i.height+k,A);e.minWidth&&e.minWidth>A&&(S=Math.max(S,e.minWidth)),e.minHeight&&e.minHeight>A&&(E=Math.max(E,e.minHeight)),e.maxWidth&&(S=Math.min(S,e.maxWidth)),e.maxHeight&&(E=Math.min(E,e.maxHeight)),e.preserveAspectRatio&&(k<C?E=S*(i.height/i.width):S=E*(i.width/i.height)),S===i.width&&E===i.height||(t.resize(S,E,{direction:v,relativeDirection:y,trueDirection:b,snapped:!0,snaplines:this.cid,restrict:this.graph.hook.getRestrictArea(n)}),h&&(h+=E-i.height),g&&(g+=S-i.width));const O=t.getBBox().bbox(l);u&&Math.abs(O.x-u)>1&&Math.abs(O.width+O.x-u)>1&&(u=void 0),p&&Math.abs(O.y-p)>1&&Math.abs(O.height+O.y-p)>1&&(p=void 0),this.update({verticalLeft:u,verticalTop:d,verticalHeight:h,horizontalTop:p,horizontalLeft:f,horizontalWidth:g})}}}snapOnMoving({view:t,e:e,x:n,y:r}){const i=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(i))return;const o=i.cell,a=o.getSize(),s=o.getPosition(),l=new jr(n-this.offset.x,r-this.offset.y,a.width,a.height),c=o.getAngle(),u=l.getCenter(),d=l.bbox(c),h=d.getTopLeft(),p=d.getBottomRight(),f=this.options.tolerance||0;let g,m,v,b,y,w,x=0,C=0;if(this.model.getNodes().some(t=>{if(this.isIgnored(o,t))return!1;const e=t.getBBox().bbox(t.getAngle()),n=e.getCenter(),r=e.getTopLeft(),i=e.getBottomRight();return null==g&&(Math.abs(n.x-u.x)<f?(g=n.x,x=.5):Math.abs(r.x-h.x)<f?(g=r.x,x=0):Math.abs(r.x-p.x)<f?(g=r.x,x=1):Math.abs(i.x-p.x)<f?(g=i.x,x=1):Math.abs(i.x-h.x)<f&&(g=i.x),null!=g&&(m=Math.min(d.y,e.y),v=Math.max(p.y,i.y)-m)),null==b&&(Math.abs(n.y-u.y)<f?(b=n.y,C=.5):Math.abs(r.y-h.y)<f?b=r.y:Math.abs(r.y-p.y)<f?(b=r.y,C=1):Math.abs(i.y-p.y)<f?(b=i.y,C=1):Math.abs(i.y-h.y)<f&&(b=i.y),null!=b&&(y=Math.min(d.x,e.x),w=Math.max(p.x,i.x)-y)),null!=g&&null!=b}),this.hide(),null!=b||null!=g){null!=b&&(d.y=b-C*d.height),null!=g&&(d.x=g-x*d.width);const t=d.getCenter(),e=t.x-l.width/2,n=t.y-l.height/2,r=e-s.x,a=n-s.y;0===r&&0===a||(o.translate(r,a,{snapped:!0,restrict:this.graph.hook.getRestrictArea(i)}),w&&(w+=r),v&&(v+=a)),this.update({verticalLeft:g,verticalTop:m,verticalHeight:v,horizontalTop:b,horizontalLeft:y,horizontalWidth:w})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||this.filterShapes[e.shape]||this.filterCells[e.id]||this.filterFunction&&s.call(this.filterFunction,this.graph,e)}update(t){if(t.horizontalTop){const e=this.graph.localToGraph(new Dr(t.horizontalLeft,t.horizontalTop)),n=this.graph.localToGraph(new Dr(t.horizontalLeft+t.horizontalWidth,t.horizontalTop));this.horizontal.setAttributes({d:`M ${e.x},${e.y} L ${n.x},${n.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(t.verticalLeft){const e=this.graph.localToGraph(new Dr(t.verticalLeft,t.verticalTop)),n=this.graph.localToGraph(new Dr(t.verticalLeft,t.verticalTop+t.verticalHeight));this.vertical.setAttributes({d:`M ${e.x},${e.y} L ${n.x},${n.y}`,display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const t=this.options.clean,e="number"===typeof t?t:!1!==t?3e3:0;return e>0&&(this.timer=window.setTimeout(()=>{null!==this.container.parentNode&&this.unmount()},e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}Ah([Ll.dispose()],Eh.prototype,"dispose",null);var Oh=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Th extends oh{init(){this.resetUpdates(),this.startListening(),this.resetViews(this.model.getCells()),!this.isFrozen()&&this.isAsync()&&this.updateViewsAsync()}startListening(){this.model.on("sorted",this.onSortModel,this),this.model.on("reseted",this.onModelReseted,this),this.model.on("batch:stop",this.onBatchStop,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("sorted",this.onSortModel,this),this.model.off("reseted",this.onModelReseted,this),this.model.off("batch:stop",this.onBatchStop,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}resetUpdates(){this.updates={priorities:[{},{},{}],mounted:{},mountedCids:[],unmounted:{},unmountedCids:[],count:0,sort:!1,frozen:!1,freezeKey:null,animationId:null}}onSortModel(){this.model.hasActiveBatch(Th.SORT_DELAYING_BATCHES)||this.sortViews()}onModelReseted({options:t}){this.removeZPivots(),this.resetViews(this.model.getCells(),t)}onBatchStop({name:t,data:e}){if(this.isFrozen())return;const n=this.model;if(!this.isAsync()){const r=Th.UPDATE_DELAYING_BATCHES;r.includes(t)&&!n.hasActiveBatch(r)&&this.updateViews(e)}const r=Th.SORT_DELAYING_BATCHES;r.includes(t)&&!n.hasActiveBatch(r)&&this.sortViews()}onCellAdded({cell:t,options:e}){const n=e.position;this.isAsync()||"number"!==typeof n?this.renderView(t,e):(e.maxPosition===n&&this.freeze({key:"addCells"}),this.renderView(t,e),0===n&&this.unfreeze({key:"addCells"}))}onCellRemoved({cell:t,options:e}){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,Th.FLAG_REMOVE,n.priority,e)}onCellZIndexChanged({cell:t,options:e}){if("approx"===this.options.sorting){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,Th.FLAG_INSERT,n.priority,e)}}onCellVisibleChanged({cell:t,current:e,options:n}){e||this.processEdgeOnTerminalVisibleChanged(t,!1);const r=this.findViewByCell(t);!e&&r?this.removeView(t):e&&null==r&&this.renderView(t,n),e&&this.processEdgeOnTerminalVisibleChanged(t,!0)}processEdgeOnTerminalVisibleChanged(t,e){const n=(t,e)=>{const n=t.getSourceCellId();if(n!==e.id)return t.getSourceCell();const r=t.getTargetCellId();return r!==e.id?t.getTargetCell():null};this.model.getConnectedEdges(t).forEach(r=>{const i=n(r,t);(null==i||i.isVisible())&&(e?r.show():r.hide())})}isEdgeTerminalVisible(t,e){const n="source"===e?t.getSourceCellId():t.getTargetCellId(),r=n?this.model.getCell(n):null;return!(r&&!r.isVisible())}requestConnectedEdgesUpdate(t,e={}){if(Gl.isCellView(t)){const n=t.cell,r=this.model.getConnectedEdges(n);for(let t=0,i=r.length;t<i;t+=1){const i=r[t],o=this.findViewByCell(i);if(!o)continue;const a=["update"];i.getTargetCell()===n&&a.push("target"),i.getSourceCell()===n&&a.push("source"),this.scheduleViewUpdate(o,o.getFlag(a),o.priority,e)}}}forcePostponedViewUpdate(t,e){if(!t||!Gl.isCellView(t))return!1;const n=t.cell;if(n.isNode())return!1;const r=t;if(n.isEdge()&&0===(e&t.getFlag(["source","target"]))){let t=0;const e=this.findViewByCell(n.getSourceCell());e&&!this.isViewMounted(e)&&(t=this.dumpView(e),r.updateTerminalMagnet("source"));let i=0;const o=this.findViewByCell(n.getTargetCell());if(o&&!this.isViewMounted(o)&&(i=this.dumpView(o),r.updateTerminalMagnet("target")),0===t&&0===i)return!this.dumpView(r)}return!1}scheduleViewUpdate(t,e,n,r={}){const i=t.cid,o=this.updates;let a=o.priorities[n];a||(a=o.priorities[n]={});const s=a[i]||0;(s&e)!==e&&(s||(o.count+=1),e&Th.FLAG_REMOVE&&s&Th.FLAG_INSERT?a[i]^=Th.FLAG_INSERT:e&Th.FLAG_INSERT&&s&Th.FLAG_REMOVE&&(a[i]^=Th.FLAG_REMOVE),a[i]|=e,this.graph.hook.onViewUpdated(t,e,r))}requestViewUpdate(t,e,n,r={}){this.scheduleViewUpdate(t,e,n,r);const i=this.isAsync();if(this.isFrozen()||i&&!1!==r.async||this.model.hasActiveBatch(Th.UPDATE_DELAYING_BATCHES))return;const o=this.updateViews(r);i&&this.graph.trigger("render:done",{stats:o,options:r})}dumpView(t,e={}){if(null==t)return 0;const n=t.cid,r=this.updates,i=r.priorities[t.priority],o=this.registerMountedView(t)|i[n];return delete i[n],o?this.updateView(t,o,e):0}dumpViews(t={}){this.checkView(t),this.updateViews(t)}requireView(t,e={}){const n=this.findViewByCell(t);return null==n?null:(this.dumpView(n,e),n)}updateView(t,e,n={}){if(null==t)return 0;if(Gl.isCellView(t)){if(e&Th.FLAG_REMOVE)return this.removeView(t.cell),0;e&Th.FLAG_INSERT&&(this.insertView(t),e^=Th.FLAG_INSERT)}return e?t.confirmUpdate(e,n):0}updateViews(t={}){let e,n=0,r=0,i=Th.MIN_PRIORITY;do{e=this.updateViewsBatch(t),n+=1,r+=e.updatedCount,i=Math.min(e.priority,i)}while(!e.empty);return{priority:i,batchCount:n,updatedCount:r}}updateViewsBatch(t={}){const e=this.updates,n=e.priorities,r=t.batchSize||Th.UPDATE_BATCH_SIZE;let i=!0,o=Th.MIN_PRIORITY,a=0,l=0,c=0,u=0,d=t.checkView||this.options.checkView;"function"!==typeof d&&(d=null);t:for(let h=0,p=n.length;h<p;h+=1){const p=n[h];for(const n in p){if(c>=r){i=!1;break t}const f=Ll.views[n];if(!f){delete p[n];continue}let g=p[n];if(0===(g&Th.FLAG_REMOVE)){const t=n in e.unmounted;if(d&&!s.call(d,this.graph,{view:f,unmounted:t})){t||(this.registerUnmountedView(f),f.unmount()),e.unmounted[n]|=g,delete p[n],l+=1;continue}t&&(g|=Th.FLAG_INSERT,a+=1),g|=this.registerMountedView(f)}const m=f;let v=this.updateView(f,g,t);if(v>0){const t=m.cell;t&&t.isEdge()&&(m.hasAction(v,"source")&&!this.isEdgeTerminalVisible(t,"source")&&(v=m.removeAction(v,"source"),v|=Th.FLAG_REMOVE),m.hasAction(v,"target")&&!this.isEdgeTerminalVisible(t,"target")&&(v=m.removeAction(v,"target"),v|=Th.FLAG_REMOVE))}v>0&&(p[n]=v,!this.graph.hook.onViewPostponed(m,v,t)||p[n])?(u+=1,i=!1):(o>h&&(o=h),c+=1,delete p[n])}}return{empty:i,priority:o,mountedCount:a,unmountedCount:l,updatedCount:c,postponedCount:u}}updateViewsAsync(t={},e={processed:0,priority:Th.MIN_PRIORITY}){const n=this.updates,r=n.animationId;if(r){if(c.cancelAnimationFrame(r),0===e.processed){const e=t.before;"function"===typeof e&&s.call(e,this.graph,this.graph)}const i=this.updateViewsBatch(t),o=this.checkViewImpl({checkView:t.checkView,mountedBatchSize:Th.MOUNT_BATCH_SIZE-i.mountedCount,unmountedBatchSize:Th.MOUNT_BATCH_SIZE-i.unmountedCount});let a=e.processed;const l=n.count,u=o.mountedCount,d=o.unmountedCount;i.updatedCount>0&&(a+=i.updatedCount+i.unmountedCount,e.priority=Math.min(i.priority,e.priority),i.empty&&0===u?(i.priority=e.priority,i.mountedCount+=u,i.unmountedCount+=d,this.graph.trigger("render:done",{stats:i,options:t}),e.processed=0,n.count=0):e.processed=a);const h=t.progress;if(l&&"function"===typeof h&&s.call(h,this.graph,{total:l,done:i.empty,current:a}),n.animationId!==r)return}n.animationId=c.requestAnimationFrame(()=>{this.updateViewsAsync(t,e)})}registerMountedView(t){const e=t.cid,n=this.updates;if(e in n.mounted)return 0;n.mounted[e]=!0,n.mountedCids.push(e);const r=n.unmounted[e]||0;return delete n.unmounted[e],r}registerUnmountedView(t){const e=t.cid,n=this.updates;if(e in n.unmounted)return 0;n.unmounted[e]|=Th.FLAG_INSERT;const r=n.unmounted[e];return n.unmountedCids.push(e),delete n.mounted[e],r}isViewMounted(t){if(null==t)return!1;const e=t.cid;return e in this.updates.mounted}getMountedViews(){return Object.keys(this.updates.mounted).map(t=>Gl.views[t])}getUnmountedViews(){return Object.keys(this.updates.unmounted).map(t=>Gl.views[t])}checkMountedViews(t,e){let n=0;if("function"!==typeof t)return n;const r=this.updates,i=r.mounted,o=r.mountedCids,a=null==e?o.length:Math.min(o.length,e);for(let l=0;l<a;l+=1){const e=o[l];if(!(e in i))continue;const r=Gl.views[e];if(null==r)continue;const a=s.call(t,this.graph,{view:r,unmounted:!0});if(a){o.push(e);continue}n+=1;const c=this.registerUnmountedView(r);c&&r.unmount()}return o.splice(0,a),n}checkUnmountedViews(t,e){let n=0;"function"!==typeof t&&(t=null);const r=this.updates,i=r.unmounted,o=r.unmountedCids,a=null==e?o.length:Math.min(o.length,e);for(let l=0;l<a;l+=1){const e=o[l];if(!(e in i))continue;const r=Gl.views[e];if(null==r)continue;if(t&&!s.call(t,this.graph,{view:r,unmounted:!1})){o.push(e);continue}n+=1;const a=this.registerMountedView(r);a&&this.scheduleViewUpdate(r,a,r.priority,{mounting:!0})}return o.splice(0,a),n}checkViewImpl(t={mountedBatchSize:Number.MAX_SAFE_INTEGER,unmountedBatchSize:Number.MAX_SAFE_INTEGER}){const e=t.checkView||this.options.checkView,n=this.checkMountedViews(e,t.unmountedBatchSize),r=this.checkUnmountedViews(e,n>0?Math.min(this.updates.unmountedCids.length-n,t.mountedBatchSize):t.mountedBatchSize);return{mountedCount:r,unmountedCount:n}}checkView(t={}){return this.checkViewImpl(t)}isFrozen(){return!!this.options.frozen}freeze(t={}){const e=t.key,n=this.updates,r=this.options.frozen,i=n.freezeKey;if(e&&e!==i){if(r&&i)return;n.frozen=r,n.freezeKey=e}this.options.frozen=!0;const o=n.animationId;n.animationId=null,this.isAsync()&&null!=o&&c.cancelAnimationFrame(o),this.graph.trigger("freeze",{key:e})}unfreeze(t={}){const e=t.key,n=this.updates,r=n.freezeKey;if(e&&r&&e!==r)return;if(n.freezeKey=null,e&&e===r&&n.frozen)return;const i=()=>{this.options.frozen=n.frozen=!1,n.sort&&(this.sortViews(),n.sort=!1);const r=t.after;r&&s.call(r,this.graph,this.graph),this.graph.trigger("unfreeze",{key:e})};if(this.isAsync()){this.freeze();const e=t.progress;this.updateViewsAsync(Object.assign(Object.assign({},t),{progress:({done:t,current:n,total:r})=>{e&&s.call(e,this.graph,{done:t,current:n,total:r}),t&&i()}}))}else this.updateViews(t),i()}isAsync(){return!!this.options.async}setAsync(t){this.options.async=t}onRemove(){this.freeze(),this.removeViews()}resetViews(t=[],e={}){this.resetUpdates(),this.removeViews(),this.freeze({key:"reset"});for(let n=0,r=t.length;n<r;n+=1)this.renderView(t[n],e);this.unfreeze({key:"reset"}),this.sortViews()}removeView(t){const e=this.views[t.id];if(e){const n=e.cid,r=this.updates,i=r.mounted,o=r.unmounted;e.remove(),delete this.views[t.id],delete i[n],delete o[n]}return e}removeViews(){this.views&&Object.keys(this.views).forEach(t=>{const e=this.views[t];e&&this.removeView(e.cell)}),this.views={}}renderView(t,e={}){const n=t.id,r=this.views;let i=0,o=r[n];if(t.isVisible()&&(!t.isEdge()||this.isEdgeTerminalVisible(t,"source")&&this.isEdgeTerminalVisible(t,"target"))){if(o)i=Th.FLAG_INSERT;else{const e=this.graph.hook.createCellView(t);e&&(o=r[t.id]=e,o.graph=this.graph,i=this.registerUnmountedView(o)|o.getBootstrapFlag())}o&&this.requestViewUpdate(o,i,o.priority,e)}}isExactSorting(){return"exact"===this.options.sorting}sortViews(){this.isExactSorting()&&(this.isFrozen()?this.updates.sort=!0:this.sortViewsExact())}sortElements(t,e){const n=t.map(t=>{const e=t.parentNode,n=e.insertBefore(document.createTextNode(""),t.nextSibling);return t=>{if(e===t)throw new Error("You can't sort elements if any one is a descendant of another.");e.insertBefore(t,n),e.removeChild(n)}});t.sort(e).forEach((t,e)=>n[e](t))}sortViewsExact(){const t=this.view.$(this.view.stage).children("[data-cell-id]").toArray(),e=this.model;this.sortElements(t,(t,n)=>{const r=e.getCell(t.getAttribute("data-cell-id")||""),i=e.getCell(n.getAttribute("data-cell-id")||""),o=r.getZIndex()||0,a=i.getZIndex()||0;return o===a?0:o<a?-1:1})}addZPivot(t=0){null==this.zPivots&&(this.zPivots={});const e=this.zPivots;let n=e[t];if(n)return n;n=e[t]=document.createComment("z-index:"+(t+1));let r=-1/0;for(const o in e){const e=+o;e<t&&e>r&&(r=e)}const i=this.view.stage;if(r!==-1/0){const t=e[r];i.insertBefore(n,t.nextSibling)}else i.insertBefore(n,i.firstChild);return n}removeZPivots(){this.zPivots&&Object.keys(this.zPivots).forEach(t=>{const e=this.zPivots[t];e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}insertView(t){const e=this.view.stage;switch(this.options.sorting){case"approx":{const n=t.cell.getZIndex(),r=this.addZPivot(n);e.insertBefore(t.container,r);break}case"exact":default:e.appendChild(t.container);break}}findViewByCell(t){if(null==t)return null;const e=sd.isCell(t)?t.id:t;return this.views[e]}findViewByElem(t){if(null==t)return null;const e="string"===typeof t?this.view.stage.querySelector(t):t instanceof Element?t:t[0];if(e){const t=this.view.findAttr("data-cell-id",e);if(t)return this.views[t]}return null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map(t=>this.findViewByCell(t)).filter(t=>null!=t&&c.getBBox(t.container,{target:this.view.stage}).containsPoint(e))}findEdgeViewsInArea(t,e={}){const n=jr.create(t);return this.model.getEdges().map(t=>this.findViewByCell(t)).filter(t=>{if(t){const r=c.getBBox(t.container,{target:this.view.stage});return 0===r.width?r.inflate(1,0):0===r.height&&r.inflate(0,1),e.strict?n.containsRect(r):n.isIntersectWithRect(r)}return!1})}findViewsInArea(t,e={}){const n=jr.create(t);return this.model.getNodes().map(t=>this.findViewByCell(t)).filter(t=>{if(t){const r=c.getBBox(t.container,{target:this.view.stage});return e.strict?n.containsRect(r):n.isIntersectWithRect(r)}return!1})}dispose(){this.resetUpdates(),this.stopListening()}}Oh([oh.dispose()],Th.prototype,"dispose",null),function(t){t.FLAG_INSERT=1<<30,t.FLAG_REMOVE=1<<29,t.MOUNT_BATCH_SIZE=1e3,t.UPDATE_BATCH_SIZE=1e3,t.MIN_PRIORITY=2,t.SORT_DELAYING_BATCHES=["add","to-front","to-back"],t.UPDATE_DELAYING_BATCHES=["translate"]}(Th||(Th={}));var _h=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Mh extends oh{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",n=t.position||"center";const r=this.graph.transform.getScale(),i=this.graph.translate();if("object"===typeof n){const t=i.tx+r.sx*(n.x||0),e=i.ty+r.sy*(n.y||0);n=`${t}px ${e}px`}"object"===typeof e&&(e=jr.fromSize(e).scale(r.sx,r.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=n}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement))return void(this.elem.style.backgroundImage="");const n=this.optionsCache;if(n&&n.image!==e.image)return;let r;const o=e.opacity,a=e.size;let s=e.repeat||"no-repeat";const l=Ts.registry.get(s);if("function"===typeof l){const n=e.quality||1;t.width*=n,t.height*=n;const i=l(t,e);if(!(i instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");r=i.toDataURL("image/png"),s=e.repeat&&s!==e.repeat?e.repeat:"repeat","object"===typeof a?(a.width*=i.width/t.width,a.height*=i.height/t.height):void 0===a&&(e.size={width:i.width/n,height:i.height/n})}else r=t.src,void 0===a&&(e.size={width:t.width,height:t.height});null!=n&&"object"===typeof e.size&&e.image===n.image&&e.repeat===n.repeat&&e.quality===n.quality&&(n.size=i.clone(e.size));const c=this.elem.style;c.backgroundImage=`url(${r})`,c.backgroundRepeat=s,c.opacity=null==o||o>=1?"":""+o,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=i.clone(e);const n=document.createElement("img");n.onload=()=>this.drawBackgroundImage(n,t),n.setAttribute("crossorigin","anonymous"),n.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}_h([oh.dispose()],Mh.prototype,"dispose",null);var Nh,Ph=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Lh=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Dh extends Ll{constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=Nh.getOptions(t);const e=this.graph.transform.getScale();this.sx=e.sx,this.sy=e.sy;const n=this.options.width||this.graph.options.width,r=this.options.height||this.graph.options.height;this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(Nh.containerClass)).css({width:n,height:r}),this.options.pageVisible&&this.$container.addClass(this.prefixClassName(Nh.pagedClass)),this.options.className&&this.$container.addClass(this.options.className);const i=this.graph.container;i.parentNode&&this.$container.insertBefore(i);const o=i.getAttribute("style");if(o){const t={},e=o.split(";");e.forEach(e=>{const n=e.trim();if(n){const e=n.split(":");e.length&&(t[e[0].trim()]=e[1]?e[1].trim():"")}}),Object.keys(t).forEach(e=>{"width"!==e&&"height"!==e&&(i.style[e]="",this.container.style[e]=t[e])})}this.content=document.createElement("div"),this.$content=this.$(this.content).addClass(this.prefixClassName(Nh.contentClass)).css({width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),this.$background=this.$(this.background).addClass(this.prefixClassName(Nh.backgroundClass)),this.$content.append(this.background),this.options.pageVisible||this.$content.append(this.graph.view.grid),this.$content.append(i),this.$content.appendTo(this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new Dh.Background(this),this.options.autoResize||this.update()}get graph(){return this.options.graph}get model(){return this.graph.model}startListening(){const t=this.graph,e=this.model;t.on("scale",this.onScale,this),t.on("resize",this.onResize,this),t.on("before:print",this.storeScrollPosition,this),t.on("before:export",this.storeScrollPosition,this),t.on("after:print",this.restoreScrollPosition,this),t.on("after:export",this.restoreScrollPosition,this),t.on("render:done",this.onRenderDone,this),t.on("unfreeze",this.onUpdate,this),e.on("reseted",this.onUpdate,this),e.on("cell:added",this.onUpdate,this),e.on("cell:removed",this.onUpdate,this),e.on("cell:changed",this.onUpdate,this),e.on("batch:stop",this.onBatchStop,this),this.delegateBackgroundEvents()}stopListening(){const t=this.graph,e=this.model;t.off("scale",this.onScale,this),t.off("resize",this.onResize,this),t.off("beforeprint",this.storeScrollPosition,this),t.off("beforeexport",this.storeScrollPosition,this),t.off("afterprint",this.restoreScrollPosition,this),t.off("afterexport",this.restoreScrollPosition,this),t.off("render:done",this.onRenderDone,this),t.off("unfreeze",this.onUpdate,this),e.off("reseted",this.onUpdate,this),e.off("cell:added",this.onUpdate,this),e.off("cell:removed",this.onUpdate,this),e.off("cell:changed",this.onUpdate,this),e.off("batch:stop",this.onBatchStop,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){!this.graph.isAsync()&&this.options.autoResize&&this.update()}onBatchStop(t){!this.graph.isAsync()&&this.options.autoResize&&Th.UPDATE_DELAYING_BATCHES.includes(t.name)&&this.update()}delegateBackgroundEvents(t){const e=t||lh.events;this.delegatedHandlers=Object.keys(e).reduce((t,n)=>{const r=e[n];if(-1===n.indexOf(" "))if("function"===typeof r)t[n]=r;else{let e=this.graph.view[r];"function"===typeof e&&(e=e.bind(this.graph.view),t[n]=e)}return t},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(t=>{this.delegateEvent(t,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(t=>{this.undelegateEvent(t,this.onBackgroundEvent)})}onBackgroundEvent(t){let e=!1;const n=t.target;if(this.options.pageVisible)e=this.options.background?this.background===n:this.content===n;else{const t=this.graph.view;e=t.background===n||t.grid===n}if(e){const e=this.delegatedHandlers[t.type];"function"===typeof e&&e.apply(this.graph,arguments)}}onRenderDone({stats:t}){this.options.autoResize&&t.priority<2&&this.update()}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:t,sy:e,ox:n,oy:r}){this.updateScale(t,e),(n||r)&&(this.centerPoint(n,r),this.updatePageBreak());const i=this.options.autoResizeOptions||this.options.fitTocontentOptions;"function"===typeof i&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(gt.IS_IE||gt.IS_EDGE)&&this.$container.css("visibility","hidden")}afterManipulation(){(gt.IS_IE||gt.IS_EDGE)&&this.$container.css("visibility","visible")}updatePageSize(t,e){null!=t&&(this.options.pageWidth=t),null!=e&&(this.options.pageHeight=e),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const t=this.graph.options.width,e=this.graph.options.height,n=this.options.pageWidth*this.sx,r=this.options.pageHeight*this.sy;if(t>n||e>r){let i=!1;const o=document.createElement("div");for(let e=1,r=Math.floor(t/n);e<r;e+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-vertical")).css({left:e*n}).appendTo(o),i=!0;for(let t=1,n=Math.floor(e/r);t<n;t+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-horizontal")).css({top:t*r}).appendTo(o),i=!0;i&&(c.addClass(o,this.prefixClassName("graph-pagebreak")),this.$(this.graph.view.grid).after(o),this.pageBreak=o)}}}update(){const t=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(t.width/2,t.height/2);let e=this.options.autoResizeOptions||this.options.fitTocontentOptions;"function"===typeof e&&(e=s.call(e,this,this));const n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},e);this.graph.fitToContent(this.getFitToContentOptions(n))}getFitToContentOptions(t){const e=this.sx,n=this.sy;return t.gridWidth&&(t.gridWidth*=e),t.gridHeight&&(t.gridHeight*=n),t.minWidth&&(t.minWidth*=e),t.minHeight&&(t.minHeight*=n),"object"===typeof t.padding?t.padding={left:(t.padding.left||0)*e,right:(t.padding.right||0)*e,top:(t.padding.top||0)*n,bottom:(t.padding.bottom||0)*n}:"number"===typeof t.padding&&(t.padding*=e),this.options.autoResize||(t.contentArea=jr.create()),t}updateScale(t,e){const n=this.graph.options,r=t/this.sx,i=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*r,n.y*i),this.graph.resizeGraph(n.width*r,n.height*i)}scrollbarPosition(t,e,n){if(null==t&&null==e)return{left:this.container.scrollLeft,top:this.container.scrollTop};const r={};return"number"===typeof t&&(r.scrollLeft=t),"number"===typeof e&&(r.scrollTop=e),n&&n.animation?this.$container.animate(r,n.animation):this.$container.prop(r),this}scrollToPoint(t,e,n){const r=this.getClientSize(),i=this.graph.matrix(),o={};return"number"===typeof t&&(o.scrollLeft=t-r.width/2+i.e+(this.padding.left||0)),"number"===typeof e&&(o.scrollTop=e-r.height/2+i.f+(this.padding.top||0)),n&&n.animation?this.$container.animate(o,n.animation):this.$container.prop(o),this}scrollToContent(t){const e=this.sx,n=this.sy,r=this.graph.getContentArea().getCenter();return this.scrollToPoint(r.x*e,r.y*n,t)}scrollToCell(t,e){const n=this.sx,r=this.sy,i=t.getBBox().getCenter();return this.scrollToPoint(i.x*n,i.y*r,e)}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const r=this.graph.matrix(),i=r.a,o=r.d,a=-r.e,s=-r.f,l=a+this.graph.options.width,c=s+this.graph.options.height;let u;if(this.storeClientSize(),"number"===typeof t||"number"===typeof e){u=n;const r=this.getVisibleArea().getCenter();"number"===typeof t?t*=i:t=r.x,"number"===typeof e?e*=o:e=r.y}else u=t,t=(a+l)/2,e=(s+c)/2;if(u&&u.padding)return this.positionPoint({x:t,y:e},"50%","50%",u);const d=this.getPadding(),h=this.getClientSize(),p=h.width/2,f=h.height/2,g=p-d.left-t+a,m=p-d.right+t-l,v=f-d.top-e+s,b=f-d.bottom+e-c;this.addPadding(Math.max(g,0),Math.max(m,0),Math.max(v,0),Math.max(b,0));const y=this.scrollToPoint(t,e,u||void 0);return this.restoreClientSize(),y}centerContent(t){return this.positionContent("center",t)}centerCell(t,e){return this.positionCell(t,"center",e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t,e)}positionCell(t,e,n){const r=t.getBBox();return this.positionRect(r,e,n)}positionRect(t,e,n){const r=jr.create(t);switch(e){case"center":return this.positionPoint(r.getCenter(),"50%","50%",n);case"top":return this.positionPoint(r.getTopCenter(),"50%",0,n);case"top-right":return this.positionPoint(r.getTopRight(),"100%",0,n);case"right":return this.positionPoint(r.getRightMiddle(),"100%","50%",n);case"bottom-right":return this.positionPoint(r.getBottomRight(),"100%","100%",n);case"bottom":return this.positionPoint(r.getBottomCenter(),"50%","100%",n);case"bottom-left":return this.positionPoint(r.getBottomLeft(),0,"100%",n);case"left":return this.positionPoint(r.getLeftMiddle(),0,"50%",n);case"top-left":return this.positionPoint(r.getTopLeft(),0,0,n);default:return this}}positionPoint(t,e,n,r={}){const{padding:i}=r,o=Lh(r,["padding"]),s=a.normalizeSides(i),l=jr.fromSize(this.getClientSize()),c=l.clone().moveAndExpand({x:s.left,y:s.top,width:-s.right-s.left,height:-s.top-s.bottom});e=a.normalizePercentage(e,Math.max(0,c.width)),e<0&&(e=c.width+e),n=a.normalizePercentage(n,Math.max(0,c.height)),n<0&&(n=c.height+n);const u=c.getTopLeft().translate(e,n),d=l.getCenter().diff(u),h=this.zoom(),p=d.scale(1/h,1/h),f=Dr.create(t).translate(p);return this.centerPoint(f.x,f.y,o)}zoom(t,e){if(null==t)return this.sx;let n,r;e=e||{};const i=this.getClientSize(),o=this.clientToLocalPoint(i.width/2,i.height/2);let a=t,s=t;if(e.absolute||(a+=this.sx,s+=this.sy),e.scaleGrid&&(a=Math.round(a/e.scaleGrid)*e.scaleGrid,s=Math.round(s/e.scaleGrid)*e.scaleGrid),e.maxScale&&(a=Math.min(e.maxScale,a),s=Math.min(e.maxScale,s)),e.minScale&&(a=Math.max(e.minScale,a),s=Math.max(e.minScale,s)),a=this.graph.transform.clampScale(a),s=this.graph.transform.clampScale(s),e.center){const t=a/this.sx,i=s/this.sy;n=e.center.x-(e.center.x-o.x)/t,r=e.center.y-(e.center.y-o.y)/i}else n=o.x,r=o.y;return this.beforeManipulation(),this.graph.transform.scale(a,s),this.centerPoint(n,r),this.afterManipulation(),this}zoomToRect(t,e={}){const n=jr.create(t),r=this.graph;e.contentArea=n,null==e.viewportArea&&(e.viewportArea={x:r.options.x,y:r.options.y,width:this.$container.width(),height:this.$container.height()}),this.beforeManipulation(),r.transform.scaleContentToFitImpl(e,!1);const i=n.getCenter();return this.centerPoint(i.x,i.y),this.afterManipulation(),this}zoomToFit(t={}){return this.zoomToRect(this.graph.getContentArea(t),t)}transitionToPoint(t,e,n){let r,i;"object"===typeof t?(n=e,e=t.y,t=t.x):e=e,null==n&&(n={});const o=this.sx,a=Math.max(n.scale||o,1e-6),l=this.getClientSize(),c=new Dr(t,e),u=this.clientToLocalPoint(l.width/2,l.height/2);if(o===a){const t=u.diff(c).scale(o,o).round();r=`translate(${t.x}px,${t.y}px)`}else{const t=a/(o-a)*c.distance(u),e=u.clone().move(c,t),n=this.localToBackgroundPoint(e).round();r=`scale(${a/o})`,i=`${n.x}px ${n.y}px`}const d=n.onTransitionEnd;return this.$container.addClass(Nh.transitionClassName),this.$content.off(Nh.transitionEventName).on(Nh.transitionEventName,n=>{this.syncTransition(a,{x:t,y:e}),"function"===typeof d&&s.call(d,this,n.originalEvent)}).css({transform:r,transformOrigin:i,transition:"transform",transitionDuration:n.duration||"1s",transitionDelay:n.delay,transitionTimingFunction:n.timing}),this}syncTransition(t,e){return this.beforeManipulation(),this.graph.scale(t),this.removeTransition(),this.centerPoint(e.x,e.y),this.afterManipulation(),this}removeTransition(){return this.$container.removeClass(Nh.transitionClassName),this.$content.off(Nh.transitionEventName).css({transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=jr.create(t),r=e.maxScale||1/0,i=e.minScale||Number.MIN_VALUE,o=e.scaleGrid||null,a=e.visibility||1,s=e.center?Dr.create(e.center):n.getCenter(),l=this.getClientSize(),c=l.width*a,u=l.height*a;let d=new jr(s.x-c/2,s.y-u/2,c,u).getMaxUniformScaleToFit(n,s);return d=Math.min(d,r),o&&(d=Math.floor(d/o)*o),d=Math.max(i,d),this.transitionToPoint(s,Object.assign({scale:d},e))}startPanning(t){const e=this.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("pan:start",{e:e}),this.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.$(window).on("mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.normalizeEvent(t),n=e.clientX-this.clientX,r=e.clientY-this.clientY;this.container.scrollTop-=r,this.container.scrollLeft-=n,this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("panning",{e:e})}stopPanning(t){this.$(document.body).off(".panning"),this.$(window).off(".panning"),this.trigger("pan:stop",{e:t})}clientToLocalPoint(t,e){let n="object"===typeof t?t.x:t,r="object"===typeof t?t.y:e;const i=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-i.e,r+=this.container.scrollTop-this.padding.top-i.f,new Dr(n/i.a,r/i.d)}localToBackgroundPoint(t,e){const n="object"===typeof t?Dr.create(t):new Dr(t,e),r=this.graph.matrix(),i=this.padding;return c.transformPoint(n,r).translate(i.left,i.top)}resize(t,e){let n=null!=t?t:this.container.offsetWidth,r=null!=e?e:this.container.offsetHeight;"number"===typeof n&&(n=Math.round(n)),"number"===typeof r&&(r=Math.round(r)),this.options.width=n,this.options.height=r,this.$container.css({width:n,height:r}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(t,e){const n=10,r=this.container,i=r.getBoundingClientRect();let o=0,a=0;return t<=i.left+n&&(o=-n),e<=i.top+n&&(a=-n),t>=i.right-n&&(o=n),e>=i.bottom-n&&(a=n),0!==o&&(r.scrollLeft+=o),0!==a&&(r.scrollTop+=a),{scrollerX:o,scrollerY:a}}addPadding(t,e,n,r){let i=this.getPadding();this.padding={left:Math.round(i.left+(t||0)),top:Math.round(i.top+(n||0)),bottom:Math.round(i.bottom+(r||0)),right:Math.round(i.right+(e||0))},i=this.padding,this.$content.css({width:i.left+this.graph.options.width+i.right,height:i.top+this.graph.options.height+i.bottom});const o=this.graph.container;return o.style.left=this.padding.left+"px",o.style.top=this.padding.top+"px",this}getPadding(){const t=this.options.padding;return"function"===typeof t?a.normalizeSides(s.call(t,this,this)):a.normalizeSides(t)}getVisibleArea(){const t=this.graph.matrix(),e=this.getClientSize(),n={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},r=c.transformRectangle(n,t.inverse());return r.x-=(this.padding.left||0)/this.sx,r.y-=(this.padding.top||0)/this.sy,r}isCellVisible(t,e={}){const n=t.getBBox(),r=this.getVisibleArea();return e.strict?r.containsRect(n):r.isIntersectWithRect(n)}isPointVisible(t){return this.getVisibleArea().containsPoint(t)}lock(){return this.$container.css("overflow","hidden"),this}unlock(){return this.$container.css("overflow","scroll"),this}onRemove(){this.stopListening()}dispose(){this.$(this.graph.container).insertBefore(this.$container),this.remove()}}function jh(t,e,n,r={}){if(n){const i=n.graph,o=i.view.normalizeEvent(e),a=i.snapToGrid(o.clientX,o.clientY);n.notify(t,Object.assign({e:o,view:n,node:n.cell,cell:n.cell,x:a.x,y:a.y},r))}}Ph([Ll.dispose()],Dh.prototype,"dispose",null),function(t){class e extends Mh{constructor(t){super(t.graph),this.scroller=t,t.options.background&&this.draw(t.options.background)}get elem(){return this.scroller.background}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(t){this.scroller.options.background=t}}t.Background=e}(Dh||(Dh={})),function(t){function e(e){const n=i.merge({},t.defaultOptions,e);return null==n.pageWidth&&(n.pageWidth=e.graph.options.width),null==n.pageHeight&&(n.pageHeight=e.graph.options.height),n}t.containerClass="graph-scroller",t.panningClass=t.containerClass+"-panning",t.pannableClass=t.containerClass+"-pannable",t.pagedClass=t.containerClass+"-paged",t.contentClass=t.containerClass+"-content",t.backgroundClass=t.containerClass+"-background",t.transitionClassName="transition-in-progress",t.transitionEventName="transitionend.graph-scroller-transition",t.defaultOptions={padding(){const t=this.getClientSize(),e=Math.max(this.options.minVisibleWidth||0,1)||1,n=Math.max(this.options.minVisibleHeight||0,1)||1,r=Math.max(t.width-e,0),i=Math.max(t.height-n,0);return{left:r,top:i,right:r,bottom:i}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0},t.getOptions=e}(Nh||(Nh={}));var Ih,Rh,Fh=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Bh extends Ll{constructor(t){super(),this.options=i.merge({},Ih.defaultOptions,t),this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new Od([],{comparator:Ih.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.initHandles(),this.startListening()}get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Ih.classNames.box)}get $boxes(){return this.$container.children("."+this.boxClassName)}get handleOptions(){return this.options}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({["mousedown ."+this.boxClassName]:"onSelectionBoxMouseDown",["touchstart ."+this.boxClassName]:"onSelectionBoxMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),t.model.off("updated",this.onModelUpdated,this),e.off("added",this.onCellAdded,this),e.off("removed",this.onCellRemoved,this),e.off("reseted",this.onReseted,this),e.off("updated",this.onCollectionUpdated,this),e.off("node:change:position",this.onNodePositionChanged,this),e.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes({async:!1})}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:n,pointerEvents:r}=this.options,{ui:i,selection:o,translateBy:a}=e;let s=!this.translating;if(s=s&&(!0!==n||"none"===r),s=s&&i&&!o,s=s&&a&&t.id===a,s){this.translating=!0;const n=t.position(),r=t.previous("position"),i=n.x-r.x,o=n.y-r.y;0===i&&0===o||this.translateSelectedNodes(i,o,t,e),this.translating=!1}}onModelUpdated({removed:t}){t&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(n,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){if(e.batch){const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.reset(n,Object.assign(Object.assign({},e),{ui:!0})),this}const n=this.cells,r=this.filter(Array.isArray(t)?t:[t]),i={},o={};n.forEach(t=>i[t.id]=t),r.forEach(t=>o[t.id]=t);const a=[],s=[];return r.forEach(t=>{i[t.id]||a.push(t)}),n.forEach(t=>{o[t.id]||s.push(t)}),s.length&&this.unselect(s,Object.assign(Object.assign({},e),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},e),{ui:!0})),0===s.length&&0===a.length&&this.updateContainer(),this}return this.clean(e)}clean(t={}){return this.length&&(!1===t.batch?this.unselect(this.cells,t):this.collection.reset([],Object.assign(Object.assign({},t),{ui:!0}))),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){let e,n;t=this.normalizeEvent(t),this.clean();const r=this.graph.container;if(null!=t.offsetX&&null!=t.offsetY&&r.contains(t.target))e=t.offsetX,n=t.offsetY;else{const i=this.$(r).offset(),o=r.scrollLeft,a=r.scrollTop;e=t.clientX-i.left+window.pageXOffset+o,n=t.clientY-i.top+window.pageYOffset+a}this.$container.css({top:n,left:e,width:1,height:1}),this.setEventData(t,{action:"selecting",clientX:t.clientX,clientY:t.clientY,offsetX:e,offsetY:n,scrollerX:0,scrollerY:0}),this.delegateDocumentEvents(Ih.documentEvents,t.data)}filter(t){const e=this.options.filter;return Array.isArray(e)?t.filter(t=>!e.includes(t)&&!e.includes(t.shape)):"function"===typeof e?t.filter(t=>s.call(e,this.graph,t)):t}stopSelecting(t){const e=this.graph,n=this.getEventData(t),r=n.action;switch(r){case"selecting":{let t=this.$container.width(),n=this.$container.height();const r=this.$container.offset(),i=e.pageToLocal(r.left,r.top),o=e.transform.getScale();t/=o.sx,n/=o.sy;const a=new jr(i.x,i.y,t,n),s=this.getCellViewsInArea(a).map(t=>t.cell);this.reset(s,{batch:!0}),this.hideRubberband();break}case"translating":{const r=e.snapToGrid(t.clientX,t.clientY);if(!this.options.following){const t=n;this.updateSelectedNodesPosition({dx:t.clientX-t.originX,dy:t.clientY-t.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",t,r.x,r.y);break}default:this.clean();break}}onMouseUp(t){const e=this.getEventData(t).action;e&&(this.stopSelecting(t),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(t){this.options.following||t.stopPropagation();const e=this.normalizeEvent(t);this.options.movable&&this.startTranslating(e);const n=this.getCellViewFromElem(e.target);this.setEventData(e,{activeView:n});const r=this.graph.snapToGrid(e.clientX,e.clientY);this.notifyBoxEvent("box:mousedown",e,r.x,r.y),this.delegateDocumentEvents(Ih.documentEvents,e.data)}startTranslating(t){this.graph.model.startBatch("move-selection");const e=this.graph.snapToGrid(t.clientX,t.clientY);this.setEventData(t,{action:"translating",clientX:e.x,clientY:e.y,originX:e.x,originY:e.y})}getSelectionOffset(t,e){let n=t.x-e.clientX,r=t.y-e.clientY;const i=this.graph.hook.getRestrictArea();if(i){const o=this.collection.toArray(),a=sd.getCellsBBox(o,{deep:!0})||jr.create(),s=i.x-a.x,l=i.y-a.y,c=i.x+i.width-(a.x+a.width),u=i.y+i.height-(a.y+a.height);if(n<s&&(n=s),r<l&&(r=l),c<n&&(n=c),u<r&&(r=u),!this.options.following){const i=t.x-e.originX,o=t.y-e.originY;n=i<=s||i>=c?0:n,r=o<=l||o>=u?0:r}}return{dx:n,dy:r}}updateSelectedNodesPosition(t){const{dx:e,dy:n}=t;if(e||n)if(this.translateSelectedNodes(e,n),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const t=this.graph.transform.getScale();this.$boxes.add(this.$selectionContainer).css({left:"+="+e*t.sx,top:"+="+n*t.sy})}}autoScrollGraph(t,e){const n=this.graph.scroller.widget;return n?n.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),n=this.getEventData(e),r=n.action;switch(r){case"selecting":{const t=n;!0!==t.moving&&(this.$container.appendTo(this.graph.container),this.showRubberband(),t.moving=!0);const{scrollerX:r,scrollerY:i}=this.autoScrollGraph(e.clientX,e.clientY);t.scrollerX+=r,t.scrollerY+=i;const o=e.clientX-t.clientX+t.scrollerX,a=e.clientY-t.clientY+t.scrollerY,s=parseInt(this.$container.css("left"),10),l=parseInt(this.$container.css("top"),10);this.$container.css({left:o<0?t.offsetX+o:s,top:a<0?t.offsetY+a:l,width:Math.abs(o),height:Math.abs(a)});break}case"translating":{const r=this.graph.snapToGrid(e.clientX,e.clientY),i=n,o=this.getSelectionOffset(r,i);this.options.following?this.updateSelectedNodesPosition(o):this.updateContainerPosition(o),o.dx&&(i.clientX=r.x),o.dy&&(i.clientY=r.y),this.notifyBoxEvent("box:mousemove",t,r.x,r.y);break}default:break}this.boxesUpdated=!1}translateSelectedNodes(t,e,n,r){const i={},o=[];if(n&&(i[n.id]=!0),this.collection.toArray().forEach(t=>{t.getDescendants({deep:!0}).forEach(t=>{i[t.id]=!0})}),r&&r.translateBy){const t=this.graph.getCellById(r.translateBy);t&&(i[t.id]=!0,t.getDescendants({deep:!0}).forEach(t=>{i[t.id]=!0}),o.push(t))}this.collection.toArray().forEach(n=>{if(!i[n.id]){const a=Object.assign(Object.assign({},r),{selection:this.cid,exclude:o});n.translate(t,e,a),this.graph.model.getConnectedEdges(n).forEach(n=>{i[n.id]||(n.translate(t,e,a),i[n.id]=!0)})}})}getCellViewsInArea(t){const e=this.graph,n={strict:this.options.strict};let r=[];return this.options.rubberNode&&(r=this.options.useCellGeometry?r.concat(e.model.getNodesInArea(t,n).map(t=>e.renderer.findViewByCell(t)).filter(t=>null!=t)):r.concat(e.renderer.findViewsInArea(t,n))),this.options.rubberEdge&&(r=this.options.useCellGeometry?r.concat(e.model.getEdgesInArea(t,n).map(t=>e.renderer.findViewByCell(t)).filter(t=>null!=t)):r.concat(e.renderer.findEdgeViewsInArea(t,n))),r}notifyBoxEvent(t,e,n,r){const i=this.getEventData(e),o=i.activeView;this.trigger(t,{e:e,view:o,x:n,y:r,cell:o.cell})}getSelectedClassName(t){return this.prefixClassName((t.isNode()?"node":"edge")+"-selected")}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(this.$container.find(`[data-cell-id="${t.id}"]`).remove(),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach(t=>this.removeCellUnSelectedClassName(t)),this.hide(),this.$boxes.remove(),this.boxCount=0}hide(){this.$container.removeClass(this.prefixClassName(Ih.classNames.rubberband)).removeClass(this.prefixClassName(Ih.classNames.selected))}showRubberband(){this.$container.addClass(this.prefixClassName(Ih.classNames.rubberband))}hideRubberband(){this.$container.removeClass(this.prefixClassName(Ih.classNames.rubberband))}showSelected(){this.$container.removeAttr("style").addClass(this.prefixClassName(Ih.classNames.selected))}createContainer(){this.container=document.createElement("div"),this.$container=this.$(this.container),this.$container.addClass(this.prefixClassName(Ih.classNames.root)),this.options.className&&this.$container.addClass(this.options.className),this.$selectionContainer=this.$("<div/>").addClass(this.prefixClassName(Ih.classNames.inner)),this.$selectionContent=this.$("<div/>").addClass(this.prefixClassName(Ih.classNames.content)),this.$selectionContainer.append(this.$selectionContent),this.$selectionContainer.attr("data-selection-length",this.collection.length),this.$container.prepend(this.$selectionContainer),this.$handleContainer=this.$selectionContainer}updateContainerPosition(t){(t.dx||t.dy)&&this.$selectionContainer.css({left:"+="+t.dx,top:"+="+t.dy})}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0},n=this.collection.toArray().filter(t=>this.canShowSelectionBox(t));n.forEach(n=>{const r=this.graph.renderer.findViewByCell(n);if(r){const n=r.getBBox({useCellGeometry:this.options.useCellGeometry});t.x=Math.min(t.x,n.x),t.y=Math.min(t.y,n.y),e.x=Math.max(e.x,n.x+n.width),e.y=Math.max(e.y,n.y+n.height)}}),this.$selectionContainer.css({position:"absolute",pointerEvents:"none",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}).attr("data-selection-length",this.collection.length);const r=this.options.content;if(r)if("function"===typeof r){const t=s.call(r,this.graph,this,this.$selectionContent[0]);t&&this.$selectionContent.html(t)}else this.$selectionContent.html(r);this.collection.length>0&&!this.container.parentNode?this.$container.appendTo(this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&!0===this.options.showNodeSelectionBox||t.isEdge()&&!0===this.options.showEdgeSelectionBox}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const n=e.getBBox({useCellGeometry:this.options.useCellGeometry}),r=this.boxClassName;this.$("<div/>").addClass(r).addClass(`${r}-${t.isNode()?"node":"edge"}`).attr("data-cell-id",t.id).css({position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:this.options.pointerEvents||"auto"}).appendTo(this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(t={}){this.collection.length>0&&(this.boxesUpdated=!0,this.graph.renderer.requestViewUpdate(this,1,2,t))}confirmUpdate(){return this.boxCount&&(this.hide(),this.$boxes.each((t,e)=>{const n=this.$(e).remove().attr("data-cell-id"),r=this.collection.get(n);r&&this.createSelectionBox(r)}),this.updateContainer()),0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const t=this.collection.get(e);if(t)return this.graph.renderer.findViewByCell(t)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach(t=>{this.listenCellRemoveEvent(t),this.createSelectionBox(t)}),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:n}){t.forEach(t=>{this.trigger("cell:selected",{cell:t,options:n}),this.graph.trigger("cell:selected",{cell:t,options:n}),t.isNode()?(this.trigger("node:selected",{cell:t,options:n,node:t}),this.graph.trigger("node:selected",{cell:t,options:n,node:t})):t.isEdge()&&(this.trigger("edge:selected",{cell:t,options:n,edge:t}),this.graph.trigger("edge:selected",{cell:t,options:n,edge:t}))}),e.forEach(t=>{this.trigger("cell:unselected",{cell:t,options:n}),this.graph.trigger("cell:unselected",{cell:t,options:n}),t.isNode()?(this.trigger("node:unselected",{cell:t,options:n,node:t}),this.graph.trigger("node:unselected",{cell:t,options:n,node:t})):t.isEdge()&&(this.trigger("edge:unselected",{cell:t,options:n,edge:t}),this.graph.trigger("edge:unselected",{cell:t,options:n,edge:t}))});const r={added:t,removed:e,options:n,selected:this.cells.filter(t=>!!this.graph.getCellById(t.id))};this.trigger("selection:changed",r),this.graph.trigger("selection:changed",r)}deleteSelectedCells(){const t=this.collection.toArray();this.clean(),this.graph.model.removeCells(t,{selection:this.cid})}startRotate({e:t}){const e=this.collection.toArray(),n=sd.getCellsBBox(e).getCenter(),r=this.graph.snapToGrid(t.clientX,t.clientY),i=e.reduce((t,e)=>(t[e.id]=Er.normalize(e.getAngle()),t),{});this.setEventData(t,{center:n,angles:i,start:r.theta(n)})}doRotate({e:t}){const e=this.getEventData(t),n=this.graph.options.rotating.grid,r="function"===typeof n?s.call(n,this.graph,null):n,i=this.graph.snapToGrid(t.clientX,t.clientY),o=e.start-i.theta(e.center);e.rotated||(e.rotated=!0),Math.abs(o)>.001&&(this.collection.toArray().forEach(t=>{const n=Ms.snapToGrid(e.angles[t.id]+o,r||15);t.rotate(n,{absolute:!0,center:e.center,selection:this.cid})}),this.updateSelectionBoxes())}stopRotate({e:t}){const e=this.getEventData(t);e.rotated&&(e.rotated=!1,this.collection.toArray().forEach(e=>{jh("node:rotated",t,this.graph.findViewByCell(e))}))}startResize({e:t}){const e=this.graph.getGridSize(),n=this.collection.toArray(),r=sd.getCellsBBox(n),i=n.map(t=>t.getBBox()),o=i.reduce((t,e)=>e.width<t?e.width:t,1/0),a=i.reduce((t,e)=>e.height<t?e.height:t,1/0);this.setEventData(t,{bbox:r,cells:this.graph.model.getSubGraph(n),minWidth:e*r.width/o,minHeight:e*r.height/a})}doResize({e:t,dx:e,dy:n}){const r=this.eventData(t),i=r.bbox,o=i.width,a=i.height,s=Math.max(o+e,r.minWidth),l=Math.max(a+n,r.minHeight);r.resized||(r.resized=!0),(Math.abs(o-s)>.001||Math.abs(a-l)>.001)&&(this.graph.model.resizeCells(s,l,r.cells,{selection:this.cid}),i.width=s,i.height=l,this.updateSelectionBoxes())}stopResize({e:t}){const e=this.eventData(t);e.resized&&(e.resized=!1,this.collection.toArray().forEach(e=>{jh("node:resized",t,this.graph.findViewByCell(e))}))}dispose(){this.clean(),this.remove()}}Fh([Ll.dispose()],Bh.prototype,"dispose",null),i.applyMixins(Bh,fh),function(t){const e="widget-selection";function n(t){return t.getAncestors().length}t.classNames={root:e,inner:e+"-inner",box:e+"-box",content:e+"-content",rubberband:e+"-rubberband",selected:e+"-selected"},t.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.defaultOptions={movable:!0,following:!0,strict:!1,useCellGeometry:!1,content(t){return o.template('<%= length %> node<%= length > 1 ? "s":"" %> selected.')({length:t.length})},handles:[{name:"remove",position:"nw",events:{mousedown:"deleteSelectedCells"}},{name:"rotate",position:"sw",events:{mousedown:"startRotate",mousemove:"doRotate",mouseup:"stopRotate"}},{name:"resize",position:"se",events:{mousedown:"startResize",mousemove:"doResize",mouseup:"stopResize"}}]},t.depthComparator=n}(Ih||(Ih={}));class zh extends bh{get node(){return this.cell}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return this.containerClassName+"-resize"}get rotateClassName(){return this.containerClassName+"-rotate"}init(t){this.options=Object.assign(Object.assign({},Rh.defaultOptions),t),this.render(),this.startListening()}startListening(){this.delegateEvents({["mousedown ."+this.resizeClassName]:"startResizing",["touchstart ."+this.resizeClassName]:"startResizing",["mousedown ."+this.rotateClassName]:"startRotating",["touchstart ."+this.rotateClassName]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),super.startListening()}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),super.stopListening()}renderHandles(){this.container=document.createElement("div"),this.$container=this.$(this.container);const t=this.$("<div/>").prop("draggable",!1),e=t.clone().addClass(this.rotateClassName),n=Rh.POSITIONS.map(e=>t.clone().addClass(this.resizeClassName).attr("data-position",e));this.empty(),this.$container.append(n,e)}render(){return this.renderHandles(),this.view.addClass(Rh.NODE_CLS),this.$container.addClass(this.containerClassName).toggleClass("no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing).toggleClass("no-resize",!this.options.resizable).toggleClass("no-rotate",!this.options.rotatable),this.options.className&&this.$container.addClass(this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const n=Er.normalize(this.node.getAngle()),r=0!==n?`rotate(${n}deg)`:"";return this.$container.css({transform:r,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view.removeClass(Rh.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=Er.normalize(this.node.getAngle()),e=Math.floor(t*(Rh.DIRECTIONS.length/360));if(e!==this.prevShift){const t=Rh.DIRECTIONS.slice(e).concat(Rh.DIRECTIONS.slice(0,e)),n=t=>`${this.containerClassName}-cursor-${t}`;this.$container.find("."+this.resizeClassName).removeClass(Rh.DIRECTIONS.map(t=>n(t)).join(" ")).each((e,r)=>{this.$(r).addClass(n(t[e]))}),this.prevShift=e}}getTrueDirection(t){const e=Er.normalize(this.node.getAngle());let n=Rh.POSITIONS.indexOf(t);return n+=Math.floor(e*(Rh.POSITIONS.length/360)),n%=Rh.POSITIONS.length,Rh.POSITIONS[n]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=this.$(t.target).attr("data-position"),n=this.graph.findViewByCell(this.node);this.prepareResizing(t,e),this.startAction(t),jh("node:resize:mousedown",t,n)}prepareResizing(t,e){const n=this.getTrueDirection(e);let r=0,i=0;e.split("-").forEach(t=>{r={left:-1,right:1}[t]||r,i={top:-1,bottom:1}[t]||i});const o=this.toValidResizeDirection(e),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],s=Er.normalize(this.node.getAngle());this.setEventData(t,{selector:a,direction:o,trueDirection:n,relativeDirection:e,angle:s,resizeX:r,resizeY:i,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.graph.findViewByCell(this.node),n=this.node.getBBox().getCenter(),r=this.normalizeEvent(t),i=this.graph.snapToGrid(r.clientX,r.clientY);this.setEventData(t,{center:n,action:"rotating",angle:Er.normalize(this.node.getAngle()),start:Dr.create(i).theta(n)}),this.startAction(t),jh("node:rotate:mousedown",t,e)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let n=this.getEventData(t);if(n.action){const r=this.normalizeEvent(t);let i=r.clientX,o=r.clientY;const s=this.graph.scroller.widget,l=this.options.restrictedResizing;if(!0===l||"number"===typeof l){const t=!0===l?0:l,e=s?Math.max(t,8):t,n=this.graph.container.getBoundingClientRect();i=a.clamp(i,n.left+e,n.right-e),o=a.clamp(o,n.top+e,n.bottom-e)}else this.options.autoScrollOnResizing&&s&&s.autoScroll(i,o);const c=this.graph.snapToGrid(i,o),u=this.graph.getGridSize(),d=this.node,h=this.options;if("resizing"===n.action){n=n,n.resized||(e&&(e.addClass("node-resizing"),jh("node:resize",t,e)),n.resized=!0);const r=d.getBBox(),i=Dr.create(c).rotate(n.angle,r.getCenter()).diff(r[n.selector]);let o=n.resizeX?i.x*n.resizeX:r.width,a=n.resizeY?i.y*n.resizeY:r.height;const s=o,l=a;if(o=Ms.snapToGrid(o,u),a=Ms.snapToGrid(a,u),o=Math.max(o,h.minWidth||u),a=Math.max(a,h.minHeight||u),o=Math.min(o,h.maxWidth||1/0),a=Math.min(a,h.maxHeight||1/0),h.preserveAspectRatio){const t=r.width*a/r.height,e=r.height*o/r.width;o<t?a=e:o=t}const p=n.relativeDirection;if(h.allowReverse&&(s<=-o||l<=-a)){let e;"left"===p?s<=-o&&(e="right"):"right"===p?s<=-o&&(e="left"):"top"===p?l<=-a&&(e="bottom"):"bottom"===p?l<=-a&&(e="top"):"top-left"===p?s<=-o&&l<=-a?e="bottom-right":s<=-o?e="top-right":l<=-a&&(e="bottom-left"):"top-right"===p?s<=-o&&l<=-a?e="bottom-left":s<=-o?e="top-left":l<=-a&&(e="bottom-right"):"bottom-left"===p?s<=-o&&l<=-a?e="top-right":s<=-o?e="bottom-right":l<=-a&&(e="top-left"):"bottom-right"===p&&(s<=-o&&l<=-a?e="top-left":s<=-o?e="bottom-left":l<=-a&&(e="top-right"));const n=e;this.stopHandle();const r=this.$container.find(`.${this.resizeClassName}[data-position="${n}"]`);this.startHandle(r[0]),this.prepareResizing(t,n),this.onMouseMove(t)}if(r.width!==o||r.height!==a){const r={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:h.minWidth,minHeight:h.minHeight,maxWidth:h.maxWidth,maxHeight:h.maxHeight,preserveAspectRatio:!0===h.preserveAspectRatio};d.resize(o,a,r),jh("node:resizing",t,e)}jh("node:resize:mousemove",t,e)}else if("rotating"===n.action){n=n,n.rotated||(e&&(e.addClass("node-rotating"),jh("node:rotate",t,e)),n.rotated=!0);const r=d.getAngle(),i=n.start-Dr.create(c).theta(n.center);let o=n.angle+i;h.rotateGrid&&(o=Ms.snapToGrid(o,h.rotateGrid)),o=Er.normalize(o),r!==o&&(d.rotate(o,{absolute:!0}),jh("node:rotating",t,e)),jh("node:rotate:mousemove",t,e)}}}onMouseUp(t){const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);n.action&&(this.stopAction(t),this.model.stopBatch("resizing"===n.action?"resize":"rotate",{cid:this.cid}),"resizing"===n.action?jh("node:resize:mouseup",t,e):"rotating"===n.action&&jh("node:rotate:mouseup",t,e))}startHandle(t){if(this.handle=t||null,this.$container.addClass(this.containerClassName+"-active"),t){this.$(t).addClass(this.containerClassName+"-active-handle");const e=t.getAttribute("data-position");if(e){const t=Rh.DIRECTIONS[Rh.POSITIONS.indexOf(e)];this.$container.addClass(`${this.containerClassName}-cursor-${t}`)}}}stopHandle(){if(this.$container.removeClass(this.containerClassName+"-active"),this.handle){this.$(this.handle).removeClass(this.containerClassName+"-active-handle");const t=this.handle.getAttribute("data-position");if(t){const e=Rh.DIRECTIONS[Rh.POSITIONS.indexOf(t)];this.$container.removeClass(`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(Rh.documentEvents,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);e&&(e.removeClass("node-"+n.action),"resizing"===n.action&&n.resized?jh("node:resized",t,e):"rotating"===n.action&&n.rotated&&jh("node:rotated",t,e))}}(function(t){t.NODE_CLS="has-widget-transform",t.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],t.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},t.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}})(Rh||(Rh={}));var Hh,Vh=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};(function(t){function e(t,e,n){const r={};return Object.keys(n||{}).forEach(i=>{const o=n[i];r[i]="function"===typeof o?o.call(t,e):o}),r}t.parseOptionGroup=e})(Hh||(Hh={})),function(t){function e(e){const{grid:n,panning:r,selecting:o,embedding:a,snapline:s,resizing:l,rotating:c,knob:u,clipboard:d,history:h,scroller:p,minimap:f,keyboard:g,mousewheel:m}=e,v=Vh(e,["grid","panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"]),b=e.container;if(null==b)throw new Error("Ensure the container of the graph is specified and valid");null==v.width&&(v.width=b.clientWidth),null==v.height&&(v.height=b.clientHeight);const y=i.merge({},t.defaults,v),w={size:10,visible:!1};y.grid="number"===typeof n?{size:n,visible:!1}:"boolean"===typeof n?Object.assign(Object.assign({},w),{visible:n}):Object.assign(Object.assign({},w),n);const x=["panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"];return x.forEach(t=>{const n=e[t];"boolean"===typeof n?y[t].enabled=n:y[t]=Object.assign(Object.assign({},y[t]),n)}),y.background&&y.scroller.enabled&&null==y.scroller.background&&(y.scroller.background=y.background,delete y.background),y}t.get=e}(Hh||(Hh={})),function(t){t.defaults={x:0,y:0,grid:{size:10,visible:!1},scaling:{min:.01,max:16},background:!1,highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:Ms.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Ms.prefix("available-magnet")}}},connecting:{snap:!1,multi:!0,dangling:!0,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",strategy:null,router:"normal",connector:"normal",validateConnection({type:t,sourceView:e,targetView:n}){const r="target"===t?n:e;return null!=r},createEdge(){return new Qd}},transforming:{clearAll:!0,clearOnBlankMouseDown:!0},resizing:{enabled:!1,minWidth:0,minHeight:0,maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,orthogonal:!0,restricted:!1,autoScroll:!0,preserveAspectRatio:!1,allowReverse:!0},rotating:{enabled:!1,grid:15},translating:{restrict:!1},knob:{enabled:!1,clearAll:!0,clearOnBlankMouseDown:!0},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},selecting:{enabled:!1,rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,useCellGeometry:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,content:null,handles:null},panning:{enabled:!1,eventTypes:["leftMouseDown"]},snapline:{enabled:!1},clipboard:{enabled:!1},history:{enabled:!1},scroller:{enabled:!1},keyboard:{enabled:!1},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},async:!1,frozen:!1,sorting:"exact",moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},guard:()=>!1}}(Hh||(Hh={}));var qh=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Uh extends oh{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return null!=this.svg.getElementById(t)}filter(t){let e=t.id;const n=t.name;if(e||(e=`filter-${n}-${this.cid}-${o.hashcode(JSON.stringify(t))}`),!this.isDefined(e)){const r=ks.registry.get(n);if(null==r)return ks.registry.onNotFound(n);const i=r(t.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});ai.create(Vl.sanitize(i),o).appendTo(this.defs)}return e}gradient(t){let e=t.id;const n=t.type;if(e||(e=`gradient-${n}-${this.cid}-${o.hashcode(JSON.stringify(t))}`),!this.isDefined(e)){const r=t.stops,i=r.map(t=>{const e=null!=t.opacity&&Number.isFinite(t.opacity)?t.opacity:1;return`<stop offset="${t.offset}" stop-color="${t.color}" stop-opacity="${e}"/>`}),o=`<${n}>${i.join("")}</${n}>`,a=Object.assign({id:e},t.attrs);ai.create(o,a).appendTo(this.defs)}return e}marker(t){const{id:e,refX:n,refY:r,markerUnits:i,markerOrient:a,tagName:s,children:l}=t,u=qh(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let d=e;if(d||(d=`marker-${this.cid}-${o.hashcode(JSON.stringify(t))}`),!this.isDefined(d)){"path"!==s&&delete u.d;const t=ai.create("marker",{refX:n,refY:r,id:d,overflow:"visible",orient:null!=a?a:"auto",markerUnits:i||"userSpaceOnUse"},l?l.map(t=>{var{tagName:e}=t,n=qh(t,["tagName"]);return ai.create(""+e||"path",c.kebablizeAttrs(Object.assign(Object.assign({},u),n)))}):[ai.create(s||"path",c.kebablizeAttrs(u))]);this.defs.appendChild(t.node)}return d}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}var Wh=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},$h=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Gh extends oh{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const n=this.graph.matrix(),r=this.getInstance(),i=Array.isArray(t)?t:[t];this.patterns.forEach((t,o)=>{const a="pattern_"+o,s=n.a||1,l=n.d||1,{update:u,markup:d}=t,h=$h(t,["update","markup"]),p=Object.assign(Object.assign(Object.assign({},h),i[o]),{sx:s,sy:l,ox:n.e||0,oy:n.f||0,width:e*s,height:e*l});r.has(a)||r.add(a,ai.create("pattern",{id:a,patternUnits:"userSpaceOnUse"},ai.createVectors(d)).node);const f=r.get(a);"function"===typeof u&&u(f.childNodes[0],p);let g=p.ox%p.width;g<0&&(g+=p.width);let m=p.oy%p.height;m<0&&(m+=p.height),c.attr(f,{x:g,y:m,width:p.width,height:p.height})});const o=(new XMLSerializer).serializeToString(r.root),a=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new cs),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(null==e)return[Object.assign(Object.assign({},cs.presets.dot),t.args)];const n=cs.registry.get(e);if(n){let e=t.args||[];return Array.isArray(e)||(e=[e]),Array.isArray(n)?n.map((t,n)=>Object.assign(Object.assign({},t),e[n])):[Object.assign(Object.assign({},n),e[0])]}return cs.registry.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}Wh([oh.dispose()],Gh.prototype,"dispose",null);class Yh extends oh{getClientMatrix(){return c.createSVGMatrix(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new Dr(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){const n="number"===typeof t?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y);return n.snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const n=Dr.create(t,e);return c.transformPoint(n,this.graph.matrix())}localToClientPoint(t,e){const n=Dr.create(t,e);return c.transformPoint(n,this.getClientMatrix())}localToPagePoint(t,e){const n="number"===typeof t?this.localToGraphPoint(t,e):this.localToGraphPoint(t);return n.translate(this.getPageOffset())}localToGraphRect(t,e,n,r){const i=jr.create(t,e,n,r);return c.transformRectangle(i,this.graph.matrix())}localToClientRect(t,e,n,r){const i=jr.create(t,e,n,r);return c.transformRectangle(i,this.getClientMatrix())}localToPageRect(t,e,n,r){const i="number"===typeof t?this.localToGraphRect(t,e,n,r):this.localToGraphRect(t);return i.translate(this.getPageOffset())}graphToLocalPoint(t,e){const n=Dr.create(t,e);return c.transformPoint(n,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const n=Dr.create(t,e);return c.transformPoint(n,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const n=Dr.create(t,e);return c.transformPoint(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const n=Dr.create(t,e),r=n.diff(this.getPageOffset());return this.graphToLocalPoint(r)}graphToLocalRect(t,e,n,r){const i=jr.create(t,e,n,r);return c.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(t,e,n,r){const i=jr.create(t,e,n,r);return c.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,r){const i=jr.create(t,e,n,r);return c.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,r){const i=jr.create(t,e,n,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}var Xh,Kh=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Zh extends oh{constructor(){super(...arguments),this.widget=this.graph.hook.createSnapline()}dispose(){this.widget.dispose()}}Kh([oh.dispose()],Zh.prototype,"dispose",null),function(t){function e(t){const e=[],n=[];return Array.isArray(t)?e.push(...t):t.split("|").forEach(t=>{-1===t.indexOf("&")?e.push(t):n.push(...t.split("&"))}),{or:e,and:n}}function n(t,n){if(null!=t&&null!=n){const r=e(t),i=e(n),o=r.or.sort(),a=i.or.sort(),s=r.and.sort(),l=i.and.sort(),c=(t,e)=>t.length===e.length&&(0===t.length||t.every((t,n)=>t===e[n]));return c(o,a)&&c(s,l)}return null==t&&null==n}function r(t,n,r){if(null==n||Array.isArray(n)&&0===n.length)return!r||!0!==t.altKey&&!0!==t.ctrlKey&&!0!==t.metaKey&&!0!==t.shiftKey;const{or:i,and:o}=e(n),a=e=>{const n=e.toLowerCase()+"Key";return!0===t[n]};return i.some(t=>a(t))&&o.every(t=>a(t))}t.parse=e,t.equals=n,t.isMatch=r}(Xh||(Xh={}));var Jh=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Qh extends oh{get widgetOptions(){return this.options.scroller}get pannable(){return!!this.widgetOptions&&("object"===typeof this.widgetOptions.pannable?this.widgetOptions.pannable.enabled:!!this.widgetOptions.pannable)}init(){this.widget=this.graph.hook.createScroller(),this.startListening(),this.updateClassName(),this.widget&&this.widget.center()}startListening(){let t=[];const e=this.widgetOptions.pannable;t="object"===typeof e?e.eventTypes||[]:["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.widget.container).on("mousedown",this.onRightMouseDown))}stopListening(){let t=[];const e=this.widgetOptions.pannable;t="object"===typeof e?e.eventTypes||[]:["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.widget.container).off("mousedown",this.onRightMouseDown)}onRightMouseDown(t){2===t.button&&this.allowPanning(t,!0)&&this.widget&&(this.updateClassName(!0),this.widget.startPanning(t),this.widget.once("pan:stop",()=>this.updateClassName(!1)))}preparePanning({e:t}){this.widget&&(this.allowPanning(t,!0)||this.allowPanning(t)&&!this.graph.selection.allowRubberband(t,!0))&&(this.updateClassName(!0),this.widget.startPanning(t),this.widget.once("pan:stop",()=>this.updateClassName(!1)))}allowPanning(t,e){return this.widget&&this.pannable&&Xh.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)}updateClassName(t){if(null==this.widget)return;const e=this.widget.container,n=this.view.prefixClassName("graph-scroller-pannable");this.pannable?(c.addClass(e,n),e.dataset.panning=(!!t).toString()):c.removeClass(e,n)}enablePanning(){this.pannable||(this.widgetOptions.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.pannable=!1,this.updateClassName())}lock(){this.widget&&this.widget.lock()}unlock(){this.widget&&this.widget.unlock()}update(){this.widget&&this.widget.update()}enableAutoResize(){this.widget&&this.widget.enableAutoResize()}disableAutoResize(){this.widget&&this.widget.disableAutoResize()}resize(t,e){this.widget&&this.widget.resize(t,e)}dispose(){this.widget&&this.widget.dispose(),this.stopListening()}}Jh([oh.dispose()],Qh.prototype,"dispose",null);var tp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ep=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class np extends oh{get commonOptions(){const t=this.instanceOptions,{enabled:e}=t,n=ep(t,["enabled"]);return n}get instanceOptions(){return this.options.clipboard}get cells(){return this.widget.cells}get disabled(){return!0!==this.instanceOptions.enabled}init(){this.widget=this.graph.hook.createClipboard(),this.widget.deserialize(this.instanceOptions)}enable(){this.disabled&&(this.instanceOptions.enabled=!0)}disable(){this.disabled||(this.instanceOptions.enabled=!1)}copy(t,e={}){this.disabled||(this.widget.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.graph.trigger("clipboard:changed",{cells:t}))}cut(t,e={}){this.disabled||(this.widget.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.graph.trigger("clipboard:changed",{cells:t}))}paste(t={},e=this.graph){return this.disabled?[]:this.widget.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}clean(t){this.disabled&&!t||(this.widget.clean(),this.graph.trigger("clipboard:changed",{cells:[]}))}isEmpty(){return this.widget.isEmpty()}dispose(){this.clean(!0)}}tp([oh.dispose()],np.prototype,"dispose",null);var rp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class ip extends oh{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:n={}}){const r=this.resolveHighlighter(n);if(!r)return;const i=this.getHighlighterId(e,r);if(!this.highlights[i]){const n=r.highlighter;n.highlight(t,e,Object.assign({},r.args)),this.highlights[i]={cellView:t,magnet:e,highlighter:n,args:r.args}}}onCellUnhighlight({magnet:t,options:e={}}){const n=this.resolveHighlighter(e);if(!n)return;const r=this.getHighlighterId(t,n);this.unhighlight(r)}resolveHighlighter(t){const e=this.options;let n=t.highlighter;if(null==n){const r=t.type;n=r&&e.highlighting[r]||e.highlighting.default}if(null==n)return null;const r="string"===typeof n?{name:n}:n,i=r.name,o=Bs.registry.get(i);return null==o?Bs.registry.onNotFound(i):(Bs.check(i,o),{name:i,highlighter:o,args:r.args||{}})}getHighlighterId(t,e){return c.ensureId(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach(t=>this.unhighlight(t)),this.stopListening()}}rp([ip.dispose()],ip.prototype,"dispose",null);var op=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class ap extends oh{constructor(){super(...arguments),this.widgets=new Map}get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get isSelectionEnabled(){return!0===this.options.selecting.enabled}init(){this.startListening(),this.resize()}startListening(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)}stopListening(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)}onNodeMouseUp({node:t}){if(!this.isSelectionEnabled){const e=this.graph.hook.createTransform(t,{clearAll:!0});e&&this.widgets.set(t,e)}}onNodeSelected({node:t}){if(this.isSelectionEnabled){const e=this.graph.hook.createTransform(t,{clearAll:!1});e&&this.widgets.set(t,e)}}onNodeUnSelected({node:t}){if(this.isSelectionEnabled){const e=this.widgets.get(t);e&&e.dispose(),this.widgets.delete(t)}}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),c.createSVGMatrix(this.viewportMatrix)}setMatrix(t){const e=c.createSVGMatrix(t),n=c.matrixToTransformString(e);this.viewport.setAttribute("transform",n),this.viewportMatrix=e,this.viewportTransformString=n}resize(t,e){let n=void 0===t?this.options.width:t,r=void 0===e?this.options.height:e;this.options.width=n,this.options.height=r,"number"===typeof n&&(n=Math.round(n)),"number"===typeof r&&(r=Math.round(r)),this.container.style.width=null==n?"":n+"px",this.container.style.height=null==r?"":r+"px";const i=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},i)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return a.isNumber(t)||(t=this.container.clientWidth),a.isNumber(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return c.matrixToScale(this.getMatrix())}scale(t,e=t,n=0,r=0,i={}){if(t=this.clampScale(t),e=this.clampScale(e),n||r){const i=this.getTranslation(),o=i.tx-n*(t-1),a=i.ty-r*(e-1);o===i.tx&&a===i.ty||this.translate(o,a)}const o=this.getMatrix();return o.a=t,o.d=e,this.setMatrix(o),this.graph.trigger("scale",Object.assign({sx:t,sy:e,ox:n,oy:r},i)),this}clampScale(t){const e=this.graph.options.scaling;return a.clamp(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let n=t,r=t;const i=this.getScale(),o=this.getComputedSize();let a=o.width/2,s=o.height/2;if(e.absolute||(n+=i.sx,r+=i.sy),e.scaleGrid&&(n=Math.round(n/e.scaleGrid)*e.scaleGrid,r=Math.round(r/e.scaleGrid)*e.scaleGrid),e.maxScale&&(n=Math.min(e.maxScale,n),r=Math.min(e.maxScale,r)),e.minScale&&(n=Math.max(e.minScale,n),r=Math.max(e.minScale,r)),e.center&&(a=e.center.x,s=e.center.y),n=this.clampScale(n),r=this.clampScale(r),a||s){const t=this.getTranslation(),o=a-(a-t.tx)*(n/i.sx),l=s-(s-t.ty)*(r/i.sy);o===t.tx&&l===t.ty||this.translate(o,l,{ui:e.ui})}return this.scale(n,r,0,0,{ui:e.ui}),this}getRotation(){return c.matrixToRotation(this.getMatrix())}rotate(t,e,n){if(null==e||null==n){const t=c.getBBox(this.graph.view.stage);e=t.width/2,n=t.height/2}const r=this.getMatrix().translate(e,n).rotate(t).translate(-e,-n);return this.setMatrix(r),this}getTranslation(){return c.matrixToTranslation(this.getMatrix())}translate(t,e,n={}){const r=this.getMatrix();r.e=t||0,r.f=e||0,this.setMatrix(r);const i=this.getTranslation();return this.options.x=i.tx,this.options.y=i.ty,this.graph.trigger("translate",Object.assign(Object.assign({},i),n)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,n,r){if("object"===typeof t){const i=t;t=i.gridWidth||1,e=i.gridHeight||1,n=i.padding||0,r=i}else t=t||1,e=e||1,n=n||0,null==r&&(r={});const i=a.normalizeSides(n),o=r.border||0,s=r.contentArea?jr.create(r.contentArea):this.getContentArea(r);o>0&&s.inflate(o);const l=this.getScale(),c=this.getTranslation(),u=l.sx,d=l.sy;s.x*=u,s.y*=d,s.width*=u,s.height*=d;let h=Math.max(Math.ceil((s.width+s.x)/t),1)*t,p=Math.max(Math.ceil((s.height+s.y)/e),1)*e,f=0,g=0;("negative"===r.allowNewOrigin&&s.x<0||"positive"===r.allowNewOrigin&&s.x>=0||"any"===r.allowNewOrigin)&&(f=Math.ceil(-s.x/t)*t,f+=i.left,h+=f),("negative"===r.allowNewOrigin&&s.y<0||"positive"===r.allowNewOrigin&&s.y>=0||"any"===r.allowNewOrigin)&&(g=Math.ceil(-s.y/e)*e,g+=i.top,p+=g),h+=i.right,p+=i.bottom,h=Math.max(h,r.minWidth||0),p=Math.max(p,r.minHeight||0),h=Math.min(h,r.maxWidth||Number.MAX_SAFE_INTEGER),p=Math.min(p,r.maxHeight||Number.MAX_SAFE_INTEGER);const m=this.getComputedSize(),v=h!==m.width||p!==m.height,b=f!==c.tx||g!==c.ty;return b&&this.translate(f,g),v&&this.resize(h,p),new jr(-f/u,-g/d,h/u,p/d)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let n,r;if(t.contentArea){const e=t.contentArea;n=this.graph.localToGraph(e),r=Dr.create(e)}else n=this.getContentBBox(t),r=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const i=a.normalizeSides(t.padding),o=t.minScale||0,s=t.maxScale||Number.MAX_SAFE_INTEGER,l=t.minScaleX||o,c=t.maxScaleX||s,u=t.minScaleY||o,d=t.maxScaleY||s;let h;if(t.viewportArea)h=t.viewportArea;else{const t=this.getComputedSize(),e=this.getTranslation();h={x:e.tx,y:e.ty,width:t.width,height:t.height}}h=jr.create(h).moveAndExpand({x:i.left,y:i.top,width:-i.left-i.right,height:-i.top-i.bottom});const p=this.getScale();let f=h.width/n.width*p.sx,g=h.height/n.height*p.sy;!1!==t.preserveAspectRatio&&(f=g=Math.min(f,g));const m=t.scaleGrid;if(m&&(f=m*Math.floor(f/m),g=m*Math.floor(g/m)),f=a.clamp(f,l,c),g=a.clamp(g,u,d),this.scale(f,g),e){const t=this.options,e=h.x-r.x*f-t.x,n=h.y-r.y*g-t.y;this.translate(e,n)}}getContentArea(t={}){return t.useCellGeometry?this.model.getAllCellsBBox()||new jr:c.getBBox(this.graph.view.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=jr.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=jr.create(t),r=this.graph;e.contentArea=n,null==e.viewportArea&&(e.viewportArea={x:r.options.x,y:r.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const i=n.getCenter();return this.centerPoint(i.x,i.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const n=this.getComputedSize(),r=this.getScale(),i=this.getTranslation(),o=n.width/2,a=n.height/2;t="number"===typeof t?t:o,e="number"===typeof e?e:a,t=o-t*r.sx,e=a-e*r.sy,i.tx===t&&i.ty===e||this.translate(t,e)}centerContent(t){const e=this.graph.getContentArea(t),n=e.getCenter();this.centerPoint(n.x,n.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,n){const r=this.getComputedSize();e=a.normalizePercentage(e,Math.max(0,r.width)),e<0&&(e=r.width+e),n=a.normalizePercentage(n,Math.max(0,r.height)),n<0&&(n=r.height+n);const i=this.getTranslation(),o=this.getScale(),s=e-t.x*o.sx,l=n-t.y*o.sy;i.tx===s&&i.ty===l||this.translate(s,l)}positionRect(t,e){const n=jr.create(t);switch(e){case"center":return this.positionPoint(n.getCenter(),"50%","50%");case"top":return this.positionPoint(n.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(n.getTopRight(),"100%",0);case"right":return this.positionPoint(n.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(n.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(n.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(n.getBottomLeft(),0,"100%");case"left":return this.positionPoint(n.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(n.getTopLeft(),0,0);default:return this}}positionCell(t,e){const n=t.getBBox();return this.positionRect(n,e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t)}dispose(){this.widgets.forEach(t=>t.dispose()),this.widgets.clear(),this.stopListening()}}op([ap.dispose()],ap.prototype,"dispose",null);var sp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class lp extends oh{constructor(){super(...arguments),this.movedMap=new WeakMap,this.unselectMap=new WeakMap}get widgetOptions(){return this.options.selecting}get rubberbandDisabled(){return!0!==this.widgetOptions.enabled||!0!==this.widgetOptions.rubberband}get disabled(){return!0!==this.widgetOptions.enabled}get length(){return this.widget.length}get cells(){return this.widget.cells}init(){this.widget=this.graph.hook.createSelection(),this.startListening()}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.widget.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.widget.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!this.graph.scroller.allowPanning(t,!0)&&!this.graph.panning.allowPanning(t,!0))&&this.startRubberband(t)}onBlankClick(){this.clean()}allowRubberband(t,e){return!this.rubberbandDisabled&&Xh.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowRubberband(t)}allowMultipleSelection(t){return this.isMultiple()&&Xh.isMatch(t,this.widgetOptions.multipleSelectionModifiers)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const n=this.widgetOptions;let r=this.disabled;!r&&this.movedMap.has(e)&&(r=!1===n.selectCellOnMoved,r||(r=!1===n.selectNodeOnMoved&&e.isNode()),r||(r=!1===n.selectEdgeOnMoved&&e.isEdge())),r||(this.allowMultipleSelection(t)?this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e):this.reset(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||this.allowMultipleSelection(t)&&(this.unselect(e),this.unselectMap.set(e,!0))}isEmpty(){return this.length<=0}isSelected(t){return this.widget.isSelected(t)}getCells(t){return(Array.isArray(t)?t:[t]).map(t=>"string"===typeof t?this.graph.getCellById(t):t).filter(t=>null!=t)}select(t,e={}){const n=this.getCells(t);return n.length&&(this.isMultiple()?this.widget.select(n,e):this.reset(n.slice(0,1),e)),this}unselect(t,e={}){return this.widget.unselect(this.getCells(t),e),this}reset(t,e={}){return this.widget.reset(t?this.getCells(t):[],e),this}clean(t={}){return this.widget.clean(t),this}enable(){return this.disabled&&(this.widgetOptions.enabled=!0),this}disable(){return this.disabled||(this.widgetOptions.enabled=!1),this}startRubberband(t){return this.rubberbandDisabled||this.widget.startSelecting(t),this}enableRubberband(){return this.rubberbandDisabled&&(this.widgetOptions.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.widgetOptions.rubberband=!1),this}isMultiple(){return!1!==this.widgetOptions.multiple}enableMultiple(){return this.widgetOptions.multiple=!0,this}disableMultiple(){return this.widgetOptions.multiple=!1,this}setModifiers(t){return this.widgetOptions.modifiers=t,this}setContent(t){return this.widget.setContent(t),this}setFilter(t){return this.widget.setFilter(t),this}dispose(){this.stopListening(),this.widget.dispose()}}sp([oh.dispose()],lp.prototype,"dispose",null);var cp,up=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},dp=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class hp extends kl{constructor(t){super(),this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.handlers=[],this.graph=t.graph,this.model=t.graph.model,this.options=cp.getOptions(t),this.validator=new hp.Validator({history:this,cancelInvalid:this.options.cancelInvalid}),this.clean(),this.startListening()}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStack.push(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}validate(t,...e){return this.validator.validate(t,...e),this}dispose(){this.validator.dispose(),this.clean(),this.stopListening()}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])}),this.validator.on("invalid",t=>this.trigger("invalid",t))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((t,e)=>{this.model.off(t,this.handlers[e])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:!!t&&t.batch,data:{}}}revertCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?cp.sortBatchCommands(t):[t];for(let r=n.length-1;r>=0;r-=1){const t=n[r],o=Object.assign(Object.assign({},e),i.pick(t.options,this.options.revertOptionsList||[]));this.executeCommand(t,!0,o)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?cp.sortBatchCommands(t):[t];for(let r=0;r<n.length;r+=1){const t=n[r],o=Object.assign(Object.assign({},e),i.pick(t.options,this.options.applyOptionsList||[]));this.executeCommand(t,!1,o)}this.freezed=!1}executeCommand(t,e,n){const r=this.model,i=r.getCell(t.data.id),o=t.event;if(cp.isAddEvent(o)&&e||cp.isRemoveEvent(o)&&!e)i.remove(n);else if(cp.isAddEvent(o)&&!e||cp.isRemoveEvent(o)&&e){const e=t.data;e.node?r.addNode(e.props,n):e.edge&&r.addEdge(e.props,n)}else if(cp.isChangeEvent(o)){const r=t.data,o=r.key;if(o){const t=e?r.prev[o]:r.next[o];i.prop(o,t,n)}}else{const r=this.options.executeCommand;r&&s.call(r,this,t,e,n)}}addCommand(t,e){if(this.freezed||this.disabled)return;const n=e,r=n.options||{};if(r.dryrun)return;if(cp.isAddEvent(t)&&this.options.ignoreAdd||cp.isRemoveEvent(t)&&this.options.ignoreRemove||cp.isChangeEvent(t)&&this.options.ignoreChange)return;const o=this.options.beforeAddCommand;if(null!=o&&!1===s.call(o,this,t,e))return;"cell:change:*"===t&&(t="cell:change:"+n.key);const a=n.cell,l=Td.isModel(a);let c;if(this.batchCommands){c=this.batchCommands[Math.max(this.lastBatchIndex,0)];const e=l&&!c.modelChange||c.data.id!==a.id,n=c.event!==t;if(this.lastBatchIndex>=0&&(e||n)){const e=this.batchCommands.findIndex(e=>(l&&e.modelChange||e.data.id===a.id)&&e.event===t);e<0||cp.isAddEvent(t)||cp.isRemoveEvent(t)?c=this.createCommand({batch:!0}):(c=this.batchCommands[e],this.batchCommands.splice(e,1)),this.batchCommands.push(c),this.lastBatchIndex=this.batchCommands.length-1}}else c=this.createCommand({batch:!1});if(cp.isAddEvent(t)||cp.isRemoveEvent(t)){const e=c.data;return c.event=t,c.options=r,e.id=a.id,e.props=i.cloneDeep(a.toJSON()),a.isEdge()?e.edge=!0:a.isNode()&&(e.node=!0),this.push(c,r)}if(cp.isChangeEvent(t)){const n=e.key,o=c.data;return c.batch&&c.event||(c.event=t,c.options=r,o.key=n,null==o.prev&&(o.prev={}),o.prev[n]=i.clone(a.previous(n)),l?c.modelChange=!0:o.id=a.id),null==o.next&&(o.next={}),o.next[n]=i.clone(a.prop(n)),this.push(c,r)}const u=this.options.afterAddCommand;u&&s.call(u,this,t,e,c),this.push(c,r)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStack.push(e),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const n=[];while(e.length>0){const t=e.shift(),r=t.event,o=t.data.id;if(null!=r&&(null!=o||t.modelChange)){if(cp.isAddEvent(r)){const t=e.findIndex(t=>cp.isRemoveEvent(t.event)&&t.data.id===o);if(t>=0){e=e.filter((e,n)=>t<n||e.data.id!==o);continue}}else if(cp.isRemoveEvent(r)){const t=e.findIndex(t=>cp.isAddEvent(t.event)&&t.data.id===o);if(t>=0){e.splice(t,1);continue}}else if(cp.isChangeEvent(r)){const e=t.data;if(i.isEqual(e.prev,e.next))continue}n.push(t)}}return n}notify(t,e,n){const r=null==e?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:r,options:n}),this.emit("change",{cmds:r,options:n})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStack.push(t),this.notify("add",t,e))}}up([kl.dispose()],hp.prototype,"dispose",null),function(t){class e extends kl{constructor(t){super(),this.map={},this.command=t.history,this.cancelInvalid=!1!==t.cancelInvalid,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:t}){return Array.isArray(t)?t.every(t=>this.isValidCommand(t)):this.isValidCommand(t)}isValidCommand(t){if(t.options&&!1===t.options.validation)return!0;const e=t.event&&this.map[t.event]||[];let n=null;return e.forEach(e=>{let r=0;const i=o=>{const a=e[r];r+=1;try{if(!a)return void(n=o);a(o,t,i)}catch(o){i(o)}};i(n)}),!n||(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1)}validate(t,...e){const n=Array.isArray(t)?t:t.split(/\s+/);return e.forEach(t=>{if("function"!==typeof t)throw new Error(n.join(" ")+" requires callback functions.")}),n.forEach(t=>{null==this.map[t]&&(this.map[t]=[]),this.map[t].push(e)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}up([kl.dispose()],e.prototype,"dispose",null),t.Validator=e}(hp||(hp={})),function(t){function e(t){return"cell:added"===t}function n(t){return"cell:removed"===t}function r(t){return null!=t&&t.startsWith("cell:change:")}function i(e){const{graph:n}=e,r=dp(e,["graph"]),i=["cell:added","cell:removed","cell:change:*"],o=["batch:start","batch:stop"],a=e.eventNames?e.eventNames.filter(e=>!(t.isChangeEvent(e)||i.includes(e)||o.includes(e))):i;return Object.assign(Object.assign({},r),{eventNames:a,applyOptionsList:e.applyOptionsList||["propertyPath"],revertOptionsList:e.revertOptionsList||["propertyPath"]})}function o(e){const n=[];for(let r=0,i=e.length;r<i;r+=1){const i=e[r];let o=null;if(t.isAddEvent(i.event)){const t=i.data.id;for(let n=0;n<r;n+=1)if(e[n].data.id===t){o=n;break}}null!==o?n.splice(o,0,i):n.push(i)}return n}t.isAddEvent=e,t.isRemoveEvent=n,t.isChangeEvent=r,t.getOptions=i,t.sortBatchCommands=o}(cp||(cp={}));var pp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class fp extends oh{get widgetOptions(){return this.options.minimap}init(){this.widget=this.graph.hook.createMiniMap()}dispose(){this.widget&&this.widget.dispose()}}pp([oh.dispose()],fp.prototype,"dispose",null);var gp=n("8a60"),mp=n.n(gp),vp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class bp extends xl{constructor(t){super(),this.options=t;const e=this.graph.scroller.widget;this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=bp.createMousetrap(this)}get graph(){return this.options.graph}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.graph.options.keyboard.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.keyboard.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}focus(t){const e=this.isInputEvent(t.e);if(e)return;const n=this.target;n.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map(t=>this.formatkey(t))}formatkey(t){const e=t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command"),n=this.options.format;return n?s.call(n,this.graph,e):e}isGraphEvent(t){const e=t.srcElement||t.target,n=t.currentTarget;return!!e&&(e===this.target||n===this.target||e===document.body||c.contains(this.container,e))}isInputEvent(t){const e=t.target,n=e&&e.tagName.toLowerCase();return["input","textarea"].includes(n)}isEnabledForEvent(t){const e=!this.disabled&&this.isGraphEvent(t),n=this.isInputEvent(t);if(e){const e=t.keyCode||t.which;if(n&&(8===e||46===e))return!1;if(this.options.guard)return s.call(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}vp([xl.dispose()],bp.prototype,"dispose",null),function(t){function e(t){const e=new mp.a(t.target),n=e.stopCallback;return e.stopCallback=(r,i,o)=>!t.isEnabledForEvent(r)||!!n&&n.call(e,r,i,o),e}t.createMousetrap=e}(bp||(bp={}));var yp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class wp extends xl{constructor(t){super(),this.options=t,this.cumulatedFactor=1;const e=this.graph.scroller.widget;this.container=e?e.container:this.graph.container,this.target=this.options.global?document:this.container,this.mousewheelHandle=new c.MouseWheelHandle(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.options.enabled&&this.enable(!0)}get graph(){return this.options.graph}get disabled(){return!0!==this.options.enabled}enable(t){(this.disabled||t)&&(this.options.enabled=!0,this.graph.options.mousewheel.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.mousewheel.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;return(null==n||n.call(this.graph,e))&&Xh.isMatch(e,this.options.modifiers)}onMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;if((null==n||n.call(this.graph,e))&&Xh.isMatch(e,this.options.modifiers)){const e=this.options.factor||1.2;null==this.currentScale&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.scroller.widget?this.graph.scroller.widget.zoom():this.graph.transform.getScale().sx);const n=t.deltaY;n<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*e*20)/20/this.currentScale:this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*(1/e)*20)/20/this.currentScale,this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const r=this.graph.scroller.widget,i=this.currentScale;let o=this.graph.transform.clampScale(i*this.cumulatedFactor);const s=this.options.minScale||Number.MIN_SAFE_INTEGER,l=this.options.maxScale||Number.MAX_SAFE_INTEGER;if(o=a.clamp(o,s,l),o!==i)if(r)if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToLocalPoint(this.startPos);r.zoom(o,{absolute:!0,center:t.clone()})}else r.zoom(o,{absolute:!0});else if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToGraphPoint(this.startPos);this.graph.transform.zoom(o,{absolute:!0,center:t.clone(),ui:!0})}else this.graph.transform.zoom(o,{absolute:!0,ui:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}yp([xl.dispose()],wp.prototype,"dispose",null);var xp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Cp extends oh{show(t={}){const e=Object.assign(Object.assign({},Cp.defaultOptions),t),n=this.createPrintPages(e);e.ready(n,t=>this.showPrintWindow(t,e),{sheetSize:this.getSheetSize(e)})}get className(){return this.view.prefixClassName("graph-print")}showPrintWindow(t,e){if(t){const n=pt()(document.body),r=pt()(this.view.container),i=this.view.prefixClassName("graph-printing");n.addClass(i);const o=r.children().detach();t.forEach(t=>{t.removeClass(this.className+"-preview").addClass(this.className+"-ready").appendTo(n)});let a=!1;const s=()=>{a||(a=!0,n.removeClass(i),t.forEach(t=>t.remove()),r.append(o),pt()("#"+this.styleSheetId).remove(),this.graph.trigger("after:print",e),pt()(window).off("afterprint",s))};pt()(window).one("afterprint",s),setTimeout(s,200),window.print()}}createPrintPage(t,e){this.graph.trigger("before:print",e);const n=pt()("<div/>").addClass(this.className),r=pt()("<div/>").addClass(this.view.prefixClassName("graph-print-inner")).css("position","relative");e.size&&n.addClass(`${this.className}-size-${e.size}`);const i=ai.create(this.view.svg).clone(),o=i.findOne("."+this.view.prefixClassName("graph-svg-stage"));r.append(i.node);const a=this.getSheetSize(e),s=this.graph.transform.getGraphArea(),l=this.graph.transform.getScale(),u=this.graph.translate(),d=c.createSVGMatrix().translate(u.tx/l.sx,u.ty/l.sy),h=this.getPageInfo(s,t,a),p=h.scale,f=h.bbox;return r.css({left:0,top:0}),i.attr({width:f.width*p,height:f.height*p,style:"position:relative",viewBox:[f.x,f.y,f.width,f.height].join(" ")}),o.attr("transform",c.matrixToTransformString(d)),n.append(r),n.addClass(this.className+"-preview"),{$page:n,sheetSize:a}}createPrintPages(t){let e;const n=this.getPrintArea(t),r=[];if(t.page){const i=this.getPageSize(n,t.page),o=this.getPageAreas(n,i);o.forEach(n=>{e=this.createPrintPage(n,t),r.push(e.$page)})}else e=this.createPrintPage(n,t),r.push(e.$page);if(e){const n={width:e.sheetSize.cssWidth,height:e.sheetSize.cssHeight};this.updatePrintStyle(n,t)}return r}get styleSheetId(){return this.view.prefixClassName("graph-print-style")}updatePrintStyle(t,e){const n=Object.keys(t).reduce((e,n)=>`${e} ${n}:${t[n]};`,""),r=a.normalizeSides(e.margin),i=e.marginUnit||"",o=e.sheetUnit||"",s=`\n @media print {\n .${this.className}.${this.className}-ready {\n ${n}\n }\n\n @page {\n margin:\n ${[r.top+i,r.right+i,r.bottom+i,r.left+i].join(" ")};\n size: ${e.sheet.width+o} ${e.sheet.height+o};\n\n .${this.className}.${this.className}-preview {\n ${n}\n }\n }`,l=this.styleSheetId,c=pt()("#"+l);c.length?c.html(s):pt()("head").append(`'<style type="text/css" id="${l}">${s}</style>'`)}getPrintArea(t){let e=t.area;if(!e){const n=a.normalizeSides(t.padding);e=this.graph.getContentArea().moveAndExpand({x:-n.left,y:-n.top,width:n.left+n.right,height:n.top+n.bottom})}return e}getPageSize(t,e){if("object"===typeof e){const n=e,r={width:n.width,height:n.height};return null==r.width&&(r.width=Math.ceil(t.width/(n.columns||1))),null==r.height&&(r.height=Math.ceil(t.height/(n.rows||1))),r}return{width:t.width,height:t.height}}getPageAreas(t,e){const n=[],r=e.width,i=e.height;for(let o=0,a=0;o<t.height&&a<200;o+=i,a+=1)for(let e=0,s=0;e<t.width&&s<200;e+=r,s+=1)n.push(new jr(t.x+e,t.y+o,r,i));return n}getSheetSize(t){const e=t.sheet,n=a.normalizeSides(t.margin),r=t.marginUnit||"",i=t.sheetUnit||"",o=`calc(${e.width}${i} - ${n.left+n.right}${r})`,s=`calc(${e.height}${i} - ${n.top+n.bottom}${r})`,l=hr.measure(o,s);return{cssWidth:o,cssHeight:s,width:l.width,height:l.height}}getPageInfo(t,e,n){const r=new jr(e.x-t.x,e.y-t.y,e.width,e.height),i=r.width/r.height,o=n.width/n.height;return{bbox:r,scale:o<i?n.width/r.width:n.height/r.height,fitHorizontal:o<i}}dispose(){}}xp([oh.dispose()],Cp.prototype,"dispose",null),function(t){t.defaultOptions={page:!1,sheet:{width:210,height:297},sheetUnit:"mm",margin:.4,marginUnit:"in",padding:5,ready:(t,e)=>e(t)}}(Cp||(Cp={}));class kp extends oh{toSVG(t,e={}){this.graph.trigger("before:export",e);const n=this.view.svg,r=ai.create(n).clone();let i=r.node;const o=r.findOne("."+this.view.prefixClassName("graph-svg-stage")),l=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),c=e.preserveDimensions;if(c){const t="boolean"===typeof c?l:c;r.attr({width:t.width,height:t.height})}if(r.removeAttribute("style").attr("viewBox",[l.x,l.y,l.width,l.height].join(" ")),o.removeAttribute("transform"),!1!==e.copyStyles){const t=n.ownerDocument,e=Array.from(n.querySelectorAll("*")),r=Array.from(i.querySelectorAll("*")),o=t.styleSheets.length,s=[];for(let n=o-1;n>=0;n-=1)s[n]=t.styleSheets[n],t.styleSheets[n].disabled=!0;const l={};e.forEach((t,e)=>{const n=window.getComputedStyle(t,null),r={};Object.keys(n).forEach(t=>{r[t]=n.getPropertyValue(t)}),l[e]=r}),o!==t.styleSheets.length&&s.forEach((e,n)=>{t.styleSheets[n]=e});for(let n=0;n<o;n+=1)t.styleSheets[n].disabled=!1;const c={};e.forEach((t,e)=>{const n=window.getComputedStyle(t,null),r=l[e],i={};Object.keys(n).forEach(t=>{a.isNumeric(t)||n.getPropertyValue(t)===r[t]||(i[t]=n.getPropertyValue(t))}),c[e]=i}),r.forEach((t,e)=>{pt()(t).css(c[e])})}const u=e.stylesheet;if("string"===typeof u){const t=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(ai.create("style",{type:"text/css"},[t]))}const d=()=>{const n=e.beforeSerialize;if("function"===typeof n){const t=s.call(n,this.graph,i);t instanceof SVGSVGElement&&(i=t)}const r=(new XMLSerializer).serializeToString(i).replace(/&nbsp;/g," ");this.graph.trigger("after:export",e),t(r)};if(e.serializeImages){const t=r.find("image").map(t=>new Promise(e=>{const n=t.attr("xlink:href")||t.attr("href");cr.imageToDataUri(n,(n,r)=>{!n&&r&&t.attr("xlink:href",r),e()})}));Promise.all(t).then(d)}else d()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const r=a.normalizeSides(e.padding);e.width&&e.height&&(r.left+r.right>=e.width&&(r.left=r.right=0),r.top+r.bottom>=e.height&&(r.top=r.bottom=0));const i=new jr(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(e.width&&e.height){const t=n.width+r.left+r.right,o=n.height+r.top+r.bottom;i.scale(t/e.width,o/e.height)}n=jr.create(n).moveAndExpand(i);const o="number"===typeof e.width&&"number"===typeof e.height?{width:e.width,height:e.height}:n;let s=e.ratio?parseFloat(e.ratio):1;Number.isFinite(s)&&0!==s||(s=1);const l={width:Math.max(Math.round(o.width*s),1),height:Math.max(Math.round(o.height*s),1)};{const t=document.createElement("canvas"),e=t.getContext("2d");t.width=l.width,t.height=l.height;const n=l.width-1,r=l.height-1;e.fillStyle="rgb(1,1,1)",e.fillRect(n,r,1,1);const i=e.getImageData(n,r,1,1).data;if(1!==i[0]||1!==i[1]||1!==i[2])throw new Error("size exceeded")}const c=new Image;c.onload=()=>{const n=document.createElement("canvas");n.width=l.width,n.height=l.height;const r=n.getContext("2d");r.fillStyle=e.backgroundColor||"white",r.fillRect(0,0,l.width,l.height);try{r.drawImage(c,0,0,l.width,l.height);const i=n.toDataURL(e.type,e.quality);t(i)}catch(i){}},this.toSVG(t=>{c.src="data:image/svg+xml,"+encodeURIComponent(t)},Object.assign(Object.assign({},e),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},l)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}}class Ap extends oh{constructor(){super(...arguments),this.widgets=new Map}get isSelectionEnabled(){return!0===this.options.selecting.enabled}init(){this.startListening()}startListening(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)}stopListening(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)}onNodeMouseUp({node:t}){if(!this.isSelectionEnabled){const e=this.graph.hook.createKnob(t,{clearAll:!0});e&&this.widgets.set(t,e)}}onNodeSelected({node:t}){if(this.isSelectionEnabled){const e=this.graph.hook.createKnob(t,{clearAll:!1});e&&this.widgets.set(t,e)}}onNodeUnSelected({node:t}){if(this.isSelectionEnabled){const e=this.widgets.get(t);e&&e.forEach(t=>t.dispose()),this.widgets.delete(t)}}}var Sp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Ep extends oh{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&!0===this.widgetOptions.enabled}init(){this.startListening(),this.updateClassName()}startListening(){const t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.graph.container).on("mousedown",this.onRightMouseDown)),t.includes("mouseWheel")&&(this.mousewheelHandle=new c.MouseWheelHandle(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()))}stopListening(){const t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.graph.container).off("mousedown",this.onRightMouseDown),t.includes("mouseWheel")&&this.mousewheelHandle&&this.mousewheelHandle.disable())}preparePanning({e:t}){(this.allowPanning(t,!0)||this.allowPanning(t)&&!this.graph.selection.allowRubberband(t,!0))&&this.startPanning(t)}allowPanning(t,e){return this.pannable&&Xh.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(),this.view.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.view.$(window).on("mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),n=e.clientX-this.clientX,r=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY;const i=this.graph.transform.getTranslation(),o=i.tx+n,a=i.ty+r;this.graph.transform.translate(o,a,{ui:!0})}stopPanning(t){this.panning=!1,this.updateClassName(),this.view.$(document.body).off(".panning"),this.view.$(window).off(".panning")}updateClassName(){const t=this.view.container,e=this.view.prefixClassName("graph-panning"),n=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(c.addClass(t,e),c.removeClass(t,n)):(c.removeClass(t,e),c.addClass(t,n)):(c.removeClass(t,e),c.removeClass(t,n))}onRightMouseDown(t){2===t.button&&this.allowPanning(t,!0)&&this.startPanning(t)}allowMouseWheel(t){return this.pannable&&!t.ctrlKey}onMouseWheel(t,e,n){t.ctrlKey||this.graph.translateBy(-e,-n)}autoPanning(t,e){const n=10,r=this.graph.getGraphArea();let i=0,o=0;t<=r.left+n&&(i=-n),e<=r.top+n&&(o=-n),t>=r.right-n&&(i=n),e>=r.bottom-n&&(o=n),0===i&&0===o||this.graph.translateBy(-i,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}Sp([oh.dispose()],Ep.prototype,"dispose",null);var Op=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Tp extends oh{hasScroller(){return null!=this.graph.scroller.widget}getContainer(){return this.hasScroller()?this.graph.scroller.widget.container:this.graph.container}init(){const t=this.options.autoResize;if(t){const e="boolean"===typeof t?this.getContainer():t;Ao.bind(e,()=>{const t=this.getContainer(),e=t.offsetWidth,n=t.offsetHeight;this.resize(e,n)})}}resize(t,e){this.hasScroller()?this.resizeScroller(t,e):this.resizeGraph(t,e)}resizeGraph(t,e){this.graph.transform.resize(t,e)}resizeScroller(t,e){this.graph.scroller.resize(t,e)}resizePage(t,e){const n=this.graph.scroller.widget;n&&n.updatePageSize(t,e)}dispose(){Ao.clear(this.getContainer())}}Op([oh.dispose()],Tp.prototype,"dispose",null);var _p,Mp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Np=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};(function(t){function e(t,e){return(n,r,i)=>{const o=i.value,a=e||r;i.value=function(...e){const n=this.options[a];if(null!=n){this.getNativeValue=o.bind(this,...e);const r=s.call(n,this.graph,...e);if(this.getNativeValue=null,null!=r||!0===t&&null===r)return r}return o.call(this,...e)}}}function n(t){return(e,n,r)=>{const i=r.value,o=t||n;r.value=function(...t){let e=i.call(this,...t);const n=this.options[o];return null!=n&&(e=s.call(n,this.graph,...t)&&e),e}}}t.hook=e,t.after=n})(_p||(_p={}));class Pp extends oh{createModel(){if(this.options.model)return this.options.model;const t=new Td;return t.graph=this.graph,t}createView(){return new lh(this.graph)}createRenderer(){return new Th(this.graph)}createDefsManager(){return new Uh(this.graph)}createGridManager(){return new Gh(this.graph)}createCoordManager(){return new Yh(this.graph)}createKnobManager(){return new Ap(this.graph)}createTransform(t,e){const n=this.getTransformOptions(t);return n.resizable||n.rotatable?new zh(Object.assign(Object.assign({node:t,graph:this.graph},n),e)):(n.clearAll&&zh.removeInstances(this.graph),null)}createKnob(t,e){const n=Hh.parseOptionGroup(this.graph,t,this.options.knob),r=Object.assign(Object.assign({},n),e);r.clearAll&&yh.removeInstances(this.graph),r.clearAll=!1;const i=t.prop("knob"),o=[],a=Array.isArray(i)?i:[i];return a.forEach((e,i)=>{e&&!1!==e.enabled&&("function"===typeof e.enabled&&!1===e.enabled.call(this.graph,t)||n.enabled&&o.push(new yh(Object.assign({node:t,index:i,graph:this.graph},r))))}),o}getTransformOptions(t){const e=Hh.parseOptionGroup(this.graph,t,this.options.resizing),n=Hh.parseOptionGroup(this.graph,t,this.options.rotating),r=Hh.parseOptionGroup(this.graph,t,this.options.transforming),i=Object.assign(Object.assign({},r),{resizable:e.enabled,minWidth:e.minWidth,maxWidth:e.maxWidth,minHeight:e.minHeight,maxHeight:e.maxHeight,orthogonalResizing:e.orthogonal,restrictedResizing:null!=e.restrict?e.restrict:e.restricted,autoScrollOnResizing:e.autoScroll,preserveAspectRatio:e.preserveAspectRatio,allowReverse:e.allowReverse,rotatable:n.enabled,rotateGrid:n.grid});return i}createTransformManager(){return new ap(this.graph)}createHighlightManager(){return new ip(this.graph)}createBackgroundManager(){return new Mh(this.graph)}createClipboard(){return new Rp}createClipboardManager(){return new np(this.graph)}createSnapline(){return new Eh(Object.assign({graph:this.graph},this.options.snapline))}createSnaplineManager(){return new Zh(this.graph)}createSelection(){return new Bh(Object.assign({graph:this.graph},this.options.selecting))}createSelectionManager(){return new lp(this.graph)}allowRubberband(t){return!0}createHistoryManager(){return new hp(Object.assign({graph:this.graph},this.options.history))}createScroller(){return this.options.scroller.enabled?new Dh(Object.assign({graph:this.graph},this.options.scroller)):null}createScrollerManager(){return new Qh(this.graph)}allowPanning(t){return!0}createMiniMap(){const t=this.options.minimap,{enabled:e}=t,n=Np(t,["enabled"]);return e?new kh(Object.assign({graph:this.graph},n)):null}createMiniMapManager(){return new fp(this.graph)}createKeyboard(){return new bp(Object.assign({graph:this.graph},this.options.keyboard))}createMouseWheel(){return new wp(Object.assign({graph:this.graph},this.options.mousewheel))}createPrintManager(){return new Cp(this.graph)}createFormatManager(){return new kp(this.graph)}createPanningManager(){return new Ep(this.graph)}createSizeManager(){return new Tp(this.graph)}allowConnectToBlank(t){const e=this.options.connecting,n=null!=e.allowBlank?e.allowBlank:e.dangling;if("function"!==typeof n)return!!n;const r=this.graph.findViewByCell(t),i=t.getSourceCell(),o=t.getTargetCell(),a=this.graph.findViewByCell(i),l=this.graph.findViewByCell(o);return s.call(n,this.graph,{edge:t,edgeView:r,sourceCell:i,targetCell:o,sourceView:a,targetView:l,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:r.sourceMagnet,targetMagnet:r.targetMagnet})}validateEdge(t,e,n){if(!this.allowConnectToBlank(t)){const e=t.getSourceCellId(),n=t.getTargetCellId();if(!e||!n)return!1}const r=this.options.connecting.validateEdge;return!r||s.call(r,this.graph,{edge:t,type:e,previous:n})}validateMagnet(t,e,n){if("passive"!==e.getAttribute("magnet")){const r=this.options.connecting.validateMagnet;return!r||s.call(r,this.graph,{e:n,magnet:e,view:t,cell:t.cell})}return!1}getDefaultEdge(t,e){let n;const r=this.options.connecting.createEdge;return r&&(n=s.call(r,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),null==n&&(n=new Qd),n}validateConnection(t,e,n,r,i,o,a){const l=this.options.connecting,c=l.allowLoop,u=l.allowNode,d=l.allowEdge,h=l.allowPort,p=null!=l.allowMulti?l.allowMulti:l.multi,f=l.validateConnection,g=o?o.cell:null,m="target"===i?n:t,v="target"===i?r:e;let b=!0;const y=l=>{const c="source"===i?a?a.port:null:g?g.getSourcePortId():null,u="target"===i?a?a.port:null:g?g.getTargetPortId():null;return s.call(l,this.graph,{edge:g,edgeView:o,sourceView:t,targetView:n,sourcePort:c,targetPort:u,sourceMagnet:e,targetMagnet:r,sourceCell:t?t.cell:null,targetCell:n?n.cell:null,type:i})};if(null!=c&&("boolean"===typeof c?c||t!==n||(b=!1):b=y(c)),b&&null!=h&&("boolean"===typeof h?!h&&v&&(b=!1):b=y(h)),b&&null!=d&&("boolean"===typeof d?!d&&kd.isEdgeView(m)&&(b=!1):b=y(d)),b&&null!=u&&null==v&&("boolean"===typeof u?!u&&Ad.isNodeView(m)&&(b=!1):b=y(u)),b&&null!=p&&o){const t=o.cell,e="source"===i?a:t.getSource(),n="target"===i?a:t.getTarget(),r=a?this.graph.getCellById(a.cell):null;if(e&&n&&e.cell&&n.cell&&r)if("function"===typeof p)b=y(p);else{const t=this.model.getConnectedEdges(r,{outgoing:"source"===i,incoming:"target"===i});if(t.length)if("withPort"===p){const r=t.some(t=>{const r=t.getSource(),i=t.getTarget();return r&&i&&r.cell===e.cell&&i.cell===n.cell&&null!=r.port&&r.port===e.port&&null!=i.port&&i.port===n.port});r&&(b=!1)}else if(!p){const r=t.some(t=>{const r=t.getSource(),i=t.getTarget();return r&&i&&r.cell===e.cell&&i.cell===n.cell});r&&(b=!1)}}}return b&&null!=f&&(b=y(f)),b}getRestrictArea(t){const e=this.options.translating.restrict,n="function"===typeof e?s.call(e,this.graph,t):e;return"number"===typeof n?this.graph.transform.getGraphArea().inflate(n):!0===n?this.graph.transform.getGraphArea():n||null}onViewUpdated(t,e,n){e&Th.FLAG_INSERT||n.mounting||this.graph.renderer.requestConnectedEdgesUpdate(t,n)}onViewPostponed(t,e,n){return this.graph.renderer.forcePostponedViewUpdate(t,e)}getCellView(t){return null}createCellView(t){const e={graph:this.graph},n=this.getCellView(t);if(n)return new n(t,e);const r=t.view;if(null!=r&&"string"===typeof r){const n=Gl.registry.get(r);return n?new n(t,e):Gl.registry.onNotFound(r)}return t.isNode()?new Ad(t,e):t.isEdge()?new kd(t,e):null}getHTMLComponent(t){let e=t.getHTML();return"string"===typeof e&&(e=nh.componentRegistry.get(e)||e),i.isPlainObject(e)&&(e=e.render),"function"===typeof e?s.call(e,this.graph,t):e}shouldUpdateHTMLComponent(t){let e=t.getHTML();if("string"===typeof e&&(e=nh.componentRegistry.get(e)||e),i.isPlainObject(e)){const n=e.shouldComponentUpdate;return"function"===typeof n?s.call(n,this.graph,t):!!n}return!1}onEdgeLabelRendered(t){}onPortRendered(t){}onToolItemCreated(t){}}Mp([_p.hook()],Pp.prototype,"createModel",null),Mp([_p.hook()],Pp.prototype,"createView",null),Mp([_p.hook()],Pp.prototype,"createRenderer",null),Mp([_p.hook()],Pp.prototype,"createDefsManager",null),Mp([_p.hook()],Pp.prototype,"createGridManager",null),Mp([_p.hook()],Pp.prototype,"createCoordManager",null),Mp([_p.hook()],Pp.prototype,"createKnobManager",null),Mp([_p.hook()],Pp.prototype,"createTransform",null),Mp([_p.hook()],Pp.prototype,"createKnob",null),Mp([_p.hook()],Pp.prototype,"createTransformManager",null),Mp([_p.hook()],Pp.prototype,"createHighlightManager",null),Mp([_p.hook()],Pp.prototype,"createBackgroundManager",null),Mp([_p.hook()],Pp.prototype,"createClipboard",null),Mp([_p.hook()],Pp.prototype,"createClipboardManager",null),Mp([_p.hook()],Pp.prototype,"createSnapline",null),Mp([_p.hook()],Pp.prototype,"createSnaplineManager",null),Mp([_p.hook()],Pp.prototype,"createSelection",null),Mp([_p.hook()],Pp.prototype,"createSelectionManager",null),Mp([_p.hook()],Pp.prototype,"allowRubberband",null),Mp([_p.hook()],Pp.prototype,"createHistoryManager",null),Mp([_p.hook()],Pp.prototype,"createScroller",null),Mp([_p.hook()],Pp.prototype,"createScrollerManager",null),Mp([_p.hook()],Pp.prototype,"allowPanning",null),Mp([_p.hook()],Pp.prototype,"createMiniMap",null),Mp([_p.hook()],Pp.prototype,"createMiniMapManager",null),Mp([_p.hook()],Pp.prototype,"createKeyboard",null),Mp([_p.hook()],Pp.prototype,"createMouseWheel",null),Mp([_p.hook()],Pp.prototype,"createPrintManager",null),Mp([_p.hook()],Pp.prototype,"createFormatManager",null),Mp([_p.hook()],Pp.prototype,"createPanningManager",null),Mp([_p.hook()],Pp.prototype,"createSizeManager",null),Mp([_p.after()],Pp.prototype,"onViewUpdated",null),Mp([_p.after()],Pp.prototype,"onViewPostponed",null),Mp([_p.hook()],Pp.prototype,"getCellView",null),Mp([_p.hook(!0)],Pp.prototype,"createCellView",null),Mp([_p.hook()],Pp.prototype,"getHTMLComponent",null),Mp([_p.hook()],Pp.prototype,"shouldUpdateHTMLComponent",null),Mp([_p.hook()],Pp.prototype,"onEdgeLabelRendered",null),Mp([_p.hook()],Pp.prototype,"onPortRendered",null),Mp([_p.hook()],Pp.prototype,"onToolItemCreated",null);var Lp,Dp,jp=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Ip extends kl{constructor(t){super(),this.options=Hh.get(t),this.css=new dh(this),this.hook=new Pp(this),this.view=this.hook.createView(),this.defs=this.hook.createDefsManager(),this.coord=this.hook.createCoordManager(),this.transform=this.hook.createTransformManager(),this.knob=this.hook.createKnobManager(),this.highlight=this.hook.createHighlightManager(),this.grid=this.hook.createGridManager(),this.background=this.hook.createBackgroundManager(),this.model=this.hook.createModel(),this.renderer=this.hook.createRenderer(),this.clipboard=this.hook.createClipboardManager(),this.snapline=this.hook.createSnaplineManager(),this.selection=this.hook.createSelectionManager(),this.history=this.hook.createHistoryManager(),this.scroller=this.hook.createScrollerManager(),this.minimap=this.hook.createMiniMapManager(),this.keyboard=this.hook.createKeyboard(),this.mousewheel=this.hook.createMouseWheel(),this.print=this.hook.createPrintManager(),this.format=this.hook.createFormatManager(),this.panning=this.hook.createPanningManager(),this.size=this.hook.createSizeManager()}get container(){return this.view.container}get[Symbol.toStringTag](){return Ip.toStringTag}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map(t=>ud.isNode(t)?t:this.createNode(t)),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map(t=>xd.isEdge(t)?t:this.createEdge(t)),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCell(t){return this.model.getCell(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,n={}){return this.model.isNeighbor(t,e,n)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,n={}){return this.model.isSuccessor(t,e,n)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,n={}){return this.model.isPredecessor(t,e,n)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,n,r,i){return this.model.getNodesInArea(t,e,n,r,i)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,n={}){return this.model.search(t,e,n),this}getShortestPath(t,e,n={}){return this.model.getShortestPath(t,e,n)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,n){const r="string"===typeof t?t:"update",i="string"===typeof t?e:t,o="function"===typeof e?n:e;this.startBatch(r,o);const a=i();return this.stopBatch(r,o),a}updateCellId(t,e){return this.model.updateCellId(t,e)}isFrozen(){return this.renderer.isFrozen()}freeze(t={}){return this.renderer.freeze(t),this}unfreeze(t={}){return this.renderer.unfreeze(t),this}isAsync(){return this.renderer.isAsync()}setAsync(t){return this.renderer.setAsync(t),this}findView(t){return sd.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return jr.isRectangleLike(t)?this.findViewsInArea(t):Dr.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const n="number"===typeof t?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(n)}findViewsInArea(t,e,n,r,i){const o="number"===typeof t?{x:t,y:e,width:n,height:r}:t,a="number"===typeof t?i:e;return this.renderer.findViewsInArea(o,a)}isViewMounted(t){return this.renderer.isViewMounted(t)}getMountedViews(){return this.renderer.getMountedViews()}getUnmountedViews(){return this.renderer.getUnmountedViews()}matrix(t){return"undefined"===typeof t?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){return this.size.resize(t,e),this}resizeGraph(t,e){return this.size.resizeGraph(t,e),this}resizeScroller(t,e){return this.size.resizeScroller(t,e),this}resizePage(t,e){return this.size.resizePage(t,e),this}scale(t,e=t,n=0,r=0){return"undefined"===typeof t?this.transform.getScale():(this.transform.scale(t,e,n,r),this)}zoom(t,e){const n=this.scroller.widget;if(n){if("undefined"===typeof t)return n.zoom();n.zoom(t,e)}else{if("undefined"===typeof t)return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const n=this.scroller.widget;return n?n.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){const n=this.scroller.widget;return n?n.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.scroller.widget;return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,n){return"undefined"===typeof t?this.transform.getRotation():(this.transform.rotate(t,e,n),this)}translate(t,e){return"undefined"===typeof t?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const n=this.translate(),r=n.tx+t,i=n.ty+e;return this.translate(r,i)}getArea(){return this.transform.getGraphArea()}getGraphArea(){return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,n,r){return this.transform.fitToContent(t,e,n,r)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const r=this.scroller.widget;return r?r.centerPoint(t,e,n):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.scroller.widget;return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const n=this.scroller.widget;return n?n.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,n,r={}){const i=this.scroller.widget;return i?i.positionPoint(t,e,n,r):this.transform.positionPoint(t,e,n),this}positionRect(t,e,n){const r=this.scroller.widget;return r?r.positionRect(t,e,n):this.transform.positionRect(t,e),this}positionCell(t,e,n){const r=this.scroller.widget;return r?r.positionCell(t,e,n):this.transform.positionCell(t,e),this}positionContent(t,e){const n=this.scroller.widget;return n?n.positionContent(t,e):this.transform.positionContent(t,e),this}getClientMatrix(){return this.coord.getClientMatrix()}getClientOffset(){return this.coord.getClientOffset()}getPageOffset(){return this.coord.getPageOffset()}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,n,r){return jr.isRectangleLike(t)?this.coord.pageToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof r?this.coord.pageToLocalRect(t,e,n,r):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,n,r){return jr.isRectangleLike(t)?this.coord.localToPageRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof r?this.coord.localToPageRect(t,e,n,r):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,n,r){return jr.isRectangleLike(t)?this.coord.clientToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof r?this.coord.clientToLocalRect(t,e,n,r):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,n,r){return jr.isRectangleLike(t)?this.coord.localToClientRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof r?this.coord.localToClientRect(t,e,n,r):this.coord.localToClientPoint(t,e)}localToGraph(t,e,n,r){return jr.isRectangleLike(t)?this.coord.localToGraphRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof r?this.coord.localToGraphRect(t,e,n,r):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,n,r){return jr.isRectangleLike(t)?this.coord.graphToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof r?this.coord.graphToLocalRect(t,e,n,r):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,n,r){return jr.isRectangleLike(t)?this.coord.clientToGraphRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof r?this.coord.clientToGraphRect(t,e,n,r):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const n=this.scroller.widget;return null==n||null!=this.options.background&&e?this.background.draw(t):n.backgroundManager.draw(t),this}clearBackground(t){const e=this.scroller.widget;return null==e||null!=this.options.background&&t?this.background.clear():e.backgroundManager.clear(),this}isClipboardEnabled(){return!this.clipboard.disabled}enableClipboard(){return this.clipboard.enable(),this}disableClipboard(){return this.clipboard.disable(),this}toggleClipboard(t){return null!=t?t!==this.isClipboardEnabled()&&(t?this.enableClipboard():this.disableClipboard()):this.isClipboardEnabled()?this.disableClipboard():this.enableClipboard(),this}isClipboardEmpty(){return this.clipboard.isEmpty()}getCellsInClipboard(){return this.clipboard.cells}cleanClipboard(){return this.clipboard.clean(),this}copy(t,e={}){return this.clipboard.copy(t,e),this}cut(t,e={}){return this.clipboard.cut(t,e),this}paste(t={},e=this){return this.clipboard.paste(t,e)}isHistoryEnabled(){return!this.history.disabled}enableHistory(){return this.history.enable(),this}disableHistory(){return this.history.disable(),this}toggleHistory(t){return null!=t?t!==this.isHistoryEnabled()&&(t?this.enableHistory():this.disableHistory()):this.isHistoryEnabled()?this.disableHistory():this.enableHistory(),this}undo(t={}){return this.history.undo(t),this}undoAndCancel(t={}){return this.history.cancel(t),this}redo(t={}){return this.history.redo(t),this}canUndo(){return this.history.canUndo()}canRedo(){return this.history.canRedo()}cleanHistory(t={}){this.history.clean(t)}isKeyboardEnabled(){return!this.keyboard.disabled}enableKeyboard(){return this.keyboard.enable(),this}disableKeyboard(){return this.keyboard.disable(),this}toggleKeyboard(t){return null!=t?t!==this.isKeyboardEnabled()&&(t?this.enableKeyboard():this.disableKeyboard()):this.isKeyboardEnabled()?this.disableKeyboard():this.enableKeyboard(),this}bindKey(t,e,n){return this.keyboard.on(t,e,n),this}unbindKey(t,e){return this.keyboard.off(t,e),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return null==t?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.scroller.widget;return t?this.scroller.pannable:this.panning.pannable}enablePanning(){const t=this.scroller.widget;return t?this.scroller.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.scroller.widget;return t?this.scroller.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return null==t?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}lockScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.lock()}unlockScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.unlock()}updateScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.update()}getScrollbarPosition(){const t=this.scroller.widget;return t.scrollbarPosition()}setScrollbarPosition(t,e,n){const r=this.scroller.widget;return r.scrollbarPosition(t,e,n),this}scrollToPoint(t,e,n){const r=this.scroller.widget;return r.scrollToPoint(t,e,n),this}scrollToContent(t){const e=this.scroller.widget;return e.scrollToContent(t),this}scrollToCell(t,e){const n=this.scroller.widget;return n.scrollToCell(t,e),this}transitionToPoint(t,e,n){const r=this.scroller.widget;return r.transitionToPoint(t,e,n),this}transitionToRect(t,e={}){const n=this.scroller.widget;return n.transitionToRect(t,e),this}isSelectionEnabled(){return!this.selection.disabled}enableSelection(){return this.selection.enable(),this}disableSelection(){return this.selection.disable(),this}toggleSelection(t){return null!=t?t!==this.isSelectionEnabled()&&(t?this.enableSelection():this.disableSelection()):this.isSelectionEnabled()?this.disableSelection():this.enableSelection(),this}isMultipleSelection(){return this.selection.isMultiple()}enableMultipleSelection(){return this.selection.enableMultiple(),this}disableMultipleSelection(){return this.selection.disableMultiple(),this}toggleMultipleSelection(t){return null!=t?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return!1!==this.selection.widget.options.movable}enableSelectionMovable(){return this.selection.widget.options.movable=!0,this}disableSelectionMovable(){return this.selection.widget.options.movable=!1,this}toggleSelectionMovable(t){return null!=t?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.selection.rubberbandDisabled}enableRubberband(){return this.selection.enableRubberband(),this}disableRubberband(){return this.selection.disableRubberband(),this}toggleRubberband(t){return null!=t?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return!0===this.selection.widget.options.strict}enableStrictRubberband(){return this.selection.widget.options.strict=!0,this}disableStrictRubberband(){return this.selection.widget.options.strict=!1,this}toggleStrictRubberband(t){return null!=t?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.selection.setModifiers(t)}setSelectionFilter(t){return this.selection.setFilter(t),this}setSelectionDisplayContent(t){return this.selection.setContent(t),this}isSelectionEmpty(){return this.selection.isEmpty()}cleanSelection(t){return this.selection.clean(t),this}resetSelection(t,e){return this.selection.reset(t,e),this}getSelectedCells(){return this.selection.cells}getSelectedCellCount(){return this.selection.length}isSelected(t){return this.selection.isSelected(t)}select(t,e){return this.selection.select(t,e),this}unselect(t,e){return this.selection.unselect(t,e),this}isSnaplineEnabled(){return!this.snapline.widget.disabled}enableSnapline(){return this.snapline.widget.enable(),this}disableSnapline(){return this.snapline.widget.disable(),this}toggleSnapline(t){if(null==t)return this.isSnaplineEnabled()?this.disableSnapline():this.enableSnapline(),this;t!==this.isSnaplineEnabled()&&(t?this.enableSnapline():this.disableSnapline())}hideSnapline(){return this.snapline.widget.hide(),this}setSnaplineFilter(t){return this.snapline.widget.setFilter(t),this}isSnaplineOnResizingEnabled(){return!0===this.snapline.widget.options.resizing}enableSnaplineOnResizing(){return this.snapline.widget.options.resizing=!0,this}disableSnaplineOnResizing(){return this.snapline.widget.options.resizing=!1,this}toggleSnaplineOnResizing(t){return null!=t?t!==this.isSnaplineOnResizingEnabled()&&(t?this.enableSnaplineOnResizing():this.disableSnaplineOnResizing()):this.isSnaplineOnResizingEnabled()?this.disableSnaplineOnResizing():this.enableSnaplineOnResizing(),this}isSharpSnapline(){return!0===this.snapline.widget.options.sharp}enableSharpSnapline(){return this.snapline.widget.options.sharp=!0,this}disableSharpSnapline(){return this.snapline.widget.options.sharp=!1,this}toggleSharpSnapline(t){return null!=t?t!==this.isSharpSnapline()&&(t?this.enableSharpSnapline():this.disableSharpSnapline()):this.isSharpSnapline()?this.disableSharpSnapline():this.enableSharpSnapline(),this}getSnaplineTolerance(){return this.snapline.widget.options.tolerance}setSnaplineTolerance(t){return this.snapline.widget.options.tolerance=t,this}removeTools(){return this.emit("tools:remove"),this}hideTools(){return this.emit("tools:hide"),this}showTools(){return this.emit("tools:show"),this}toSVG(t,e={}){this.format.toSVG(t,e)}toDataURL(t,e){this.format.toDataURL(t,e)}toPNG(t,e={}){this.format.toPNG(t,e)}toJPEG(t,e={}){this.format.toJPEG(t,e)}printPreview(t){this.print.show(t)}dispose(){this.clearCells(),this.off(),this.css.dispose(),this.hook.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.knob.dispose(),this.highlight.dispose(),this.background.dispose(),this.clipboard.dispose(),this.snapline.dispose(),this.selection.dispose(),this.history.dispose(),this.keyboard.dispose(),this.mousewheel.dispose(),this.print.dispose(),this.format.dispose(),this.minimap.dispose(),this.panning.dispose(),this.scroller.dispose(),this.view.dispose(),this.renderer.dispose(),this.size.dispose()}}jp([ah.checkScroller()],Ip.prototype,"lockScroller",null),jp([ah.checkScroller()],Ip.prototype,"unlockScroller",null),jp([ah.checkScroller()],Ip.prototype,"updateScroller",null),jp([ah.checkScroller()],Ip.prototype,"getScrollbarPosition",null),jp([ah.checkScroller()],Ip.prototype,"setScrollbarPosition",null),jp([ah.checkScroller()],Ip.prototype,"scrollToPoint",null),jp([ah.checkScroller()],Ip.prototype,"scrollToContent",null),jp([ah.checkScroller()],Ip.prototype,"scrollToCell",null),jp([ah.checkScroller()],Ip.prototype,"transitionToPoint",null),jp([ah.checkScroller()],Ip.prototype,"transitionToRect",null),jp([kl.dispose()],Ip.prototype,"dispose",null),function(t){t.View=lh,t.Hook=Pp,t.Renderer=Th,t.Keyboard=bp,t.MouseWheel=wp,t.BaseManager=oh,t.DefsManager=Uh,t.GridManager=Gh,t.CoordManager=Yh,t.PrintManager=Cp,t.FormatManager=kp,t.MiniMapManager=fp,t.HistoryManager=hp,t.SnaplineManager=Zh,t.ScrollerManager=Qh,t.ClipboardManager=np,t.TransformManager=ap,t.HighlightManager=ip,t.BackgroundManager=Mh,t.SelectionManager=lp}(Ip||(Ip={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&null!=r.hook&&null!=r.view&&null!=r.model}t.toStringTag="X6."+t.name,t.isGraph=e}(Ip||(Ip={})),function(t){function e(e,n){const r=e instanceof HTMLElement?new t({container:e}):new t(e);return null!=n&&r.fromJSON(n),r}t.render=e}(Ip||(Ip={})),function(t){t.registerNode=ud.registry.register,t.registerEdge=xd.registry.register,t.registerView=Gl.registry.register,t.registerAttr=is.registry.register,t.registerGrid=cs.registry.register,t.registerFilter=ks.registry.register,t.registerNodeTool=uc.registry.register,t.registerEdgeTool=dc.registry.register,t.registerBackground=Ts.registry.register,t.registerHighlighter=Bs.registry.register,t.registerPortLayout=Qs.registry.register,t.registerPortLabelLayout=vl.registry.register,t.registerMarker=Ha.registry.register,t.registerRouter=Iu.registry.register,t.registerConnector=td.registry.register,t.registerAnchor=Mc.registry.register,t.registerEdgeAnchor=Rc.registry.register,t.registerConnectionPoint=$c.registry.register,t.registerConnectionStrategy=Hl.registry.register,t.registerHTMLComponent=nh.componentRegistry.register}(Ip||(Ip={})),function(t){t.unregisterNode=ud.registry.unregister,t.unregisterEdge=xd.registry.unregister,t.unregisterView=Gl.registry.unregister,t.unregisterAttr=is.registry.unregister,t.unregisterGrid=cs.registry.unregister,t.unregisterFilter=ks.registry.unregister,t.unregisterNodeTool=uc.registry.unregister,t.unregisterEdgeTool=dc.registry.unregister,t.unregisterBackground=Ts.registry.unregister,t.unregisterHighlighter=Bs.registry.unregister,t.unregisterPortLayout=Qs.registry.unregister,t.unregisterPortLabelLayout=vl.registry.unregister,t.unregisterMarker=Ha.registry.unregister,t.unregisterRouter=Iu.registry.unregister,t.unregisterConnector=td.registry.unregister,t.unregisterAnchor=Mc.registry.unregister,t.unregisterEdgeAnchor=Rc.registry.unregister,t.unregisterConnectionPoint=$c.registry.unregister,t.unregisterConnectionStrategy=Hl.registry.unregister,t.unregisterHTMLComponent=nh.componentRegistry.unregister}(Ip||(Ip={}));class Rp{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const i=Td.isModel(e)?e:e.model,o=i.cloneSubGraph(t,n);this.cells=r.sortBy(Object.keys(o).map(t=>o[t]),t=>t.isEdge()?2:1),this.serialize(n)}cut(t,e,n={}){this.copy(t,e,n);const r=Ip.isGraph(e)?e.model:e;r.batchUpdate("cut",()=>{t.forEach(t=>t.remove())})}paste(t,e={}){const n=Object.assign(Object.assign({},this.options),e),{offset:r,edgeProps:i,nodeProps:o}=n;let a=20,s=20;r&&(a="number"===typeof r?r:r.dx,s="number"===typeof r?r:r.dy),this.deserialize(n);const l=this.cells;l.forEach(t=>{t.model=null,t.removeProp("zIndex"),(a||s)&&t.translate(a,s),o&&t.isNode()&&t.prop(o),i&&t.isEdge()&&t.prop(i)});const c=Ip.isGraph(t)?t.model:t;return c.batchUpdate("paste",()=>{c.addCells(this.cells)}),this.copy(l,t,e),l}serialize(t){!1!==t.useLocalStorage&&Lp.save(this.cells)}deserialize(t){if(t.useLocalStorage){const t=Lp.fetch();t&&(this.cells=t)}}isEmpty(){return this.cells.length<=0}clean(){this.options={},this.cells=[],Lp.clean()}}(function(t){const e=_s.prefixCls+".clipboard.cells";function n(t){if(window.localStorage){const n=t.map(t=>t.toJSON());localStorage.setItem(e,JSON.stringify(n))}}function r(){if(window.localStorage){const t=localStorage.getItem(e),n=t?JSON.parse(t):[];if(n)return Td.fromJSON(n)}}function i(){window.localStorage&&localStorage.removeItem(e)}t.save=n,t.fetch=r,t.clean=i})(Lp||(Lp={}));class Fp{constructor(t){this.halo=t}get options(){return this.halo.options}get graph(){return this.halo.graph}get model(){return this.halo.model}get view(){return this.halo.view}get cell(){return this.halo.cell}get node(){return this.cell}getPresets(){return{className:"type-node",handles:[{name:"remove",position:"nw",events:{mousedown:this.removeCell.bind(this)},icon:null},{name:"resize",position:"se",events:{mousedown:this.startResize.bind(this),mousemove:this.doResize.bind(this),mouseup:this.stopResize.bind(this)},icon:null},{name:"clone",position:"n",events:{mousedown:this.startClone.bind(this),mousemove:this.doClone.bind(this),mouseup:this.stopClone.bind(this)},icon:null},{name:"link",position:"e",events:{mousedown:this.startLink.bind(this),mousemove:this.doLink.bind(this),mouseup:this.stopLink.bind(this)},icon:null},{name:"fork",position:"ne",events:{mousedown:this.startFork.bind(this),mousemove:this.doFork.bind(this),mouseup:this.stopFork.bind(this)},icon:null},{name:"unlink",position:"w",events:{mousedown:this.unlink.bind(this)},icon:null},{name:"rotate",position:"sw",events:{mousedown:this.startRotate.bind(this),mousemove:this.doRotate.bind(this),mouseup:this.stopRotate.bind(this)},icon:null}],bbox(t){if(this.options.useCellGeometry){const e=t.cell;return e.getBBox()}return t.getBBox()},content(t){const e=o.template("x: <%= x %>, y: <%= y %>, width: <%= width %>, height: <%= height %>, angle: <%= angle %>"),n=t.cell,r=n.getBBox();return e({x:Math.floor(r.x),y:Math.floor(r.y),width:Math.floor(r.width),height:Math.floor(r.height),angle:Math.floor(n.getAngle())})},magnet(t){return t.container},tinyThreshold:40,smallThreshold:80,loopEdgePreferredSide:"top",loopEdgeWidth:40,rotateGrid:15,rotateEmbeds:!1}}removeCell(){this.model.removeConnectedEdges(this.cell),this.cell.remove()}startLink({x:t,y:e}){this.halo.startBatch();const n=this.graph,r=this.createEdgeConnectedToSource();r.setTarget({x:t,y:e}),this.model.addEdge(r,{validation:!1,halo:this.halo.cid,async:!1}),n.view.undelegateEvents(),this.edgeView=n.renderer.findViewByCell(r),this.edgeView.prepareArrowheadDragging("target",{x:t,y:e,fallbackAction:"remove"})}createEdgeConnectedToSource(){const t=this.getMagnet(this.view,"source"),e=this.getEdgeTerminal(this.view,t),n=this.graph.hook.getDefaultEdge(this.view,t);return n.setSource(e),n}getMagnet(t,e){const n=this.options.magnet;if("function"===typeof n){const r=s.call(n,this.halo,t,e);if(r instanceof SVGElement)return r}throw new Error("`magnet()` has to return an SVGElement")}getEdgeTerminal(t,e){const n={cell:t.cell.id};if(e!==t.container){const r=e.getAttribute("port");r?n.port=r:n.selector=t.getSelector(e)}return n}doLink({e:t,x:e,y:n}){this.edgeView&&this.edgeView.onMouseMove(t,e,n)}stopLink({e:t,x:e,y:n}){const r=this.edgeView;if(r){r.onMouseUp(t,e,n);const i=r.cell;i.hasLoop()&&this.makeLoopEdge(i),this.halo.stopBatch(),this.halo.trigger("action:edge:addde",{edge:i}),this.edgeView=null}this.graph.view.delegateEvents()}makeLoopEdge(t){let e=null,n=null;const r=this.options.loopEdgeWidth,i=this.graph.options,o=new jr(0,0,i.width,i.height),a=this.graph.graphToLocal(this.view.getBBox()),s=[this.options.loopEdgePreferredSide,"top","bottom","left","right"].some(t=>{let i=null,s=0,l=0;switch(t){case"top":i=new Dr(a.x+a.width/2,a.y-r),s=r/2;break;case"bottom":i=new Dr(a.x+a.width/2,a.y+a.height+r),s=r/2;break;case"left":i=new Dr(a.x-r,a.y+a.height/2),l=r/2;break;case"right":i=new Dr(a.x+a.width+r,a.y+a.height/2),l=r/2;break;default:break}return!!i&&(e=i.translate(-s,-l),n=i.translate(s,l),o.containsPoint(e)&&o.containsPoint(n))});s&&e&&n&&t.setVertices([e,n])}startResize({e:t}){this.halo.startBatch(),this.flip=[1,0,0,1,1,0,0,1][Math.floor(Er.normalize(this.node.getAngle())/45)],this.view.addClass("node-resizing"),jh("node:resize",t,this.view)}doResize({e:t,dx:e,dy:n}){const r=this.node.getSize(),i=Math.max(r.width+(this.flip?e:n),1),o=Math.max(r.height+(this.flip?n:e),1);this.node.resize(i,o,{absolute:!0}),jh("node:resizing",t,this.view)}stopResize({e:t}){this.view.removeClass("node-resizing"),jh("node:resized",t,this.view),this.halo.stopBatch()}startClone({e:t,x:e,y:n}){this.halo.startBatch();const r=this.options,i=r.clone(this.cell,{clone:!0});if(!sd.isCell(i))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(i,e,n),this.model.addCell(i,{halo:this.halo.cid,async:!1});const o=this.graph.renderer.findViewByCell(i);o.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:o})}centerNodeAtCursor(t,e,n){const r=t.getBBox().getCenter(),i=e-r.x,o=n-r.y;t.translate(i,o)}doClone({e:t,x:e,y:n}){const r=this.halo.getEventData(t).cloneView;r&&r.onMouseMove(t,e,n)}stopClone({e:t,x:e,y:n}){const r=this.halo.getEventData(t).cloneView;r&&r.onMouseUp(t,e,n),this.halo.stopBatch()}startFork({e:t,x:e,y:n}){this.halo.startBatch();const r=this.options.clone(this.cell,{fork:!0});if(!sd.isCell(r))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(r,e,n),this.model.addCell(r,{halo:this.halo.cid,async:!1});const i=this.createEdgeConnectedToSource(),o=this.graph.renderer.findViewByCell(r),a=this.getMagnet(o,"target"),s=this.getEdgeTerminal(o,a);i.setTarget(s),this.model.addEdge(i,{halo:this.halo.cid,async:!1}),o.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:o})}doFork({e:t,x:e,y:n}){const r=this.halo.getEventData(t).cloneView;r&&r.onMouseMove(t,e,n)}stopFork({e:t,x:e,y:n}){const r=this.halo.getEventData(t).cloneView;r&&r.onMouseUp(t,e,n),this.halo.stopBatch()}startRotate({e:t,x:e,y:n}){this.halo.startBatch();const r=this.node.getBBox().getCenter(),i=[this.node];this.options.rotateEmbeds&&this.node.getDescendants({deep:!0}).reduce((t,e)=>(e.isNode()&&t.push(e),t),i),this.halo.setEventData(t,{center:r,nodes:i,rotateStartAngles:i.map(t=>t.getAngle()),clientStartAngle:new Dr(e,n).theta(r)}),i.forEach(e=>{const n=this.graph.findViewByCell(e);n&&(n.addClass("node-rotating"),jh("node:rotate",t,n))})}doRotate({e:t,x:e,y:n}){const r=this.halo.getEventData(t),i=r.clientStartAngle-new Dr(e,n).theta(r.center);r.nodes.forEach((e,n)=>{const o=r.rotateStartAngles[n],a=Ms.snapToGrid(o+i,this.options.rotateGrid);e.rotate(a,{absolute:!0,center:r.center,halo:this.halo.cid}),jh("node:rotating",t,this.graph.findViewByCell(e))})}stopRotate({e:t}){const e=this.halo.getEventData(t);e.nodes.forEach(e=>{const n=this.graph.findViewByCell(e);n.removeClass("node-rotating"),jh("node:rotated",t,n)}),this.halo.stopBatch()}unlink(){this.halo.startBatch(),this.model.removeConnectedEdges(this.cell),this.halo.stopBatch()}}class Bp{constructor(t){this.halo=t}get options(){return this.halo.options}get graph(){return this.halo.graph}get model(){return this.halo.model}get view(){return this.halo.view}get cell(){return this.halo.cell}get edge(){return this.cell}getPresets(){return{className:"type-edge",handles:[{name:"remove",position:"nw",icon:null,events:{mousedown:this.removeEdge.bind(this)}},{name:"direction",position:"se",icon:null,events:{mousedown:this.directionSwap.bind(this)}}],content:!1,bbox(t){return t.graph.localToGraph(t.getPointAtRatio(.5))},tinyThreshold:-1,smallThreshold:-1}}removeEdge(){this.cell.remove()}directionSwap(){const t=this.edge.getSource(),e=this.edge.getTarget();this.edge.prop({source:e,target:t})}}class zp extends bh{get type(){return this.options.type||"surround"}get handleOptions(){return this.options}init(t){this.options=i.merge(zp.defaultOptions,this.cell.isNode()?new Fp(this).getPresets():this.cell.isEdge()?new Bp(this).getPresets():null,t),this.render(),this.initHandles(),this.update(),this.startListening()}startListening(){const t=this.model,e=this.graph,n=this.view.cell;n.on("removed",this.remove,this),t.on("reseted",this.remove,this),e.on("halo:destroy",this.remove,this),t.on("*",this.update,this),e.on("scale",this.update,this),e.on("translate",this.update,this),super.startListening()}stopListening(){const t=this.model,e=this.graph,n=this.view.cell;this.undelegateEvents(),n.off("removed",this.remove,this),t.off("reseted",this.remove,this),e.off("halo:destroy",this.remove,this),t.off("*",this.update,this),e.off("scale",this.update,this),e.off("translate",this.update,this),super.stopListening()}render(){const t=this.options,e=this.prefixClassName("widget-halo");return this.view.addClass(Dp.NODE_CLS),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(e).attr("data-shape",this.view.cell.shape),t.className&&this.$container.addClass(t.className),this.$handleContainer=this.$("<div/>").addClass(e+"-handles").appendTo(this.container),this.$content=this.$("<div/>").addClass(e+"-content").appendTo(this.container),this.$container.appendTo(this.graph.container),this}remove(){return this.stopBatch(),this.view.removeClass(Dp.NODE_CLS),super.remove()}update(){if(this.isRendered()){this.updateContent();const t=this.getBBox(),e=this.options.tinyThreshold||0,n=this.options.smallThreshold||0;this.$handleContainer.toggleClass(this.handleClassName+"-tiny",t.width<e&&t.height<e);const r=this.handleClassName+"-small";this.$handleContainer.toggleClass(r,!this.$handleContainer.hasClass(r)&&t.width<n&&t.height<n),this.$container.css({width:t.width,height:t.height,left:t.x,top:t.y}),this.hasHandle("unlink")&&this.toggleUnlink(),"surround"!==this.type&&"toolbar"!==this.type||this.hasHandle("fork")&&this.toggleFork()}}updateContent(){const t=this.options.content;if("function"===typeof t){const e=s.call(t,this,this.view,this.$content[0]);e&&this.$content.html(e)}else t?this.$content.html(t):this.$content.remove()}getBBox(){const t=this.view,e=this.options.bbox,n="function"===typeof e?s.call(e,this,t):e;return jr.create(Object.assign({x:0,y:0,width:1,height:1},n))}removeCell(){this.cell.remove()}toggleFork(){const t=this.view.cell.clone(),e=this.graph.hook.createCellView(t),n=this.graph.hook.validateConnection(this.view,null,e,null,"target");this.$handleContainer.children(".fork").toggleClass("hidden",!n),e.remove()}toggleUnlink(){const t=this.model.getConnectedEdges(this.view.cell).length>0;this.$handleContainer.children(".unlink").toggleClass("hidden",!t)}startBatch(){this.model.startBatch("halo",{halo:this.cid})}stopBatch(){this.model.hasActiveBatch("halo")&&this.model.stopBatch("halo",{halo:this.cid})}}(function(t){t.defaultOptions={type:"surround",clearAll:!0,clearOnBlankMouseDown:!0,useCellGeometry:!1,clone:t=>t.clone().removeZIndex()}})(zp||(zp={})),Object.getOwnPropertyNames(fh.prototype).forEach(t=>{"constructor"!==t&&Object.defineProperty(zp.prototype,t,Object.getOwnPropertyDescriptor(fh.prototype,t))}),function(t){t.NODE_CLS="has-widget-halo"}(Dp||(Dp={}));var Hp,Vp,qp,Up=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};class Wp extends Ll{constructor(t){super(),this.options=Object.assign(Object.assign({},Wp.defaults),t),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName("widget-dnd")),this.draggingGraph=new Ip(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1})),this.$container.append(this.draggingGraph.container)}get targetScroller(){const t=this.options.target;return Ip.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return Ip.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}get snapline(){return this.targetGraph.snapline.widget}start(t,e){const n=e;n.preventDefault(),this.targetModel.startBatch("dnd"),this.$container.addClass("dragging").appendTo(this.options.containerParent||document.body),this.sourceNode=t,this.prepareDragging(t,n.clientX,n.clientY);const r=this.updateNodePosition(n.clientX,n.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:n,node:t,cell:t,view:this.draggingView,x:r.x,y:r.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(Wp.documentEvents,n.data)}isSnaplineEnabled(){return this.snapline&&!this.snapline.disabled}prepareDragging(t,e,n){const r=this.draggingGraph,i=r.model,o=this.options.getDragNode(t,{sourceNode:t,draggingGraph:r,targetGraph:this.targetGraph});o.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const t=this.targetGraph.transform.getScale();r.scale(t.sx,t.sy),a*=Math.max(t.sx,t.sy)}else r.scale(1,1);this.clearDragging(),this.options.animation&&this.$container.stop(!0,!0),i.resetCells([o]);const s=r.findViewByCell(o);s.undelegateEvents(),s.cell.off("changed"),r.fitToContent({padding:a,allowNewOrigin:"any"});const l=s.getBBox();this.geometryBBox=s.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(l.getTopLeft()),this.draggingNode=o,this.draggingView=s,this.draggingBBox=o.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(e,n)}updateGraphPosition(t,e){const n=document.body.scrollTop||document.documentElement.scrollTop,r=this.delta,i=this.geometryBBox,o=this.padding||5,a={left:t-r.x-i.width/2-o,top:e-r.y-i.height/2-o+n};return this.draggingGraph&&this.$container.offset(a),a}updateNodePosition(t,e){const n=this.targetGraph.clientToLocal(t,e),r=this.draggingBBox;return n.x-=r.width/2,n.y-=r.height/2,this.draggingNode.position(n.x,n.y),n}snap({cell:t,current:e,options:n}){const r=t;if(n.snapped){const t=this.draggingBBox;r.position(t.x+n.tx,t.y+n.ty,{silent:!0}),this.draggingView.translate(),r.position(e.x,e.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const n=this.normalizeEvent(t),r=n.clientX,i=n.clientY;this.updateGraphPosition(r,i);const o=this.updateNodePosition(r,i),a=this.targetGraph.options.embedding.enabled,s=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:r,y:i});if(a){e.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const t=e.getEventData(n);s?e.processEmbedding(n,t):e.clearEmbedding(t),this.candidateEmbedView=t.candidateEmbedView}this.isSnaplineEnabled()&&(s?this.snapline.snapOnMoving({e:n,view:e,x:o.x,y:o.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const n=this.normalizeEvent(t),r=this.draggingView,i=this.draggingBBox,o=this.snapOffset;let a=i.x,l=i.y;o&&(a+=o.x,l+=o.y),e.position(a,l,{silent:!0});const c=this.drop(e,{x:n.clientX,y:n.clientY}),u=t=>{t?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&r&&(r.setEventData(n,{cell:t,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),r.finalizeEmbedding(n,r.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};s.isAsync(c)?(this.undelegateDocumentEvents(),c.then(u)):u(c)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),this.$container.removeClass("dragging").remove())}onDropInvalid(){const t=this.draggingNode;if(t){const e=this.options.animation;if(e){const n="object"===typeof e&&e.duration||150,r="object"===typeof e&&e.easing||"swing";this.draggingView=null,this.$container.animate(this.originOffset,n,r,()=>this.onDropped(t))}else this.onDropped(t)}}isInsideValidArea(t){let e;const n=this.targetGraph,r=this.targetScroller;if(r)if(r.options.autoResize)e=this.getDropArea(r.container);else{const t=this.getDropArea(r.container);e=this.getDropArea(n.container).intersectsWithRect(t)}else e=this.getDropArea(n.container);return e&&e.containsPoint(t)}getDropArea(t){const e=this.$(t),n=e.offset(),r=document.body.scrollTop||document.documentElement.scrollTop,i=document.body.scrollLeft||document.documentElement.scrollLeft;return jr.create({x:n.left+parseInt(e.css("border-left-width"),10)-i,y:n.top+parseInt(e.css("border-top-width"),10)-r,width:e.innerWidth(),height:e.innerHeight()})}drop(t,e){if(this.isInsideValidArea(e)){const n=this.targetGraph,r=n.model,i=n.clientToLocal(e),o=this.sourceNode,a=this.options.getDropNode(t,{sourceNode:o,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),l=a.getBBox();i.x+=l.x-l.width/2,i.y+=l.y-l.height/2;const c=this.snapOffset?1:n.getGridSize();a.position(Ms.snapToGrid(i.x,c),Ms.snapToGrid(i.y,c)),a.removeZIndex();const u=this.options.validateNode,d=!u||u(a,{sourceNode:o,draggingNode:t,droppingNode:a,targetGraph:n,draggingGraph:this.draggingGraph});return"boolean"===typeof d?d?(r.addCell(a,{stencil:this.cid}),a):null:s.toDeferredBoolean(d).then(t=>t?(r.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove()}}function $p(t,e={}){const n=Td.isModel(t)?t:(new Td).resetCells(t,{sort:!1,dryrun:!0}),r=n.getNodes(),i=e.columns||1,o=Math.ceil(r.length/i),a=e.dx||0,s=e.dy||0,l=!1!==e.center,c=!0===e.resizeToFit,u=e.marginX||0,d=e.marginY||0,h=[];let p=e.columnWidth;if("compact"===p)for(let b=0;b<i;b+=1){const t=Hp.getNodesInColumn(r,b,i);h.push(Hp.getMaxDim(t,"width")+a)}else{null!=p&&"auto"!==p||(p=Hp.getMaxDim(r,"width")+a);for(let t=0;t<i;t+=1)h.push(p)}const f=Hp.accumulate(h,u),g=[];let m=e.rowHeight;if("compact"===m)for(let b=0;b<o;b+=1){const t=Hp.getNodesInRow(r,b,i);g.push(Hp.getMaxDim(t,"height")+s)}else{null!=m&&"auto"!==m||(m=Hp.getMaxDim(r,"height")+s);for(let t=0;t<o;t+=1)g.push(m)}const v=Hp.accumulate(g,d);n.startBatch("layout"),r.forEach((t,n)=>{const r=n%i,o=Math.floor(n/i),u=h[r],d=g[o];let p=0,m=0,b=t.getSize();if(c){let n=u-2*a,r=d-2*s;const i=b.height*(b.width?n/b.width:1),o=b.width*(b.height?r/b.height:1);d<i?n=o:r=i,b={width:n,height:r},t.setSize(b,e)}l&&(p=(u-b.width)/2,m=(d-b.height)/2),t.position(f[r]+a+p,v[o]+s+m,e)}),n.stopBatch("layout")}Up([Ll.dispose()],Wp.prototype,"dispose",null),function(t){t.defaults={animation:!1,getDragNode:t=>t.clone(),getDropNode:t=>t.clone()},t.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(Wp||(Wp={})),function(t){function e(t,e){return t.reduce((t,n)=>Math.max(n.getSize()[e],t),0)}function n(t,e,n){const r=[];for(let i=n*e,o=i+n;i<o;i+=1)r.push(t[i]);return r}function r(t,e,n){const r=[];for(let i=e,o=t.length;i<o;i+=n)r.push(t[i]);return r}function i(t,e){return t.reduce((t,e,n)=>(t.push(t[n]+e),t),[e||0])}t.getMaxDim=e,t.getNodesInRow=n,t.getNodesInColumn=r,t.accumulate=i}(Hp||(Hp={}));class Gp extends Ll{constructor(t){if(super(),this.graphs={},this.$groups={},this.options=Object.assign(Object.assign({},Gp.defaultOptions),t),this.dnd=new Wp(this.options),this.onSearch=s.debounce(this.onSearch,200),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(Vp.base)).attr("data-not-found-text",this.options.notFoundText||"No matches found"),this.options.collapsable=t.collapsable&&t.groups&&t.groups.some(t=>!1!==t.collapsable),this.options.collapsable){this.$container.addClass("collapsable");const e=t.groups&&t.groups.every(t=>t.collapsed||!1===t.collapsable);e&&this.$container.addClass("collapsed")}this.$("<div/>").addClass(this.prefixClassName(Vp.title)).html(this.options.title).appendTo(this.$container),t.search&&this.$container.addClass("searchable").append(this.renderSearch()),this.$content=this.$("<div/>").addClass(this.prefixClassName(Vp.content)).appendTo(this.$container);const e=t.stencilGraphOptions||{};if(t.groups&&t.groups.length)t.groups.forEach(n=>{const r=this.$("<div/>").addClass(this.prefixClassName(Vp.group)).attr("data-name",n.name);(null==n.collapsable&&t.collapsable||!1!==n.collapsable)&&r.addClass("collapsable"),r.toggleClass("collapsed",!0===n.collapsed);const i=this.$("<h3/>").addClass(this.prefixClassName(Vp.groupTitle)).html(n.title||n.name),o=this.$("<div/>").addClass(this.prefixClassName(Vp.groupContent)),a=n.graphOptions,s=new Ip(Object.assign(Object.assign(Object.assign({},e),a),{container:document.createElement("div"),model:e.model||new Td,width:n.graphWidth||t.stencilGraphWidth,height:n.graphHeight||t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));o.append(s.container),r.append(i,o).appendTo(this.$content),this.$groups[n.name]=r,this.graphs[n.name]=s});else{const n=new Ip(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new Td,width:t.stencilGraphWidth,height:t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.$content.append(n.container),this.graphs[qp.defaultGroupName]=n}return this.startListening(),this}get targetScroller(){const t=this.options.target;return Ip.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return Ip.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}renderSearch(){return this.$("<div/>").addClass(this.prefixClassName(Vp.search)).append(this.$("<input/>").attr({type:"search",placeholder:this.options.placeholder||"Search"}).addClass(this.prefixClassName(Vp.searchText)))}startListening(){const t=this.prefixClassName(Vp.title),e=this.prefixClassName(Vp.searchText),n=this.prefixClassName(Vp.groupTitle);this.delegateEvents({["click ."+t]:"onTitleClick",["touchstart ."+t]:"onTitleClick",["click ."+n]:"onGroupTitleClick",["touchstart ."+n]:"onGroupTitleClick",["input ."+e]:"onSearch",["focusin ."+e]:"onSearchFocusIn",["focusout ."+e]:"onSearchFocusOut"}),Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];e.on("cell:mousedown",this.onDragStart,this)})}stopListening(){this.undelegateEvents(),Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];e.off("cell:mousedown",this.onDragStart,this)})}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach(e=>{t[e]&&this.loadGroup(t[e],e)}),this}loadGroup(t,e){const n=this.getModel(e);if(n){const e=t.map(t=>ud.isNode(t)?t:ud.create(t));n.resetCells(e)}const r=this.getGroup(e);let i=this.options.stencilGraphHeight;r&&null!=r.graphHeight&&(i=r.graphHeight);const o=r&&r.layout||this.options.layout;if(o&&n&&s.call(o,this,n,r),!i){const t=this.getGraph(e);t.fitToContent({minWidth:t.options.width,gridHeight:1,padding:r&&r.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e:e,node:n}=t;this.dnd.start(n,e)}filter(t,e){const n=Object.keys(this.graphs).reduce((n,r)=>{const i=this.graphs[r],o=r===qp.defaultGroupName?null:r,a=i.model.getNodes().filter(n=>{let r=!1;r="function"===typeof e?s.call(e,this,n,t,o,this):"boolean"===typeof e?e:this.isCellMatched(n,t,e,t.toLowerCase()!==t);const a=i.renderer.findViewByCell(n);return a&&a.$(a.container).toggleClass("unmatched",!r),r}),l=a.length>0,c=this.options,u=new Td;return u.resetCells(a),c.layout&&s.call(c.layout,this,u,this.getGroup(r)),this.$groups[r]&&this.$groups[r].toggleClass("unmatched",!l),i.fitToContent({gridWidth:1,gridHeight:1,padding:c.stencilGraphPadding||10}),n||l},!1);this.$container.toggleClass("not-found",!n)}isCellMatched(t,e,n,r){return!e||!n||Object.keys(n).some(i=>{if("*"===i||t.shape===i){const o=n[i];if("boolean"===typeof o)return o;const a=Array.isArray(o)?o:[o];return a.some(n=>{let i=t.getPropByPath(n);return null!=i&&(i=""+i,r||(i=i.toLowerCase()),i.indexOf(e)>=0)})}return!1})}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){this.$container.addClass("is-focused")}onSearchFocusOut(){this.$container.removeClass("is-focused")}onTitleClick(){this.options.collapsable&&(this.$container.toggleClass("collapsed"),this.$container.hasClass("collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=this.$(t.target).closest("."+this.prefixClassName(Vp.group));this.toggleGroup(e.attr("data-name")||"");const n=Object.keys(this.$groups).every(t=>{const e=this.getGroup(t),n=this.$groups[t];return e&&!1===e.collapsable||n.hasClass("collapsed")});this.$container.toggleClass("collapsed",n)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||qp.defaultGroupName]}getGroup(t){const e=this.options.groups;return null!=t&&e&&e.length?e.find(e=>e.name===t):null}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.$groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),e.addClass("collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.$groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),e.removeClass("collapsed"))}return this}isGroupCollapsable(t){const e=this.$groups[t];return e.hasClass("collapsable")}isGroupCollapsed(t){const e=this.$groups[t];return e&&e.hasClass("collapsed")}collapseGroups(){return Object.keys(this.$groups).forEach(t=>this.collapseGroup(t)),this}expandGroups(){return Object.keys(this.$groups).forEach(t=>this.expandGroup(t)),this}resizeGroup(t,e){const n=this.graphs[t];return n&&n.resize(e.width,e.height),this}onRemove(){Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];e.view.remove(),delete this.graphs[t]}),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}}function Yp(){if(_s.trackable){const t="https://kcart.alipay.com/web/bi.do",e=new Image,n=Object.assign(Object.assign({},_s.trackInfo),{version:Ns,pg:document.URL,r:(new Date).getTime(),x6:!0,page_type:"syslog"}),r=encodeURIComponent(JSON.stringify([n]));e.src=`${t}?BIProfile=merge&d=${r}`}}(function(t){t.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(t,e){const n={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};$p(t,Object.assign(Object.assign(Object.assign({},n),this.options.layoutOptions),e?e.layoutOptions:{}))}},Wp.defaults)})(Gp||(Gp={})),function(t){t.base="widget-stencil",t.title=t.base+"-title",t.search=t.base+"-search",t.searchText=t.search+"-text",t.content=t.base+"-content",t.group=t.base+"-group",t.groupTitle=t.group+"-title",t.groupContent=t.group+"-content"}(Vp||(Vp={})),function(t){t.defaultGroupName="__default__"}(qp||(qp={})),_s.trackable&&setTimeout(Yp,3e3);var Xp=n("1aef"),Kp=n.n(Xp),Zp={cardName:"mindmap",data:function(){return{value:"",graph:""}},props:{engine:{type:Object,default:function(){}},showMindMap:{default:!1},closeMindMap:{default:!1},isEditor:{default:!1}},mounted:function(){var t=this;this.$nextTick((function(){t.initEchart(),t.graph.enableKeyboard(),t.value&&t.graph.fromJSON(t.value)}))},methods:{saveMindMap:function(){this.isEditor?(this.value=this.graph.toJSON(),this.closeMindMap&&this.closeMindMap()):(this.value=this.graph.toJSON(),this.engine.command.execute("mindmap",{value:this.value}),this.closeMindMap&&this.closeMindMap())},loadMindMap:function(){var t=localStorage.getItem("MIND_MAP");this.graph.fromJSON(JSON.parse(t))},close:function(){this.closeMindMap&&this.closeMindMap()},initEchart:function(){var t;p();var e=new Ip({container:document.getElementById("graph-container")||void 0,grid:!0,mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:"ctrl",minScale:.5,maxScale:3},connecting:{router:{name:"manhattan",args:{padding:1}},connector:{name:"rounded",args:{radius:8}},anchor:"center",connectionPoint:"anchor",allowBlank:!1,snap:{radius:20},createEdge:function(){return new A.Edge({attrs:{line:{stroke:"#A2B1C3",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},zIndex:0})},validateConnection:function(t){var e=t.targetMagnet;return!!e}},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{fill:"#5F95FF",stroke:"#5F95FF"}}}},resizing:!0,rotating:!0,selecting:{enabled:!0,rubberband:!0,showNodeSelectionBox:!0},snapline:!0,keyboard:{enabled:!0,format:function(t){return t.replace(/\s/g,"").replace("cmd","command")}},clipboard:!0});this.graph=e;var n=new S.Stencil({title:"流程图",target:e,stencilGraphWidth:200,stencilGraphHeight:180,collapsable:!0,groups:[{title:"基础流程图",name:"group1"},{title:"系统设计图",name:"group2",graphHeight:250,layoutOptions:{rowHeight:70}}],layoutOptions:{columns:2,columnWidth:80,rowHeight:55}});null===(t=document.getElementById("stencil"))||void 0===t||t.appendChild(n.container),e.bindKey(["meta+c","ctrl+c"],(function(){var t=e.getSelectedCells();return t.length&&e.copy(t),!1})),e.bindKey(["meta+x","ctrl+x"],(function(){var t=e.getSelectedCells();return t.length&&e.cut(t),!1})),e.bindKey(["meta+v","ctrl+v"],(function(){if(!e.isClipboardEmpty()){var t=e.paste({offset:32});e.cleanSelection(),e.select(t)}return!1})),e.bindKey(["meta+z","ctrl+z"],(function(){return e.history.canUndo()&&e.history.undo(),!1})),e.bindKey(["meta+shift+z","ctrl+shift+z"],(function(){return e.history.canRedo()&&e.history.redo(),!1})),e.bindKey(["meta+a","ctrl+a"],(function(){var t=e.getNodes();t&&e.select(t)})),e.bindKey("backspace",(function(){var t=e.getSelectedCells();t.length&&e.removeCells(t)})),e.bindKey(["ctrl+1","meta+1"],(function(){var t=e.zoom();t<1.5&&e.zoom(.1)})),e.bindKey(["ctrl+2","meta+2"],(function(){var t=e.zoom();t>.5&&e.zoom(-.1)}));var r=function(t,e){for(var n=0,r=t.length;n<r;n+=1)t[n].style.visibility=e?"visible":"hidden"};e.on("node:mouseenter",(function(){var t=document.getElementById("graph-container"),e=null===t||void 0===t?void 0:t.querySelectorAll(".x6-port-body");r(e,!0)})),e.on("node:mouseleave",(function(){var t=document.getElementById("graph-container"),e=null===t||void 0===t?void 0:t.querySelectorAll(".x6-port-body");r(e,!1)}));var i={groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#5F95FF",strokeWidth:1,fill:"#fff",style:{visibility:"hidden"}}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#5F95FF",strokeWidth:1,fill:"#fff",style:{visibility:"hidden"}}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#5F95FF",strokeWidth:1,fill:"#fff",style:{visibility:"hidden"}}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#5F95FF",strokeWidth:1,fill:"#fff",style:{visibility:"hidden"}}}}},items:[{group:"top"},{group:"right"},{group:"bottom"},{group:"left"}]};Ip.registerNode("custom-rect",{inherit:"rect",width:66,height:36,attrs:{body:{strokeWidth:1,stroke:"#5F95FF",fill:"#EFF4FF"},text:{fontSize:12,fill:"#262626"}},ports:Object(_["a"])({},i)},!0),Ip.registerNode("custom-polygon",{inherit:"polygon",width:66,height:36,attrs:{body:{strokeWidth:1,stroke:"#5F95FF",fill:"#EFF4FF"},text:{fontSize:12,fill:"#262626"}},ports:Object(_["a"])(Object(_["a"])({},i),{},{items:[{group:"top"},{group:"bottom"}]})},!0),Ip.registerNode("custom-circle",{inherit:"circle",width:45,height:45,attrs:{body:{strokeWidth:1,stroke:"#5F95FF",fill:"#EFF4FF"},text:{fontSize:12,fill:"#262626"}},ports:Object(_["a"])({},i)},!0),Ip.registerNode("custom-image",{inherit:"rect",width:52,height:52,markup:[{tagName:"rect",selector:"body"},{tagName:"image"},{tagName:"text",selector:"label"}],attrs:{body:{stroke:"#5F95FF",fill:"#5F95FF"},image:{width:26,height:26,refX:13,refY:16},label:{refX:3,refY:2,textAnchor:"left",textVerticalAnchor:"top",fontSize:12,fill:"#fff"}},ports:Object(_["a"])({},i)},!0);var o=e.createNode({shape:"custom-rect",label:"开始",attrs:{body:{rx:20,ry:26}}}),a=e.createNode({shape:"custom-rect",label:"过程"}),s=e.createNode({shape:"custom-rect",attrs:{body:{rx:6,ry:6}},label:"可选过程"}),l=e.createNode({shape:"custom-polygon",attrs:{body:{refPoints:"0,10 10,0 20,10 10,20"}},label:"决策"}),c=e.createNode({shape:"custom-polygon",attrs:{body:{refPoints:"10,0 40,0 30,20 0,20"}},label:"数据"}),u=e.createNode({shape:"custom-circle",label:"连接"});n.load([o,a,s,l,c,u],"group1");var d=[{label:"Client",image:"https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg"},{label:"Http",image:"https://gw.alipayobjects.com/zos/bmw-prod/dc1ced06-417d-466f-927b-b4a4d3265791.svg"},{label:"Api",image:"https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg"},{label:"Sql",image:"https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg"},{label:"Clound",image:"https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg"},{label:"Mq",image:"https://gw.alipayobjects.com/zos/bmw-prod/2010ac9f-40e7-49d4-8c4a-4fcf2f83033b.svg"}],h=d.map((function(t){return e.createNode({shape:"custom-image",label:t.label,attrs:{image:{"xlink:href":t.image}}})}));function p(){var t=document.getElementById("container"),e=document.createElement("div");e.id="stencil";var n=document.createElement("div");n.id="graph-container",null===t||void 0===t||t.appendChild(e),null===t||void 0===t||t.appendChild(n),Kp()("\n #container {\n display: flex;\n border: 1px solid #dfe3e8;\n }\n #stencil {\n width: 180px;\n height: 100%;\n position: relative;\n border-right: 1px solid #dfe3e8;\n }\n #graph-container {\n width: calc(100% - 180px);\n height: 100%;\n }\n .x6-widget-stencil {\n background-color: #fff;\n }\n .x6-widget-stencil-title {\n background-color: #fff;\n }\n .x6-widget-stencil-group-title {\n background-color: #fff !important;\n }\n .x6-widget-transform {\n margin: -1px 0 0 -1px;\n padding: 0px;\n border: 1px solid #239edd;\n }\n .x6-widget-transform > div {\n border: 1px solid #239edd;\n }\n .x6-widget-transform > div:hover {\n background-color: #3dafe4;\n }\n .x6-widget-transform-active-handle {\n background-color: #3dafe4;\n }\n .x6-widget-transform-resize {\n border-radius: 0;\n }\n .x6-widget-selection-inner {\n border: 1px solid #239edd;\n }\n .x6-widget-selection-box {\n opacity: 0;\n }\n ")}n.load(h,"group2")}}},Jp=Zp,Qp=(n("71493"),Object(it["a"])(Jp,ut,dt,!1,null,"2f838d9b",null)),tf=Qp.exports,ef=n("ade3"),nf=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"execute",value:function(){var t=this.editor;Object(D["isEngine"])(t)&&(t.readonly||t.history.redo())}},{key:"queryState",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)&&!t.readonly)return t.history.hasRedo()}},{key:"hotkey",value:function(){return this.options.hotkey||["mod+y","shift+mod+y"]}}],[{key:"pluginName",get:function(){return"redo"}}]),n}(D["Plugin"]),rf=nf,of=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"execute",value:function(){var t=this.editor;Object(D["isEngine"])(t)&&(t.readonly||t.history.undo())}},{key:"queryState",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)&&!t.readonly)return t.history.hasUndo()}},{key:"hotkey",value:function(){return this.options.hotkey||["mod+z","shift+mod+z"]}}],[{key:"pluginName",get:function(){return"undo"}}]),n}(D["Plugin"]),af=of,sf="markdown-it",lf=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="strong",t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("emphasis")},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;Object(D["isEngine"])(t)&&t.on(sf,this.markdownIt)}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+b"}},{key:"conversion",value:function(){return[{from:{span:{style:{"font-weight":["bold","700"]}}},to:this.tagName},{from:"b",to:this.tagName}]}},{key:"destroy",value:function(){this.editor.off(sf,this.markdownIt)}}],[{key:"pluginName",get:function(){return"bold"}}]),n}(D["MarkPlugin"]),cf=lf;function uf(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var df=".am-engine code, .am-engine-view code {\n font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;\n font-size: inherit;\n background-color: rgba(0, 0, 0, 0.06);\n padding: 0 2px;\n border-radius: 6px;\n line-height: inherit;\n word-wrap: break-word;\n text-indent: 0;\n}";uf(df);var hf="parse:html",pf="markdown-it",ff=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="code",t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("backticks")},t.parseHtml=function(e){e.find(t.tagName).css({"font-family":"monospace","font-size":"inherit","background-color":"rgba(0,0,0,.06)",padding:"0 2px","border-radius":"6px","line-height":"inherit","overflow-wrap":"break-word","text-indent":"0"})},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;t.on(hf,this.parseHtml),Object(D["isEngine"])(t)&&t.on(pf,this.markdownIt)}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+e"}},{key:"destroy",value:function(){var t=this.editor;t.off(hf,this.parseHtml),t.off(pf,this.markdownIt)}}],[{key:"pluginName",get:function(){return"code"}}]),n}(D["InlinePlugin"]),gf=ff,mf=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.mergeLeval=2,t.tagName="span",t.style={"background-color":"@var0"},t.variable={"@var0":{required:!0,value:"@color"}},t}return Object(B["a"])(n,[{key:"schema",value:function(){var t=Object(z["a"])(Object(H["a"])(n.prototype),"schema",this).call(this);return t.attributes.style["background"]="@color",t}},{key:"conversion",value:function(){var t=this;return[{from:function(e,n){return e===t.tagName&&!!n.background},to:function(t,e,n){var r=Object(D["$"])("<".concat(t," />")),i=e["background"];return delete e["background"],e["background-color"]=i,r.css(e),Object.keys(n).forEach((function(t){r.attributes(t,n[t])})),r}}]}},{key:"isTrigger",value:function(t,e){return void 0===e||t!==e}},{key:"hotkey",value:function(){return this.options.hotkey||[]}}],[{key:"pluginName",get:function(){return"backcolor"}}]),n}(D["MarkPlugin"]),vf=mf,bf=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.mergeLeval=3,t.tagName="span",t.style={color:"@var0"},t.variable={"@var0":{required:!0,value:"@color"}},t}return Object(B["a"])(n,[{key:"isTrigger",value:function(t,e){return void 0===e||t!==e}},{key:"hotkey",value:function(){return this.options.hotkey||[]}}],[{key:"pluginName",get:function(){return"fontcolor"}}]),n}(D["MarkPlugin"]),yf=bf,wf=n("257e"),xf=n("5122"),Cf=n("5cf7"),kf="paste:each",Af=Object(Cf["a"])("styleName"),Sf=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.mergeLeval=4,t.tagName="span",t.style={"font-size":"@var0"},t.variable={"@var0":{required:!0,value:/[\d\.]+(pt|px)$/}},Object.defineProperty(Object(wf["a"])(t),Af,{writable:!0,value:"font-size"}),t.defaultSize=t.options.defaultSize||t.editor.container.css("font-size")||"14px",t.pasteEach=function(e){if(e.name===t.tagName){var n=e.css(Object(xf["a"])(Object(wf["a"])(t),Af)[Af]);if(!n)return;var r=t.convertToPX(n);if(n.endsWith("pt")&&e.css(Object(xf["a"])(Object(wf["a"])(t),Af)[Af],r),r!==t.defaultSize){var i=t.options.filter;if(i){var o=i(r);!1===o?e.css(Object(xf["a"])(Object(wf["a"])(t),Af)[Af],""):"string"===typeof o&&e.css(Object(xf["a"])(Object(wf["a"])(t),Af)[Af],o)}else e.css(Object(xf["a"])(Object(wf["a"])(t),Af)[Af],"");var a=t.editor.node;a.isMark(e)||a.unwrap(e)}}},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;Object(D["isEngine"])(t)&&t.on(kf,this.pasteEach),this.options.defaultSize&&t.container.css("font-size",this.defaultSize)}},{key:"isTrigger",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultSize;return t!==e}},{key:"hotkey",value:function(){return this.options.hotkey||[]}},{key:"convertToPX",value:function(t){var e=/([\d\.]+)(pt|px)$/i.exec(t);return e&&"pt"===e[2]?String(Math.round(96*parseInt(e[1],10)/72))+"px":t}},{key:"destroy",value:function(){var t=this.editor;Object(D["isEngine"])(t)&&t.off(kf,this.pasteEach)}}],[{key:"pluginName",get:function(){return"fontsize"}}]),n}(D["MarkPlugin"]),Ef=Sf,Of="markdown-it",Tf=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="em",t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("emphasis")},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;Object(D["isEngine"])(t)&&t.on(Of,this.markdownIt)}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+i"}},{key:"conversion",value:function(){return[{from:{span:{style:{"font-style":"italic"}}},to:this.tagName},{from:"i",to:this.tagName}]}},{key:"destroy",value:function(){this.editor.off(Of,this.markdownIt)}}],[{key:"pluginName",get:function(){return"italic"}}]),n}(D["MarkPlugin"]),_f=Tf,Mf=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="u",t}return Object(B["a"])(n,[{key:"hotkey",value:function(){return this.options.hotkey||"mod+u"}},{key:"conversion",value:function(){var t=this;return[{from:function(t,e){return"span"===t&&(e["text-decoration"]||"").includes("underline")},to:function(e,n,r){var i=Object(D["$"])("<".concat(t.tagName," />"));return n["text-decoration"]=n["text-decoration"].split(/\s+/).filter((function(t){return"underline"!==t})).join(" ").trim(),i.css(n),i.attributes(r),i}}]}}],[{key:"pluginName",get:function(){return"underline"}}]),n}(D["MarkPlugin"]),Nf=Mf;function Pf(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var Lf=".am-engine .card-hr,.am-engine-view .card-hr {\r\n border: 1px solid transparent;\r\n padding: 18px 0;\r\n border-radius: 2px 2px;\r\n}\r\n\r\n.am-engine .card-hr hr,.am-engine-view .card-hr hr {\r\n box-sizing: border-box;\r\n position: absolute;\r\n top: 50%;\r\n left: 0;\r\n margin-top: -1px;\r\n width: 100%;\r\n height: 2px;\r\n background-color: #e8e8e8;\r\n padding: 0;\r\n border: 1px solid transparent;\r\n}\r\n\r\n.am-engine .card-hr:hover , .am-engine .card-hr.hr-activated {\r\n background-color: #f4f4f4;\r\n}";Pf(Lf);var Df=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"toolbar",value:function(){var t,e=this.editor,n=function(){return!Object(D["isEngine"])(e)||e.readonly?[]:[{key:"dnd",type:"dnd"},{key:"copy",type:"copy"},{key:"delete",type:"delete"}]},r=null===(t=e.plugin.findPlugin("hr"))||void 0===t?void 0:t.options;return(null===r||void 0===r?void 0:r.cardToolbars)?r.cardToolbars(n(),this.editor):n()}},{key:"onActivate",value:function(t){Object(z["a"])(Object(H["a"])(n.prototype),"onActivate",this).call(this,t);var e="hr-activated",r=this.getCenter();t?r.addClass(e):r.removeClass(e)}},{key:"onSelectByOther",value:function(t,e){Object(z["a"])(Object(H["a"])(n.prototype),"onSelectByOther",this).call(this,t,e),this.getCenter().find("hr").css("background-color",t?e.rgb:"")}},{key:"onActivateByOther",value:function(t,e){this.onSelectByOther(t,e)}},{key:"render",value:function(){return this.getCenter().addClass("card-hr"),"<hr />"}}],[{key:"cardName",get:function(){return"hr"}},{key:"cardType",get:function(){return D["CardType"].BLOCK}},{key:"autoActivate",get:function(){return!1}},{key:"selectStyleType",get:function(){return D["SelectStyleType"].BACKGROUND}}]),n}(D["Card"]),jf="parse:html",If="paste:schema",Rf="paste:each",Ff="markdown-it",Bf=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("hr")},t.pasteSchema=function(t){t.add([{type:"block",name:"hr",isVoid:!0}])},t.pasteHtml=function(e){var n=t.editor;if(Object(D["isEngine"])(n))return"hr"!==e.name||(n.card.replaceNode(e,Df.cardName),!1)},t.parseHtml=function(e,n){var r=[];return e.find("[".concat(D["CARD_KEY"],"=").concat(Df.cardName,"]")).each((function(e){var i=Object(D["$"])(e),o=i.find("hr");if(o.css({"background-color":"#e8e8e8",border:"1px solid transparent",margin:"18px 0"}),n){var a=t.editor.card.find(i),s=(null===a||void 0===a?void 0:a.getValue())||Object(D["decodeCardValue"])(i.attributes(D["CARD_VALUE_KEY"]));o=n(o,s)}i.replaceWith(o),r.push(o)})),r},t}return Object(B["a"])(n,[{key:"init",value:function(){var t=this.editor;t.on(jf,this.parseHtml),t.on(If,this.pasteSchema),t.on(Rf,this.pasteHtml),Object(D["isEngine"])(t)&&t.on(Ff,this.markdownIt)}},{key:"execute",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.card;e.insert(Df.cardName)}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+e"}},{key:"destroy",value:function(){var t=this.editor;t.off(jf,this.parseHtml),t.off(If,this.pasteSchema),t.off(Rf,this.pasteHtml),Object(D["isEngine"])(t)&&t.off(Ff,this.markdownIt)}}],[{key:"pluginName",get:function(){return"hr"}}]),n}(D["Plugin"]),zf=Bf,Hf=n("3835"),Vf=["[ ] ","[x] ","[X] "];function qf(t,e){e||(e={checkStrings:Vf}),e.checkStrings=e.checkStrings||Vf,t.core.ruler.after("inline","task-list",(function(t){for(var n=t.tokens,r=2;r<n.length;r++)$f(n,r,e)?Yf(n,r,t,e):Gf(n,r-1,e)&&Xf(n,r,t,e)}))}function Uf(t,e,n){var r=t.attrIndex(e),i=[e,n];r<0?t.attrPush(i):(t.attrs||(t.attrs=[]),t.attrs[r]=i)}function Wf(t,e){for(var n=t[e].level-1,r=e-1;r>=0;r--)if(t[r].level===n)return r;return-1}function $f(t,e,n){return Jf(t[e])&&Qf(t[e-1])&&eg(t[e],!1,n)&&tg(t[e-2])}function Gf(t,e,n){return Jf(t[e])&&Qf(t[e-1])&&eg(t[e],!0,n)&&(e-2<0||!tg(t[e-2]))}function Yf(t,e,n,r){var i=t[e],o=t[e-2];r.itemClass&&Uf(o,"class",r.itemClass),r.rootClass&&Uf(t[Wf(t,e-2)],"class",r.rootClass);var a=Kf(i,r.checkStrings),s=a.markup,l=a.content,c=a.checked;o.markup=s,i.content=l,i.children&&i.children.length>0&&(i.children[0].content=i.content),o.info=c?"true":"false";var u=Zf(c,n.Token),d=Object(Hf["a"])(u,2),h=d[0],p=d[1];t.splice(e,0,h),t.splice(e+1,0,p)}function Xf(t,e,n,r){var i=t[e],o=t[e-1],a=t[e-2];a.tag="ul",a.type="task_list_open",r.rootClass&&Uf(a,"class",r.rootClass);var s=new n.Token("task_list_item_open","li",1);r.itemClass&&Uf(s,"class",r.itemClass),t.splice(e-1,0,s);var l=Kf(o,r.checkStrings),c=l.markup,u=l.content,d=l.checked;s.markup=c,o.content=u,o.children&&o.children.length>0&&(o.children[0].content=o.content),s.info=d?"true":"false";var h=Zf(d,n.Token),p=Object(Hf["a"])(h,2),f=p[0],g=p[1];t.splice(e,0,f),t.splice(e+1,0,g);var m=new n.Token("task_list_item_close","li",-1);t.splice(e+3,0,m),i.tag="ul",i.type="task_list_close"}function Kf(t,e){for(var n="",r="",i=!1,o=function(o){var a=e[o],s=function(e){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o?e.trim():a;return!!t.content.startsWith(s)&&(n=s,r=t.content.replace(s,""),i="x"===s.substring(1,2).trim().toLowerCase(),!0)},l=s(a);if(l||(l=s(a,!0)),l)return"break"},a=0;a<e.length;a++){var s=o(a);if("break"===s)break}return{markup:n,content:r,checked:i}}function Zf(t,e){var n=new e("task_list_item_checkbox_open","span",1);Uf(n,D["CARD_TYPE_KEY"],"inline"),Uf(n,D["CARD_KEY"],"checkbox"),Uf(n,D["CARD_VALUE_KEY"],Object(D["encodeCardValue"])({type:"inline",checked:t}));var r=new e("task_list_item_checkbox_close","span",-1);return[n,r]}function Jf(t){return"inline"===t.type}function Qf(t){return"paragraph_open"===t.type}function tg(t){return"list_item_open"===t.type}function eg(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;return n.checkStrings.some((function(n){return 0===t.content.indexOf(e?n.trim():n)}))}function ng(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var rg=".data-checkbox {\r\n\tfont-size: 14px;\r\n\tfont-variant: tabular-nums;\r\n\tcolor: rgba(0, 0, 0, 0.65);\r\n\tbox-sizing: border-box;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\twidth: 16px;\r\n\theight: 16px;\r\n\tmax-width: 16px !important;\r\n\tlist-style: none;\r\n\twhite-space: nowrap;\r\n\tcursor: pointer;\r\n\toutline: none;\r\n\tdisplay: inline-block;\r\n\tline-height: 1;\r\n\tposition: relative;\r\n}\r\n\r\n.data-checkbox-checked:after {\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\tborder-radius: 2px;\r\n\tborder: 1px solid #347eff;\r\n\tcontent: \"\";\r\n\tvisibility: hidden;\r\n}\r\n\r\n.data-checkbox:not(.data-checkbox-mobile):focus .data-checkbox-inner,.data-checkbox:not(.data-checkbox-mobile) .data-checkbox-inner {\r\n border-color: #347eff\r\n}\r\n\r\n.data-checkbox:hover:after{\r\n\tvisibility: visible;\r\n}\r\n\r\n.data-checkbox-inner {\r\n\tposition: relative;\r\n\ttop: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n display: inline-block;\r\n\tborder: 1px solid #d9d9d9;\r\n\tborder-radius: 2px;\r\n\tbackground-color: #fff;\r\n\t-webkit-transition: all 0.3s;\r\n\ttransition: all 0.3s;\r\n\tborder-collapse: separate;\r\n}\r\n\r\n.data-checkbox-inner:after {\r\n\t-webkit-transform: rotate(45deg) scale(0);\r\n\t-ms-transform: rotate(45deg) scale(0);\r\n\ttransform: rotate(45deg) scale(0);\r\n\tposition: absolute;\r\n\tleft: 4.57142857px;\r\n\ttop: 1.14285714px;\r\n\tdisplay: table;\r\n\twidth: 5.71428571px;\r\n\theight: 9.14285714px;\r\n\tborder: 2px solid #fff;\r\n\tborder-top: 0;\r\n\tborder-left: 0;\r\n\tcontent: ' ';\r\n\t-webkit-transition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6), opacity 0.1s;\r\n\ttransition: all 0.1s cubic-bezier(0.71, -0.46, 0.88, 0.6), opacity 0.1s;\r\n\topacity: 0;\r\n}\r\n\r\n.data-checkbox-checked .data-checkbox-inner:after {\r\n\t-webkit-transform: rotate(45deg) scale(1);\r\n\t-ms-transform: rotate(45deg) scale(1);\r\n\ttransform: rotate(45deg) scale(1);\r\n\tposition: absolute;\r\n\tdisplay: table;\r\n\tborder: 2px solid #fff;\r\n\tborder-top: 0;\r\n\tborder-left: 0;\r\n\tcontent: ' ';\r\n\t-webkit-transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;\r\n\ttransition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;\r\n\topacity: 1;\r\n}\r\n\r\n.data-checkbox-checked .data-checkbox-inner {\r\n\tbackground-color: #347eff;\r\n border-color: #347eff;\r\n}\r\n\r\n.data-checkbox-disabled {\r\n\tcursor: not-allowed;\r\n}\r\n\r\n.data-checkbox-disabled.data-checkbox-checked .data-checkbox-inner:after {\r\n\t-webkit-animation-name: none;\r\n\tanimation-name: none;\r\n\tborder-color: rgba(0, 0, 0, 0.25);\r\n}\r\n\r\n.data-checkbox-disabled .data-checkbox-input {\r\n\tcursor: not-allowed;\r\n}\r\n\r\n.data-checkbox-disabled .data-checkbox-inner {\r\n\tborder-color: #d9d9d9 !important;\r\n\tbackground-color: #f5f5f5;\r\n}\r\n\r\n.data-checkbox-disabled .data-checkbox-inner:after {\r\n\t-webkit-animation-name: none;\r\n\tanimation-name: none;\r\n\tborder-color: #f5f5f5;\r\n\tborder-collapse: separate;\r\n}\r\n\r\n.data-checkbox-disabled + span {\r\n\tcolor: rgba(0, 0, 0, 0.25);\r\n\tcursor: not-allowed;\r\n}\r\n";ng(rg);var ig="data-checkbox",og="data-checkbox-inner",ag="data-checkbox-checked",sg=Object(Cf["a"])("container"),lg=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Object.defineProperty(Object(wf["a"])(t),sg,{writable:!0,value:void 0}),t.update=function(e){var n,r,i=void 0===e?t.isChecked():e,o=t.root.parent();i?(null===(n=Object(xf["a"])(Object(wf["a"])(t),sg)[sg])||void 0===n||n.removeClass(ag),null===o||void 0===o||o.removeAttributes("checked")):(null===(r=Object(xf["a"])(Object(wf["a"])(t),sg)[sg])||void 0===r||r.addClass(ag),null===o||void 0===o||o.attributes("checked","true"));return i},t.isChecked=function(){var e;return!!(null===(e=Object(xf["a"])(Object(wf["a"])(t),sg)[sg])||void 0===e?void 0:e.hasClass(ag))},t.onClick=function(e){e.preventDefault(),e.stopPropagation();var n=t.update();t.setValue({checked:!n})},t}return Object(B["a"])(n,[{key:"onSelectByOther",value:function(){}},{key:"onSelect",value:function(){}},{key:"onActivateByOther",value:function(){}},{key:"render",value:function(){var t='\n <span class="'.concat(ig).concat(D["isMobile"]?" ".concat(ig,"-mobile"):"",'">\n <span class="').concat(og,'"></span>\n </span>'),e=this.getValue();Object(xf["a"])(this,sg)[sg]?Object(xf["a"])(this,sg)[sg]=this.getCenter().first():(Object(xf["a"])(this,sg)[sg]=Object(D["$"])(t),this.getCenter().append(Object(xf["a"])(this,sg)[sg]));var n=this.editor;this.update(!(null===e||void 0===e?void 0:e.checked)),Object(D["isEngine"])(n)&&!n.readonly&&Object(xf["a"])(this,sg)[sg].on("mousedown",this.onClick)}},{key:"destroy",value:function(){var t;null===(t=Object(xf["a"])(this,sg)[sg])||void 0===t||t.off("mousedown",this.onClick)}}],[{key:"cardName",get:function(){return"checkbox"}},{key:"cardType",get:function(){return D["CardType"].INLINE}},{key:"singleSelectable",get:function(){return!1}},{key:"autoSelected",get:function(){return!1}},{key:"collab",get:function(){return!1}},{key:"focus",get:function(){return!1}}]),n}(D["Card"]),cg='.am-engine .data-list-item [data-card-key="checkbox"],.am-engine-view .data-list-item [data-card-key="checkbox"] {\r\n\tmargin-left: 0;\r\n}\r\n\r\n.am-engine .data-list-task,.am-engine-view .data-list-task {\r\n\tlist-style: none;\r\n\ttext-indent: 0;\r\n}\r\n\r\n.am-engine .data-list-task [data-card-key="checkbox"],.am-engine-view .data-list-task [data-card-key="checkbox"] {\r\n margin-left: -22px;\r\n height: 16px;\r\n display: inline-block;\r\n width: 22px;\r\n vertical-align: middle;\r\n height: 100%;\r\n}\r\n\r\n.am-engine .data-list-task [data-card-key="checkbox"] [data-card-element="center"],.am-engine .data-list-task [data-card-key="checkbox"] [data-card-element="body"],.am-engine-view .data-list-task [data-card-key="checkbox"] [data-card-element="center"]{\r\n height: 16px;\r\n width: 16px;\r\n vertical-align: unset;\r\n}';ng(cg);var ug="data-list-task",dg="parse:html",hg="markdown-it",pg="paste:each",fg="paste:each-after",gg=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.cardName="checkbox",t.tagName="ul",t.attributes={class:"@var0","data-indent":"@var1"},t.variable={"@var0":{required:!0,value:[t.editor.list.CUSTOMZIE_UL_CLASS,ug]},"@var1":"@number"},t.allowIn=["blockquote","$root"],t.parseHtml=function(e,n){var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return'<span style="'.concat(t?"background:#347eff;position:relative;":"background:#fff;",'width: 16px;height: 16px;display: inline-block;border: 1px solid #347eff;border-radius: 2px;transition: all 0.3s;border-collapse: separate;">').concat(t,"</span>")},i=[];return e.find("[".concat(D["CARD_KEY"],'="checkbox"]')).each((function(e){var o=Object(D["$"])(e),a=Object(D["$"])("<span>".concat(o.find(".data-checkbox-checked").length>0?r('<span style="transform: rotate(45deg) scale(1);position: absolute;display: block;border: 2px solid #fff;border-top: 0;border-left: 0;width:5.71428571px;height:9.14285714px;transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;opacity: 1;left:3.57142857px;top:0.14285714px;"></span>'):r(),"</span>"));if(a.css({margin:"3px 0.5ex","vertical-align":"middle",width:"16px",height:"16px",color:"color: rgba(0, 0, 0, 0.65)"}),o.empty(),n){var s=t.editor.card.find(o),l=(null===s||void 0===s?void 0:s.getValue())||Object(D["decodeCardValue"])(o.attributes(D["CARD_VALUE_KEY"]));l&&(a=n(a,l))}o.append(a),i.push(o)})),e.find(".".concat(ug)).css({"list-style":"none"}),i},t.markdownIt=function(e){var n=t.editor;!1!==t.options.markdown&&(e.use(qf,{itemClass:n.list.CUSTOMZIE_LI_CLASS,rootClass:"".concat(n.list.CUSTOMZIE_UL_CLASS," ").concat(ug)}),e.enable("task-list"))},t.pasteHtml=function(e){if(Object(D["isEngine"])(t.editor)){if(e.isElement()){var n,r=e.attributes(),i=r[D["CARD_KEY"]]||r[D["READY_CARD_KEY"]];if(i&&i===lg.cardName&&"li"!==(null===(n=e.parent())||void 0===n?void 0:n.name))return e.remove(),!1}return!0}},t.pasteEachAfter=function(e){var n=t.editor,r=e.find("li.".concat(n.list.CUSTOMZIE_LI_CLASS));r.each((function(t,e){var i=r.eq(e);if(i){var o=i.first();if(o&&o.name===lg.cardName){var a=n.card.find(o);if(a){var s=i.parent();null===s||void 0===s||s.addClass(ug);var l=a.getValue();l&&l.checked?null===s||void 0===s||s.attributes("checked","true"):null===s||void 0===s||s.removeAttributes("checked")}}}}))},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;t.on(dg,this.parseHtml),Object(D["isEngine"])(t)&&(t.on(hg,this.markdownIt),t.on(fg,this.pasteEachAfter),t.on(pg,this.pasteHtml))}},{key:"schema",value:function(){var t=Object(z["a"])(Object(H["a"])(n.prototype),"schema",this).call(this);return[t,{name:"li",type:"block",attributes:{class:{required:!0,value:this.editor.list.CUSTOMZIE_LI_CLASS},checked:["true","false"]},allowIn:["ul"]}]}},{key:"isCurrent",value:function(t){var e;return"li"===t.name?t.hasClass(this.editor.list.CUSTOMZIE_LI_CLASS)&&"checkbox"===(null===(e=t.first())||void 0===e?void 0:e.attributes(D["CARD_KEY"])):t.hasClass("data-list")&&t.hasClass(ug)}},{key:"execute",value:function(t){var e=this.editor;if(Object(D["isEngine"])(e)){var n=e.change,r=e.list,i=e.block;r.split();var o=n.range.get(),a=i.findBlocks(o);if(a){var s=o.createSelection("tasklist-execute");if(r.isSpecifiedType(a,"ul","checkbox"))r.unwrap(a);else{var l=r.toCustomize(a,"checkbox",t);l.forEach((function(t){e.node.isList(t)&&t.addClass(ug)}))}if(s.move(),o.collapsed&&o.startContainer.nodeType===Node.ELEMENT_NODE&&0===o.startContainer.childNodes.length&&o.startContainer.parentNode){var c=document.createElement("br");o.startNode.before(c),o.startContainer.parentNode.removeChild(o.startContainer),o.select(c),o.collapse(!1)}n.apply(o),r.merge()}}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+9"}},{key:"destroy",value:function(){var t=this.editor;t.off(dg,this.parseHtml),Object(D["isEngine"])(t)&&(t.off(hg,this.markdownIt),t.off(fg,this.pasteEachAfter),t.off(pg,this.pasteHtml))}}],[{key:"pluginName",get:function(){return"tasklist"}}]),n}(D["ListPlugin"]),mg=gg,vg=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="ol",t.attributes={start:"@var0","data-indent":"@var1"},t.variable={"@var0":"@number","@var1":"@number"},t.allowIn=["blockquote","$root"],t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("list")},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;Object(D["isEngine"])(t)&&t.on("markdown-it",this.markdownIt)}},{key:"schema",value:function(){var t=Object(z["a"])(Object(H["a"])(n.prototype),"schema",this).call(this);return[t,{name:"ol",type:"block"},{name:"li",type:"block",allowIn:["ol"]}]}},{key:"isCurrent",value:function(t){var e=this.editor.list;return!t.hasClass(e.CUSTOMZIE_UL_CLASS)&&"ol"===t.name}},{key:"execute",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=this.editor;if(Object(D["isEngine"])(e)){var n=e.change,r=e.list,i=e.block;r.split();var o=n.range.get(),a=i.findBlocks(o);if(a){var s=o.createSelection();"orderedlist"===r.getPluginNameByNodes(a)?r.unwrap(a):r.toNormal(a,"ol",t),s.move(),n.range.select(o),r.merge()}}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+7"}},{key:"destroy",value:function(){this.editor.off("markdown-it",this.markdownIt)}}],[{key:"pluginName",get:function(){return"orderedlist"}}]),n}(D["ListPlugin"]),bg=vg,yg="markdown-it",wg=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="ul",t.attributes={"data-indent":"@var0"},t.variable={"@var0":"@number"},t.allowIn=["blockquote","$root"],t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("list")},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;Object(D["isEngine"])(t)&&t.on(yg,this.markdownIt)}},{key:"schema",value:function(){var t=Object(z["a"])(Object(H["a"])(n.prototype),"schema",this).call(this);return[t,{name:"ul",type:"block"},{name:"li",type:"block",allowIn:["ul"]}]}},{key:"isCurrent",value:function(t){return!t.hasClass(this.editor.list.CUSTOMZIE_UL_CLASS)&&"ul"===t.name}},{key:"execute",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.change,n=t.list,r=t.block;n.split();var i=e.range.get(),o=r.findBlocks(i);if(o){var a=i.createSelection();"unorderedlist"===n.getPluginNameByNodes(o)?n.unwrap(o):n.toNormal(o,"ul"),a.move(),e.range.select(i),n.merge()}}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+8"}},{key:"destroy",value:function(){this.editor.off(yg,this.markdownIt)}}],[{key:"pluginName",get:function(){return"unorderedlist"}}]),n}(D["ListPlugin"]),xg=wg,Cg=(n("99af"),n("8a794"),n("b64b"),"text-indent"),kg="keydown:backspace",Ag="keydown:tab",Sg="keydown:shift-tab",Eg="paste:each",Og=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.onBackspace=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.list,o=n.node,a=n.block,s=r.range.get(),l=a.closest(s.startNode);if(o.isBlock(l)){var c=l.parent(),u=r.blocks;if(c&&o.isBlock(c)&&(u=u.filter((function(t){return!t.equal(c)}))),"li"===l.name){if(s.collapsed&&!i.isFirst(s))return;if(!s.collapsed)return}else{if((s.collapsed&&a.isLastOffset(s,"end")||!a.isFirstOffset(s,"start"))&&!o.isEmptyWidthChild(l)||u.length>1)return;if(!s.collapsed)return}return t.queryState()?(e.preventDefault(),n.command.execute(t.constructor.pluginName,"out"),!1):void 0}}},t.onTab=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.list,o=n.block,a=r.range.get();return a.collapsed&&i.isFirst(a)?(e.preventDefault(),n.command.execute(t.constructor.pluginName,"in"),!1):!a.collapsed||o.isFirstOffset(a,"start")?(e.preventDefault(),n.command.execute(t.constructor.pluginName,"in",!0),!1):void 0}},t.onShiftTab=function(e){var n=t.editor;if(Object(D["isEngine"])(n))return e.preventDefault(),n.command.execute(t.constructor.pluginName,"out"),!1},t.pasteEach=function(e){var n=t.editor;if(e.isElement()&&!e.isCard()&&n.node.isBlock(e)){var r=e.css(),i=r[Cg];if(i&&i.endsWith("pt")){var o=t.convertToPX(i);if(o){var a=t.options.maxPadding||50,s=Object(D["removeUnit"])(o),l=e.width();l=0===l?n.root.width():l;var c=e.css("font-size");c=!c||c.endsWith("em")?n.root.css("font-size"):c,c.endsWith("em")&&(c=Object(D["$"])(document.body).css("font-size")),c.endsWith("px")||(c="16px");var u=l>0?l/Object(D["removeUnit"])(c):a;s=Math.min(o.endsWith("px")?s/Object(D["removeUnit"])(c):s,a,u),s<=0?e.css(Cg,""):e.css(Cg,Object(D["addUnit"])(s>0?s:0,"em"))}}}},t}return Object(B["a"])(n,[{key:"init",value:function(){var t=this.editor;t.schema.add(this.schema()),this.conversion().forEach((function(e){var n=e.from,r=e.to;t.conversion.add(n,r)})),t.on(kg,this.onBackspace),t.on(Ag,this.onTab),t.on(Sg,this.onShiftTab),Object(D["isEngine"])(t)&&t.on(Eg,this.pasteEach)}},{key:"execute",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"in",n=this.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.list,o=n.block;i.split();var a=r.range.get(),s=o.findBlocks(a);if(s){var l=this.options.maxPadding||50;s.forEach((function(n){t.addPadding(n,"in"===e?2:-2,l)})),i.merge()}}}},{key:"queryState",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.change,n=t.list,r=t.node,i=e.range.get();if(!i.startNode.inEditor())return 0;var o=t.block.closest(i.startNode);return"li"===o.name?n.getIndent(o.closest("ul,ol")):r.isRootBlock(o)||r.isNestedBlock(o)?Object(D["removeUnit"])(o.css(Cg)):0}}},{key:"addPadding",value:function(t,e,n){var r=this.editor,i=r.list,o=r.node;if("li"!==t.name)if(o.isList(t))i.addIndent(t,e,n);else if(o.isRootBlock(t)||o.isNestedBlock(t))if(e>0)if(Object(D["removeUnit"])(t.css(Cg))){var a=t.css(Cg),s=Object(D["removeUnit"])(a)+e,l=t.width();l=0===l?r.root.width():l;var c=t.css("font-size");c=!c||c.endsWith("em")?r.root.css("font-size"):c,c.endsWith("em")&&(c=Object(D["$"])(document.body).css("font-size")),c.endsWith("px")||(c="16px");var u=l>0?l/Object(D["removeUnit"])(c):n;s=Math.min(a.endsWith("px")?s/Object(D["removeUnit"])(c):s,n,u),s<=0?t.css(Cg,""):t.css(Cg,Object(D["addUnit"])(s>0?s:0,"em"))}else t.css(Cg,"".concat(e,"em"));else{var d=t.css(Cg),h=Object(D["removeUnit"])(d)+e;h<=0?t.css(Cg,""):t.css(Cg,Object(D["addUnit"])(h>0?h:0,"em"))}}},{key:"hotkey",value:function(){var t,e,n=(null===(t=this.options.hotkey)||void 0===t?void 0:t.in)||"mod+]",r=(null===(e=this.options.hotkey)||void 0===e?void 0:e.out)||"mod+[";return[{key:n,args:"in"},{key:r,args:"out"}]}},{key:"schema",value:function(){return{type:"block",attributes:{style:Object(ef["a"])({},Cg,"@length")}}}},{key:"conversion",value:function(){var t=this;return[{from:function(t,e,n){return!!e["padding-left"]||!!n[Cg]},to:function(e,n,r){var i=Object(D["$"])("<".concat(e," />")),o=n["padding-left"]||r[Cg];if(o.endsWith("pt")&&(o=t.convertToPX(o)),o.endsWith("px")){var a=n["font-size"];a=!a||a.endsWith("em")?t.editor.root.css("font-size"):a,a.endsWith("em")&&(a=Object(D["$"])(document.body).css("font-size")),a.endsWith("px")||(a="16px");var s=Object(D["removeUnit"])(o)/Object(D["removeUnit"])(a);n[Cg]="".concat(s,"em")}else o.endsWith("em")&&(n[Cg]=o);return delete n["padding-left"],delete r[Cg],i.css(n),Object.keys(r).forEach((function(t){i.attributes(t,r[t])})),i}}]}},{key:"convertToPX",value:function(t){var e=/([\d\.]+)(pt|px)$/i.exec(t);return e&&"pt"===e[2]?String(Math.round(96*parseInt(e[1],10)/72))+"px":t}},{key:"destroy",value:function(){var t=this.editor;t.off(kg,this.onBackspace),t.off(Ag,this.onTab),t.off(Sg,this.onShiftTab),Object(D["isEngine"])(t)&&t.off(Eg,this.pasteEach)}}],[{key:"pluginName",get:function(){return"indent"}}]),n}(D["Plugin"]),Tg=Og,_g="padding-left",Mg="paste:each",Ng=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.onBackspace=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.list,o=n.node,a=n.block,s=r.range.get(),l=a.closest(s.startNode);if(o.isBlock(l)){var c=l.parent(),u=r.blocks;if(c&&o.isBlock(c)&&(u=u.filter((function(t){return!t.equal(c)}))),"li"===l.name){if(s.collapsed&&!i.isFirst(s))return;if(!s.collapsed)return}else{if((s.collapsed&&a.isLastOffset(s,"end")||!a.isFirstOffset(s,"start"))&&!o.isEmptyWidthChild(l)||u.length>1)return;if(!s.collapsed)return}return t.queryState()?(e.preventDefault(),n.command.execute(t.constructor.pluginName,"out"),!1):void 0}}},t.onTab=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.list,o=n.block,a=r.range.get();return a.collapsed&&i.isFirst(a)?(e.preventDefault(),n.command.execute(t.constructor.pluginName,"in"),!1):!a.collapsed||o.isFirstOffset(a,"start")?(e.preventDefault(),n.command.execute(t.constructor.pluginName,"in",!0),!1):void 0}},t.onShiftTab=function(e){var n=t.editor;if(Object(D["isEngine"])(n))return e.preventDefault(),n.command.execute(t.constructor.pluginName,"out"),!1},t.pasteEach=function(e){var n=t.editor;if(e.isElement()&&!e.isCard()&&n.node.isBlock(e)){var r=e.css(),i=r[_g];if(i&&i.endsWith("pt")){var o=t.convertToPX(i);if(o){var a=t.options.maxPadding||50,s=Object(D["removeUnit"])(o),l=e.width();l=0===l?n.root.width():l;var c=e.css("font-size");c=!c||c.endsWith("em")?n.root.css("font-size"):c,c.endsWith("em")&&(c=Object(D["$"])(document.body).css("font-size")),c.endsWith("px")||(c="16px");var u=l>0?l/Object(D["removeUnit"])(c):a;s=Math.min(o.endsWith("px")?s/Object(D["removeUnit"])(c):s,a,u),s<=0?e.css(_g,""):e.css(_g,Object(D["addUnit"])(s>0?s:0,"em"))}}}},t}return toolbar=!0,Object(B["a"])(n,[{key:"init",value:function(){var t=this.editor;t.schema.add(this.schema()),this.conversion().forEach((function(e){var n=e.from,r=e.to;t.conversion.add(n,r)})),Object(D["isEngine"])(t)&&t.on(Mg,this.pasteEach)}},{key:"execute",value:function(){var t,e=this;t=this.arguments&&this.arguments.length>0&&this.arguments[0]?"in":null;var n=this.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.list,o=n.block;i.split();var a=r.range.get(),s=o.findBlocks(a);if(s){var l=this.options.maxPadding||50;s.forEach((function(n){e.addPadding(n,"in"===t?2:-2,l)})),i.merge()}}}},{key:"queryState",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.change,n=t.list,r=t.node,i=e.range.get();if(!i.startNode.inEditor())return 0;var o=t.block.closest(i.startNode);return"li"===o.name?n.getIndent(o.closest("ul,ol")):r.isRootBlock(o)||r.isNestedBlock(o)?Object(D["removeUnit"])(o.css(_g)):0}}},{key:"addPadding",value:function(t,e,n){var r=this.editor,i=r.list,o=r.node;if("li"!==t.name)if(o.isList(t))i.addIndent(t,e,n);else if(o.isRootBlock(t)||o.isNestedBlock(t))if(e>0)if(Object(D["removeUnit"])(t.css(_g))){var a=t.css(_g),s=Object(D["removeUnit"])(a)+e,l=t.width();l=0===l?r.root.width():l;var c=t.css("font-size");c=!c||c.endsWith("em")?r.root.css("font-size"):c,c.endsWith("em")&&(c=Object(D["$"])(document.body).css("font-size")),c.endsWith("px")||(c="16px");var u=l>0?l/Object(D["removeUnit"])(c):n;s=Math.min(a.endsWith("px")?s/Object(D["removeUnit"])(c):s,n,u),s<=0?t.css(_g,""):t.css(_g,Object(D["addUnit"])(s>0?s:0,"em"))}else t.css(_g,"".concat(e,"em"));else{var d=t.css(_g),h=Object(D["removeUnit"])(d)+e;h<=0?t.css(_g,""):t.css(_g,Object(D["addUnit"])(h>0?h:0,"em"))}}},{key:"schema",value:function(){return{type:"block",attributes:{style:Object(ef["a"])({},_g,"@length")}}}},{key:"conversion",value:function(){var t=this;return[{from:function(t,e,n){return!!e["padding-left"]||!!n[_g]},to:function(e,n,r){var i=Object(D["$"])("<".concat(e," />")),o=n["padding-left"]||r[_g];if(o.endsWith("pt")&&(o=t.convertToPX(o)),o.endsWith("px")){var a=n["font-size"];a=!a||a.endsWith("em")?t.editor.root.css("font-size"):a,a.endsWith("em")&&(a=Object(D["$"])(document.body).css("font-size")),a.endsWith("px")||(a="16px");var s=Object(D["removeUnit"])(o)/Object(D["removeUnit"])(a);n[_g]="".concat(s,"em")}else o.endsWith("em")&&(n[_g]=o);return delete n["padding-left"],delete r[_g],i.css(n),Object.keys(r).forEach((function(t){i.attributes(t,r[t])})),i}}]}},{key:"convertToPX",value:function(t){var e=/([\d\.]+)(pt|px)$/i.exec(t);return e&&"pt"===e[2]?String(Math.round(96*parseInt(e[1],10)/72))+"px":t}},{key:"destroy",value:function(){var t=this.editor;Object(D["isEngine"])(t)&&t.off(Mg,this.pasteEach)}}],[{key:"pluginName",get:function(){return"indentMultiLine"}}]),n}(D["Plugin"]),Pg=Ng,Lg="markdown-it",Dg=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="del",t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("strikethrough")},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;Object(D["isEngine"])(t)&&t.on(Lg,this.markdownIt)}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+x"}},{key:"conversion",value:function(){var t=this;return[{from:function(t,e){return"span"===t&&(e["text-decoration"]||"").includes("line-through")},to:function(e,n,r){var i=Object(D["$"])("<".concat(t.tagName," />"));return n["text-decoration"]=n["text-decoration"].split(/\s+/).filter((function(t){return"line-through"!==t})).join(" ").trim(),i.css(n),i.attributes(r),i}},{from:"s",to:this.tagName},{from:"strike",to:this.tagName}]}},{key:"destroy",value:function(){this.editor.off(Lg,this.markdownIt)}}],[{key:"pluginName",get:function(){return"strikethrough"}}]),n}(D["MarkPlugin"]),jg=Dg,Ig=n("54f6"),Rg=n.n(Ig),Fg="markdown-it",Bg=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="sub",t.markdownIt=function(e){!1!==t.options.markdown&&(e.use(Rg.a),e.enable("sub"))},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;Object(D["isEngine"])(t)&&t.on(Fg,this.markdownIt)}},{key:"conversion",value:function(){var t=this;return[{from:function(t,e){return"span"===t&&"sub"===(e["vertical-align"]||"")},to:function(e,n,r){var i=Object(D["$"])("<".concat(t.tagName," />"));return delete n["vertical-align"],i.css(n),i.attributes(r),i}}]}},{key:"execute",value:function(){var t,e=this.editor.command.queryState("sup");e&&this.editor.command.execute("sup");for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];(t=Object(z["a"])(Object(H["a"])(n.prototype),"execute",this)).call.apply(t,[this].concat(i))}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+,"}},{key:"destroy",value:function(){this.editor.off(Fg,this.markdownIt)}}],[{key:"pluginName",get:function(){return"sub"}}]),n}(D["MarkPlugin"]),zg=Bg,Hg=n("7ba6"),Vg=n.n(Hg),qg="markdown-it",Ug=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="sup",t.markdownIt=function(e){!1!==t.options.markdown&&(e.use(Vg.a),e.enable("sup"))},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;Object(D["isEngine"])(t)&&t.on(qg,this.markdownIt)}},{key:"conversion",value:function(){var t=this;return[{from:function(t,e){return"span"===t&&"super"===(e["vertical-align"]||"")},to:function(e,n,r){var i=Object(D["$"])("<".concat(t.tagName," />"));return delete n["vertical-align"],i.css(n),i.attributes(r),i}}]}},{key:"execute",value:function(){var t,e=this.editor.command.queryState("sub");e&&this.editor.command.execute("sub");for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];(t=Object(z["a"])(Object(H["a"])(n.prototype),"execute",this)).call.apply(t,[this].concat(i))}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+."}},{key:"destroy",value:function(){this.editor.off(qg,this.markdownIt)}}],[{key:"pluginName",get:function(){return"sup"}}]),n}(D["MarkPlugin"]),Wg=Ug,$g="keydown:backspace",Gg=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.kind="block",t.style={"text-align":"@var0","list-style-position":"@var1"},t.variable={"@var0":["center","right","justify"],"@var1":["outside","inside"]},t.onBackspace=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.block,o=r.range.get();if(!(i.isLastOffset(o,"end")||!i.isFirstOffset(o,"start")||r.blocks.length>1)){var a=n.command,s=t.queryState();return"center"===s?(e.preventDefault(),a.execute(t.constructor.pluginName,"left"),!1):"right"===s?(e.preventDefault(),a.execute(t.constructor.pluginName,"center"),!1):void 0}}},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this),this.editor.on($g,this.onBackspace)}},{key:"execute",value:function(t){var e=this.editor;if(Object(D["isEngine"])(e)&&!e.readonly){var n=e.change,r=e.block;r.setBlocks({style:{"text-align":!t||["left"].indexOf(t)>-1?"":t}}),n.blocks.forEach((function(n){"li"===n.name&&e.list.addAlign(n,t)}))}}},{key:"queryState",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.change,n=t.schema,r=e.blocks;if(0!==r.length){var i=r[0],o=n.getAllowInTags();o.indexOf(i.name)>-1&&(i=r[1]||i.first()||i);var a=i.css("text-align");return"start"===a&&(a="left"),"end"===a&&(a="right"),a}}}},{key:"hotkey",value:function(){var t,e,n,r,i=(null===(t=this.options.hotkey)||void 0===t?void 0:t.left)||"mod+shift+l",o=(null===(e=this.options.hotkey)||void 0===e?void 0:e.center)||"mod+shift+c",a=(null===(n=this.options.hotkey)||void 0===n?void 0:n.right)||"mod+shift+r",s=(null===(r=this.options.hotkey)||void 0===r?void 0:r.justify)||"mod+shift+j";return[{key:i,args:"left"},{key:o,args:"center"},{key:a,args:"right"},{key:s,args:"justify"}]}},{key:"destroy",value:function(){this.editor.off($g,this.onBackspace)}}],[{key:"pluginName",get:function(){return"alignment"}}]),n}(D["ElementPlugin"]),Yg=Gg;function Xg(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var Kg=".am-engine blockquote, .am-engine-view blockquote {\r\n margin: 5px 0 5px 0;\r\n border-left: 3px solid #eee;\r\n color: #8C8C8C;\r\n}\r\n\r\n.am-engine blockquote + blockquote, .am-engine-view blockquote + blockquote {\r\n margin-top: -5px;\r\n}\r\n\r\n.am-engine blockquote > *, .am-engine-view blockquote > * {\r\n margin-left: 14px;\r\n color: #8C8C8C;\r\n}\r\n\r\n.am-engine blockquote *, .am-engine-view blockquote * {\r\n color: #8C8C8C;\r\n}\r\n\r\n.am-engine blockquote a, .am-engine blockquote a:hover, .am-engine-view blockquote a, .am-engine-view blockquote a:hover {\r\n color: #1890ff !important;\r\n}";Xg(Kg);var Zg="parse:html",Jg="keydown:backspace",Qg="keydown:enter",tm="paste:each",em="markdown-it",nm=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="blockquote",t.canMerge=!0,t.pasteEach=function(e){var n;e.isText()&&(null===(n=e.parent())||void 0===n?void 0:n.name)===t.tagName&&t.editor.node.wrap(e,Object(D["$"])("<p></p>"))},t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("blockquote")},t.onBackspace=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.node,o=r.range.get(),a=n.block,s=a.isLastOffset(o,"end");if(s&&!o.collapsed){var l=a.closest(o.startNode),c=a.closest(o.endNode),u=l.parent(),d=c.parent();if(u&&d&&"blockquote"===d.name&&!u.equal(d))return void d.remove()}if(o.collapsed){var h=a.isFirstOffset(o,"start");if(h){var p=a.closest(o.startNode),f=p.parent();if(f&&"blockquote"===f.name&&i.isBlock(p)){if(e.preventDefault(),p.prevElement())r.mergeAfterDelete(p);else if(i.isEmpty(f)){var g=Object(D["$"])("<p><br/></p>");f.replaceWith(g),o.select(g,!0).collapse(!1),r.apply(o)}else a.unwrap("<blockquote />");return!1}}}}},t.onEnter=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=n.block,o=r.range.get(),a=i.closest(o.endNode),s=a.parent();return(null===s||void 0===s?void 0:s.name)===t.tagName&&"p"===a.name&&a.nextElement()?(e.preventDefault(),i.insertOrSplit(o,a),!1):void 0}},t.parseHtml=function(t){t.find("blockquote").css({"margin-top":"5px","margin-bottom":"5px","padding-left":"1em","margin-left":"0px","border-left":"3px solid #eee",opacity:"0.6"})},t.pasteHtml=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){if(e.name===t.tagName){var r=n.node;return e.css("padding-left",""),e.css("text-indent",""),r.isEmpty(e)&&e.empty().append("<p><br/></p>"),n.normalize(e),!1}return!0}},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;t.schema.addAllowIn(this.tagName),t.on(Zg,this.parseHtml),Object(D["isEngine"])(t)&&(t.on(tm,this.pasteHtml),t.on(Jg,this.onBackspace),t.on(Qg,this.onEnter),t.on(tm,this.pasteEach),t.on(em,this.markdownIt))}},{key:"execute",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.change,n=t.block,r=t.node;if(this.queryState()){var i=e.range.get(),o=e.blocks[0].closest(this.tagName),a=i.createSelection();return r.unwrap(o),a.move(),void e.range.select(i)}n.wrap("<".concat(this.tagName," />"))}}},{key:"queryState",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.change,n=e.blocks;if(0===n.length)return!1;var r=n[0].closest(this.tagName);return this.isSelf(r)}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+shift+u"}},{key:"destroy",value:function(){var t=this.editor;t.off(Zg,this.parseHtml),Object(D["isEngine"])(t)&&(t.off(tm,this.pasteHtml),t.off(Jg,this.onBackspace),t.off(Qg,this.onEnter),t.off(tm,this.pasteEach),t.off(em,this.markdownIt))}}],[{key:"pluginName",get:function(){return"quote"}}]),n}(D["BlockPlugin"]),rm=nm;function im(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var om=".am-engine.data-paintformat-mode,\r\n.am-engine-view.data-paintformat-mode {\r\n cursor: text;\r\n cursor: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAUCAYAAACTQC2+AAAABGdBTUEAALGPC/xhBQAAATtJREFUSA3dlTFLA0EQhU+jlSkEG63EYGdlZZFG7QUbSyG/QP/C/Q0rqzQWQX+BwUKwtrexEFRQtFSI35NZWDa3soOHhQ8eM/v2zWw2N9xVVVUdwXUYoFxaq5il2wa8hvtG5dJaxYx16xFvLN8i3lmehiFC6Y94wbsTGsxZosajKA/7aewjrKZiyTocJO9DSYHT82r+YXyQs0eRfYBrD/Y1DB58OMyfeM/hrWq8N9qlZkmFBXiPPd6D7ikWUxwjrKWirTeJkzDeNYttKIxhDUuxiFGjfAnfMkUX3hs19emYqFt9P48mU6zVLEQPFjCfwgk8gyuwEd6pS5t0EQYmHhCXLZ8Kvz1oqmFO+H8HxVOXfZC5vwNd46y3xbx5ni1mQ4+dJ6NyDw4xX0GN9484YfcRhg+fcmmt408+5V99wSyVTWN94gAAAABJRU5ErkJggg==) 5 10, text;\r\n}";im(om);var am="data-paintformat-mode",sm=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.activeMarks=void 0,t.activeBlocks=void 0,t.type=void 0,t.event=void 0,t.isFormat=!1,t.onBeforeCommandExecute=function(e){"paintformat"!==e&&!t.isFormat&&t.event&&t.removeActiveNodes(t.editor.container[0].ownerDocument)},t.onContainerMouseUp=function(e){if(t.activeMarks&&e.target){var n=t.editor;n.card.closest(Object(D["$"])(e.target))?t.removeActiveNodes(n.container[0].ownerDocument):(t.isFormat=!0,t.paintFormat(t.activeMarks,t.activeBlocks),t.isFormat=!1,"single"===t.type&&t.removeActiveNodes(n.container[0].ownerDocument))}},t}return Object(B["a"])(n,[{key:"init",value:function(){var t=this.editor;Object(D["isEngine"])(t)&&(t.on("beforeCommandExecute",this.onBeforeCommandExecute),t.container.on("mouseup",this.onContainerMouseUp))}},{key:"removeActiveNodes",value:function(t){Object(D["isNode"])(t)&&(t=Object(D["$"])(t));var e=this.editor;e.container.removeClass(am),this.activeMarks=void 0,this.activeBlocks=void 0,this.event&&(t.off("keydown",this.event),this.event=void 0),Object(D["isEngine"])(e)&&e.trigger("select")}},{key:"bindEvent",value:function(t){var e=this,n=t[0].ownerDocument,r=function r(i){i.metaKey||i.ctrlKey||i.shiftKey||(e.event=void 0,"Escape"!==i.key&&27!==i.keyCode||(t.off("keydown",r),n&&e.removeActiveNodes(n)))};n&&(Object(D["$"])(n).on("keydown",r),this.event=r)}},{key:"paintFormat",value:function(t,e){var n=this,r=this.editor;if(Object(D["isEngine"])(r)){var i=r.change,o=r.command,a=r.block,s=i.range.get(),l=this.options.removeCommand||"removeformat";if(s.collapsed){var c=Object(D["$"])("<img ".concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" role="format-dummy" style="display: none;" />'));s.insertNode(c[0]);var u=a.closest(s.startNode);s.select(u,!0),i.range.select(s),"function"===typeof l?l(s):o.execute(l),this.paintMarks(t);var d=a.getBlocks(s);e&&d.forEach((function(t){n.paintBlocks(t,e)})),c=u.find('img[role="format-dummy"]'),s.select(c),s.collapse(!0),c.remove(),i.apply(s)}else{"function"===typeof l?l(s):o.execute(l),this.paintMarks(t);var h=a.getBlocks(s);e&&h.forEach((function(t){n.paintBlocks(t,e)}))}r.mark.merge(s)}}},{key:"paintMarks",value:function(t){for(var e=this.editor,n=e.mark,r=t.length-1;r>=0;r--){var i=t[r];n.wrap(e.node.clone(i,!1,!1))}}},{key:"paintBlocks",value:function(t,e){var n=this,r=this.editor;if(Object(D["isEngine"])(r)&&t.inEditor()){var i=r.node,o=r.change,a=r.block,s=o.range.get(),l=s.createSelection("removeformat");e.forEach((function(e){if(t.inEditor()){if(n.options.paintBlock){var r=n.options.paintBlock(t,e);if(!1===r)return}if(e.name!==t.name)if(s.select(t).shrinkToElementNode(),o.blocks=[t],"p"===e.name){var l=a.findPlugin(t);l&&l.execute(e.name)}else if(i.isRootBlock(e)){var c=a.findPlugin(e);c&&c.execute(e.name)}else if(i.isList(e)&&"li"!==e.name){var u=a.findPlugin(e),d=a.findPlugin("li"===t.name?t.parent():t);u&&d!==u&&u.execute()}var h=e.css();Object.keys(h).length>0&&a.setBlocks({style:h})}})),l.move()}}},{key:"execute",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"single",e=this.editor;if(Object(D["isEngine"])(e))if(this.activeMarks)this.removeActiveNodes(e.container);else{this.type=t,this.bindEvent(e.container);var n=e.change,r=e.mark,i=e.block,o=n.range.get();this.activeMarks=r.findMarks(o),this.activeBlocks=i.findBlocks(o),e.trigger("select"),e.container.addClass("data-paintformat-mode")}}},{key:"queryState",value:function(){return!!this.activeMarks}},{key:"destroy",value:function(){var t=this.editor;t.off("beforeCommandExecute",this.onBeforeCommandExecute),t.container.off("mouseup",this.onContainerMouseUp)}}],[{key:"pluginName",get:function(){return"paintformat"}}]),n}(D["Plugin"]),lm=sm,cm=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"execute",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.change,n=t.block,r=t.mark,i=t.inline,o=n,a=e.range.get(),s=o.getBlocks(a),l=r.findMarks(a),c=i.findInlines(a);if(l.length>0)r.unwrap();else if(c.length>0)i.unwrap();else{var u=a.createSelection("removeformat");s.forEach((function(t){var e=o.findPlugin("li"===t.name?t.parent():t);e&&(a.select(t).shrinkToElementNode(),e.execute()),t.removeAttributes("style")})),u.move()}}}},{key:"hotkey",value:function(){return this.options.hotkey||"mod+\\"}}],[{key:"pluginName",get:function(){return"removeformat"}}]),n}(D["Plugin"]),um=cm,dm="keydown:all",hm=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.onSelectAll=function(e){var n=t.editor.command;e.preventDefault(),n.execute("selectall")},t}return Object(B["a"])(n,[{key:"init",value:function(){this.editor.on(dm,this.onSelectAll)}},{key:"execute",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.change,n=e.range.get(),r=n.startNode.closest(D["EDITABLE_SELECTOR"]);r.length>0?n.select(r,!0):n.select(t.container,!0),e.range.select(n),t.trigger("select")}}},{key:"destroy",value:function(){this.editor.off(dm,this.onSelectAll)}}],[{key:"pluginName",get:function(){return"selectall"}}]),n}(D["Plugin"]),pm=hm,fm=(n("38cf"),n("c740"),n("1fe2"),n("ddb0"),n("00b4"),n("697e")),gm=n.n(fm),mm=n("7232"),vm=n("66cb"),bm=n.n(vm),ym=(n("8d45"),"table-wrapper"),wm="table-overflow",xm="data-table",Cm="table-cols-header",km="table-cols-header-item",Am="cols-trigger",Sm="cols-addition-header",Em="table-rows-header",Om="table-rows-header-item",Tm="rows-trigger",_m="table-header",Mm="table-menubar",Nm="table-menubar-item",Pm="table-menubar-item-input",Lm="table-viewport",Dm="data-table-reader",jm="table-placeholder",Im="multi-addition",Rm="table-highlight",Fm="table-row-delete-button",Bm="table-col-delete-button",zm="table-row-add-button",Hm="table-row-add-split-button",Vm="table-col-add-button",qm="table-col-add-split-button",Um="table-main-content",Wm="table-main-bg",$m={};function Gm(t){t[0].onkeydown=function(t){return t.ctrlKey&&t.shiftKey&&("Digit1"==t.code&&$m.command.mergeCell(),"Digit2"==t.code&&$m.command.splitCell()),!0},t.addClass("active")}function Ym(t){t[0]&&(t[0].onkeydown=null),t.removeClass("active")}var Xm=function(){function t(e){Object(F["a"])(this,t),this.isReadonly=!1,this.table=void 0,this.table=e}return Object(B["a"])(t,[{key:"getEmptyCell",value:function(){return t.EmptyCell(this.isReadonly)}},{key:"renderRowsHeader",value:function(t){return"<div ".concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" class="').concat(Em,'">')+'<div class="'.concat(Fm,'"><span class="data-icon data-icon-delete"></span></div>')+'<div class="'.concat(zm,'"><span class="data-icon data-icon-plus"></span><div class="').concat(Hm,'"></div></div>')+'<div class="'.concat(Om,'" draggable="true">\n <div class="row-dragger">\n <span class="data-icon data-icon-drag"></span>\n <span class="drag-info"></span>\n </div>\n <div class="').concat(Tm,'"></div>\n </div>').repeat(t)+"\n </div>"}},{key:"renderColsHeader",value:function(t){return"<div ".concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" class="').concat(Cm,'">')+'<div class="'.concat(Bm,'"><span class="data-icon data-icon-delete"></span></div>')+'<div class="'.concat(Vm,'"><span class="data-icon data-icon-plus"></span><div class="').concat(qm,'"></div></div>')+'<div class="'.concat(km,'" draggable="true">\n <div class="col-dragger">\n <span class="data-icon data-icon-drag"></span>\n <span class="drag-info"></span>\n </div>\n <div class="').concat(Am,'"></div>\n </div>').repeat(t)+"\n </div>"}},{key:"htmlEdit",value:function(t,e){var n=t.rows,r=t.cols,i=t.html,o=t.noBorder,a=t.overflow;r=r===-1/0?1:r,n=n===-1/0?1:n,r=r===1/0?10:r,n=n===1/0?10:n;var s="<td ".concat(D["DATA_TRANSIENT_ATTRIBUTES"],'="table-cell-selection">').concat(this.getEmptyCell(),"</td>").repeat(r),l="<tr>".concat(s,"</tr>").repeat(n),c="<col />".repeat(r),u="<colgroup>".concat(c,"</colgroup>"),d="<div ".concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" class="').concat(Rm,'"></div>'),h="<div ".concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" class="').concat(_m,'"><div class="').concat(_m,'-item"></div></div>'),p="<div ".concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" class="').concat(jm,'"></div>'),f=e.map((function(t){var e;if(t.split)return'<div class="split"></div>';var n=t.text;switch(t.action){case"insertColLeft":case"insertColRight":case"insertRowUp":case"insertRowDown":n=(null===(e=n)||void 0===e?void 0:e.replace("$data",'<input type=\'text\' maxlength="3" class="'.concat(Pm,'" />')))||"";break}return'<div class="'.concat(Nm,'" ').concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" data-action="').concat(t.action,'">\n <span class="data-icon data-icon-table-').concat(t.icon,'"></span>').concat(n,"</div>")}));if(f=["<div ".concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" class="').concat(Mm,'">').concat(f.join(""),"</div>")],i){var g,m=i.indexOf("<colgroup")>-1;if(i=Object(D["transformCustomTags"])(i)||i,!m)i=null===(g=i)||void 0===g?void 0:g.replace(/^(<table[^>]+>)/,(function(t){return t+u}));var v=this.table.helper.normalize(Object(D["$"])(i)),b=v.find("tr");n=b.length,i=v.get().outerHTML}var y=i||'<table class="'.concat(xm,'"').concat(!0===o?" data-table-no-border='true'":""," ").concat(D["DATA_TRANSIENT_ATTRIBUTES"],'="class">').concat(u).concat(l,"</table>");return"<div ".concat(D["DATA_TRANSIENT_ATTRIBUTES"],'="*" class="').concat(ym," ").concat(!1!==a?wm:"",'" ').concat(D["DATA_TRANSIENT_ATTRIBUTES"],'="*">').concat(h,"<div ").concat(D["DATA_TRANSIENT_ATTRIBUTES"],'="*" class="').concat(Lm,'">').concat(this.renderColsHeader(r)).concat(y).concat(p).concat(d,"</div>").concat(this.renderRowsHeader(n)).concat(f,"</div>")}},{key:"htmlView",value:function(t){var e,n,r=t.html,i=t.noBorder,o=t.overflow;r=Object(D["transformCustomTags"])(null!==(e=r)&&void 0!==e?e:"");var a=Object(D["$"])(r);return a.find("td").attributes(D["DATA_ELEMENT"],D["EDITABLE"]),'<div class="'.concat(ym," ").concat(!1!==o?wm:"",'"><div class="').concat(Dm,'"').concat(!0===i?" data-table-no-border='true'":"",">").concat(null===(n=a.get())||void 0===n?void 0:n.outerHTML,"</div></div>")}}],[{key:"EmptyCell",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return'<div class="'.concat(Um,'" ').concat(D["DATA_TRANSIENT_ATTRIBUTES"],'="').concat(D["DATA_CONTENTEDITABLE_KEY"],'" ').concat(D["DATA_CONTENTEDITABLE_KEY"],'="').concat(e?"false":"true",'" ').concat(D["DATA_ELEMENT"],'="').concat(D["EDITABLE"],'"><p><br /></p></div>').concat(t.CellBG)}}]),t}();Xm.TABLE_WRAPPER_CLASS=".".concat(ym),Xm.TABLE_OVERFLOW_CLASS=".".concat(wm),Xm.TABLE_CLASS=".".concat(xm),Xm.COLS_HEADER_CLASS=".".concat(Cm),Xm.COLS_HEADER_ITEM_CLASS=".".concat(km),Xm.COLS_HEADER_TRIGGER_CLASS=".".concat(Am),Xm.COLS_ADDITION_HEADER_CLASS=".".concat(Sm),Xm.ROWS_HEADER_CLASS=".".concat(Em),Xm.ROWS_HEADER_ITEM_CLASS=".".concat(Om),Xm.ROWS_HEADER_TRIGGER_CLASS=".".concat(Tm),Xm.HEADER_CLASS=".".concat(_m),Xm.MENUBAR_CLASS=".".concat(Mm),Xm.MENUBAR_ITEM_CLASS=".".concat(Nm),Xm.MENUBAR_ITEM_INPUT_CALSS=".".concat(Pm),Xm.VIEWPORT=".".concat(Lm),Xm.VIEWPORT_READER=".".concat(Dm),Xm.PLACEHOLDER_CLASS=".".concat(jm),Xm.MULTI_ADDITION_CLASS=".".concat(Im),Xm.TABLE_HIGHLIGHT_CLASS=".".concat(Rm),Xm.ROW_DELETE_BUTTON_CLASS=".".concat(Fm),Xm.COL_DELETE_BUTTON_CLASS=".".concat(Bm),Xm.ROW_ADD_BUTTON_CLASS=".".concat(zm),Xm.COL_ADD_BUTTON_CLASS=".".concat(Vm),Xm.ROW_ADD_BUTTON_SPLIT_CLASS=".".concat(Hm),Xm.COL_ADD_BUTTON_SPLIT_CLASS=".".concat(qm),Xm.TABLE_TD_CONTENT_CLASS=".".concat(Um),Xm.TABLE_TD_BG_CLASS=".".concat(Wm),Xm.CellBG='<div class="'.concat(Wm,'"><div class="table-main-border-top"></div><div class="table-main-border-right"></div><div class="table-main-border-bottom"></div><div class="table-main-border-left"></div></div>');var Km=Object(Cf["a"])("editor"),Zm=function(){function t(e){Object(F["a"])(this,t),this.clipboard=void 0,Object.defineProperty(this,Km,{writable:!0,value:void 0}),Object(xf["a"])(this,Km)[Km]=e}return Object(B["a"])(t,[{key:"isEmptyModelCol",value:function(t){return t&&t.isEmpty}},{key:"getTableModel",value:function(t){for(var e=[],n=t.get(),r=n.rows,i=(null===r||void 0===r?void 0:r.length)||0,o=0;o<i;o++)for(var a=r[o],s=a.cells,l=s.length,c=0;c<l;c++){var u=s[c],d=u.rowSpan,h=u.colSpan;d=void 0===d?1:d,h=void 0===h?1:h;var p=d>1||h>1;e[o]=e[o]||[];var f=c;while(e[o][f])f++;if(e[o][f]={rowSpan:d,colSpan:h,isMulti:p,element:u},p){var g=d;while(g>0){var m=h;while(m>0){if(1!==m||1!==g){var v=o+g-1,b=f+m-1;e[v]=e[v]||[],e[v][b]={isEmpty:!0,parent:{row:o,col:f},element:null}}m--}g--}}}var y=e.map((function(t){return t.length})),w=Math.max.apply(Math,Object(T["a"])(y));e.forEach((function(t){if(t.length<w){var e=w-t.length;while(e--)t.push({rowSpan:1,colSpan:1,isShadow:!0,element:null})}for(var n=0;n<w;n++)t[n]||(t[n]={rowSpan:1,colSpan:1,isShadow:!0,element:null})}));var x={rows:e.length,cols:w,width:n.offsetWidth,height:n.offsetHeight,table:e};return x}},{key:"normalize",value:function(t){var e=this;this.trimStartTr(t),this.fixNumberTr(t),t.addClass("data-table"),t.attributes(D["DATA_TRANSIENT_ATTRIBUTES"],"class");var n=t.css("width");0===parseInt(n)&&t.css("width","auto"),t.css("background-color","");var r=this.getTableModel(t),i=t.find("col");if(0!==i.length){for(var o=i.length-1;o>=0;o--){var a,s,l=i[o],c=null===(a=i.eq(o))||void 0===a?void 0:a.attributes("width");if(c)null===(s=i.eq(o))||void 0===s||s.attributes("width",parseInt(c));if(l.span>1){var u=l.span-1;while(u--){var d,h;null===(d=null!==(h=i[o].parentElement)&&void 0!==h?h:i[o].parentNode)||void 0===d||d.insertBefore(i[o].cloneNode(),i[o])}}}if(i=t.find("col"),i.length<r.cols){var p=i.length-1,f=r.cols-i.length;while(f--){var g,m;null===(g=null!==(m=i[0].parentElement)&&void 0!==m?m:i[0].parentNode)||void 0===g||g.appendChild(i[p].cloneNode())}}t.find("col").attributes("span",1)}else{var v=t.find("colgroup")[0];v||(v=document.createElement("colgroup")),t.prepend(v);for(var b=function(t){var e=t.find("tr")[0],n=Object(D["$"])(e).find("td"),r=[];n.each((function(t,e){var i=n.eq(e);if(i){var o=i.attributes("data-colwidth"),a=i.attributes("width"),s=i[0].colSpan;o?o=o.split(","):a&&(a=parseInt(a)/s);for(var l=0;s>l;l++)o&&o[l]?r.push(parseInt(o[l])):a?r.push(parseInt(a.toString())):r.push(void 0)}}));var i=t.find("td");return i.removeAttributes("data-colwidth"),i.removeAttributes("width"),r}(t),y=document.createElement("col"),w=0;r.cols>w;w++){var x=y.cloneNode();b[w]&&x.setAttribute("width",(b[w]||"").toString()),v.appendChild(x)}}var C=t.get();r.table.forEach((function(t,n){C.rows[n]||C.insertRow(n);var r=t.filter((function(t){return!e.isEmptyModelCol(t)&&t.isShadow})),i=r.length;while(i--)0===n?C.rows[n].insertCell(0):C.rows[n].insertCell()}));var k=t.find("tr");k.each((function(t,n){var r,i=k.eq(n);if(i){var o=parseInt(i.css("height"));o=o||(null===(r=Object(xf["a"])(e,Km)[Km].plugin.findPlugin("table"))||void 0===r?void 0:r.options.rowMinHeight)||0,i.css("height",o+"px")}}));var A=t.find("td"),S=Object(D["$"])(Xm.EmptyCell(!Object(D["isEngine"])(Object(xf["a"])(this,Km)[Km])||Object(xf["a"])(this,Km)[Km].readonly));return A.each((function(t,e){var n=A.eq(e);if(n){n.attributes(D["DATA_TRANSIENT_ATTRIBUTES"],"table-cell-selection");var r=n.find(D["EDITABLE_SELECTOR"]);if(0===r.length){var i=n.children();n.append(S.clone(!0)),r=n.find(D["EDITABLE_SELECTOR"]),r.empty(),r.append(i)}r.find("p").each((function(t){0===t.childNodes.length&&t.appendChild(document.createElement("br"))}))}})),t}},{key:"trimStartTr",value:function(t){var e,n=t.find("tr"),r=n.eq(0);r&&0===(null===(e=r.get())||void 0===e?void 0:e.childNodes.length)&&r.remove()}},{key:"fixNumberTr",value:function(t){for(var e=t.get(),n=e.rows,r=(null===n||void 0===n?void 0:n.length)||0,i=[],o=0,a=[],s=0,l=0,c=0,u=0;u<r;u++){for(var d=n[u],h=d.cells,p=0,f=0;f<h.length;f++){var g=h[f],m=g.rowSpan,v=g.colSpan;s+=m*v,p+=v,m>1&&(l+=(m-1)*v)}a[u]=p,0===u&&(o=p),c=Math.max(p,c)}var b=gm()(s/o),y=o===c,w=b&&y;if(w){var x=0;if(a.forEach((function(t){x+=c-t})),x!==l){var C=l-x;if(gm()(C/c)){for(var k=[],A=0;A<r;A++){var S=n[A],E=S.cells,O=A+k.length;while(i[O]===c)k.push(O),O++;for(var T=0;T<E.length;T++){var _=E[T],M=_.rowSpan,N=_.colSpan;if(M>1)for(var P=1;P<M;P++)i[O+P]=(i[O+P]||0)+N}}k.forEach((function(t){e.insertRow(t)}))}}}}},{key:"fixDragEvent",value:function(t){var e,n;null===(e=t.dataTransfer)||void 0===e||e.clearData(),null===(n=t.dataTransfer)||void 0===n||n.setData("aomao",""),t.dataTransfer&&(t.dataTransfer.effectAllowed="all")}},{key:"copyCss",value:function(t,e){Object(D["isNode"])(t)&&(t=Object(D["$"])(t)),Object(D["isNode"])(e)&&(e=Object(D["$"])(e)),e.css("vertical-align",t.css("vertical-align"));var n=t.css("background-color");n="rgba(0, 0, 0, 0)"!==n?n:"",e.css("background-color",n)}},{key:"copyTo",value:function(t,e){Object(D["isNode"])(t)&&(t=Object(D["$"])(t)),Object(D["isNode"])(e)&&(e=Object(D["$"])(e));var n=e.find(D["EDITABLE_SELECTOR"]);0===n.length&&(e.html(Xm.EmptyCell(!Object(D["isEngine"])(Object(xf["a"])(this,Km)[Km])||Object(xf["a"])(this,Km)[Km].readonly)),n=e.find(D["EDITABLE_SELECTOR"])),n.html(Object(D["transformCustomTags"])(t.html())),"td"===e.name&&0===e.find(Xm.TABLE_TD_BG_CLASS).length&&e.append(Object(D["$"])(Xm.CellBG)),"td"===e.name&&e.attributes("data-transient-attributes","table-cell-selection"),this.copyCss(t,e)}},{key:"copyHTML",value:function(t){var e;this.clipboard={html:t,text:(null===(e=Object(D["$"])(t).get())||void 0===e?void 0:e.innerText)||""}}},{key:"getCopyData",value:function(){return this.clipboard}},{key:"clearCopyData",value:function(){this.clipboard=void 0}},{key:"trimBlankSpan",value:function(t){var e=t.length,n=[],r=0,i=e-1;while(t[r]&&"span"===t[r].tagName.toLowerCase()&&""===t[r].innerText.trim())r++;while(t[i]&&"span"===t[i].tagName.toLowerCase()&&""===t[i].innerText.trim())i--;if(r<=i)for(var o=r;o<=i;o++)n.push(t[o]);return n.length?Object(D["$"])(n):t}},{key:"normalizeTable",value:function(t){var e=this;this.trimStartTr(t),this.fixNumberTr(t),t.addClass("data-table");var n=t.css("width");0===parseInt(n)?t.css("width","auto"):n.endsWith("%")||t.css("width",parseInt(n,10)+"px"),t.css("background-color","");var r=this.getTableModel(t),i=t.find("col");if(0!==i.length){for(var o=i.length-1;o>=0;o--){var a,s=i[o],l=null===(a=i.eq(o))||void 0===a?void 0:a.attributes("width");if(l&&!l.endsWith("%")){var c,u=parseInt(l);NaN!==u&&(null===(c=i.eq(o))||void 0===c||c.attributes("width",u))}if(s.span>1){var d=s.span-1;while(d--){var h,p;null===(h=null!==(p=i[o].parentElement)&&void 0!==p?p:i[o].parentNode)||void 0===h||h.insertBefore(i[o].cloneNode(),i[o])}}}if(i=t.find("col"),i.length<r.cols){var f=i.length-1,g=r.cols-i.length;while(g--){var m,v;null===(m=null!==(v=i[0].parentElement)&&void 0!==v?v:i[0].parentNode)||void 0===m||m.appendChild(i[f].cloneNode())}}t.find("col").attributes("span",1)}else{var b=t.find("colgroup")[0];b||(b=document.createElement("colgroup")),t.prepend(b);for(var y=function(t){var e=t.find("tr")[0],n=Object(D["$"])(e).find("td"),r=[];n.each((function(t,e){var i=n.eq(e);if(i){var o=i.attributes("data-colwidth"),a=i.attributes("width"),s=i[0].colSpan;o?o=o.split(","):a&&(a=parseInt(a)/s);for(var l=0;s>l;l++)o&&o[l]?r.push(parseInt(o[l])):a?r.push(parseInt(a.toString())):r.push(void 0)}}));var i=t.find("td");return i.removeAttributes("data-colwidth"),i.removeAttributes("width"),r}(t),w=document.createElement("col"),x=0;r.cols>x;x++){var C=w.cloneNode();y[x]&&C.setAttribute("width",(y[x]||"").toString()),b.appendChild(C)}}var k=t.get();r.table.forEach((function(t,e){k.rows[e]||k.insertRow(e);var n=t.filter((function(t){return t.isShadow})),r=n.length;while(r--)k.rows[e].insertCell()}));var A=t.find("tr");return A.each((function(t,n){var r,i=A.eq(n);if(i){var o=parseInt(i.css("height"));o=o||(null===(r=Object(xf["a"])(e,Km)[Km].plugin.findPlugin("table"))||void 0===r?void 0:r.options.rowMinHeight)||0,i.css("height",o+"px")}})),t}}]),t}(),Jm=function(t){return[{action:"cut",icon:"cut",text:t.cut},{action:"copy",icon:"copy",text:t.copy},{action:"mockPaste",icon:"paste",text:t.paste},{split:!0},{action:"insertColLeft",icon:"insert-col-left",text:t.insertColLeft},{action:"insertColRight",icon:"insert-col-right",text:t.insertColRight},{action:"insertRowUp",icon:"insert-row-up",text:t.insertRowUp},{action:"insertRowDown",icon:"insert-row-down",text:t.insertRowDown},{split:!0},{action:"mergeCell",icon:"merge-cell",text:t.mergeCell},{action:"splitCell",icon:"split-cell",text:t.splitCell},{split:!0},{action:"removeCol",icon:"remove-col",text:t.removeCol},{action:"removeRow",icon:"remove-row",text:t.removeRow},{split:!0},{action:"removeTable",icon:"remove-table",text:t.removeTable},{split:!0},{action:"clear",icon:"clear",text:t.clear}]},Qm=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(t,r,i){var o;return Object(F["a"])(this,n),o=e.call(this),o.editor=void 0,o.table=void 0,o.COL_MIN_WIDTH=void 0,o.ROW_MIN_HEIGHT=void 0,o.MAX_INSERT_NUM=void 0,o.tableRoot=void 0,o.colsHeader=void 0,o.rowsHeader=void 0,o.tableHeader=void 0,o.menuBar=void 0,o.dragging=void 0,o.draggingHeader=void 0,o.changeSize=void 0,o.viewport=void 0,o.placeholder=void 0,o.contextVisible=!1,o.rowDeleteButton=void 0,o.colDeleteButton=void 0,o.colAddButton=void 0,o.colAddAlign=void 0,o.colAddButtonSplit=void 0,o.moveColIndex=-1,o.hideColAddButtonTimeount=void 0,o.rowAddButton=void 0,o.rowAddAlign=void 0,o.rowAddButtonSplit=void 0,o.moveRowIndex=-1,o.hideRowAddButtonTimeount=void 0,o.onMouseDownColsHeader=function(t){var e=Object(D["$"])(t.target||[]).closest(Xm.COLS_HEADER_TRIGGER_CLASS);0!==e.length?o.startChangeCol(e,t):t instanceof MouseEvent&&2===t.button&&o.showContextMenu(t)},o.onMouseDownRowsHeader=function(t){var e=Object(D["$"])(t.target||[]).closest(Xm.ROWS_HEADER_TRIGGER_CLASS);0!==e.length?o.startChangeRow(e,t):t instanceof MouseEvent&&2===t.button&&o.showContextMenu(t)},o.onClickColsHeader=function(t){var e,n=o.table.selection,r=Object(D["$"])(t.target||[]).closest(Xm.COLS_HEADER_TRIGGER_CLASS);if(!(r.length>0)){var i=Object(D["$"])(t.target||[]).closest(Xm.COLS_HEADER_ITEM_CLASS);if(0!==i.length){var a=null===(e=o.colsHeader)||void 0===e?void 0:e.find(Xm.COLS_HEADER_ITEM_CLASS).toArray().findIndex((function(t){return t.equal(i)}));void 0!==a&&n.selectCol(a)}}},o.onClickRowsHeader=function(t){var e,n=o.table.selection,r=Object(D["$"])(t.target||[]).closest(Xm.ROWS_HEADER_TRIGGER_CLASS);if(!(r.length>0)){var i=Object(D["$"])(t.target||[]).closest(Xm.ROWS_HEADER_ITEM_CLASS);if(0!==i.length){var a=null===(e=o.rowsHeader)||void 0===e?void 0:e.find(Xm.ROWS_HEADER_ITEM_CLASS).toArray().findIndex((function(t){return t.equal(i)}));void 0!==a&&n.selectRow(a)}}},o.onClickTableHeader=function(t){var e;t.preventDefault();var n=o.table.selection;if(null===(e=o.tableHeader)||void 0===e?void 0:e.hasClass("selected"))n.clearSelect();else{var r=n.tableModel;if(!r)return;n.select({row:0,col:0},{row:r.rows-1,col:r.cols-1})}},o.onChangeSize=function(t){o.dragging&&(o.dragging.y>-1?o.onChangeRowHeight(t):o.dragging.x>-1&&o.onChangeColWidth(t),o.emit("sizeChanging"))},o.onChangeSizeEnd=function(t){if("mouseleave"!==t.type||!o.table.getCenter().contains(t["toElement"])){if(o.dragging&&o.changeSize){var e=o.changeSize.trigger,n=e.width,r=e.height,i=e.element;i.removeClass("dragging"),o.dragging.x>-1&&i.css("height","".concat(r,"px")),o.dragging.y>-1&&i.css("width","".concat(n,"px")),o.dragging=void 0,o.renderRowBars(),o.emit("sizeChanged")}o.unbindChangeSizeEvent()}},o.onDragStartColsHeader=function(t){var e,n;t.stopPropagation();var r=o.table.selection,i=r.getSelectArea();if(t.target&&i.allRow){var a=Object(D["$"])(t.target).closest(Xm.COLS_HEADER_ITEM_CLASS);if(0!==a.length){var s=null===(e=o.colsHeader)||void 0===e?void 0:e.find(Xm.COLS_HEADER_ITEM_CLASS).toArray().findIndex((function(t){return t.equal(a)}));if(void 0!==s){var l=s;l<i.begin.col||l>i.end.col||(o.draggingHeader={element:a,minIndex:i.begin.col,maxIndex:i.end.col,count:i.end.col-i.begin.col+1},a.addClass("dragging"),a.find(".drag-info").html(o.editor.language.get("table","draggingCol").replace("$data",o.draggingHeader.count.toString())),null===(n=o.colsHeader)||void 0===n||n.addClass("dragging"),o.table.helper.fixDragEvent(t),o.bindDragColEvent())}}}},o.onDragStartRowsHeader=function(t){var e,n;t.stopPropagation();var r=o.table.selection,i=r.getSelectArea();if(t.target&&i.allCol){var a=Object(D["$"])(t.target).closest(Xm.ROWS_HEADER_ITEM_CLASS);if(0!==a.length){var s=null===(e=o.rowsHeader)||void 0===e?void 0:e.find(Xm.ROWS_HEADER_ITEM_CLASS).toArray().findIndex((function(t){return t.equal(a)}));if(void 0!==s){var l=s;l<i.begin.row||l>i.end.row||(o.draggingHeader={element:a,minIndex:i.begin.row,maxIndex:i.end.row,count:i.end.row-i.begin.row+1},a.addClass("dragging"),a.find(".drag-info").html(o.editor.language.get("table","draggingRow").replace("$data",o.draggingHeader.count.toString())),null===(n=o.rowsHeader)||void 0===n||n.addClass("dragging"),o.table.helper.fixDragEvent(t),o.bindDragRowEvent())}}}},o.onDragCol=function(t){var e;if(t.stopPropagation(),o.draggingHeader&&t.target&&(void 0===o.dragging&&(o.dragging={x:t.offsetX,y:t.offsetY}),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),!(Math.abs(o.dragging.x-t.offsetX)<3))){o.dragging.x=t.offsetX,o.draggingHeader.element.removeClass("dragging");var n=Object(D["$"])(t.target).closest("td"),r=Object(D["$"])(t.target).closest(Xm.COLS_HEADER_ITEM_CLASS);if(0!==n.length||0!==r.length)if(r.length>0){var i,a=null===(i=o.colsHeader)||void 0===i?void 0:i.find(Xm.COLS_HEADER_ITEM_CLASS).toArray().findIndex((function(t){return t.equal(r)}));if(void 0===a)return;var s=a,l=t.offsetX>r.get().offsetWidth/2?s+1:s;o.showPlaceHolder(l,l!==s)}else{var c=null===(e=o.colsHeader)||void 0===e?void 0:e.find(Xm.COLS_HEADER_ITEM_CLASS);if(c){for(var u=n.get(),d=u.colSpan,h=o.table.selection.getCellPoint(n),p=Object(Hf["a"])(h,2),f=(p[0],p[1]),g=f,m=0,v=0;v<d;v++){var b=c.eq(f+v).get();if(m+b.offsetWidth/2>t.offsetX){g=f+v;break}if(m+b.offsetWidth>t.offsetX){g=f+v+1;break}m+=b.offsetWidth}o.showPlaceHolder(g,g!==f)}}}},o.onDragColEnd=function(){var t,e;o.unbindDragColEvent();var n=o.draggingHeader||{},r=n.index,i=n.count,a=n.isNext;if(o.draggingHeader&&void 0!==r&&void 0!==i){var s=o.table,l=s.command,c=s.selection,u=c.getSelectArea(),d=null===(t=o.table.wrapper)||void 0===t?void 0:t.find(Xm.COLS_HEADER_ITEM_CLASS);if(d){for(var h=[],p=u.begin.col;p<=u.end.col;p++){var f,g;h.push((null===(f=d.eq(p))||void 0===f||null===(g=f.get())||void 0===g?void 0:g.offsetWidth)||0)}if(l.mockCopy(),u.begin.col>r){var m=a?r-1:r;l.removeCol(),l.insertColAt(m,i,a,h,!0),c.selectCol(m,m+i-1),l.mockPaste(!0)}else{l.removeCol();var v=(a?r-1:r)-i;l.insertColAt(v,i,a,h,!0),c.selectCol(v+1,v+i),l.mockPaste(!0)}null===(e=o.placeholder)||void 0===e||e.css("display","none"),o.draggingHeader=void 0,o.dragging=void 0}}},o.onDragRow=function(t){var e;if(t.stopPropagation(),o.draggingHeader&&t.target&&(void 0===o.dragging&&(o.dragging={x:t.offsetX,y:t.offsetY}),!(Math.abs(o.dragging.y-t.offsetY)<3))){o.dragging.y=t.offsetY,o.draggingHeader.element.removeClass("dragging");var n=Object(D["$"])(t.target).closest("td"),r=Object(D["$"])(t.target).closest(Xm.ROWS_HEADER_ITEM_CLASS);if(0!==n.length||0!==r.length)if(r.length>0){var i,a=null===(i=o.rowsHeader)||void 0===i?void 0:i.find(Xm.ROWS_HEADER_ITEM_CLASS).toArray().findIndex((function(t){return t.equal(r)}));if(void 0===a)return;var s=a,l=t.offsetY>r.get().offsetHeight/2?s+1:s;o.showPlaceHolder(l,l!==s)}else{var c=null===(e=o.rowsHeader)||void 0===e?void 0:e.find(Xm.ROWS_HEADER_ITEM_CLASS);if(c){for(var u=n.get().rowSpan,d=o.table.selection.getCellPoint(n),h=Object(Hf["a"])(d,1),p=h[0],f=p,g=0,m=0;m<u;m++){var v=c[p+m];if(g+v.offsetHeight/2>t.offsetY){f=p+m;break}if(g+v.offsetHeight>t.offsetY){f=p+m+1;break}g+=v.offsetHeight}o.showPlaceHolder(f,f!==p)}}}},o.onDragRowEnd=function(){var t;o.unbindDragRowEvent();var e=o.draggingHeader||{},n=e.index,r=e.count,i=e.isNext;if(o.draggingHeader&&void 0!==n&&void 0!==r){var a=o.table,s=a.command,l=a.selection,c=l.getSelectArea(),u=c.begin;c.end;if(s.mockCopy(),u.row>n){var d=i?n-1:n;s.removeRow(),s.insertRowAt(d,r,!i,!0),l.selectRow(n,n+r-1),s.mockPaste(!0)}else{s.removeRow();var h=(i?n-1:n)-r;s.insertRowAt(h,r,!i,!0),l.selectRow(h+1,h+r),s.mockPaste(!0)}null===(t=o.placeholder)||void 0===t||t.css("display","none"),o.draggingHeader=void 0,o.dragging=void 0}},o.menuSets=new WeakSet,o.onMenuInputMousedown=function(t){t.stopPropagation()},o.handleHighlightRow=function(){var t=o.table.selection,e=t.tableModel;if(e){var n=Object(_["a"])({},t.getSelectArea());n.allCol=!0,n.begin={row:n.begin.row,col:0},n.end={row:n.end.row,col:e.cols-1},t.showHighlight(n)}},o.handleHighlightCol=function(){var t=o.table.selection,e=t.tableModel;if(e){var n=Object(_["a"])({},t.getSelectArea());n.allRow=!0,n.begin={row:0,col:n.begin.col},n.end={row:e.rows-1,col:n.end.col},t.showHighlight(n)}},o.handleHighlightTable=function(){var t=o.table.selection,e=t.tableModel;if(e){var n=Object(_["a"])({},t.getSelectArea());n.allRow=!0,n.allCol=!0,n.begin={row:0,col:0},n.end={row:e.rows-1,col:e.cols-1},t.showHighlight(n)}},o.table=r,o.editor=t,o.COL_MIN_WIDTH=i.col_min_width,o.ROW_MIN_HEIGHT=i.row_min_height,o.MAX_INSERT_NUM=i.max_insert_num,o}return Object(B["a"])(n,[{key:"init",value:function(){var t=this.table.wrapper;t&&(this.tableRoot=t.find(Xm.TABLE_CLASS),this.colsHeader=t.find(Xm.COLS_HEADER_CLASS),this.rowsHeader=t.find(Xm.ROWS_HEADER_CLASS),this.tableHeader=t.find(Xm.HEADER_CLASS),this.viewport=t.find(Xm.VIEWPORT),this.menuBar=t.find(Xm.MENUBAR_CLASS),this.placeholder=t.find(Xm.PLACEHOLDER_CLASS),this.renderRowBars(),this.renderColBars(),this.bindEvents())}},{key:"renderRowBars",value:function(){var t,e,n,r,i,o,a,s,l=this,c=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],u=null===(t=this.tableRoot)||void 0===t?void 0:t.get();if(u&&(null===(e=this.rowDeleteButton)||void 0===e||e.removeAllEvents(),this.rowDeleteButton=null===(n=this.rowsHeader)||void 0===n?void 0:n.find(Xm.ROW_DELETE_BUTTON_CLASS),null===(r=this.rowAddButton)||void 0===r||r.removeAllEvents(),this.rowAddButton=null===(i=this.rowsHeader)||void 0===i?void 0:i.find(Xm.ROW_ADD_BUTTON_CLASS),this.rowAddButtonSplit=null===(o=this.rowAddButton)||void 0===o?void 0:o.find(Xm.ROW_ADD_BUTTON_SPLIT_CLASS),null===(a=this.rowDeleteButton)||void 0===a||a.on("mouseover",(function(t){return l.handleHighlightRow()})).on("mouseleave",(function(t){return l.hideHighlight(t)})).on("mousedown",(function(t){t.preventDefault(),l.table.command["removeRow"]()})),null===(s=this.rowAddButton)||void 0===s||s.on("mouseenter",(function(){var t;l.hideRowAddButtonTimeount&&clearTimeout(l.hideRowAddButtonTimeount),null===(t=l.rowsHeader)||void 0===t||t.css("z-index",128)})).on("mouseleave",(function(){l.hideRowAddButtonTimeount=setTimeout((function(){var t,e;null===(t=l.rowAddButton)||void 0===t||t.hide(),null===(e=l.rowsHeader)||void 0===e||e.css("z-index",1),l.moveRowIndex=-1}),200)})).on("mousedown",(function(t){t.preventDefault(),l.table.command.insertRowAt(l.moveRowIndex,1,"down"!==l.rowAddAlign)})),c)){var d,h,p,f,g=u.rows,m=(null===g||void 0===g?void 0:g.length)||0,v=null===(d=this.rowsHeader)||void 0===d?void 0:d.find(Xm.ROWS_HEADER_ITEM_CLASS);if(v)for(var b=0;b<m;b++){var y=Object(D["getComputedStyle"])(g[b],"height"),w=v[b],x=null===w||void 0===w?void 0:w.style.height;w&&y!==x&&(w.style.height=y)}var C=null===(h=this.rowsHeader)||void 0===h?void 0:h.find(Xm.ROWS_HEADER_TRIGGER_CLASS),k=this.tableRoot.width(),A=(null===(p=this.table.wrapper)||void 0===p?void 0:p.width())||0,S=k<A?k:A,E=S+((null===(f=this.rowsHeader)||void 0===f?void 0:f.width())||0)-1;null===C||void 0===C||C.each((function(t){var e=t.style.width;e!==E+"px"&&(t.style.width=E+"px")}))}}},{key:"renderColBars",value:function(){var t,e,n,r,i,o,a,s,l,c,u=this,d=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],h=null===(t=this.tableRoot)||void 0===t?void 0:t.get();if(h){var p=Object(D["removeUnit"])(Object(D["getComputedStyle"])(h,"width"));null===(e=this.colDeleteButton)||void 0===e||e.removeAllEvents(),this.colDeleteButton=null===(n=this.table.wrapper)||void 0===n?void 0:n.find(Xm.COL_DELETE_BUTTON_CLASS),null===(r=this.colAddButton)||void 0===r||r.removeAllEvents(),this.colAddButton=null===(i=this.colsHeader)||void 0===i?void 0:i.find(Xm.COL_ADD_BUTTON_CLASS),this.colAddButtonSplit=null===(o=this.colAddButton)||void 0===o?void 0:o.find(Xm.COL_ADD_BUTTON_SPLIT_CLASS),null===(a=this.colDeleteButton)||void 0===a||a.on("mouseover",(function(t){return u.handleHighlightCol()})).on("mouseleave",(function(t){return u.hideHighlight(t)})).on("mousedown",(function(t){t.preventDefault(),u.table.command["removeCol"]()})),null===(s=this.colAddButton)||void 0===s||s.on("mouseenter",(function(){u.hideColAddButtonTimeount&&clearTimeout(u.hideColAddButtonTimeount)})).on("mouseleave",(function(){u.hideColAddButtonTimeount=setTimeout((function(){var t;null===(t=u.colAddButton)||void 0===t||t.hide(),u.moveColIndex=-1}),200)})).on("mousedown",(function(t){t.preventDefault(),u.moveColIndex>-1&&u.table.command.insertColAt(u.moveColIndex,1,"right"!==u.colAddAlign)})),null===(l=this.tableRoot)||void 0===l||l.css("width","".concat(p,"px")),null===(c=this.colsHeader)||void 0===c||c.css("width","".concat(p,"px")),d&&this.renderColSize()}}},{key:"renderColSize",value:function(){var t,e,n,r,i,o=this,a=null===(t=this.tableRoot)||void 0===t?void 0:t.get();if(a){var s=Object(D["removeUnit"])(Object(D["getComputedStyle"])(a,"width")),l=null===(e=this.tableRoot)||void 0===e?void 0:e.find("col");if(l){var c=!0,u={},d=0,h=0;l.each((function(t,e){var n=l[e],r=Object(D["removeUnit"])(Object(D["$"])(n).attributes("width"));r?(u[e]=r,d+=r,c=!1):h++}));var p=null===(n=this.colsHeader)||void 0===n?void 0:n.find(Xm.COLS_HEADER_ITEM_CLASS);if(p){var f=this.table.selection.tableModel;if(c){var g,m=[];null===f||void 0===f||null===(g=f.table)||void 0===g||g.forEach((function(t){t.forEach((function(t,e){m[e]||o.table.helper.isEmptyModelCol(t)||t.isMulti||!t.element||(m[e]=Object(D["removeUnit"])(Object(D["getComputedStyle"])(t.element,"width")))}))}));for(var v=0,b=0,y=0;y<l.length;y++)m[y]?b+=m[y]:v++;var w=0;v>0&&(w=Math.round(1e4*Math.round((s-b)/v))/1e4);for(var x=0;x<l.length;x++){var C,k,A=m[x]||w;null===(C=p.eq(x))||void 0===C||C.css("width",A+"px"),null===(k=l.eq(x))||void 0===k||k.attributes("width",A)}}else if(h){var S=Math.round((s-d)/h*1e4)/1e4;l.each((function(t,e){var n,r,i=void 0===u[e]?S:u[e];null===(n=p.eq(e))||void 0===n||n.css("width",i+"px"),null===(r=l.eq(e))||void 0===r||r.attributes("width",i)}))}else l.each((function(t,e){var n=Math.round(s*u[e]/d*1e4)/1e4,r=p[e],i=null===r||void 0===r?void 0:r.style.width;r&&i!==n+"px"&&(r.style.width=n+"px")}));var E=null===(r=this.colsHeader)||void 0===r?void 0:r.find(Xm.COLS_HEADER_TRIGGER_CLASS),O=((null===f||void 0===f?void 0:f.height)||0)+((null===(i=this.colsHeader)||void 0===i?void 0:i.height())||0);null===E||void 0===E||E.each((function(t){var e=t.style.height;e!==O+"px"&&(t.style.height=O+"px")}))}}}}},{key:"bindEvents",value:function(){var t,e,n,r,i,o,a,s,l,c,u,d,h,p,f,g,m,v,b=this;null===(t=this.colsHeader)||void 0===t||t.on(D["isMobile"]?"touchstart":"mousedown",this.onMouseDownColsHeader).on("mouseup",this.onClickColsHeader).on("dragstart",this.onDragStartColsHeader),null===(e=this.rowsHeader)||void 0===e||e.on(D["isMobile"]?"touchstart":"mousedown",this.onMouseDownRowsHeader).on("mouseup",this.onClickRowsHeader).on("dragstart",this.onDragStartRowsHeader),null===(n=this.tableHeader)||void 0===n||n.on("mousedown",this.onClickTableHeader),null===(r=this.table.wrapper)||void 0===r||r.on("contextmenu",(function(t){return t.preventDefault()})),null===(i=this.tableRoot)||void 0===i||i.on("contextmenu",(function(t){return t.preventDefault()})),null===(o=this.colsHeader)||void 0===o||o.on("contextmenu",(function(t){return t.preventDefault()})),null===(a=this.rowsHeader)||void 0===a||a.on("contextmenu",(function(t){return t.preventDefault()})),null===(s=this.tableRoot)||void 0===s||s.on("mousedown",(function(t){return b.onTableMouseDown(t)})),null===(l=this.menuBar)||void 0===l||l.on("click",(function(t){return b.handleClickMenu(t)})),null===(c=this.menuBar)||void 0===c||c.on("mouseover",(function(t){return b.handleHoverMenu(t)})),null===(u=this.menuBar)||void 0===u||u.on("mouseleave",(function(t){return b.hideHighlight(t)}));var y=this.editor;null===(d=this.viewport)||void 0===d||d.on(D["isMobile"]?"touchstart":"mousedown",(function(t){var e;if(t.target){var n=Object(D["$"])(t.target);if(Object(D["isEngine"])(y)&&t.target&&(null===(e=b.viewport)||void 0===e?void 0:e.equal(n))){t.preventDefault(),t.stopPropagation();var r=y.change,i=r.range.get();y.card.focusPrevBlock(b.table,i,!0),y.card.activate(i.startNode,D["CardActiveTrigger"].MOUSE_DOWN),r.range.select(i)}}}));var w=null;null===(h=this.colsHeader)||void 0===h||h.on("mouseenter",(function(){b.hideColAddButtonTimeount&&clearTimeout(b.hideColAddButtonTimeount)})).on("mousemove",(function(t){w&&clearTimeout(w),w=setTimeout((function(){b.onMouseMoveColsHeader(t)}),200)})).on("mouseleave",(function(t){w&&clearTimeout(w),b.hideColAddButtonTimeount=setTimeout((function(){var t;null===(t=b.colAddButton)||void 0===t||t.hide()}),200)}));var x=null;null===(p=this.colsHeader)||void 0===p||p.find(Xm.COLS_HEADER_ITEM_CLASS).on("mouseenter",(function(t){x&&clearTimeout(x),x=setTimeout((function(){t.target&&Gm(Object(D["$"])(t.target).closest(Xm.COLS_HEADER_ITEM_CLASS))}),200)})).on("mouseleave",(function(t){x&&clearTimeout(x),t.target&&Ym(Object(D["$"])(t.target).closest(Xm.COLS_HEADER_ITEM_CLASS))}));var C=null;null===(f=this.colsHeader)||void 0===f||f.find(Xm.COLS_HEADER_TRIGGER_CLASS).on("mouseenter",(function(t){C&&clearTimeout(C);var e=Object(D["$"])(t.target||[]);C=setTimeout((function(){Gm(e)}),200)})).on("mouseleave",(function(t){C&&clearTimeout(C),t.target&&Ym(Object(D["$"])(t.target))}));var k=null;null===(g=this.rowsHeader)||void 0===g||g.on("mouseenter",(function(){b.hideRowAddButtonTimeount&&clearTimeout(b.hideRowAddButtonTimeount)})).on("mousemove",(function(t){k&&clearTimeout(k),k=setTimeout((function(){var e;b.onMouseMoveRowsHeader(t),null===(e=b.rowsHeader)||void 0===e||e.css("z-index",128)}),200)})).on("mouseleave",(function(){k&&clearTimeout(k),b.hideRowAddButtonTimeount=setTimeout((function(){var t,e;null===(t=b.rowsHeader)||void 0===t||t.css("z-index",""),null===(e=b.rowAddButton)||void 0===e||e.hide()}),200)}));var A=null;null===(m=this.rowsHeader)||void 0===m||m.find(Xm.ROWS_HEADER_ITEM_CLASS).on("mouseenter",(function(t){A&&clearTimeout(A),A=setTimeout((function(){t.target&&Gm(Object(D["$"])(t.target).closest(Xm.ROWS_HEADER_ITEM_CLASS))}),200)})).on("mouseleave",(function(t){A&&clearTimeout(A),t.target&&Ym(Object(D["$"])(t.target).closest(Xm.ROWS_HEADER_ITEM_CLASS))}));var S=null;null===(v=this.rowsHeader)||void 0===v||v.find(Xm.ROWS_HEADER_TRIGGER_CLASS).on("mouseenter",(function(t){S&&clearTimeout(S);var e=Object(D["$"])(t.target||[]);S=setTimeout((function(){Gm(e)}),200)})).on("mouseleave",(function(t){S&&clearTimeout(S),t.target&&Ym(Object(D["$"])(t.target))}))}},{key:"onTableMouseDown",value:function(t){if(t.target){var e=Object(D["$"])(t.target).closest("td");e.length>0&&2===t.button&&this.table.activated?this.showContextMenu(t):this.hideContextMenu()}}},{key:"onMouseMoveColsHeader",value:function(t){var e,n;if(t.target&&this.colAddButton&&this.colAddButtonSplit){var r=Object(D["$"])(t.target),i=r.closest(Xm.COLS_HEADER_ITEM_CLASS);if(0!==i.length){var o=this.colsHeader.find(Xm.COLS_HEADER_ITEM_CLASS).toArray(),a=i.width(),s=this.colAddButton.width(),l=i.get().offsetLeft,c=o.findIndex((function(t){return t.equal(i)})),u=t.offsetX>a/2||r.hasClass("cols-trigger"),d=o[o.length-1].equal(i);u&&(l+=d?a-s/2:a),this.colAddAlign=u?"left":"right",this.moveColIndex=c,null===(e=this.colAddButton)||void 0===e||e.show("flex"),this.colAddButton.css("left","".concat(l,"px")),this.colAddButton.css("z-index",128);var h=((null===(n=this.table.selection.tableModel)||void 0===n?void 0:n.height)||0)+i.height()+4;this.colAddButtonSplit.css("height","".concat(h,"px")),this.colAddButtonSplit.css("left","".concat(d&&u?s-3+"px":""))}}}},{key:"onMouseMoveRowsHeader",value:function(t){var e,n;if(t.target&&this.rowAddButton&&this.rowAddButtonSplit){var r=Object(D["$"])(t.target),i=r.closest(Xm.ROWS_HEADER_ITEM_CLASS);if(0!==i.length){var o=this.rowsHeader.find(Xm.ROWS_HEADER_ITEM_CLASS).toArray(),a=i.height(),s=i.get().offsetTop,l=o.findIndex((function(t){return t.equal(i)})),c=t.offsetY>a/2||r.hasClass("rows-trigger");c&&(s+=a),this.moveRowIndex=l,this.rowAddButton.show("flex"),this.rowAddButton.css("top","".concat(s,"px")),this.rowAddAlign=c?"down":"up";var u=null===(e=this.viewport)||void 0===e?void 0:e.get(),d=((null===(n=this.table.selection.tableModel)||void 0===n?void 0:n.width)||0)+i.width()+4,h=Math.min(u.offsetWidth+4,d);this.rowAddButtonSplit.css("width","".concat(h,"px"))}}}},{key:"activeHeader",value:function(){var t,e,n,r=this.table.selection.getSelectArea();this.clearActiveStatus();var i=null===(t=this.colsHeader)||void 0===t?void 0:t.find(Xm.COLS_HEADER_ITEM_CLASS),o=null===(e=this.rowsHeader)||void 0===e?void 0:e.find(Xm.ROWS_HEADER_ITEM_CLASS),a=r.begin,s=r.end,l=r.allCol,c=r.allRow;if(o)for(var u=a.row;u<=s.row;u++)if(l){var d=o[u];(null===d||void 0===d?void 0:d.classList.contains("selected"))||null===d||void 0===d||d.classList.add("selected"),c&&!(null===d||void 0===d?void 0:d.classList.contains("no-dragger"))&&(null===d||void 0===d||d.classList.add("no-dragger"))}if(i)for(var h=a.col;h<=s.col;h++)if(c){var p=i[h];(null===p||void 0===p?void 0:p.classList.contains("selected"))||null===p||void 0===p||p.classList.add("selected"),l&&!(null===p||void 0===p?void 0:p.classList.contains("no-dragger"))&&(null===p||void 0===p||p.classList.add("no-dragger"))}var f=null===(n=this.tableHeader)||void 0===n?void 0:n.get();if(l&&c?(null===f||void 0===f?void 0:f.classList.contains("selected"))||null===f||void 0===f||f.classList.add("selected"):(null===f||void 0===f?void 0:f.classList.contains("selected"))&&(null===f||void 0===f||f.classList.remove("selected")),l&&!c){var g,m=null===(g=this.tableRoot)||void 0===g?void 0:g.find("tr").eq(a.row);if(m){var v,b,y=m.get().offsetTop;null===(v=this.rowDeleteButton)||void 0===v||v.show("flex"),null===(b=this.rowDeleteButton)||void 0===b||b.css("top","".concat(y-this.rowDeleteButton.height(),"px"))}}else{var w;null===(w=this.rowDeleteButton)||void 0===w||w.hide()}if(!l&&c){for(var x,C,k,A,S=0,E=a.col;E<=s.col;E++){var O;S+=(null===i||void 0===i||null===(O=i.eq(E))||void 0===O?void 0:O.width())||0}var T=(null===i||void 0===i||null===(x=i.eq(a.col))||void 0===x||null===(C=x.get())||void 0===C?void 0:C.offsetLeft)||0;null===(k=this.colDeleteButton)||void 0===k||k.show("flex"),null===(A=this.colDeleteButton)||void 0===A||A.css("left","".concat(T+S/2,"px"))}else{var _;null===(_=this.colDeleteButton)||void 0===_||_.hide()}}},{key:"clearActiveStatus",value:function(){var t,e,n,r=null===(t=this.colsHeader)||void 0===t?void 0:t.find(Xm.COLS_HEADER_ITEM_CLASS),i=null===(e=this.rowsHeader)||void 0===e?void 0:e.find(Xm.ROWS_HEADER_ITEM_CLASS);null===r||void 0===r||r.each((function(t){var e=t;e.classList.contains("selected")&&e.classList.remove("selected"),e.classList.contains("no-dragger")&&e.classList.remove("no-dragger")})),null===i||void 0===i||i.each((function(t){var e=t;e.classList.contains("selected")&&e.classList.remove("selected"),e.classList.contains("no-dragger")&&e.classList.remove("no-dragger")}));var o=null===(n=this.tableHeader)||void 0===n?void 0:n.get();(null===o||void 0===o?void 0:o.classList.contains("selected"))&&o.classList.remove("selected")}},{key:"refresh",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.renderColBars(t),this.renderRowBars(t),this.activeHeader()}},{key:"startChangeCol",value:function(t,e){var n,r,i;e.stopPropagation(),e.preventDefault();var o=t.parent(),a=o.get();this.table.selection.clearSelect(),this.dragging={x:e instanceof MouseEvent?e.clientX:e.touches[0].clientX,y:-1};var s=(null===(n=this.colsHeader)||void 0===n?void 0:n.find(Xm.COLS_HEADER_ITEM_CLASS).toArray().findIndex((function(t){return t.equal(o)})))||0;this.changeSize={trigger:{element:t,height:Object(D["removeUnit"])(Object(D["getComputedStyle"])(t.get(),"height")),width:Object(D["removeUnit"])(Object(D["getComputedStyle"])(t.get(),"width"))},element:o,width:Object(D["removeUnit"])(Object(D["getComputedStyle"])(a,"width")),height:-1,index:s,table:{width:(null===(r=this.table.selection.tableModel)||void 0===r?void 0:r.width)||0,height:(null===(i=this.table.selection.tableModel)||void 0===i?void 0:i.height)||0}},this.bindChangeSizeEvent()}},{key:"startChangeRow",value:function(t,e){var n,r,i;e.stopPropagation(),e.preventDefault();var o=t.parent(),a=o.get();this.table.selection.clearSelect(),this.dragging={x:-1,y:e instanceof MouseEvent?e.clientY:e.touches[0].clientY};var s=(null===(n=this.rowsHeader)||void 0===n?void 0:n.find(Xm.ROWS_HEADER_ITEM_CLASS).toArray().findIndex((function(t){return t.equal(o)})))||0;this.changeSize={trigger:{element:t,height:Object(D["removeUnit"])(Object(D["getComputedStyle"])(t.get(),"height")),width:Object(D["removeUnit"])(Object(D["getComputedStyle"])(t.get(),"width"))},element:o,width:-1,height:Object(D["removeUnit"])(Object(D["getComputedStyle"])(a,"height")),index:s,table:{width:(null===(r=this.table.selection.tableModel)||void 0===r?void 0:r.width)||0,height:(null===(i=this.table.selection.tableModel)||void 0===i?void 0:i.height)||0}},this.bindChangeSizeEvent()}},{key:"bindChangeSizeEvent",value:function(){var t,e;null===(t=this.colsHeader)||void 0===t||t.addClass("resize"),null===(e=this.rowsHeader)||void 0===e||e.addClass("resize"),document.addEventListener(D["isMobile"]?"touchmove":"mousemove",this.onChangeSize),document.addEventListener(D["isMobile"]?"touchend":"mouseup",this.onChangeSizeEnd),D["isMobile"]||document.addEventListener("mouseleave",this.onChangeSizeEnd)}},{key:"unbindChangeSizeEvent",value:function(){var t,e,n=this.table.root[0].querySelector("div.table-describe");n&&null===(n.style.width=this.table.getValue().width+"px")(t=this.colsHeader)||void 0===t||t.removeClass("resize"),null===(e=this.rowsHeader)||void 0===e||e.removeClass("resize"),document.removeEventListener(D["isMobile"]?"touchmove":"mousemove",this.onChangeSize),document.removeEventListener(D["isMobile"]?"touchend":"mouseup",this.onChangeSizeEnd),D["isMobile"]||document.removeEventListener("mouseleave",this.onChangeSizeEnd)}},{key:"onChangeColWidth",value:function(t){var e,n,r,i,o;if(this.dragging&&this.changeSize){var a=(t instanceof MouseEvent?t.clientX:t.touches[0].clientX)-this.dragging.x,s=Math.max(this.COL_MIN_WIDTH,this.changeSize.width+a);a=s-this.changeSize.width;var l=this.changeSize.table.width+a;this.changeSize.element.css("width",s+"px");var c=this.changeSize.element.get();null===(e=this.colsHeader)||void 0===e||e.css("width",l+"px");var u=null===(n=this.viewport)||void 0===n?void 0:n.get(),d=c.offsetLeft+c.offsetWidth;d-u.scrollLeft+20>u.offsetWidth?u.scrollLeft=d+20-u.offsetWidth:u.scrollLeft+u.offsetWidth===u.scrollWidth&&(u.scrollLeft=Math.max(0,l+34-u.offsetWidth)),this.clearActiveStatus(),this.hideContextMenu(),this.renderRowBars(),this.renderColSplitBars(this.changeSize.element,this.changeSize.trigger.element),null===(r=this.tableRoot)||void 0===r||null===(i=r.find("col").eq(this.changeSize.index))||void 0===i||i.attributes("width",s),null===(o=this.tableRoot)||void 0===o||o.css("width","".concat(l,"px"))}}},{key:"onChangeRowHeight",value:function(t){var e,n;if(this.dragging&&this.changeSize){var r=(t instanceof MouseEvent?t.clientY:t.touches[0].clientY)-this.dragging.y,i=Math.max(this.ROW_MIN_HEIGHT,this.changeSize.height+r);r=i-this.changeSize.height,this.changeSize.element.css("height",i+"px"),this.clearActiveStatus(),this.hideContextMenu(),this.renderRowSplitBars(this.changeSize.element,this.changeSize.trigger.element),null===(e=this.tableRoot)||void 0===e||null===(n=e.find("tr").eq(this.changeSize.index))||void 0===n||n.css("height","".concat(i,"px"))}}},{key:"renderColSplitBars",value:function(t,e){var n,r=(null===(n=this.table.selection.tableModel)||void 0===n?void 0:n.height)||0;e.addClass("dragging").css("height","".concat(r+t.height(),"px"))}},{key:"renderRowSplitBars",value:function(t,e){var n,r,i=null===(n=this.viewport)||void 0===n?void 0:n.get(),o=(null===(r=this.table.selection.tableModel)||void 0===r?void 0:r.width)||0,a=Math.min(i.offsetWidth-t.width(),o);e.addClass("dragging").css("width","".concat(a+t.width(),"px"))}},{key:"bindDragColEvent",value:function(){var t=this.table.wrapper;null===t||void 0===t||t.on("dragover",this.onDragCol),null===t||void 0===t||t.on("drop",this.onDragColEnd),null===t||void 0===t||t.on("dragend",this.onDragColEnd)}},{key:"unbindDragColEvent",value:function(){var t,e,n=this.table.wrapper,r=null===(t=this.colsHeader)||void 0===t?void 0:t.find(Xm.COLS_HEADER_ITEM_CLASS);null===r||void 0===r||r.removeClass("dragging"),null===(e=this.colsHeader)||void 0===e||e.removeClass("dragging"),null===n||void 0===n||n.off("dragover",this.onDragCol),null===n||void 0===n||n.off("drop",this.onDragColEnd),null===n||void 0===n||n.off("dragend",this.onDragColEnd)}},{key:"bindDragRowEvent",value:function(){var t=this.table.wrapper;null===t||void 0===t||t.on("dragover",this.onDragRow),null===t||void 0===t||t.on("drop",this.onDragRowEnd),null===t||void 0===t||t.on("dragend",this.onDragRowEnd)}},{key:"unbindDragRowEvent",value:function(){var t,e,n=this.table.wrapper,r=null===(t=this.rowsHeader)||void 0===t?void 0:t.find(Xm.ROWS_HEADER_ITEM_CLASS);null===r||void 0===r||r.removeClass("dragging"),null===(e=this.rowsHeader)||void 0===e||e.removeClass("dragging"),null===n||void 0===n||n.off("dragover",this.onDragRow),null===n||void 0===n||n.off("drop",this.onDragRowEnd),null===n||void 0===n||n.off("dragend",this.onDragRowEnd)}},{key:"showPlaceHolder",value:function(t,e){if(this.draggingHeader){var n=this.draggingHeader,r=n.element,i=n.minIndex,o=n.maxIndex;if(r.closest(Xm.COLS_HEADER_CLASS).length>0){var a,s,l,c,u,d,h,p,f,g,m;if(t===this.draggingHeader.index)return;if(i<=t&&t<=o+1)return delete this.draggingHeader.index,delete this.draggingHeader.isNext,void(null===(m=this.placeholder)||void 0===m||m.css("display","none"));this.draggingHeader.isNext=e,this.draggingHeader.index=t;var v=null===(a=this.colsHeader)||void 0===a?void 0:a.find(Xm.COLS_HEADER_ITEM_CLASS);if(!v)return;var b=this.draggingHeader.index!==v.length?v.eq(this.draggingHeader.index).get().offsetLeft+2:v.eq(this.draggingHeader.index-1).get().offsetLeft+v.eq(this.draggingHeader.index-1).get().offsetWidth+2,y=null===(s=this.viewport)||void 0===s?void 0:s.get(),w=y.scrollLeft,x=y.offsetWidth;b<w&&(y.scrollLeft=b-5),b>w+x&&(y.scrollLeft=b-x+5);var C=((null===(l=this.table.selection.tableModel)||void 0===l?void 0:l.height)||0)+v.height(),k=null===(c=this.viewport)||void 0===c?void 0:c.css("padding-top"),A=(null===(u=this.viewport)||void 0===u?void 0:u.css("padding-left"))||"0";null===(d=this.placeholder)||void 0===d||d.css("width","2px"),null===(h=this.placeholder)||void 0===h||h.css("height","".concat(C,"px")),null===(p=this.placeholder)||void 0===p||p.css("left",b-4+Object(D["removeUnit"])(A)+"px"),null===(f=this.placeholder)||void 0===f||f.css("top",k),null===(g=this.placeholder)||void 0===g||g.css("display","block")}else if(r.closest(Xm.ROWS_HEADER_CLASS).length>0){var S,E,O,T,_,M,N,P,L,j,I;if(t===this.draggingHeader.index)return;if(i<=t&&t<=o+1)return delete this.draggingHeader.index,delete this.draggingHeader.isNext,void(null===(I=this.placeholder)||void 0===I||I.css("display","none"));this.draggingHeader.index=t,this.draggingHeader.isNext=e;var R=null===(S=this.rowsHeader)||void 0===S?void 0:S.find(Xm.ROWS_HEADER_ITEM_CLASS);if(!R)return;var F=this.draggingHeader.index!==R.length?R.eq(this.draggingHeader.index).get().offsetTop+2:R.eq(this.draggingHeader.index-1).get().offsetTop+R.eq(this.draggingHeader.index-1).get().offsetHeight-2,B=(null===(E=this.table.selection.tableModel)||void 0===E?void 0:E.width)||0,z=null===(O=this.viewport)||void 0===O?void 0:O.css("padding-top"),H=(null===(T=this.viewport)||void 0===T?void 0:T.css("padding-left"))||"0",V=null===(_=this.colsHeader)||void 0===_?void 0:_.find(Xm.COLS_HEADER_ITEM_CLASS);null===(M=this.placeholder)||void 0===M||M.css("height","2px"),null===(N=this.placeholder)||void 0===N||N.css("width","".concat(B,"px")),null===(P=this.placeholder)||void 0===P||P.css("left",H),null===(L=this.placeholder)||void 0===L||L.css("top",F+Object(D["removeUnit"])(z||"0")+((null===V||void 0===V?void 0:V.height())||0)-2+"px"),null===(j=this.placeholder)||void 0===j||j.css("display","block")}}}},{key:"removeRow",value:function(t){var e,n,r,i,o=null===(e=this.rowsHeader)||void 0===e?void 0:e.find(Xm.ROWS_HEADER_ITEM_CLASS),a=null===o||void 0===o||null===(n=o.eq(t))||void 0===n?void 0:n.get();a&&(null===(r=this.rowsHeader)||void 0===r||null===(i=r.get())||void 0===i||i.removeChild(a))}},{key:"removeCol",value:function(t){var e,n,r,i,o,a,s=null===(e=this.colsHeader)||void 0===e?void 0:e.find(Xm.COLS_HEADER_ITEM_CLASS),l=null===(n=this.colsHeader)||void 0===n?void 0:n.get(),c=null===s||void 0===s||null===(r=s.eq(t))||void 0===r?void 0:r.get();l&&c&&(null===(i=this.colsHeader)||void 0===i||i.css("width",l.offsetWidth-c.offsetWidth+"px"),l.removeChild(c),null===(o=this.tableRoot)||void 0===o||o.css("width",null===(a=this.colsHeader)||void 0===a?void 0:a.css("width")))}},{key:"showContextMenu",value:function(t){var e=this,n=this.editor;if(this.menuBar&&t.target&&this.table.wrapper&&n.scrollNode){t.preventDefault();var r=this.table.selection,i=this.menuBar.find(Xm.MENUBAR_ITEM_CLASS);i.removeClass("disabled"),i.each((function(t){var n=Object(D["$"])(t),i=n.attributes("data-action");if(e.getMenuDisabled(i))n.addClass("disabled");else{var o=n.find("input".concat(Xm.MENUBAR_ITEM_INPUT_CALSS));if(0===o.length)return;var a=o.get();e.menuSets.has(t)||(e.menuSets.add(t),o.on("blur",(function(){a.value=Math.min(parseInt(a.value,10)||1,e.MAX_INSERT_NUM).toString()})).on("keydown",(function(t){Object(D["isHotkey"])("enter",t)&&e.handleTriggerMenu(n)})),o.on("mousedown",e.onMenuInputMousedown));var s=r.getSelectArea(),l=["insertColLeft","insertColRight"].indexOf(i)>-1,c=["insertRowUp","insertRowDown"].indexOf(i)>-1;l&&(a.value="".concat(s.end.col-s.begin.col+1)),c&&(a.value="".concat(s.end.row-s.begin.row+1))}}));var o=this.menuBar.find("div.split");o.each((function(t){var e=Object(D["$"])(t),n=e.prev();while(n){if(n.hasClass("split")){e.remove();break}if(!n.hasClass("disabled"))break;n=n.prev()}n||e.remove()}));var a=Object(D["$"])(t.target),s=a.getBoundingClientRect()||{top:0,left:0},l=a.parent(),c=0,u=0;while(l&&l.closest(Xm.TABLE_WRAPPER_CLASS).length>0){var d=l.getBoundingClientRect()||{top:0,left:0};c+=s.top-d.top,u+=s.left-d.left,s=d,l=l.parent()}var h=this.table.wrapper.get().getBoundingClientRect(),p=n.scrollNode.getViewport();c+=t.offsetY;var f=this.menuBar.height(),g=h.top+c+f+4;if(g>p.bottom){var m=g-p.bottom;c-m<0&&h.top+c-m<p.top&&(m=h.top+c-p.top),c-=m}this.menuBar.css("left",u+t.offsetX+"px"),this.menuBar.css("top",c+"px"),this.contextVisible=!0}}},{key:"hideContextMenu",value:function(){var t,e;if(this.contextVisible){var n=null===(t=this.menuBar)||void 0===t?void 0:t.find(Xm.MENUBAR_ITEM_CLASS);null===n||void 0===n||n.removeClass("disabled"),this.contextVisible=!1,null===(e=this.menuBar)||void 0===e||e.css({top:"-99999px",left:"-99999px"})}}},{key:"getMenuDisabled",value:function(t){var e=this.table,n=e.selection,r=e.command;switch(t){case"cut":case"copy":return!n.selectArea||n.selectArea.count<=1;case"splitCell":return!n.hasMergeCell();case"mergeCell":return!n.selectArea;case"mockPaste":return!r.hasCopyData();case"removeCol":case"insertColLeft":case"insertColRight":return n.isColSelected();case"removeRow":case"insertRowUp":case"insertRowDown":return n.isRowSelected();default:return!1}}},{key:"handleClickMenu",value:function(t){if(t.target){var e=Object(D["$"])(t.target),n=e.closest(".table-menubar-item");0!==n.length&&"input"!==e.name&&(t.stopPropagation(),this.handleTriggerMenu(n))}}},{key:"handleTriggerMenu",value:function(t){if(!t.hasClass("disabled")){var e,n=t.attributes("data-action"),r=t.find("input".concat(Xm.MENUBAR_ITEM_INPUT_CALSS)),i=void 0;if(r.length>0)i=Math.min(parseInt((null===(e=r.get())||void 0===e?void 0:e.value)||"1",10),this.MAX_INSERT_NUM);this.table.command[n](i)}this.hideContextMenu()}},{key:"handleHoverMenu",value:function(t){if(t.target){var e=Object(D["$"])(t.target).closest(".table-menubar-item");if(0!==e.length){t.stopPropagation();var n=this.table.selection;if(!e.hasClass("disabled")){var r=e.attributes("data-action");switch(r){case"removeCol":this.handleHighlightCol();break;case"removeRow":this.handleHighlightRow();break;case"removeTable":this.handleHighlightTable();break;default:n.hideHighlight()}}}}}},{key:"hideHighlight",value:function(t){t.stopPropagation(),this.table.selection.hideHighlight()}},{key:"drawBackgroundColor",value:function(t){var e=this.table,n=e.selection,r=e.helper;n.each((function(e){!r.isEmptyModelCol(e)&&e.element&&(t&&"transparent"!==t?e.element.style.backgroundColor=t:e.element.style.removeProperty("background-color"))}))}},{key:"setAlign",value:function(t){var e=this.table,n=e.selection,r=e.helper;n.each((function(e){!r.isEmptyModelCol(e)&&e.element&&(t&&"top"!==t?e.element.style.verticalAlign=t:e.element.style.removeProperty("vertical-align"))}))}},{key:"destroy",value:function(){var t,e,n,r,i,o,a,s,l,c,u,d,h;null===(t=this.colsHeader)||void 0===t||t.removeAllEvents(),null===(e=this.rowsHeader)||void 0===e||e.removeAllEvents(),null===(n=this.tableHeader)||void 0===n||n.removeAllEvents(),null===(r=this.table.wrapper)||void 0===r||r.removeAllEvents(),null===(i=this.tableRoot)||void 0===i||i.removeAllEvents(),null===(o=this.menuBar)||void 0===o||o.removeAllEvents(),null===(a=this.viewport)||void 0===a||a.removeAllEvents(),null===(s=this.rowDeleteButton)||void 0===s||s.removeAllEvents(),null===(l=this.colDeleteButton)||void 0===l||l.removeAllEvents(),null===(c=this.colAddButton)||void 0===c||c.removeAllEvents(),null===(u=this.colsHeader)||void 0===u||u.removeAllEvents(),null===(d=this.rowAddButton)||void 0===d||d.removeAllEvents(),null===(h=this.rowsHeader)||void 0===h||h.removeAllEvents()}}]),n}(mm["EventEmitter2"]),tv=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(t,r){var i;return Object(F["a"])(this,n),i=e.call(this),i.editor=void 0,i.table=void 0,i.tableRoot=void 0,i.colsHeader=void 0,i.rowsHeader=void 0,i.tableHeader=void 0,i.tableModel=void 0,i.selectArea=void 0,i.selectRange=void 0,i.dragging=void 0,i.isShift=!1,i.prevMouseDownTd=void 0,i.prevOverTd=void 0,i.highlight=void 0,i.beginAllRow=void 0,i.beginAllCol=void 0,i.onTdMouseDown=function(t){i.selectRange=void 0;var e=i.editor;if(t.target&&Object(D["isEngine"])(e)){var n=e.change,r=Object(D["$"])(t.target),o=r.closest("td");if(0!==o.length&&o.inEditor()){var a=n.range.get(),s=i.getCellPoint(o),l=Object(Hf["a"])(s,2),c=l[0],u=l[1],d=!!o.attributes("table-cell-selection");if(i.isShift){var h={row:0,col:0};if(i.prevMouseDownTd){var p=i.getCellPoint(i.prevMouseDownTd),f=Object(Hf["a"])(p,2),g=f[0],m=f[1];h={row:g,col:m}}else if(i.selectArea&&(h=i.selectArea.begin,i.tableModel)){var v=i.tableModel.table[h.row][h.col];!i.table.helper.isEmptyModelCol(v)&&v.element&&(i.prevMouseDownTd=Object(D["$"])(v.element))}i.select(h,{row:c,col:u})}else{if(i.prevMouseDownTd=o,t instanceof MouseEvent&&2!==t.button&&i.select({row:c,col:u},{row:c,col:u}),"td"!==r.name||!d&&a.startNode.closest("td").equal(o)&&a.endNode.closest("td").equal(o))"td"===r.name&&t.preventDefault();else{if(t instanceof MouseEvent&&2===t.button&&r.attributes("table-cell-selection"))return;t.preventDefault(),i.focusCell(o)}var b=function(){i.select({row:c,col:u},{row:c,col:u}),i.dragging={trigger:{element:o}},i.addDragEvent()};if(t instanceof MouseEvent&&2===t.button)r.attributes("table-cell-selection")&&t.preventDefault();else{if("td"===r.name){var y=o.find(D["EDITABLE_SELECTOR"]);if(y.length>0){var w=y.last();if(w){var x,C;if(!w.isBlockCard())return b();if(((null===(x=w.get())||void 0===x?void 0:x.offsetTop)||0)+((null===(C=w.get())||void 0===C?void 0:C.clientHeight)||0)>(t instanceof MouseEvent?t:t.touches[0]).clientY)return b();var k=Object(D["$"])("<p><br /></p>");y.append(k);var A=e.change.range.get();A.select(k,!0).collapse(!1),e.change.apply(A)}}}b()}}}}},i.removeDragEvent=function(){var t,e;null===(t=i.tableRoot)||void 0===t||t.removeClass("drag-select"),null===(e=i.table.wrapper)||void 0===e||e.removeClass("drag-selecting"),document.removeEventListener(D["isMobile"]?"touchend":"mouseup",i.removeDragEvent),document.removeEventListener(D["isMobile"]?"touchmove":"mousemove",i.onDragMove),i.dragging=void 0},i.onDragMove=function(t){if(i.dragging&&t.target){var e,n,r=Object(D["$"])(t.target).closest("td");if(!(0===r.length||!r.inEditor()||i.prevOverTd&&r.equal(i.prevOverTd)))if(i.prevOverTd=r,i.dragging.trigger.element.equal(r))null===(e=i.table.wrapper)||void 0===e||e.removeClass("drag-selecting"),i.clearSelect();else null===(n=i.table.wrapper)||void 0===n||n.addClass("drag-selecting"),i.selectCell(i.dragging.trigger.element,r)}},i.onShiftKeydown=function(t){t.target&&i.tableModel&&Object(D["isEngine"])(i.editor)&&Object(D["isHotkey"])("shift",t)&&(i.isShift=!0)},i.onKeydown=function(t){if(t.target&&i.tableModel&&Object(D["isEngine"])(i.editor)){var e=Object(D["$"])(t.target).closest("td");if(0!==e.length&&e.inEditor()){var n=i.getCellPoint(e),r=Object(Hf["a"])(n,2),o=r[0],a=r[1];if(!(o<0||a<0))if(Object(D["isHotkey"])("shift+left",t)?i.selectLeft(t,e):Object(D["isHotkey"])("shift+right",t)?i.selectRigth(t,e):Object(D["isHotkey"])("shift+up",t)?i.selectUp(t,e):Object(D["isHotkey"])("shift+down",t)&&i.selectDown(t,e),Object(D["isHotkey"])("shift",t))i.isShift=!0;else{if(i.selectRange&&(i.isShift=!1,i.selectRange=void 0),Object(D["isHotkey"])("tab",t)||Object(D["isHotkey"])("mod",t)||Object(D["isHotkey"])("opt",t)||Object(D["isHotkey"])("shift",t)||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)return;setTimeout((function(){i.clearSelect()}),50)}}}},i.onShiftKeyup=function(t){!1===i.isShift&&i.selectRange&&(i.selectRange=void 0,i.clearSelect()),i.isShift=!1},i.table=r,i.editor=t,i}return Object(B["a"])(n,[{key:"init",value:function(){var t=this.table.wrapper;t&&(this.tableRoot=t.find(Xm.TABLE_CLASS),this.colsHeader=t.find(Xm.COLS_HEADER_CLASS),this.rowsHeader=t.find(Xm.ROWS_HEADER_CLASS),this.tableHeader=t.find(Xm.HEADER_CLASS),this.highlight=t.find(Xm.TABLE_HIGHLIGHT_CLASS),this.render("init"),this.bindEvents())}},{key:"render",value:function(t){this.refreshModel();var e=this.tableModel;if(e){var n=this.getSelectArea(),r=n.begin,i=n.end;if("mergeCell"===t||"splitCell"===t){var o=r.row<0?0:Math.min(r.row,e.rows-1),a=r.col<0?0:Math.min(r.col,e.cols-1),s=e.table[o][a];this.table.helper.isEmptyModelCol(s)&&(s=e.table[s.parent.row][s.parent.col]),!this.table.helper.isEmptyModelCol(s)&&s.element&&"mergeCell"===t&&(this.clearSelect(),this.selectCellRange(s.element))}else if("removeRow"===t){var l=r.row<0?0:Math.min(r.row,e.rows-1),c=e.table[l][0];!this.table.helper.isEmptyModelCol(c)&&c.element&&this.focusCell(c.element)}else if("removeCol"===t){var u=r.col<0?0:Math.min(r.col,e.cols-1),d=e.table[0][u];!this.table.helper.isEmptyModelCol(d)&&d.element&&this.focusCell(d.element)}else this.select(r,i);this.renderBorder()}}},{key:"renderBorder",value:function(){var t=this,e=this.tableModel;e&&e.table.forEach((function(n,r){n.forEach((function(n,i){if(!t.table.helper.isEmptyModelCol(n)){if(!n.element)return;var o=r===e.rows-1,a=i===e.cols-1;n.isMulti&&(i+n.colSpan===e.cols&&(a=!0),r+n.rowSpan===e.rows&&(o=!0)),o?n.element.classList.contains("table-last-column")||n.element.classList.add("table-last-column"):n.element.classList.contains("table-last-column")&&n.element.classList.remove("table-last-column"),a?n.element.classList.contains("table-last-row")||n.element.classList.add("table-last-row"):n.element.classList.contains("table-last-row")&&n.element.classList.remove("table-last-row")}}))}))}},{key:"bindEvents",value:function(){var t;document.addEventListener("keydown",this.onShiftKeydown),document.addEventListener("keyup",this.onShiftKeyup),null===(t=this.table.wrapper)||void 0===t||t.on("mousedown",this.onTdMouseDown).on("keydown",this.onKeydown)}},{key:"unbindEvents",value:function(){var t;document.removeEventListener("keydown",this.onShiftKeydown),document.removeEventListener("keyup",this.onShiftKeyup),null===(t=this.table.wrapper)||void 0===t||t.off("mousedown",this.onTdMouseDown).off("keydown",this.onKeydown)}},{key:"refreshModel",value:function(){this.tableRoot&&0!==this.tableRoot.length&&(this.tableModel=this.table.helper.getTableModel(this.tableRoot))}},{key:"each",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.tableModel;if(n){var r=this.getSelectArea(),i=r.begin,o=r.end;if(!(i.row<0||i.col<0))if(e)for(var a=o.row;a>-1&&a>=i.row;a--)for(var s=o.col;s>-1&&s>=i.col;s--){var l=n.table[a][s];t(l,a,s)}else for(var c=i.row;c>-1&&c<=o.row;c++)for(var u=i.col;u>-1&&u<=o.col;u++){var d=n.table[c][u];t(d,c,u)}}}},{key:"getCellPoint",value:function(t){var e,n,r,i=this;if("td"!==t.name)return[-1,-1];var o=null===(e=t.parent())||void 0===e?void 0:e.index();if(void 0===o||o<0)return[-1,-1];var a=null===(n=this.tableModel)||void 0===n||null===(r=n.table[o])||void 0===r?void 0:r.findIndex((function(e){var n;return t.equal((i.table.helper.isEmptyModelCol(e)?null===(n=i.tableModel)||void 0===n?void 0:n.table[e.parent.row][e.parent.col]:e).element)}));return void 0===a||a<0?[-1,-1]:[o,a]}},{key:"getCellIndex",value:function(t,e){if(!this.tableModel)return 0;for(var n=this.tableModel.table[t],r=0,i=0;i<e;i++){var o=n[i];!this.table.helper.isEmptyModelCol(o)&&o.element&&r++}return r}},{key:"getSingleCell",value:function(){return this.prevMouseDownTd?this.prevMouseDownTd:null}},{key:"getSingleCellPoint",value:function(){var t=this.getSingleCell();return t?this.getCellPoint(t):[-1,-1]}},{key:"getSelectArea",value:function(){if(this.selectArea)return this.selectArea;var t=this.getSingleCellPoint();if(!this.tableModel||-1===t[0])return{begin:{row:-1,col:-1},end:{row:-1,col:-1},count:0,allCol:!1,allRow:!1};var e=this.tableModel,n=e.cols,r=e.rows,i=e.table,o=i[t[0]][t[1]];return this.table.helper.isEmptyModelCol(o)&&(o=i[o.parent.row][o.parent.col],o.element&&(t=this.getCellPoint(Object(D["$"])(o.element)))),{begin:{row:t[0],col:t[1]},end:{row:t[0],col:t[1]},count:-1===t[0]?0:1,allCol:1===n,allRow:1===r}}},{key:"selectCol",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this.tableModel){if(this.isShift)if(this.beginAllCol)t<this.beginAllCol?e=this.beginAllCol:t=this.beginAllCol;else if(this.prevMouseDownTd){var n=this.getCellPoint(this.prevMouseDownTd),r=Object(Hf["a"])(n,2),i=(r[0],r[1]);t=i,this.beginAllCol=i}else if(this.selectArea&&(t=this.selectArea.begin.col,this.tableModel)){var o=this.tableModel.table[this.selectArea.begin.row][this.selectArea.begin.col];!this.table.helper.isEmptyModelCol(o)&&o.element&&this.focusCell(o.element)}this.select({row:0,col:t},{row:this.tableModel.rows-1,col:e})}}},{key:"selectRow",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this.tableModel){if(this.isShift)if(this.beginAllRow)t<this.beginAllRow?e=this.beginAllRow:t=this.beginAllRow;else if(this.prevMouseDownTd){var n=this.getCellPoint(this.prevMouseDownTd),r=Object(Hf["a"])(n,2),i=r[0];r[1];t=i,this.beginAllRow=i}else if(this.selectArea&&(t=this.selectArea.begin.row,this.tableModel)){var o=this.tableModel.table[this.selectArea.begin.row][this.selectArea.begin.col];!this.table.helper.isEmptyModelCol(o)&&o.element&&this.focusCell(o.element)}this.select({row:t,col:0},{row:e,col:this.tableModel.cols-1})}}},{key:"selectCell",value:function(t,e){if("td"===t.name&&"td"===e.name){var n=this.getCellPoint(t),r=this.getCellPoint(e);this.select({row:n[0],col:n[1]},{row:r[0],col:r[1]})}}},{key:"clearSelect",value:function(){this.select({row:-1,col:-1},{row:-1,col:-1})}},{key:"select",value:function(t,e){var n,r=this,i=this;if(this.tableModel){var o=t.row===e.row&&t.col===e.col,a=Math.min(t.row,e.row),s=Math.max(t.row,e.row),l=Math.min(t.col,e.col),c=Math.max(t.col,e.col);null===(n=this.tableRoot)||void 0===n||n.find("td[table-cell-selection]").removeAttributes("table-cell-selection");var u=function t(){if(!i.tableModel)return{beginCol:l,beginRow:a,endCol:c,endRow:s};for(var e=a;e<=s;e++){var n=i.tableModel.table[e];if(n)for(var r=l;r<=c;r++){var o=n[r];if(o)if(i.table.helper.isEmptyModelCol(o)){var u=i.tableModel.table[o.parent.row][o.parent.col];if(i.table.helper.isEmptyModelCol(u))continue;if(u.colSpan+o.parent.col-1===l&&o.parent.col<l)return l=o.parent.col,t();if(u.rowSpan+o.parent.row-1===a&&o.parent.row<a)return a=o.parent.row,t();if(u.rowSpan>1&&s<u.rowSpan-1+o.parent.row)return s=u.rowSpan-1+o.parent.row,t();if(u.colSpan>1&&c<u.colSpan-1+o.parent.col)return c=u.colSpan-1+o.parent.col,t()}else{if(r!==l&&o.colSpan+r-1===l)return l=r,t();if(e!==a&&o.rowSpan+e-1===a)return a=e,t();if(o.rowSpan>1&&s<o.rowSpan-1+e)return s=o.rowSpan-1+e,t();if(o.colSpan>1&&c<o.colSpan-1+r)return c=o.colSpan-1+r,t()}}}return{beginCol:l,beginRow:a,endCol:c,endRow:s}},d=u();a=d.beginRow,s=d.endRow,l=d.beginCol,c=d.endCol;var h=0;if(a>=0&&l>=0&&s<this.tableModel.rows&&c<this.tableModel.cols)for(var p=a;p<=s;p++)for(var f=l;f<=c;f++){var g=this.tableModel.table[p];if(g){var m=g[f];m&&(this.table.helper.isEmptyModelCol(m)||(!o&&m.element&&Object(D["$"])(m.element).attributes("table-cell-selection","true"),h++))}}if(o&&t.row>-1&&t.col>-1){var v,b=this.tableModel.table[t.row][t.col];b&&!this.table.helper.isEmptyModelCol(b)&&b.element&&!(null===(v=this.prevMouseDownTd)||void 0===v?void 0:v.equal(b.element))&&this.focusCell(b.element)}var y=0===l&&c===this.tableModel.cols-1,w=0===a&&s===this.tableModel.rows-1;y&&!this.beginAllRow?this.beginAllRow=a:!y&&this.beginAllRow&&(this.beginAllRow=void 0),w&&!this.beginAllCol?this.beginAllCol=l:!w&&this.beginAllCol&&(this.beginAllCol=void 0),this.selectArea=0===h||o?void 0:{begin:{row:a,col:l},end:{row:s,col:c},count:h,allCol:y,allRow:w},this.emit("select",this.selectArea),setTimeout((function(){var t=r.table.activated,e=r.table.getValue();if(!t||!e.showDescribe||"top"!==e.describePosition&&e.describePosition){if(!t||!e.showDescribe&&"top"!==!e.describePosition){var n=r.table.root[0].querySelector(".table-describe");n&&(n.style.marginBottom=0)}}else{var i=r.table.root[0].querySelector(".table-describe");i&&(i.style.marginBottom="10px")}}),0)}}},{key:"focusCell",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.editor;if(Object(D["isEngine"])(n)){var r=n.change;Object(D["isNode"])(t)&&(t=Object(D["$"])(t));var i,o=r.range.get(),a=t.find(D["EDITABLE_SELECTOR"]);if(a.length>0)o.select(a,!0).shrinkToElementNode().shrinkToTextNode().collapse(e),setTimeout((function(){r.range.select(o)}),20),null===(i=a.get())||void 0===i||i.focus(),this.prevMouseDownTd=t,this.selectCell(t,t)}}},{key:"selectCellRange",value:function(t){var e,n=this.editor;if(Object(D["isEngine"])(n)){var r=n.change;Object(D["isNode"])(t)&&(t=Object(D["$"])(t));var i=r.range.get(),o=t.find(D["EDITABLE_SELECTOR"]);if(0!==o.length){i.select(o,!0).shrinkToElementNode();var a,s=o.children(),l=s.eq(0);if(1===s.length&&"br"===(null===l||void 0===l||null===(e=l.first())||void 0===e?void 0:e.name))i.collapse(!1),r.range.select(i),null===(a=o.get())||void 0===a||a.focus();else r.range.select(i);this.prevMouseDownTd=t,this.selectCell(t,t)}}}},{key:"addDragEvent",value:function(){var t;null===(t=this.tableRoot)||void 0===t||t.addClass("drag-select"),document.addEventListener(D["isMobile"]?"touchend":"mouseup",this.removeDragEvent,{passive:!0}),document.addEventListener(D["isMobile"]?"touchmove":"mousemove",this.onDragMove,{passive:!0})}},{key:"selectLeft",value:function(t,e){var n,r,i,o=this.editor;if(Object(D["isEngine"])(o)){var a=this.getCellPoint(e),s=Object(Hf["a"])(a,2),l=s[0],c=s[1];if(!(l<0||c<0)){var u=(null===(n=this.selectArea)||void 0===n?void 0:n.count)||0,d=o.change.range.get();if(0===u){if(this.selectRange&&"right"===this.selectRange.type&&d.endOffset!==this.selectRange.startOffset)return;this.selectRange={type:"left",startOffset:d.startOffset,endOffset:d.endOffset};var h=d.startNode;if(0!==d.startOffset)return;if(h.prev())return;var p=h.parent();while(p&&!p.isEditable()){if(p.prev())return;p=p.parent()}}var f=(null===(r=this.selectArea)||void 0===r?void 0:r.begin)||{row:l,col:c},g=(null===(i=this.selectArea)||void 0===i?void 0:i.end)||{row:l,col:c},m=f.col!==c,v=m?f.col-1:g.col-1;v<0||(t.preventDefault(),v===c&&2===u&&(v=-1),m?this.select(Object(_["a"])(Object(_["a"])({},f),{},{col:v}),g):this.select(f,Object(_["a"])(Object(_["a"])({},g),{},{col:v})))}}}},{key:"selectRigth",value:function(t,e){var n,r,i,o=this.editor;if(Object(D["isEngine"])(o)&&this.tableModel){t.stopPropagation();var a=this.getCellPoint(e),s=Object(Hf["a"])(a,2),l=s[0],c=s[1];if(!(l<0||c<0)){var u=(null===(n=this.selectArea)||void 0===n?void 0:n.count)||0,d=o.change.range.get();if(0===u){var h;if(this.selectRange&&"left"===this.selectRange.type&&d.startOffset!==this.selectRange.endOffset)return;this.selectRange={type:"right",startOffset:d.startOffset,endOffset:d.endOffset};var p=d.endNode;if(p.isText()&&d.endOffset!==p.text().length)return;var f=p.children();if(p.isElement()&&d.endOffset!==f.length&&"br"!==(null===(h=p.last())||void 0===h?void 0:h.name))return;if(p.next())return;var g=p.parent();while(g&&!g.isEditable()){if(g.next())return;g=g.parent()}}var m=this.tableModel.cols,v=(null===(r=this.selectArea)||void 0===r?void 0:r.begin)||{row:l,col:c},b=(null===(i=this.selectArea)||void 0===i?void 0:i.end)||{row:l,col:c},y=v.col!==c,w=y?v.col+1:b.col+1;w>m-1||(t.preventDefault(),w===c&&2===u&&(w=-1),y?this.select(Object(_["a"])(Object(_["a"])({},v),{},{col:w}),b):this.select(v,Object(_["a"])(Object(_["a"])({},b),{},{col:w})))}}}},{key:"selectUp",value:function(t,e){var n,r,i,o=this.editor;if(Object(D["isEngine"])(o)&&this.tableModel){var a=this.getCellPoint(e),s=Object(Hf["a"])(a,2),l=s[0],c=s[1];if(!(l<0||c<0)){var u=(null===(n=this.selectArea)||void 0===n?void 0:n.count)||0,d=o.change.range.get();if(0===u){if(this.selectRange&&"bottom"===this.selectRange.type&&d.endOffset!==this.selectRange.startOffset)return;this.selectRange={type:"top",startOffset:d.startOffset,endOffset:d.endOffset};var h=d.getBoundingClientRect(),p=e.find(D["EDITABLE_SELECTOR"]).getBoundingClientRect();if(0!==h.width&&0===h.height&&h.top-((null===p||void 0===p?void 0:p.top)||0)>10)return}var f=(null===(r=this.selectArea)||void 0===r?void 0:r.begin)||{row:l,col:c},g=(null===(i=this.selectArea)||void 0===i?void 0:i.end)||{row:l,col:c},m=f.row!==l,v=m?f.row-1:g.row-1;t.preventDefault(),v<0||(v===l&&2===u&&(v=-1),m?this.select(Object(_["a"])(Object(_["a"])({},f),{},{row:v}),g):this.select(f,Object(_["a"])(Object(_["a"])({},g),{},{row:v})))}}}},{key:"selectDown",value:function(t,e){var n,r,i,o=this.editor;if(Object(D["isEngine"])(o)&&this.tableModel){var a=this.getCellPoint(e),s=Object(Hf["a"])(a,2),l=s[0],c=s[1];if(!(l<0||c<0)){var u=(null===(n=this.selectArea)||void 0===n?void 0:n.count)||0,d=o.change.range.get();if(d.shrinkToElementNode(),0===u){if(this.selectRange&&"top"===this.selectRange.type&&d.startOffset!==this.selectRange.endOffset)return;this.selectRange={type:"bottom",startOffset:d.startOffset,endOffset:d.endOffset};var h=d.getBoundingClientRect(),p=e.find(D["EDITABLE_SELECTOR"]).getBoundingClientRect();if(0!==h.width&&0===h.height&&((null===p||void 0===p?void 0:p.bottom)||0)-h.bottom>10)return}var f=this.tableModel.rows,g=(null===(r=this.selectArea)||void 0===r?void 0:r.begin)||{row:l,col:c},m=(null===(i=this.selectArea)||void 0===i?void 0:i.end)||{row:l,col:c},v=g.row!==l,b=v?g.row+1:m.row+1;b>f-1||(t.preventDefault(),b===l&&2===u&&(b=-1),v?this.select(Object(_["a"])(Object(_["a"])({},g),{},{row:b}),m):this.select(g,Object(_["a"])(Object(_["a"])({},m),{},{row:b})))}}}},{key:"getSelectionHtml",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.tableModel,n=this.table.helper;if(!e||!this.tableRoot)return null;var r={row:0,col:0},i={row:e.rows-1,col:e.cols-1};if(!t){var o=this.getSelectArea();r=o.begin,i=o.end}for(var a=this.tableRoot.find("col"),s=[],l=0,c=r.col;c<=i.col;c++){var u,d=null===(u=a.eq(c))||void 0===u?void 0:u.get();d&&(s.push('<col width="'.concat(d.width,'" />')),l+=parseInt(d.width))}for(var h="<colgroup>".concat(s.join(""),"</colgroup>"),p=[],f=r.row;f<=i.row;f++){for(var g=[],m=void 0,v=r.col;v<=i.col;v++){var b=e.table[f][v],y=void 0,w=void 0,x=void 0;if(!n.isEmptyModelCol(b)&&b.element&&(x=b.element.cloneNode(!0),b.element.parentElement&&(m=Object(D["$"])(b.element.parentElement).css("height"))),!n.isEmptyModelCol(b)&&b.isMulti&&(y=Math.min(f+b.rowSpan-1,i.row)-f+1,w=Math.min(v+b.colSpan-1,i.col)-v+1),n.isEmptyModelCol(b)){var C=e.table[b.parent.row][b.parent.col];if(b.parent.row===f&&b.parent.col<r.col&&v===r.col){var k,A=r.col-b.parent.col;if(!n.isEmptyModelCol(C))w=Math.min(C.colSpan-A,i.col-r.col+1),y=C.rowSpan,x=null===(k=C.element)||void 0===k?void 0:k.cloneNode(!0)}if(b.parent.col===v&&b.parent.row<r.row&&f===r.row){var S,E=r.row-b.parent.row;if(!n.isEmptyModelCol(C))y=Math.min(C.rowSpan-E,i.row-r.row+1),w=C.colSpan,x=null===(S=C.element)||void 0===S?void 0:S.cloneNode(!0)}}if(x){x=x,y&&x.setAttribute("rowspan","".concat(y)),w&&x.setAttribute("colspan","".concat(w));var O=x.firstChild;if(O.classList.contains("table-main-content")){var T=x.cloneNode(!1);T.innerHTML=O.innerHTML,g.push(T.outerHTML)}else g.push(x.outerHTML)}}var _=Object(D["$"])("<tr>".concat(g.join(""),"</tr>"));m&&_.css("height",m),p.push(_.get().outerHTML)}return'<body><meta name="aomao" content="table" /><table style="width:'.concat(l,'px">').concat(h).concat(p.join(""),"</table></body>")}},{key:"hasMergeCell",value:function(){var t=this.table,e=this.tableModel;if(!e)return!1;var n=this.getSelectArea(),r=n.begin,i=(n.end,n.count);if(1!==i)return!1;var o=e.table[r.row][r.col];return!t.helper.isEmptyModelCol(o)&&!0===o.isMulti}},{key:"isRowSelected",value:function(){return!!this.selectArea&&this.selectArea.allRow}},{key:"isColSelected",value:function(){return!!this.selectArea&&this.selectArea.allCol}},{key:"isTableSelected",value:function(){return!!this.selectArea&&this.selectArea.allCol&&this.selectArea.allRow}},{key:"showHighlight",value:function(t){var e,n,r,i,o,a,s,l=this.table.helper,c=this.tableModel;if(c){var u=t.begin,d=t.end,h=t.allCol,p=t.allRow;if(!(u.row<0||u.col<0)){var f=u.row,g=d.row,m=u.col,v=d.col;this.hideHighlight();for(var b=null===(e=this.colsHeader)||void 0===e?void 0:e.find(Xm.COLS_HEADER_ITEM_CLASS),y=null===(n=this.rowsHeader)||void 0===n?void 0:n.find(Xm.ROWS_HEADER_ITEM_CLASS),w=f;w<=g;w++)for(var x=m;x<=v;x++){var C=c.table[w][x];if(this.table.helper.isEmptyModelCol(C)){u.row>C.parent.row&&(u.row=C.parent.row),u.col>=C.parent.col&&(u.col=C.parent.col);var k=c.table[C.parent.row][C.parent.col];this.table.helper.isEmptyModelCol(k)||(k.rowSpan>1&&d.row<k.rowSpan-1+C.parent.row&&(d.row=k.rowSpan-1+C.parent.row),k.colSpan>1&&d.col<k.colSpan-1+C.parent.col&&(d.col=k.colSpan-1+C.parent.col))}else this.table.helper.isEmptyModelCol(C)||(C.rowSpan>1&&d.row<C.rowSpan-1+w&&(d.row=C.rowSpan-1+w),C.colSpan>1&&d.col<C.colSpan-1+x&&(d.col=C.colSpan-1+x))}for(var A,S=0,E=0,O=u.row;O<=d.row;O++){var T,_=c.table[O][u.col];if(!l.isEmptyModelCol(_)&&_.element)S+=_.element.offsetHeight,null===y||void 0===y||null===(T=y.eq(O))||void 0===T||Gm(T)}for(var M=u.col;M<=d.col;M++){var N,P=c.table[u.row][M];if(!l.isEmptyModelCol(P)&&P.element)E+=P.element.offsetWidth,null===b||void 0===b||null===(N=b.eq(M))||void 0===N||Gm(N)}if(d.row===c.rows-1&&d.col===c.cols-1)null===(A=this.tableHeader)||void 0===A||Gm(A);var L=c.table[u.row][u.col],j=0,I=0;if(!l.isEmptyModelCol(L)&&L.element){var R,F=null===(R=this.tableRoot)||void 0===R?void 0:R.parent(),B=null===F||void 0===F?void 0:F.getBoundingClientRect(),z=L.element.getBoundingClientRect();j+=z.top-((null===B||void 0===B?void 0:B.top)||0)-13,I+=z.left-((null===B||void 0===B?void 0:B.left)||0)}var H=Object(D["removeUnit"])((null===(r=this.table.wrapper)||void 0===r||null===(i=r.find(".data-scrollbar"))||void 0===i?void 0:i.css("left"))||"0")+Object(D["removeUnit"])((null===(o=this.table.wrapper)||void 0===o?void 0:o.css("margin-left"))||"0");I+=H;var V=(null===(a=this.colsHeader)||void 0===a||null===(s=a.find(Xm.COLS_HEADER_ITEM_CLASS).get())||void 0===s?void 0:s.offsetHeight)||0;if(j+=V,S>0&&E>0){var q,U,W,$,G,Y,X,K,Z;if(null===(q=this.highlight)||void 0===q||q.css("width","".concat(E,"px")),null===(U=this.highlight)||void 0===U||U.css("height","".concat(S,"px")),null===(W=this.highlight)||void 0===W||W.css("top","".concat(j,"px")),null===($=this.highlight)||void 0===$||$.css("left","".concat(I,"px")),null===(G=this.highlight)||void 0===G||G.show("block"),null===(Y=this.table.wrapper)||void 0===Y||Y.addClass("data-table-highlight"),h)null===(X=this.table.wrapper)||void 0===X||X.addClass("data-table-highlight-row");if(p)null===(K=this.table.wrapper)||void 0===K||K.addClass("data-table-highlight-col");if(h&&p)null===(Z=this.table.wrapper)||void 0===Z||Z.addClass("data-table-highlight-all")}}}}},{key:"hideHighlight",value:function(){var t,e,n,r,i,o,a,s;null===(t=this.highlight)||void 0===t||t.hide(),null===(e=this.colsHeader)||void 0===e||Ym(e.find(".active")),null===(n=this.rowsHeader)||void 0===n||Ym(n.find(".active")),null===(r=this.tableHeader)||void 0===r||Ym(r),null===(i=this.table.wrapper)||void 0===i||i.removeClass("data-table-highlight"),null===(o=this.table.wrapper)||void 0===o||o.removeClass("data-table-highlight-row"),null===(a=this.table.wrapper)||void 0===a||a.removeClass("data-table-highlight-col"),null===(s=this.table.wrapper)||void 0===s||s.removeClass("data-table-highlight-all")}},{key:"destroy",value:function(){this.unbindEvents()}}]),n}(mm["EventEmitter2"]),ev=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(t,r){var i;return Object(F["a"])(this,n),i=e.call(this),i.editor=void 0,i.table=void 0,i.tableCleared=!1,i.rowCleared=!1,i.colCleared=!1,i.tableRoot=void 0,i.colsHeader=void 0,i.rowsHeader=void 0,i.tableHeader=void 0,i.viewport=void 0,i.clearFormat=function(){var t=i.table,e=t.selection,n=t.helper;e.getSelectArea();e.each((function(t){!n.isEmptyModelCol(t)&&t.element&&t.element.removeAttribute("style")})),i.emit("actioned","clearFormat")},i.hasCopyData=function(){return!!i.table.helper.getCopyData()},i.clearCopyData=function(){i.table.helper.clearCopyData()},i.editor=t,i.table=r,i}return Object(B["a"])(n,[{key:"init",value:function(){var t=this.table.wrapper;t&&(this.tableRoot=t.find(Xm.TABLE_CLASS),this.colsHeader=t.find(Xm.COLS_HEADER_CLASS),this.rowsHeader=t.find(Xm.ROWS_HEADER_CLASS),this.tableHeader=t.find(Xm.HEADER_CLASS),this.viewport=t.find(Xm.VIEWPORT))}},{key:"insertColAt",value:function(t,e,n,r){var i,o,a=this,s=this.table,l=s.selection,c=s.wrapper,u=l.tableModel;if(c&&u&&this.tableRoot){var d=t,h=n?"after":"before",p=c.find(Xm.COLS_HEADER_ITEM_CLASS),f=null===(i=p.eq(d))||void 0===i?void 0:i.get(),g=n?d+1:d,m=c.find(Xm.COLS_HEADER_CLASS),v=0;r||(r=f.offsetWidth),Array.isArray(r)?r.forEach((function(t){v+=t})):"number"===typeof r&&(v=e*r),m.css("width",m.get().offsetWidth+v+"px");var b=this.tableRoot.find("colgroup"),y=c.find("tr"),w=this.tableRoot.find("col"),x=null===(o=w.eq(d))||void 0===o?void 0:o.clone();if(x){var C=e,k=this.editor.nodeId;while(C>0){var A=Object(D["$"])(f.outerHTML);Object(D["$"])(f)[h](A);var S=Array.isArray(r)?r[e-C]:r;A.css({width:"".concat(S,"px")});var E=null===x||void 0===x?void 0:x.clone();E.removeAttributes(D["DATA_ID"]),E.attributes("width",S),k.create(E);var O=w[t];"after"===h?Object(D["$"])(O).after(E):b[0].insertBefore(E[0],O),C--}y.each((function(t,n){for(var r=l.getCellIndex(n,g),i=0;i<e;i++){var o=t.insertCell(r);o.innerHTML=a.table.template.getEmptyCell(),Object(D["$"])(o).attributes(D["DATA_TRANSIENT_ATTRIBUTES"],"table-cell-selection"),k.generate(o)}}));for(var T=arguments.length,_=new Array(T>4?T-4:0),M=4;M<T;M++)_[M-4]=arguments[M];this.emit.apply(this,["actioned","insertCol"].concat(_)),l.selectArea&&l.selectCol(t,t+e-1)}}}},{key:"insertCol",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.table,i=r.selection,o=r.wrapper,a=i.tableModel;if(o&&a){var s=i.getSelectArea(),l="left"===t,c="end"===t||!t,u=o.find(Xm.COLS_HEADER_ITEM_CLASS),d=a.cols-1;c||(d=l?s.begin.col:s.end.col);var h=l?d-1:d+1;h<0?(h=0,l=!1):l||d!==a.cols-1||(h--,l=!0);for(var p=null===(e=u.eq(d))||void 0===e?void 0:e.get().offsetWidth,f=arguments.length,g=new Array(f>2?f-2:0),m=2;m<f;m++)g[m-2]=arguments[m];if(this.insertColAt.apply(this,[h,n,l,p].concat(g)),c){var v,b=null===(v=this.viewport)||void 0===v?void 0:v.get();if(!b)return;b.scrollLeft=b.scrollWidth-b.offsetWidth}}}},{key:"removeCol",value:function(){var t=this,e=this.table,n=e.selection,r=e.conltrollBar,i=e.helper,o=n.tableModel;if(o&&this.tableRoot){var a=o.table,s=Object(_["a"])({},n.getSelectArea());s.end.col-s.begin.col===0&&n.each((function(t){i.isEmptyModelCol(t)||(s.end.col+=t.colSpan-1)}));var l=s.end.col-s.begin.col+1,c=this.tableRoot.find("colgroup"),u=this.tableRoot.find("tr"),d=c.find("col");if(s.allCol)this.removeTable();else{for(var h=s.end.col;h>=s.begin.col;h--){var p;r.removeCol(h),null===(p=d.eq(h))||void 0===p||p.remove()}a.forEach((function(e,n){for(var r=s.end.col;r>=s.begin.col;r--){var o=e[r];if(i.isEmptyModelCol(o)){var c=a[o.parent.row][o.parent.col];if(!i.isEmptyModelCol(c)&&o.parent.col<s.begin.col){var d=Math.min(l,o.parent.col+c.colSpan-s.begin.col);c.element&&(c.element.colSpan=c.colSpan-d)}}else{var h;if(o.isMulti){var p=r+o.colSpan-1>s.end.col,f=s.end.col+1-r;if(p){for(var g,m,v=0,b=0;b<=s.end.col;b++)i.isEmptyModelCol(e[b])||v++;var y=null===(g=u.eq(n))||void 0===g||null===(m=g.get())||void 0===m?void 0:m.insertCell(v);if(!y)return;y.setAttribute(D["DATA_TRANSIENT_ATTRIBUTES"],"table-cell-selection"),y.innerHTML=t.table.template.getEmptyCell(),y.colSpan=o.colSpan-f,y.rowSpan=o.rowSpan,t.editor.nodeId.generate(y)}}null===(h=o.element)||void 0===h||h.remove()}}}));for(var f=arguments.length,g=new Array(f),m=0;m<f;m++)g[m]=arguments[m];this.emit.apply(this,["actioned","removeCol"].concat(g))}}}},{key:"insertColLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.insertCol("left",t)}},{key:"insertColRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.insertCol("right",t)}},{key:"insertRowAt",value:function(t,e,n){var r=this,i=this.table,o=i.wrapper,a=i.selection,s=i.helper,l=a.tableModel;if(o&&l){var c=n?"after":"before",u=t,d=o.find(Xm.ROWS_HEADER_ITEM_CLASS),h=d[u],p=n?u:u+1,f=[],g=l.table[u];g.forEach((function(t,r){if(s.isEmptyModelCol(t)||!t.isMulti)if(s.isEmptyModelCol(t)){var i=l.table[t.parent.row][t.parent.col];!s.isEmptyModelCol(i)&&t.parent.row<p&&t.parent.row+i.rowSpan-1>=p?i.element.rowSpan=i.rowSpan+e:!s.isEmptyModelCol(i)&&t.parent.row<u&&t.parent.col===r&&f.push({tdBase:i.element})}else f.push({tdBase:t.element});else!n&&t.rowSpan>1&&p<=u+t.rowSpan-1?t.element.rowSpan=t.rowSpan+e:f.push({tdBase:t.element})}));var m=e,v=this.editor.nodeId,b=function(){var t,e,n=null===(t=r.tableRoot)||void 0===t||null===(e=t.get())||void 0===e?void 0:e.insertRow(p);n&&(f.forEach((function(t){var e=n.insertCell();e.setAttribute(D["DATA_TRANSIENT_ATTRIBUTES"],"table-cell-selection"),e.innerHTML=r.table.template.getEmptyCell(),e.colSpan=t.tdBase.colSpan})),Object(D["$"])(h)[c](Object(D["$"])(h.outerHTML)),v.generate(n),v.generateAll(n),m--)};while(m>0)b();for(var y=arguments.length,w=new Array(y>3?y-3:0),x=3;x<y;x++)w[x-3]=arguments[x];this.emit.apply(this,["actioned","insertRow"].concat(w)),a.selectArea&&a.selectRow(t,t+e-1)}}},{key:"insertRow",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.table,r=n.selection,i=n.helper,o=r.tableModel;if(o){var a=r.getSelectArea(),s="up"===t,l="end"===t||!t,c=o.rows-1;if(!l){var u=a.end.row;r.each((function(t){i.isEmptyModelCol(t)||(u+=t.rowSpan-1)})),c=s?a.begin.row:u}for(var d=c,h=arguments.length,p=new Array(h>2?h-2:0),f=2;f<h;f++)p[f-2]=arguments[f];this.insertRowAt.apply(this,[d,e,s].concat(p))}}},{key:"insertRowUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.insertRow("up",t)}},{key:"insertRowDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.insertRow("down",t)}},{key:"removeRow",value:function(){var t=this,e=this.table,n=e.selection,r=e.conltrollBar,i=e.helper,o=n.tableModel;if(o&&this.tableRoot){var a=o.table,s=Object(_["a"])({},n.getSelectArea()),l=s.begin,c=s.end;c.row-l.row===0&&n.each((function(t){i.isEmptyModelCol(t)||(c.row+=t.rowSpan-1)}));var u=c.row-l.row+1,d=this.tableRoot.find("tr");if(s.allRow)this.removeTable();else{for(var h=function(e){var r=a[e];r.forEach((function(r,o){if(!i.isEmptyModelCol(r)&&r.isMulti&&r.rowSpan>1&&e+r.rowSpan-1>c.row){var s=n.getCellIndex(c.row+1,o),h=d[c.row+1].insertCell(s),p=c.row-e+1;h.setAttribute(D["DATA_TRANSIENT_ATTRIBUTES"],"table-cell-selection"),h.innerHTML=t.table.template.getEmptyCell(),h.colSpan=r.colSpan,h.rowSpan=r.rowSpan-p,t.editor.nodeId.generate(h)}if(i.isEmptyModelCol(r)){var f=a[r.parent.row][r.parent.col];if(!i.isEmptyModelCol(f)&&r.parent.row<l.row){var g=Math.min(u,r.parent.row+f.rowSpan-l.row);f.element.rowSpan=f.rowSpan-g}}}))},p=l.row;p<=c.row;p++)h(p);for(var f=c.row;f>=l.row;f--){var g;null===(g=this.tableRoot.get())||void 0===g||g.deleteRow(f),r.removeRow(f)}for(var m=arguments.length,v=new Array(m),b=0;b<m;b++)v[b]=arguments[b];this.emit.apply(this,["actioned","removeRow"].concat(v))}}}},{key:"removeTable",value:function(){var t=this.editor;Object(D["isEngine"])(t)||this.emit("tableRemoved"),t.card.remove(this.table.id)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.table,n=e.selection,r=e.helper,i=n.getSelectionHtml(t);i&&(this.editor.clipboard.copy(i),r.copyHTML(i))}},{key:"mockCopy",value:function(){var t=this.table,e=t.selection,n=t.helper,r=e.getSelectionHtml();r&&n.copyHTML(r)}},{key:"shortcutCopy",value:function(t){var e,n,r,i=this.table,o=i.selection,a=i.helper,s=o.getSelectionHtml();s&&(null===(e=t.clipboardData)||void 0===e||e.clearData(),null===(n=t.clipboardData)||void 0===n||n.setData("text/plain",Object(D["$"])(s).html()),null===(r=t.clipboardData)||void 0===r||r.setData("text/html",s),a.copyHTML(s),t.preventDefault())}},{key:"cut",value:function(){this.copy(),this.clear()}},{key:"shortcutCut",value:function(t){this.shortcutCopy(t),this.clear()}},{key:"clear",value:function(){var t=this,e=this.table,n=e.selection,r=e.helper,i=n.getSelectArea();if(i.allCol&&i.allRow){if(this.tableCleared)return this.removeTable(),void(this.tableCleared=!1);this.tableCleared=!0}if(i.allRow){if(this.rowCleared)return this.removeRow(),void(this.rowCleared=!1);this.rowCleared=!0}if(i.allCol){if(this.colCleared)return this.removeCol(),void(this.colCleared=!1);this.colCleared=!0}n.each((function(e){!r.isEmptyModelCol(e)&&e.element&&(e.element.innerHTML=t.table.template.getEmptyCell())})),this.emit("actioned","clear")}},{key:"mockPaste",value:function(){var t=this.table.helper.getCopyData();if(t){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.paste.apply(this,[t].concat(n))}}},{key:"shortcutPaste",value:function(t){t.preventDefault(),t.stopPropagation();var e=this.editor.clipboard.getData(t);this.paste(e)}},{key:"paste",value:function(t){var e=this.table,n=e.selection,r=e.helper,i=n.tableModel;if(i){var o=n.getSelectArea(),a=o.begin,s=o.end,l=a.row===s.row&&a.col===s.col,c=t.html;t.text;if(c){var u=this.editor,d=u.schema,h=u.conversion,p=new D["Parser"](c,u).toValue(d,h),f=r.trimBlankSpan(Object(D["$"])(p));u.nodeId.generateAll(f,!0);for(var g=arguments.length,m=new Array(g>1?g-1:0),v=1;v<g;v++)m[v-1]=arguments[v];if("table"===f.name){r.normalizeTable(f);var b=r.getTableModel(f),y=b.rows,w=b.cols,x=b.table[0][0],C=i.table[a.row];if(!C)return;var k=C[a.col];if(!k||r.isEmptyModelCol(x)||r.isEmptyModelCol(k))return;var A=x.rowSpan,S=x.colSpan,E=A===y&&S===w;if(E&&!o&&x.element)return r.copyTo(x.element,k.element),void this.emit.apply(this,["actioned","paste"].concat(m));if(l){if(w+a.col>i.cols){var O=w+a.col-i.cols;this.insertCol("end",O,!0)}if(y+a.row>i.rows){var T=y+a.row-i.rows;this.insertRow("end",T,!0)}n.select(a,{row:a.row+y-1,col:a.col+w-1})}var _=n.getSelectArea();m[0]||this.splitCell(!0),n.each((function(t,e,n){var i=(e-_.begin.row)%y,o=(n-_.begin.col)%w,a=b.table[i][o];if(a){if(!r.isEmptyModelCol(a)&&a.isMulti&&!r.isEmptyModelCol(t)){var s=t.element;return s.rowSpan=Math.min(a.rowSpan,_.end.row-e+1),s.colSpan=Math.min(a.colSpan,_.end.col-n+1),void r.copyTo(a.element,s)}var l;if(r.isEmptyModelCol(a))r.isEmptyModelCol(t)||null===(l=t.element)||void 0===l||l.remove();else a.element&&!r.isEmptyModelCol(t)&&t.element&&r.copyTo(a.element,t.element)}}))}else this.mergeCell(!0);this.emit.apply(this,["actioned","paste"].concat(m))}}}},{key:"mergeCell",value:function(){var t=this.table,e=t.selection,n=t.helper,r=e.selectArea,i=e.tableModel;if(r&&i){var o=r.begin,a=r.end,s=a.row-o.row+1,l=a.col-o.col+1,c=[],u=null;if(this.splitCell(),e.select(o,a),e.each((function(t,e,r){if(!n.isEmptyModelCol(t))return r===o.col&&e===o.row?(u=t.element,u.rowSpan=s,void(u.colSpan=l)):void(t.element&&(""!==t.element.innerText.trim()&&c.unshift(Object(D["$"])(t.element).find(Xm.TABLE_TD_CONTENT_CLASS).html()),t.element.remove()))})),u){var d=Object(D["$"])(u),h=d.find(Xm.TABLE_TD_CONTENT_CLASS);h.html(h.html()+c.join(""));for(var p=arguments.length,f=new Array(p),g=0;g<p;g++)f[g]=arguments[g];this.emit.apply(this,["actioned","mergeCell"].concat(f))}}}},{key:"splitCell",value:function(){var t=this,e=this.table,n=e.selection,r=e.helper,i=n.tableModel;if(i&&this.tableRoot){var o=this.tableRoot.find("tr");n.each((function(e,a,s){if(!r.isEmptyModelCol(e))for(var l=a+e.rowSpan,c=s+e.colSpan,u=l-1;u>=a;u--){u>=o.length&&t.insertRowAt(a,1);for(var d=u>=o.length?t.tableRoot.find("tr")[u]:o[u],h=c-1;h>=s;h--){var p=i.table[u][h];if(!r.isEmptyModelCol(p)&&p.isMulti)p.element=p.element,p.element.colSpan=1,p.element.rowSpan=1;else if(r.isEmptyModelCol(p)){var f=n.getCellIndex(u,h),g=d.insertCell(f);t.editor.nodeId.generate(g),g.setAttribute(D["DATA_TRANSIENT_ATTRIBUTES"],"table-cell-selection"),g.innerHTML=t.table.template.getEmptyCell()}}}}));for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];this.emit.apply(this,["actioned","splitCell"].concat(s))}}}]),n}(mm["EventEmitter2"]),nv=Object(B["a"])((function t(){Object(F["a"])(this,t)}));nv.colors=void 0,nv._map=void 0,nv.getStroke=void 0,nv.getColors=void 0,nv.colors=[["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FAFAFA","#FFFFFF"],["#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96"],["#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB"],["#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2"],["#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB"],["#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F"],["#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"]],nv._map=function(){for(var t={},e=nv.colors,n=0,r=e.length;n<r;n++)for(var i=e[n],o=0,a=i.length;o<a;o++){var s=e[n][o];t[s]={y:n,x:o}}return t}(),nv.getStroke=function(t){var e=nv._map[t];return e&&(2===e.y||3===e.y&&e.x>2&&e.x<5)?this.colors[4][e.x]:t},nv.getColors=function(){return this.colors};var rv=Object(Cf["a"])("editor"),iv=Object(Cf["a"])("options"),ov=Object(Cf["a"])("color"),av=Object(Cf["a"])("button"),sv=Object(Cf["a"])("cardId"),lv=Object(Cf["a"])("container"),cv=Object(Cf["a"])("position"),uv=function(){function t(e,n,r){var i=this;Object(F["a"])(this,t),Object.defineProperty(this,rv,{writable:!0,value:void 0}),Object.defineProperty(this,iv,{writable:!0,value:void 0}),Object.defineProperty(this,ov,{writable:!0,value:void 0}),Object.defineProperty(this,av,{writable:!0,value:void 0}),Object.defineProperty(this,sv,{writable:!0,value:void 0}),Object.defineProperty(this,lv,{writable:!0,value:void 0}),Object.defineProperty(this,cv,{writable:!0,value:void 0}),this.windowClick=function(t){var e=t.target;e&&0===Object(D["$"])(e).closest(".data-table-color-tool,.table-color-dropdown-arrow").length&&i.remove()},Object(xf["a"])(this,rv)[rv]=e,Object(xf["a"])(this,sv)[sv]=n,Object(xf["a"])(this,iv)[iv]=r,Object(xf["a"])(this,cv)[cv]=new D["Position"](Object(xf["a"])(this,rv)[rv]),Object(xf["a"])(this,ov)[ov]=r.defaultColor||"transparent",Object(xf["a"])(this,av)[av]=Object(D["$"])('<div class="table-color-dropdown-trigger">\n <button type="button" class="table-color-dropdown-button-text">\n <svg width="16px" height="16px" viewBox="0 0 16 16" style="margin-bottom: '.concat("transparent"===Object(xf["a"])(this,ov)[ov]?-5:-3,'">\n <g ="none" strokeWidth="1" fill="none" fillRule="evenodd">\n <path d="M11.9745711,7.921875 C11.9745711,7.921875 13.2147672,9.2863447 13.2147672,10.1226326 C13.2147672,10.8142992 12.6566789,11.3802083 11.9745711,11.3802083 C11.2924632,11.3802083 10.734375,10.8142992 10.734375,10.1226326 C10.734375,9.2863447 11.9745711,7.921875 11.9745711,7.921875 Z M9.07958999,6.47535893 L6.28501575,3.68078468 L3.4904415,6.47535893 L9.07958999,6.47535893 Z M5.3326566,3.04215357 L4.28223263,1.9917296 C4.22692962,1.93642659 4.22692962,1.84676271 4.28223263,1.7914597 L5.03228902,1.0414033 C5.08759203,0.986100299 5.17725591,0.986100299 5.23255892,1.0414033 L6.4546098,2.26345418 C6.46530408,2.27146914 6.4755605,2.28033918 6.48528564,2.29006432 L10.4848531,6.28963174 C10.5954591,6.40023775 10.5954591,6.57956552 10.4848531,6.69017153 L6.4838816,10.691143 C6.37327559,10.801749 6.19394782,10.801749 6.08334181,10.691143 L2.08377439,6.69157557 C1.97316838,6.58096956 1.97316838,6.40164179 2.08377439,6.29103578 L5.3326566,3.04215357 Z" fill="#595959"/>\n <rect stroke="').concat(nv.getStroke(Object(xf["a"])(this,ov)[ov]),'" fill="').concat(Object(xf["a"])(this,ov)[ov],'" strokeWidth="0.5" x="2" y="12.75" width="12" height="1.5" rx="0.125" />\n </g>\n </svg>\n </button>\n <button type="button" class="table-color-dropdown-arrow">\n <span class="table-color-dropdown-empty"></span>\n <span class="data-icon data-icon-arrow"></span>\n </button>\n </div>')),Object(xf["a"])(this,av)[av].find(".table-color-dropdown-arrow").on("mousedown",(function(t){t.preventDefault(),void 0!==Object(xf["a"])(i,lv)[lv]&&Object(xf["a"])(i,lv)[lv].length>0?i.remove():i.render()})),Object(xf["a"])(this,av)[av].find(".table-color-dropdown-button-text").on("mousedown",(function(t){t.preventDefault();var e=Object(xf["a"])(i,iv)[iv].onChange;e&&e(Object(xf["a"])(i,ov)[ov])}))}return Object(B["a"])(t,[{key:"getButton",value:function(){return Object(xf["a"])(this,av)[av]}},{key:"select",value:function(t){var e=nv.getStroke(t),n=Object(xf["a"])(this,av)[av].find("rect");n.attributes("stroke",e),n.attributes("fill",t),Object(xf["a"])(this,av)[av].find("svg").css("margin-bottom","transparent"===t?-5:-3)}},{key:"change",value:function(t){Object(xf["a"])(this,ov)[ov]=t,this.select(t);var e=Object(xf["a"])(this,iv)[iv].onChange;e&&e(t)}},{key:"toState",value:function(t,e){var n=t["hex"]?bm()(t["hex"]):bm()(t),r=n.toHsl(),i=n.toHsv(),o=n.toRgb(),a=n.toHex();0===r.s&&(r.h=e||0,i.h=e||0);var s="000000"===a&&0===o.a;return{hsl:r,hex:s?"transparent":"#".concat(a),rgb:o,hsv:i,oldHue:t["h"]||e||r.h,source:t["source"]}}},{key:"render",value:function(){var t,e=this;Object(xf["a"])(this,lv)[lv]=Object(D["$"])('<div class="data-table-color-tool'.concat(D["isMobile"]?" data-table-color-tool-mobile":"",'" ').concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" ').concat(D["TRIGGER_CARD_ID"],'="').concat(Object(xf["a"])(this,sv)[sv],'"></div>'));var n=Object(D["$"])('<div class="data-table-color-tool-panle"></div>'),r=Object(xf["a"])(this,iv)[iv].colors,i=function(t,r){var i=e.toState(t.color||"#FFFFFF"),o=["#ffffff","#fafafa","transparent"].indexOf(i.hex)>=0,a=Object(D["$"])('<span class="data-table-color-tool-item'.concat(o?" data-table-color-tool-border":"",'"><span style="background-color:').concat(t.color).concat(t.border?";".concat(o?"":"border:1px solid ".concat(t.border)):"",'"><svg\n style="fill: ').concat("#8C8C8C"===t.color.toUpperCase()?"#FFFFFF":"#8C8C8C",";\n display: ").concat(t.color===Object(xf["a"])(e,ov)[ov]&&!1!==r?"block":"none",';"\n viewBox="0 0 18 18"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /></svg></span></span>'));return a.on("mousedown",(function(i){i.preventDefault(),i.stopPropagation(),n.find("svg").each((function(t){t.style.display="none"})),!1!==r&&a.find("svg").css("display","block"),e.change(t.color)})),a},o=Object(D["$"])('<div class="data-table-color-tool-group data-table-color-tool-default"></div>'),a=i({color:"transparent"},!1);o.append(a),o.on("mousedown",(function(t){t.preventDefault(),n.find("svg").each((function(t){t.style.display="none"})),e.change("transparent")}));var s=Object(xf["a"])(this,rv)[rv].language.get("table","color","nonFillText");o.append(Object(D["$"])('<span class="data-table-color-tool-default-text">'.concat(s,"</span>"))),Object(xf["a"])(this,lv)[lv].append(o),r.forEach((function(t){var e=Object(D["$"])('<div class="data-table-color-tool-group"></div>');t.forEach((function(t){var n=i(t);e.append(n)})),n.append(e)})),Object(xf["a"])(this,lv)[lv].append(n),null===(t=Object(xf["a"])(this,cv)[cv])||void 0===t||t.bind(Object(xf["a"])(this,lv)[lv],Object(xf["a"])(this,av)[av]),document.addEventListener("mousedown",this.windowClick,!0)}},{key:"remove",value:function(){var t,e;null===(t=Object(xf["a"])(this,lv)[lv])||void 0===t||t.remove(),null===(e=Object(xf["a"])(this,cv)[cv])||void 0===e||e.destroy(),document.removeEventListener("mousedown",this.windowClick,!0),Object(xf["a"])(this,lv)[lv]=void 0}},{key:"destroy",value:function(){this.remove();var t=Object(xf["a"])(this,iv)[iv].onDestroy;t&&t()}}]),t}();function dv(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var hv='.table-color-dropdown-trigger {\r\n display: flex;\r\n}\r\n\r\n.table-color-dropdown-trigger:hover {\r\n background: transparent !important;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-button-text, .table-color-dropdown-trigger .table-color-dropdown-arrow {\r\n display: inline-block;\r\n width: auto;\r\n margin: 0;\r\n text-align: center;\r\n background-color: transparent;\r\n border: 1px solid transparent;\r\n border-radius: 3px 3px;\r\n font-size: 16px;\r\n cursor: pointer;\r\n color: #595959;\r\n outline: none;\r\n margin-right: 0;\r\n min-width: 26px;\r\n border-radius: 3px 0 0 3px;\r\n padding: 0 4px;\r\n}\r\n\r\n.table-color-dropdown-trigger:hover .table-color-dropdown-button-text, .table-color-dropdown-trigger:hover .table-color-dropdown-arrow\r\n{\r\n border: 1px solid #e8e8e8;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-button-text:hover, .table-color-dropdown-trigger .table-color-dropdown-arrow:hover {\r\n background-color: #f5f5f5;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-arrow {\r\n margin-left: -1px;\r\n min-width: 17px;\r\n text-align: center;\r\n border-radius: 0 3px 3px 0;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-arrow .table-color-dropdown-empty {\r\n display: inline-block;\r\n}\r\n\r\n.table-color-dropdown-trigger .table-color-dropdown-arrow .data-icon-arrow {\r\n position: absolute;\r\n right: 5px;\r\n top: 12px;\r\n width: 8px;\r\n height: 8px;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjhweCIgaGVpZ2h0PSI1cHgiIHZpZXdCb3g9IjAgMCA4IDUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1Mi41ICg2NzQ2OSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+DQogICAgPHRpdGxlPkdyb3VwIENvcHkgNjwvdGl0bGU+DQogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPg0KICAgICAgICA8ZyBpZD0idG9vbGJhciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyOC4wMDAwMDAsIC0xOC4wMDAwMDApIj4NCiAgICAgICAgICAgIDxnIGlkPSJwYXJhZ3JhcGgtc3R5bGUiPg0KICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIyNi4wMDAwMDAsIDQuMDAwMDAwKSI+DQogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC1Db3B5LTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMi4wMDAwMDAsIDEyLjAwMDAwMCkiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjgiIGhlaWdodD0iOCI+PC9yZWN0Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTAuNTk2MDkzNzUsMi41NTcwMzEyNSBMMy43NDUzMTI1LDYuMzc4MTI1IEMzLjg3NzM0Mzc1LDYuNTI1NzgxMjUgNC4xMDg1OTM3NSw2LjUyNTc4MTI1IDQuMjQwNjI1LDYuMzc4MTI1IEw3LjQwNTQ2ODc1LDIuNTU3MDMxMjUgQzcuNTk2MDkzNzUsMi4zNDI5Njg3NSA3LjQ0NDUzMTI1LDIuMDAzOTA2MjUgNy4xNTc4MTI1LDIuMDAzOTA2MjUgTDAuODQ0NTMxMjUsMi4wMDM5MDYyNSBDMC41NTcwMzEyNSwyLjAwMzkwNjI1IDAuNDA0Njg3NSwyLjM0Mjk2ODc1IDAuNTk2MDkzNzUsMi41NTcwMzEyNSBaIiBpZD0iU2hhcGUiIGZpbGw9IiMwMDAwMDAiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICAgICAgICAgICAgICA8L2c+DQogICAgICAgICAgICAgICAgPC9nPg0KICAgICAgICAgICAgPC9nPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);\r\n background-repeat: no-repeat;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\r\n}\r\n\r\n.data-table-color-tool {\r\n outline: none;\r\n width: auto;\r\n border-radius: 3px 3px;\r\n position: absolute;\r\n border: 1px solid #e8e8e8;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\r\n z-index: 130;\r\n text-indent: 0;\r\n top:0;\r\n padding: 8px 0;\r\n background: #fff;\r\n}\r\n\r\n.data-table-color-tool-mobile {\r\n width: calc(100vw - 20px);\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-panle {\r\n position: relative;\r\n text-align: left;\r\n text-indent: 0;\r\n width: 100%;\r\n height: auto;\r\n margin-top: 8px;\r\n padding: 0 8px;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-group\r\n{\r\n display: flex;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-group > span {\r\n width: 24px;\r\n height: 24px;\r\n display: inline-block;\r\n cursor: pointer;\r\n background-color: rgb(255, 255, 255);\r\n padding: 2px;\r\n border-radius: 3px;\r\n border-width: 1px;\r\n border-style: solid;\r\n border-color: transparent;\r\n -o-border-image: initial;\r\n border-image: initial;\r\n flex: 0 0 auto;\r\n position: relative;\r\n}\r\n\r\n.data-table-color-tool span.data-table-color-tool-border > span {\r\n border: 1px solid #e8e8e8 !important;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-group > span > span\r\n{\r\n position: relative;\r\n width: 18px;\r\n height: 18px;\r\n display: block;\r\n border-radius: 2px;\r\n border-width: 1px;\r\n border-style: solid;\r\n border-color: transparent;\r\n -o-border-image: initial;\r\n border-image: initial;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-group > span > span > svg {\r\n position: absolute;\r\n top: -1px;\r\n left: 1px;\r\n width: 12px;\r\n height: 12px;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-default {\r\n display: flex;\r\n align-items: center;\r\n margin: 2px 0 8px;\r\n border-radius: 2px;\r\n cursor: pointer;\r\n padding: 2px 8px;\r\n} \r\n\r\n.data-table-color-tool .data-table-color-tool-default:hover {\r\n background: #f5f5f5;\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-default > span:first-child::after {\r\n content: "";\r\n display: block;\r\n position: absolute;\r\n top: 10px;\r\n left: 0px;\r\n width: 22px;\r\n height: 0;\r\n border-bottom: 2px solid #ff5151;\r\n transform: rotate(45deg);\r\n}\r\n\r\n.data-table-color-tool .data-table-color-tool-default .data-table-color-tool-default-text {\r\n width: auto;\r\n margin-left: 8px;\r\n height: auto;\r\n background: transparent;\r\n}';dv(hv);var pv=Object(Cf["a"])("changeTimeout"),fv=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t,r,i,o,a;Object(F["a"])(this,n);for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return a=e.call.apply(e,[this].concat(l)),a.contenteditable=["div".concat(Xm.TABLE_TD_CONTENT_CLASS)],a.colMinWidth=(null===(t=a.editor.plugin.findPlugin("table"))||void 0===t?void 0:t.options.colMinWidth)||40,a.rowMinHeight=(null===(r=a.editor.plugin.findPlugin("table"))||void 0===r?void 0:r.options.rowMinHeight)||35,a.maxInsertNum=(null===(i=a.editor.plugin.findPlugin("table"))||void 0===i?void 0:i.options.maxInsertNum)||30,a.wrapper=void 0,a.helper=new Zm(a.editor),a.template=new Xm(Object(wf["a"])(a)),a.selection=new tv(a.editor,Object(wf["a"])(a)),a.conltrollBar=new Qm(a.editor,Object(wf["a"])(a),{col_min_width:a.colMinWidth,row_min_height:a.rowMinHeight,max_insert_num:a.maxInsertNum}),a.command=new ev(a.editor,Object(wf["a"])(a)),a.scrollbar=void 0,a.viewport=void 0,a.colorTool=void 0,a.noBorderToolButton=void 0,a.alignToolButton=void 0,Object.defineProperty(Object(wf["a"])(a),pv,{writable:!0,value:void 0}),a.doChange=function(){a.remoteRefresh(),a.handleChange("local")},a.handleChange=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"local",r=a.editor;a.conltrollBar.refresh(),a.selection.render("change");var i,s=Object(z["a"])((o=Object(wf["a"])(a),Object(H["a"])(n.prototype)),"getValue",o).call(o);(null===s||void 0===s?void 0:s.noBorder)?null===(i=a.noBorderToolButton)||void 0===i||Gm(i):null===(t=a.noBorderToolButton)||void 0===t||Ym(t);if("local"===e&&Object(D["isEngine"])(r)){var l=a.getValue();l&&a.setValue(l)}},a.onChange=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"local",e=a.editor;Object(D["isEngine"])(e)&&"local"===t&&e.ot.isStopped()||(Object(xf["a"])(Object(wf["a"])(a),pv)[pv]&&clearTimeout(Object(xf["a"])(Object(wf["a"])(a),pv)[pv]),Object(xf["a"])(Object(wf["a"])(a),pv)[pv]=setTimeout((function(){a.handleChange(t),"remote"===t&&a.remoteRefresh()}),50))},a.updateScrollbar=function(){var t,e,n,r;if(a.scrollbar){var i=((null===(t=a.wrapper)||void 0===t||null===(e=t.getBoundingClientRect())||void 0===e?void 0:e.bottom)||0)-((null===(n=a.wrapper)||void 0===n?void 0:n.getViewport().bottom)||0);null===(r=a.wrapper)||void 0===r||r.find(".data-scrollbar-x").css({bottom:"".concat(i>0?i+2:0,"px")})}},a.remoteRefreshTimeout=null,a}return Object(B["a"])(n,[{key:"init",value:function(){var t,e=this;Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var r=this.editor;Object(D["isEngine"])(r)&&(r.event.listeners["keydown:tab"]||(r.event.listeners["keydown:tab"]=[]),r.event.listeners["keydown:tab"].unshift((function(t){if(Object(D["isEngine"])(r)&&!r.readonly){var n=r.change,i=r.block,o=r.node,a=r.card,s=n.range.get(),l=s.endNode.closest("td");if(0!==l.length&&l.inEditor()){var c=a.closest(l,!0);if(null===c||void 0===c?void 0:c.equal(e.root)){var u=i.closest(s.endNode);if(l.length>0&&(i.isLastOffset(s,"end")||"li"!==u.name&&o.isEmptyWidthChild(u))){var d=l.next();if(!d){var h,p,f,g=null===(h=l.parent())||void 0===h?void 0:h.next();if(g)d=g.find("td:first-child")||null;else e.command.insertRowDown(),d=(null===(p=l.parent())||void 0===p||null===(f=p.next())||void 0===f?void 0:f.find("td:first-child"))||null}if(d)return t.preventDefault(),e.selection.focusCell(d),!1}l.length>0&&setTimeout((function(){var t;null===(t=e.scrollbar)||void 0===t||t.refresh()}),0)}}}})),r.on("keydown:down",(function(t){if(Object(D["isEngine"])(r)&&!r.readonly){var n=r.change,i=r.card,o=n.range.get(),a=o.endNode.closest("td");if(0!==a.length&&a.inEditor()){var s=i.closest(a,!0);if(null===s||void 0===s?void 0:s.equal(e.root)){var l=a.find(".table-main-content");if(l){var c=l.get().getBoundingClientRect(),u=o.getBoundingClientRect();if(a.length>0&&(0===u.bottom||c.bottom-u.bottom<10)){var d,h=a.index(),p=null===(d=a.parent())||void 0===d?void 0:d.next();if(!p){t.preventDefault();var f=o.cloneRange(),g=e.root.next(),m=g?i.find(g):void 0;return(null===m||void 0===m?void 0:m.onSelectDown)?m.onSelectDown(t):(i.focusNextBlock(e,f,!1),n.range.select(f)),!1}var v,b=0,y=p.find("td:last-child");if(null===(v=e.selection.tableModel)||void 0===v||v.table[p.index()].some((function(t){return!e.helper.isEmptyModelCol(t)&&b>=h&&t.element?(y=Object(D["$"])(t.element),!0):(b++,!1)})),y)return t.preventDefault(),e.selection.focusCell(y,!0),!1}a.length>0&&setTimeout((function(){var t;null===(t=e.scrollbar)||void 0===t||t.refresh()}),0)}}}}})),r.on("keydown:up",(function(t){if(Object(D["isEngine"])(r)&&!r.readonly){var n=r.change,i=r.card,o=n.range.get(),a=o.endNode.closest("td");if(0!==a.length&&a.inEditor()){var s=i.closest(a,!0);if(null===s||void 0===s?void 0:s.equal(e.root)){var l=a.find(".table-main-content");if(l){var c=l.get().getBoundingClientRect(),u=o.getBoundingClientRect();if(a.length>0&&(0===u.top||u.top-c.top<10)){var d,h=a.index(),p=null===(d=a.parent())||void 0===d?void 0:d.prev();if(!p){t.preventDefault();var f=o.cloneRange(),g=e.root.prev(),m=g?i.find(g):void 0;return(null===m||void 0===m?void 0:m.onSelectUp)?m.onSelectUp(t):(i.focusPrevBlock(e,f,!1),n.range.select(f)),!1}var v,b=0,y=p.find("td:first-child");if(null===(v=e.selection.tableModel)||void 0===v||v.table[p.index()].some((function(t){return!e.helper.isEmptyModelCol(t)&&b>=h&&t.element?(y=Object(D["$"])(t.element),!0):(b++,!1)})),y)return t.preventDefault(),e.selection.focusCell(y),!1}a.length>0&&setTimeout((function(){var t;null===(t=e.scrollbar)||void 0===t||t.refresh()}),0)}}}}})),r.on("keydown:left",(function(){if(Object(D["isEngine"])(r)&&!r.readonly){var t=r.change,n=r.card,i=t.range.get(),o=i.endNode.closest("td");if(0!==o.length&&o.inEditor()){var a=n.closest(o,!0);if(null===a||void 0===a?void 0:a.equal(e.root)){var s=o.find(".table-main-content");s&&o.length>0&&setTimeout((function(){var t;null===(t=e.scrollbar)||void 0===t||t.refresh()}),0)}}}})),r.on("keydown:right",(function(){if(Object(D["isEngine"])(r)&&!r.readonly){var t=r.change,n=r.card,i=t.range.get(),o=i.endNode.closest("td");if(0!==o.length&&o.inEditor()){var a=n.closest(o,!0);if(null===a||void 0===a?void 0:a.equal(e.root)){var s=o.find(".table-main-content");s&&o.length>0&&setTimeout((function(){var t;null===(t=e.scrollbar)||void 0===t||t.refresh()}),0)}}}}))),this.colorTool||(this.colorTool=new uv(r,this.id,{colors:n.colors,defaultColor:null===(t=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",this).call(this))||void 0===t?void 0:t.color,onChange:function(t){e.conltrollBar.drawBackgroundColor(t);var n=e.getValue();e.setValue(Object(_["a"])(Object(_["a"])({},n),{},{color:t}))}}))}},{key:"toolbar",value:function(){var t,e=this,r=this.editor,i=function(){var t,i;if(!e.isMaximize){if(!Object(D["isEngine"])(r)||r.readonly)return[{key:"maximize",type:"maximize"}];var o=r.language.get("table"),a=[{key:"color",type:"node",title:r.language.get("table","color","title"),node:e.colorTool.getButton()},{key:"border",type:"button",title:(null===(t=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",e).call(e))||void 0===t?void 0:t.noBorder)?o["showBorder"]:o["noBorder"],content:'<span class="data-icon data-icon-no-border"></span>',didMount:function(t){var r=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",e).call(e);!0===(null===r||void 0===r?void 0:r.noBorder)&&Gm(t),e.noBorderToolButton=t},onClick:function(t,r){var i,o=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",e).call(e);e.setValue({noBorder:!(null===o||void 0===o?void 0:o.noBorder)});var a=null===(i=e.wrapper)||void 0===i?void 0:i.find(".data-table");!0===(null===o||void 0===o?void 0:o.noBorder)?(null===a||void 0===a||a.removeAttributes("data-table-no-border"),Ym(r)):(null===a||void 0===a||a.attributes("data-table-no-border","true"),Gm(r))}},{key:"align",type:"dropdown",content:'<span class="data-icon data-icon-align-top" />',title:o["verticalAlign"]["title"],didMount:function(t){e.alignToolButton=t.find(".data-toolbar-btn")},items:[{type:"button",content:'<span class="data-icon data-icon-align-top"></span> '.concat(o["verticalAlign"]["top"]),onClick:function(t){return e.updateAlign(t,"top")}},{type:"button",content:'<span class="data-icon data-icon-align-middle"></span> '.concat(o["verticalAlign"]["middle"]),onClick:function(t){return e.updateAlign(t,"middle")}},{type:"button",content:'<span class="data-icon data-icon-align-bottom"></span> '.concat(o["verticalAlign"]["bottom"]),onClick:function(t){return e.updateAlign(t,"bottom")}}]},{key:"merge",type:"button",title:o["mergeCell"],content:'<span class="data-icon data-icon-merge-cells"></span>',disabled:e.conltrollBar.getMenuDisabled("mergeCell"),onClick:function(){e.command.mergeCell()}},{key:"split",type:"button",title:o["splitCell"],content:'<span class="data-icon data-icon-solit-cells"></span>',disabled:e.conltrollBar.getMenuDisabled("splitCell"),onClick:function(){e.command.splitCell()}},{key:"equalWidth",type:"button",title:"列等宽",content:'<span class="data-icon" style="font-size:12px;display:flex;align-items:center;padding-top:2px;padding-right:5px"><svg class="ne-icon-symbol" aria-hidden="true" style="\n width: 16px;\n height: 16px;\n margin:0 6px;\n "><path d="M12.375 7.125c1.036 0 1.875.84 1.875 1.875v3.438c0 1.035-.84 1.874-1.875 1.874h-8.75a1.875 1.875 0 0 1-1.875-1.874V9c0-1.036.84-1.875 1.875-1.875Zm0 1.25h-8.75A.625.625 0 0 0 3 9v3.438c0 .345.28.624.625.624h8.75c.345 0 .625-.28.625-.624V9a.625.625 0 0 0-.625-.625ZM2.312 1.75c.311 0 .563.252.563.563v2.874a.563.563 0 0 1-1.125 0V2.313c0-.31.252-.562.563-.562Zm11.376 0c.31 0 .562.252.562.563v2.874a.562.562 0 1 1-1.125 0V2.313c0-.31.252-.562.563-.562ZM12.26 3.188c.323 0 .584.251.584.562a.57.57 0 0 1-.489.555l-.095.008h-.333a.573.573 0 0 1-.583-.563.57.57 0 0 1 .488-.555l.095-.007h.333Zm-2.75 0c.323 0 .584.251.584.562a.57.57 0 0 1-.489.555l-.095.008h-.333a.573.573 0 0 1-.583-.563.57.57 0 0 1 .488-.555l.095-.007h.333Zm-2.75 0c.323 0 .584.251.584.562a.57.57 0 0 1-.489.555l-.095.008h-.333a.573.573 0 0 1-.583-.563.57.57 0 0 1 .488-.555l.095-.007h.333Zm-2.75 0c.323 0 .584.251.584.562a.57.57 0 0 1-.489.555l-.095.008h-.333a.573.573 0 0 1-.583-.563.57.57 0 0 1 .488-.555l.095-.007h.333Z" fill="currentColor" fill-rule="nonzero"></path></svg>列等宽</span>',onClick:function(){var t=e.getValue(),n=document.createElement("div");n.innerHTML=t.html;var r=e.root[0].querySelectorAll("table>colgroup>col");null===r||void 0===r||r.forEach((function(e){e.width=t.width/t.cols})),e.setValue(),e.onChange()}},{key:"describe",type:"button",title:"表头",content:'<span class="data-icon">\n <svg t="1676534718436" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7782" width="16" height="16"><path d="M768 576a224 224 0 1 1 0 448 224 224 0 0 1 0-448z m10.56-516.16a128 128 0 0 1 125.76 108.224l1.28 9.984 0.384 9.856V515.84a38.4 38.4 0 1 1-76.8 0V189.632l-0.192-6.4a51.2 51.2 0 0 0-44.032-46.144l-6.4-0.448H190.336l-6.336 0.256a51.2 51.2 0 0 0-45.632 44.48l-0.384 6.528v651.008l0.192 6.4a51.2 51.2 0 0 0 43.968 46.144l6.4 0.384h294.208a38.4 38.4 0 0 1 6.272 76.352l-6.272 0.448H188.608a128 128 0 0 1-125.76-108.16l-1.28-9.984-0.384-9.856V187.904c0-62.848 45.568-115.968 107.648-126.336l9.92-1.28 9.856-0.448h589.952zM768 640a160 160 0 1 0 0 320 160 160 0 0 0 0-320z m50.368 41.088v232.96h-64.384v-152.64l-10.24 7.424a178.56 178.56 0 0 1-19.968 11.776 236.16 236.16 0 0 1-36.608 14.08v-52.16l12.416-4.352c15.744-6.08 28.416-12.992 38.016-20.8 11.968-9.792 21.376-21.888 28.16-36.288h52.608z m-402.752-112.64c20.032 0 36.48 16.832 36.48 37.312 0 20.48-16.448 37.312-36.48 37.312H324.48A36.992 36.992 0 0 1 288 605.76c0-20.48 16.384-37.312 36.48-37.312z m200.448-155.776c20.096 0 36.48 16.832 36.48 37.312 0 20.544-16.384 37.312-36.48 37.312H324.48A36.992 36.992 0 0 1 288 449.984c0-20.48 16.384-37.312 36.48-37.312zM515.84 256c20.032 0 36.48 16.768 36.48 37.312 0 20.48-16.448 37.312-36.48 37.312H324.48A36.992 36.992 0 0 1 288 293.312c0-20.48 16.384-37.312 36.48-37.312z" fill="#515151" p-id="7783"></path></svg> </span>',didMount:function(t){var r=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",e).call(e);r.showDescribe?Gm(t):Ym(t)},onClick:function(t,n){var r=e.getValue();e.setValue({showDescribe:!r.showDescribe}),r.showDescribe?(Ym(n),e.editor.removeTableDescribe(e)):(Gm(n),e.editor.addTableDescribe(e))}},{key:"describePosition",type:"button",title:"表头位置",content:'<span class="data-icon data-icon-compact-display"></span>',disabled:function(){var t=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",e).call(e);return!t.showDescribe}(),didMount:function(t){},onClick:function(t,n){var r="default",i={bottom:"top",top:"bottom"},o=e.getValue();r=o.describePosition?i[o.describePosition]:"bottom",e.editor.addTableDescribe(e,r),e.setValue({describePosition:r})}}];if(e.isMaximize)return a;var s=[{key:"maximize",type:"maximize"},{key:"copy",type:"copy",onClick:function(){e.command.copy(!0),r.messageSuccess("copy",r.language.get("copy","success"))}},{key:"delete",type:"delete"},{key:"separator",type:"separator"}].concat(a);return 0===Object(D["removeUnit"])((null===(i=e.wrapper)||void 0===i?void 0:i.css("margin-left"))||"0")&&s.unshift({key:"dnd",type:"dnd"}),s}},o=null===(t=r.plugin.findPlugin("table"))||void 0===t?void 0:t.options;return(null===o||void 0===o?void 0:o.cardToolbars)?o.cardToolbars(i(),this.editor):i()}},{key:"onSelectLeft",value:function(t){var e=this.selection.tableModel;if(e)for(var n=e.rows-1;n>=0;n--)for(var r=e.cols-1;r>=0;r--){var i=e.table[n][r];if(!this.helper.isEmptyModelCol(i)&&i.element)return t.preventDefault(),this.selection.focusCell(i.element,!1),!1}}},{key:"onSelectRight",value:function(t){var e=this.selection.tableModel;if(e)for(var n=0;n<e.rows;n++)for(var r=0;r<e.cols;r++){var i=e.table[n][r];if(!this.helper.isEmptyModelCol(i)&&i.element)return t.preventDefault(),this.selection.focusCell(i.element),!1}}},{key:"onSelectUp",value:function(t){var e=this.selection.tableModel;if(e)for(var n=e.rows-1;n>=0;n--)for(var r=0;r<e.cols;r++){var i=e.table[n][r];if(!this.helper.isEmptyModelCol(i)&&i.element)return t.preventDefault(),this.selection.focusCell(i.element,!1),!1}}},{key:"onSelectDown",value:function(t){var e=this.selection.tableModel;if(e)for(var n=0;n<e.rows;n++)for(var r=0;r<e.cols;r++){var i=e.table[n][r];if(!this.helper.isEmptyModelCol(i)&&i.element)return t.preventDefault(),this.selection.focusCell(i.element),!1}}},{key:"updateAlign",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top";t.preventDefault(),this.conltrollBar.setAlign(e),this.onChange("local"),this.updateAlignText(e)}},{key:"updateAlignText",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"top",n='<span class="data-icon data-icon-align-'.concat(e,'"></span>');null===(t=this.alignToolButton)||void 0===t||t.html(n)}},{key:"getValue",value:function(){var t=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",this).call(this);if(!this.wrapper)return t;var e=this.wrapper.find(Xm.TABLE_CLASS);if(!e)return t;var r=this.selection.tableModel;if(!r)return t;var i=this.editor,o=i.schema,a=i.conversion,s=Object(D["$"])("<div></div>");s.append(e.clone(!0));var l=new D["Parser"](s,i,(function(t){t.find(Xm.TABLE_TD_BG_CLASS).remove(),t.find(D["EDITABLE_SELECTOR"]).each((function(t){"TD"===t.nodeName?Object(D["$"])(t).removeAttributes(D["DATA_ELEMENT"]):i.node.unwrap(Object(D["$"])(t))}))})),c=r.rows,u=r.cols,d=r.height,h=r.width,p=l.toValue(o,a,!1,!1);return Object(D["isEngine"])(i)?Object(_["a"])(Object(_["a"])({},t),{},{rows:c,cols:u,height:d,width:h,html:p}):Object(_["a"])(Object(_["a"])({},t),{},{html:p})}},{key:"drawBackground",value:function(t,e){var n,r,i=t.get().getBoundingClientRect(),o=new DOMRect(i.x,i.y,0,0),a=e.startContainer,s=e.endContainer,l=Object(D["closest"])(a,"td"),c=Object(D["closest"])(s,"td");if(l instanceof Element&&c instanceof Element&&"TD"===l.nodeName&&"TD"===(null===c||void 0===c?void 0:c.nodeName)&&l!==c){var u=l.getBoundingClientRect(),d=c.getBoundingClientRect(),h=null===(n=this.viewport)||void 0===n?void 0:n.getBoundingClientRect(),p=((null===h||void 0===h?void 0:h.left)||0)+(this.activated?13:0);return o.x=Math.max(u.left-i.left,p-((null===(r=this.editor.root.getBoundingClientRect())||void 0===r?void 0:r.left)||0)),o.y=u.top-i.top,o.width=(h?Math.min(d.right,h.right):d.right)-u.left,o.height=u.bottom-u.top,o.width<0&&(o.width=0),o.height=d.bottom-u.top,o}}},{key:"activate",value:function(t){var e,r,i;(Object(z["a"])(Object(H["a"])(n.prototype),"activate",this).call(this,t),t)?(this.conltrollBar.refresh(),null===(r=this.wrapper)||void 0===r||Gm(r)):(this.selection.clearSelect(),this.conltrollBar.hideContextMenu(),null===(i=this.wrapper)||void 0===i||Ym(i));null===(e=this.scrollbar)||void 0===e||e.refresh()}},{key:"maximize",value:function(){var t;Object(z["a"])(Object(H["a"])(n.prototype),"maximize",this).call(this),null===(t=this.scrollbar)||void 0===t||t.refresh();var e=this.editor;Object(D["isEngine"])(e)&&!D["isMobile"]&&this.getCenter().on("scroll",this.updateScrollbar,{passive:!0})}},{key:"minimize",value:function(){var t;Object(z["a"])(Object(H["a"])(n.prototype),"minimize",this).call(this),null===(t=this.scrollbar)||void 0===t||t.refresh(),this.getCenter().off("scroll",this.updateScrollbar)}},{key:"getSelectionNodes",value:function(){var t=this,e=[];return this.selection.each((function(n){!t.helper.isEmptyModelCol(n)&&n.element&&e.push(Object(D["$"])(n.element).find(D["EDITABLE_SELECTOR"]))})),1===e.length&&0===e[0].closest("[table-cell-selection=true]").length?[]:e}},{key:"overflow",value:function(t){var e,n,r,i=(null===(e=this.wrapper)||void 0===e||null===(n=e.find(".data-table"))||void 0===n?void 0:n.width())||0,o=this.getCenter().width(),a=i-o;if(a>0&&!this.isMaximize)null===(r=this.wrapper)||void 0===r||r.css("margin-right","-".concat(a>t?t:a,"px"));else if(a<0||this.isMaximize){var s;null===(s=this.wrapper)||void 0===s||s.css("margin-right","")}}},{key:"initScrollbar",value:function(){var t=this;if(this.viewport){var e=this.editor,n=e.plugin.findPlugin("table"),r=(null===n||void 0===n?void 0:n.options.overflow)||{},i=r.maxLeftWidth?{onScrollX:function(n){var i;t.isMaximize&&(n=0);var o=r.maxLeftWidth();return null===(i=t.wrapper)||void 0===i||i.css("margin-left","-".concat(n>o?o:n,"px")),n>0?e.root.find(".data-card-dnd").hide():e.root.find(".data-card-dnd").show(),n-o},getScrollLeft:function(e){var n;return e-Object(D["removeUnit"])((null===(n=t.wrapper)||void 0===n?void 0:n.css("margin-left"))||"0")},getOffsetWidth:function(e){var n;return e+Object(D["removeUnit"])((null===(n=t.wrapper)||void 0===n?void 0:n.css("margin-left"))||"0")}}:void 0;this.scrollbar=new D["Scrollbar"](this.viewport,!0,!1,!0,i),this.scrollbar.setContentNode(this.viewport.find(".data-table")),this.scrollbar.on("display",(function(e){var n,r;"block"===e?null===(n=t.wrapper)||void 0===n||n.addClass("scrollbar-show"):null===(r=t.wrapper)||void 0===r||r.removeClass("scrollbar-show")}));var o,a={x:0,y:0},s=function(n){var i=n.x,o=n.y;r["maxRightWidth"]&&t.overflow(r["maxRightWidth"]()),a.x===i&&a.y===o||(a={x:i,y:o},Object(D["isEngine"])(e)&&(e.trigger("scroll",t.root,{x:i,y:o}),t.conltrollBar.refresh()))};if(this.scrollbar.on("change",s),D["isMobile"]||window.addEventListener("scroll",this.updateScrollbar,{passive:!0}),window.addEventListener("resize",this.updateScrollbar),Object(D["isEngine"])(e)&&!D["isMobile"])null===(o=e.scrollNode)||void 0===o||o.on("scroll",this.updateScrollbar,{passive:!0})}}},{key:"didRender",value:function(){var t,e,r,i,o,a=this;Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this);var s=this.editor;s.on("undo",this.doChange),s.on("redo",this.doChange),this.viewport=Object(D["isEngine"])(s)?null===(t=this.wrapper)||void 0===t?void 0:t.find(Xm.VIEWPORT):null===(e=this.wrapper)||void 0===e?void 0:e.find(Xm.VIEWPORT_READER),this.selection.init(),this.conltrollBar.init(),this.command.init(),!Object(D["isEngine"])(s)||s.readonly?null===(r=this.toolbarModel)||void 0===r||r.setOffset([0,-20]):null===(i=this.toolbarModel)||void 0===i||i.setOffset([13,-8,0,-6]);var l=s.plugin.findPlugin("table"),c=(null===l||void 0===l?void 0:l.options.overflow)||{};this.viewport&&(this.selection.refreshModel(),setTimeout((function(){a.initScrollbar()}),0)),this.selection.on("select",(function(){var t,e;if(a.conltrollBar.refresh(!1),Object(D["isEngine"])(s)){var n=null===(t=a.selection.getSingleCell())||void 0===t?void 0:t.css("vertical-align");a.updateAlignText(n),null===(e=a.toolbarModel)||void 0===e||e.update()}})),this.conltrollBar.on("sizeChanged",(function(){var t;a.selection.refreshModel(),a.onChange(),null===(t=a.scrollbar)||void 0===t||t.refresh()})),this.conltrollBar.on("sizeChanging",(function(){var t;null===(t=a.scrollbar)||void 0===t||t.refresh(),s.trigger("editor:resize"),a.updateScrollbar()})),this.command.on("actioned",(function(t,e){var n,r;"paste"===t&&s.card.render(a.wrapper),["splitCell","mergeCell"].includes(t)&&s.trigger("editor:resize"),a.selection.render(t),null===(n=a.toolbarModel)||void 0===n||n.update(),e||a.onChange(),c.maxRightWidth&&a.overflow(c.maxRightWidth()),null===(r=a.scrollbar)||void 0===r||r.refresh()}));var u=null===(o=this.wrapper)||void 0===o?void 0:o.find(Xm.TABLE_CLASS);if(u){var d=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",this).call(this);if(!(null===d||void 0===d?void 0:d.html)){var h=this.getValue();h&&Object(D["isEngine"])(s)&&this.setValue(h),this.onChange()}c.maxRightWidth&&this.overflow(c.maxRightWidth()),$m.editor.addTableDescribe($m)}}},{key:"remoteRefresh",value:function(){var t,e,r=this;if(this.wrapper&&0!==this.wrapper.length&&(null!==(t=this.wrapper[0].parentElement)&&void 0!==t?t:this.wrapper[0].parentNode)){var i=this.wrapper.find(Xm.COLS_HEADER_CLASS),o=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",this).call(this),a=i.find(Xm.COLS_HEADER_ITEM_CLASS),s=a.length;if(o.cols>s)i.append(Object(D["$"])(this.template.renderColsHeader(o.cols-s)).find(Xm.COLS_HEADER_ITEM_CLASS)),a=i.find(Xm.COLS_HEADER_ITEM_CLASS);else if(o.cols<s)for(var l=s;l>o.cols;l--){var c;null===(c=a.eq(l-1))||void 0===c||c.remove()}var u=o.html?Object(D["$"])(o.html):this.wrapper.find("table"),d=u.find("col").toArray();d.forEach((function(t,e){var n,i=t.attributes("width")||t.css("width");null===(n=a.eq(e))||void 0===n||n.css("width","".concat(Math.max(parseInt(i),r.colMinWidth),"px"))}));var h=this.wrapper.find(Xm.ROWS_HEADER_CLASS),p=h.find(Xm.ROWS_HEADER_ITEM_CLASS),f=p.length;if(o.rows>f)h.append(Object(D["$"])(this.template.renderRowsHeader(o.rows-f)).find(Xm.ROWS_HEADER_ITEM_CLASS)),p=h.find(Xm.ROWS_HEADER_ITEM_CLASS);else if(o.rows<f)for(var g=f;g>o.rows;g--){var m;null===(m=p.eq(g-1))||void 0===m||m.remove()}var v=u.find("tr").toArray();v.forEach((function(t,e){var n;null===(n=p.eq(e))||void 0===n||n.css("height",Math.max(parseInt(t.css("width")),r.rowMinHeight))})),null===(e=this.scrollbar)||void 0===e||e.refresh(),this.remoteRefreshTimeout&&clearTimeout(this.remoteRefreshTimeout),this.remoteRefreshTimeout=setTimeout((function(){var t;null===(t=r.wrapper)||void 0===t||t.find(D["EDITABLE_SELECTOR"]).each((function(t){var e=t;e.hasAttribute(D["DATA_CONTENTEDITABLE_KEY"])||e.setAttribute(D["DATA_CONTENTEDITABLE_KEY"],r.template.isReadonly?"false":"true")}))}),10)}}},{key:"render",value:function(){var t;$m=this;var e=this.editor;if(this.template.isReadonly=!Object(D["isEngine"])(e)||e.readonly,!(this.wrapper&&this.wrapper.length>0&&(null!==(t=this.wrapper[0].parentElement)&&void 0!==t?t:this.wrapper[0].parentNode))){var n=this.getValue();if(!n)return"Error value";if(n.showDescribe&&setTimeout((function(){}),0),n.html){var r=Object(D["$"])(n.html);r&&"table"!==r.name&&(r=r.toArray().find((function(t){return"table"===t.name})),r?n.html=r.get().outerHTML:(n.html="<table><tr><td>".concat(n.html,"</td></tr></table>"),r=Object(D["$"])(n.html)));var i=this.helper.getTableModel(r);n.rows=i.rows,n.cols=i.cols}return this.wrapper=Object(D["isEngine"])(e)?Object(D["$"])(this.template.htmlEdit(n,Jm(e.language.get("table")))):Object(D["$"])(this.template.htmlView(n)),Object(D["isEngine"])(e)||this.wrapper.find("table").addClass("data-table").addClass("data-table-view"),n.rows=this.wrapper.find("tr").length,n.width&&this.wrapper.find("table").css("width","".concat(n.width,"px")),this.wrapper}this.remoteRefresh()}},{key:"destroy",value:function(t){var e,r;Object(z["a"])(Object(H["a"])(n.prototype),"destroy",this).call(this);var i=this.editor;window.removeEventListener("scroll",this.updateScrollbar),window.removeEventListener("resize",this.updateScrollbar),null===(e=i.scrollNode)||void 0===e||e.off("scroll",this.updateScrollbar),null===(r=this.scrollbar)||void 0===r||r.destroy(),this.command.removeAllListeners();var o=this.selection;o.removeAllListeners(),o.destroy();var a=this.conltrollBar;a.removeAllListeners(),a.destroy(),i.off("undo",this.doChange),i.off("redo",this.doChange)}}],[{key:"cardName",get:function(){return"table"}},{key:"cardType",get:function(){return D["CardType"].BLOCK}},{key:"selectStyleType",get:function(){return D["SelectStyleType"].BACKGROUND}},{key:"autoSelected",get:function(){return!1}},{key:"lazyRender",get:function(){return!0}}]),n}(D["Card"]);fv.colors=nv.getColors().map((function(t){return t.map((function(t){return{color:t,border:nv.getStroke(t)}}))}));var gv={table:{insertColLeft:"Insert column(s) $data left",insertColRight:"Insert column(s) $data right",insertRowUp:"Insert row(s) $data up",insertRowDown:"Insert row(s) $data down",mergeCell:"Merge cells",splitCell:"Unmerge cells",removeCol:"Delete selected column(s)",removeRow:"Delete selected row(s)",removeTable:"Delete table",copy:"Copy",cut:"Cut",paste:"Paste",clear:"Clear",draggingCol:"Moving $data column",draggingRow:"Moving $data row",color:{title:"Cell background color",nonFillText:"No fill color"},noBorder:"Hide border",showBorder:"Show border",verticalAlign:{title:"Vertical align",top:"Align top",middle:"Align middle",bottom:"Align bottom"}}},mv={table:{insertColLeft:"左边插入 $data 列",insertColRight:"右边插入 $data 列",insertRowUp:"上方插入 $data 行",insertRowDown:"下方插入 $data 行",mergeCell:"合并单元格",splitCell:"拆分单元格",removeCol:"删除选中列",removeRow:"删除选中行",removeTable:"删除表格",copy:"复制",cut:"剪切",paste:"粘贴",clear:"清空内容",draggingCol:"正在移动 $data 列",draggingRow:"正在移动 $data 行",color:{title:"单元格背景色",nonFillText:"无填充色"},noBorder:"隐藏边框",showBorder:"显示边框",verticalAlign:{title:"垂直对齐",top:"顶对齐",middle:"垂直居中",bottom:"底对齐"}}},vv={"en-US":gv,"zh-CN":mv},bv='div.table-describe{\n text-align: center; \n color: black;} div[dnd-trigger-key="table"], div[toolbar-trigger-key="table"] {\n margin-left: -13px;\n margin-top: -13px;\n}\n\n.data-table {\n border: none;\n position: relative;\n z-index: 1;\n table-layout: fixed;\n white-space: pre-wrap;\n width: 100%;\n border-collapse: collapse;\n background-color: #ffffff;\n}\n\ndiv[data-card-key="table"].card-selected .data-table, div[data-card-key="table"].card-selected-other .data-table {\n background: transparent\n}\n\n.am-engine [data-card-key="table"].card-selected [data-card-element="center"].data-card-background-selected {\n background: transparent;\n}\n\n.am-engine [data-card-key="table"].card-selected [data-card-element="center"].data-card-background-selected .table-wrapper {\n background: rgba(27, 162, 227, 0.2);\n}\n\n.am-engine-mobile div[data-card-key="table"].card-activated {\n margin-left: 20px;\n}\n\n.data-table tr,.data-table td {\n position: relative;\n}\n\n.data-table tr {\n height: 35px;\n}\n\n.data-table tr td {\n border: none;\n vertical-align: top;\n cursor: text;\n}\n\n.data-table tr td[table-cell-selection]:after {\n content: \' \';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(180, 213, 254, 0.5);\n pointer-events: none;\n z-index: 2;\n}\n\n.drag-selecting .data-table, .data-table tr td[table-cell-selection] {\n caret-color:transparent\n}\n\n.data-table tr td[table-cell-selection] ::-moz-selection{\n background: transparent !important;\n}\n\n.data-table tr td[table-cell-selection] ::selection{\n background: transparent !important;\n}\n\n.table-wrapper {\n position: relative;\n cursor: default;\n}\n\n.table-wrapper.active {\n margin-top: -42px;\n width: 100%;\n}\n\n.table-wrapper.scrollbar-show {\n margin-bottom: -10px;\n}\n\n.table-wrapper.data-table-highlight tr td[table-cell-selection]:after {\n background: transparent;\n}\n\n.table-wrapper .table-header {\n position: absolute;\n visibility: hidden;\n left: -13px;\n top: 28px;\n width: 14px;\n height: 14px;\n cursor: pointer;\n z-index: 4;\n background-color: #ffffff;\n}\n\n.table-wrapper .table-header .table-header-item {\n border: 1px solid #dfdfdf;\n background-color: #f2f3f5;\n border-top-left-radius: 50%;\n width: 100%;\n height: 100%;\n}\n\n.table-wrapper .table-header:hover {\n background-color: #ffffff;\n}\n\n.table-wrapper.data-table-highlight-all .table-header .table-header-item {\n background: rgba(255, 77, 79, 0.4) !important;\n}\n\n.table-wrapper .table-header-item:hover{\n background-color: #e2e4e6;\n}\n\n.table-wrapper.active .table-header {\n visibility:visible\n}\n\n.table-wrapper .table-header.selected .table-header-item {\n background: #4daaff;\n border-color: #4daaff;\n}\n\n.table-wrapper .table-cols-header {\n position: relative;\n z-index:1;\n height: 13px;\n display: none;\n width: 100%;\n cursor: default;\n}\n\n.table-wrapper.active .table-cols-header {\n display: flex;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item {\n position: relative;\n height: 13px;\n width: auto;\n border: 1px solid #dfdfdf;\n border-bottom: 0 none;\n overflow: visible;\n background: #f2f3f5;\n cursor: pointer;\n border-right: 0 none;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item.active{\n background-color: #e2e4e6;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item:first-child {\n border-top-left-radius: 2px;\n border-bottom-left-radius: 2px;\n}\n.table-wrapper .table-cols-header .table-cols-header-item:last-child {\n border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\n border-right: 1px solid #dfdfdf;\n}\n.table-wrapper.data-table-highlight-col .table-cols-header .table-cols-header-item.active, .table-wrapper.data-table-highlight-all .table-cols-header .table-cols-header-item {\n background: rgba(255, 77, 79, 0.4) !important;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.selected {\n background: #fff;\n z-index: 1;\n border-radius: 0;\n border-bottom: 0;\n cursor: move;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.selected .col-dragger {\n display: flex;\n position: absolute;\n left: -1px;\n top: -1px;\n right: -1px;\n bottom: -1px;\n background: #4daaff;\n border-radius: 0;\n z-index: 1;\n justify-content: center;\n align-items: center;\n}\n\n.table-wrapper.data-table-highlight-col .table-cols-header .table-cols-header-item .col-dragger,.table-wrapper.data-table-highlight-all .table-cols-header .table-cols-header-item .col-dragger {\n background: transparent !important;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.selected .col-dragger .drag-info {\n display: none;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.no-dragger .col-dragger .data-icon {\n display: none;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.dragging .col-dragger {\n height: 50px;\n}\n.table-wrapper .table-cols-header .table-cols-header-item.dragging .col-dragger .drag-info {\n display: block;\n color: #fff;\n}\n.table-wrapper .table-cols-header .table-cols-header-item .cols-trigger {\n position: absolute;\n right: -1px;\n top: -1px;\n width: 2px;\n height: 14px;\n z-index: 10;\n}\n\n.am-engine-mobile .table-wrapper .table-cols-header .table-cols-header-item .cols-trigger {\n right: -3px;\n width: 6px;\n}\n\n.am-engine:not(.am-engine-mobile) .table-wrapper .table-cols-header .table-cols-header-item .cols-trigger.active {\n background: #0589f3;\n cursor: col-resize;\n}\n\n.am-engine:not(.am-engine-mobile) .table-wrapper .table-cols-header .table-cols-header-item .cols-trigger.dragging {\n width: 2px;\n background: #0589f3;\n right: -1px;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item .col-dragger {\n text-align: center;\n display: none;\n}\n.table-wrapper .table-cols-header .table-cols-header-item .col-dragger .data-icon-drag {\n font-size: 10px;\n color: #fff;\n}\n\n.table-wrapper .table-cols-header .table-cols-header-item .col-dragger .data-icon-drag::before {\n transform: rotate(90deg);\n display: inline-block;\n}\n\n.table-wrapper.data-table-highlight-col .table-cols-header .table-cols-header-item .col-dragger .data-icon-drag,.table-wrapper.data-table-highlight-all .table-cols-header .table-cols-header-item .col-dragger .data-icon-drag{\n display: none;\n}\n.table-wrapper .table-cols-header.dragging .table-cols-header-item .cols-trigger,.table-wrapper.drag-selecting .table-cols-header-item .cols-trigger{\n display: none;\n}\n.table-wrapper .table-cols-header.resize .table-cols-header-item {\n cursor: col-resize;\n}\n.table-wrapper .table-rows-header {\n position: absolute;\n left: -13px;\n top: 41px;\n width: 14px;\n z-index: 128;\n border-right: 0;\n display: none;\n}\n\n.table-wrapper.active .table-rows-header {\n display: block;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item {\n position: relative;\n width: 100%;\n border: 1px solid #dfdfdf;\n border-bottom: 0;\n background: #f2f3f5;\n cursor: pointer;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item.active\n{\n background-color: #e2e4e6;\n}\n\n/* .table-wrapper .table-rows-header .table-rows-header-item:nth-child(3) {\n border-top: 0 none;\n} */\n\n.table-wrapper .table-rows-header .table-rows-header-item:last-child{\n border-bottom: 1px solid #dfdfdf;\n}\n\n.table-wrapper.data-table-highlight-row .table-rows-header .table-rows-header-item.active,.table-wrapper.data-table-highlight-all .table-rows-header .table-rows-header-item {\n background: rgba(255, 77, 79, 0.4) !important;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item.selected {\n width: 14px;\n background: #fff;\n cursor: move;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.selected .row-dragger {\n display: flex;\n position: absolute;\n align-items: center;\n text-align: left;\n white-space: nowrap;\n content: \' \';\n left: -1px;\n top: -1px;\n bottom: -1px;\n right: -1px;\n background: #4daaff;\n border-radius: 0;\n z-index: 1;\n}\n.table-wrapper.data-table-highlight-row .table-rows-header .table-rows-header-item .row-dragger,.table-wrapper.data-table-highlight-all .table-rows-header .table-rows-header-item .row-dragger{\n background: transparent !important;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.selected .row-dragger .drag-info {\n display: none;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.no-dragger .row-dragger .data-icon {\n display: none;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.dragging .row-dragger {\n width: 150px;\n}\n.table-wrapper .table-rows-header .table-rows-header-item.dragging .row-dragger .drag-info {\n margin-left: 5px;\n display: flex;\n padding: 10px;\n color: #fff;\n}\n.table-wrapper .table-rows-header .table-rows-header-item .rows-trigger {\n position: absolute;\n bottom: -1px;\n height: 2px;\n width: 14px;\n left: -1px;\n z-index: 10;\n cursor: row-resize;\n}\n\n.am-engine-mobile .table-wrapper .table-rows-header .table-rows-header-item .rows-trigger {\n bottom: -3px;\n height: 6px;\n}\n\n.am-engine:not(.am-engine-mobile) .table-wrapper .table-rows-header .table-rows-header-item .rows-trigger.active {\n background: #0589f3;\n}\n\n.am-engine:not(.am-engine-mobile) .table-wrapper .table-rows-header .table-rows-header-item .rows-trigger.dragging {\n height: 2px;\n background: #0589f3;\n bottom: -1px;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item .row-dragger {\n display: none;\n}\n.table-wrapper .table-rows-header .table-rows-header-item .row-dragger .data-icon-drag {\n font-size: 10px;\n color: #fff;\n margin-left: 1px;\n}\n\n.table-wrapper.data-table-highlight-row .table-rows-header .table-rows-header-item .row-dragger .data-icon-drag,.table-wrapper.data-table-highlight-all .table-rows-header .table-rows-header-item .row-dragger .data-icon-drag{\n display: none;\n}\n\n.table-wrapper .table-rows-header .table-rows-header-item .row-dragger .drag-info {\n height: 100%;\n display: flex;\n align-items: center;\n}\n.table-wrapper .table-rows-header.dragging .table-rows-header-item .rows-trigger,.table-wrapper.drag-selecting .table-rows-header-item .rows-trigger {\n display: none;\n}\n.table-wrapper .table-rows-header.resize .table-rows-header-item {\n cursor: row-resize;\n}\n\n.table-wrapper .table-viewport {\n position: relative;\n overflow: hidden;\n overflow-y: hidden;\n cursor: text;\n}\n\n.table-wrapper.active .table-viewport{\n padding-top: 28px;\n padding-left: 13px;\n margin-left: -13px;\n}\n\n.table-wrapper .table-viewport .scrollbar-shadow-left {\n top: 0;\n bottom: 10px;\n}\n\n.table-wrapper.active .table-viewport .scrollbar-shadow-left {\n top: 28px;\n margin-left: 14px;\n}\n\n.table-wrapper .table-viewport .scrollbar-shadow-right {\n top: 0;\n bottom: 10px;\n}\n\n.table-wrapper.active .table-viewport .scrollbar-shadow-right {\n top: 28px;\n}\n\n.table-wrapper .table-placeholder {\n position: absolute;\n border: 1px solid #008dff;\n background: #008dff;\n display: none;\n z-index: 126;\n}\n.table-wrapper .table-menubar {\n position: absolute;\n top: -99999px;\n left: -99999px;\n padding: 4px 0;\n border-radius: 4px;\n border: 1px solid #e9e9e9;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.08);\n background: #fff;\n /* \\u4ee3\\u7801\\u5757\\u7684 codemirror \\u9ed8\\u8ba4\\u7ed9\\u6bcf\\u884c\\u4ee3\\u7801\\u7684 pre \\u8bbe\\u7f6e\\u4e86 z-index 2, \\u5982\\u679c\\u8868\\u683c\\u5728\\u4ee3\\u7801\\u5757\\u524d\\u9762\\uff0c\\u9020\\u6210\\u53f3\\u952e\\u83dc\\u5355\\u65e0\\u6cd5\\u70b9\\u51fb */\n z-index: 130;\n min-width: 240px;\n}\n.table-wrapper .table-menubar .table-menubar-item {\n padding: 6px 16px;\n cursor: default;\n}\n.table-wrapper .table-menubar .table-menubar-item:hover {\n background: #f0f0f0;\n}\n\n.table-wrapper .table-menubar .table-menubar-item.disabled {\n color: #aaa;\n display: none;\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input {\n width: 46px;\n line-height: 12px;\n font-size: 12px;\n outline: none;\n border: 1px solid #dadada;\n border-radius: 4px;\n text-align: center;\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input::-moz-selection {\n color: inherit;\n background:transparent\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input::selection {\n color: inherit;\n background:transparent\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input:focus::-moz-selection\n{\n color: #fff;\n background: #1890ff;\n}\n\n.table-wrapper .table-menubar .table-menubar-item .table-menubar-item-input:focus::selection\n{\n color: #fff;\n background: #1890ff;\n}\n\n.table-wrapper .table-menubar .split {\n height: 0;\n border-top: 1px solid #e8e8e8;\n margin: 2px 0;\n}\n\n.table-wrapper .table-main-content {\n margin: 2px 2px;\n padding: 4px 4px;\n position: relative;\n z-index: 3;\n}\n\n.table-wrapper .table-main-content [data-card-key] {\n max-width: 100%;\n}\n\n.table-wrapper .table-main-bg {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 1;\n bottom: 0;\n pointer-events: none;\n}\n\n.table-wrapper .table-main-bg .table-main-border-top {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 1;\n height: 0;\n border-top: 1px solid rgb(217, 217, 217);\n}\n\n.table-wrapper:not(.active) [data-table-no-border="true"] .table-main-bg .table-main-border-top {\n border-top-color: transparent;\n}\n\n.table-wrapper.active [data-table-no-border="true"] .table-main-bg .table-main-border-top {\n border-top-style: dashed;\n}\n\n.table-wrapper .table-main-bg .table-main-border-right {\n display: none;\n position: absolute;\n top: 0;\n bottom: 0;\n right: -1px;\n z-index: 1;\n width: 0;\n border-right: 1px solid rgb(217, 217, 217);\n}\n\n.table-wrapper:not(.active) [data-table-no-border="true"] .table-main-bg .table-main-border-right {\n border-right-color: transparent;\n}\n\n.table-wrapper.active [data-table-no-border="true"] .table-main-bg .table-main-border-right {\n border-right-style: dashed;\n}\n\n.table-wrapper tr td.table-last-row .table-main-bg .table-main-border-right {\n display: block;\n right: 0;\n}\n\n.table-wrapper .table-main-bg .table-main-border-bottom {\n display: none;\n position: absolute;\n bottom: -1px;\n left: 0;\n right: 0;\n z-index: 1;\n height: 0;\n border-bottom: 1px solid rgb(217, 217, 217);\n}\n\n.table-wrapper:not(.active) [data-table-no-border="true"] .table-main-bg .table-main-border-bottom {\n border-bottom-color: transparent;\n}\n\n.table-wrapper.active [data-table-no-border="true"] .table-main-bg .table-main-border-bottom {\n border-bottom-style: dashed;\n}\n\n.table-wrapper tr td.table-last-column .table-main-bg .table-main-border-bottom{\n display: block;\n bottom: 0;\n}\n\n.table-wrapper .table-main-bg .table-main-border-left {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n width: 0;\n border-left: 1px solid rgb(217, 217, 217);\n}\n\n.table-wrapper:not(.active) [data-table-no-border="true"] .table-main-bg .table-main-border-left {\n border-left-color: transparent;\n}\n\n.table-wrapper.active [data-table-no-border="true"] .table-main-bg .table-main-border-left {\n border-left-style: dashed;\n}\n\n.table-wrapper .table-highlight {\n background: #ff4d4f;\n opacity: 0.08;\n position: absolute;\n z-index: 2;\n pointer-events: none;\n display: none;\n}\n\n.table-wrapper.scrollbar-show .data-scrollable.scroll-x {\n padding-bottom: 10px;\n}\n\n.table-wrapper .data-scrollable.scroll-x {\n padding-bottom: 0;\n}\n\n.table-wrapper .data-scrollable.scroll-x:hover {\n overflow: hidden;\n}\n\n.table-wrapper.scrollbar-show .data-scrollable.scroll-x .data-scrollbar-x{\n margin-bottom: 2px;\n}\n\n.table-wrapper .data-scrollable .data-scrollbar.data-scrollbar-x {\n height: 6px;\n z-index: 5;\n}\n\n.table-wrapper .data-scrollable .data-scrollbar.data-scrollbar-x .data-scrollbar-trigger {\n height: 6px;\n}\n\n.table-wrapper .table-rows-header .table-row-delete-button,.table-wrapper .table-rows-header .table-row-add-button {\n position: absolute;\n right: 100%;\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 2;\n width: 24px;\n height: 24px;\n border: 1px solid #e4e4e4;\n border-radius: 2px;\n cursor: pointer;\n background-color: #fff;\n background-position: center center;\n background-repeat: no-repeat;\n\n left: 14px;\n margin-left: 2px;\n margin-top: -2px;\n}\n\n.table-wrapper .table-rows-header .table-row-delete-button .data-icon,.table-wrapper .table-rows-header .table-row-add-button .data-icon {\n font-size: 12px;\n}\n\n.table-wrapper .table-rows-header .table-row-add-button {\n left: -30px;\n margin-top: -12px;\n}\n\n.table-wrapper .table-rows-header .table-row-delete-button:hover,.table-wrapper .table-col-delete-button:hover {\n color:#ff4d4f;\n}\n\n.table-wrapper .table-col-delete-button, .table-wrapper .table-col-add-button {\n position: absolute;\n bottom: 100%;\n display: none;\n justify-content: center;\n align-items: center;\n z-index: 128;\n margin-bottom: 4px;\n width: 24px;\n height: 24px;\n border: 1px solid #e4e4e4;\n border-radius: 2px;\n cursor: pointer;\n background: #fff;\n background-position: center center;\n background-repeat: no-repeat;\n margin-left: -12px;\n}\n\n.table-wrapper .table-col-delete-button .data-icon, .table-wrapper .table-col-add-button .data-icon {\n font-size: 12px;\n}\n\n.table-wrapper .table-cols-header .table-col-add-button .table-col-add-split-button {\n position: absolute;\n width: 2px;\n left: 10px;\n top: 22px;\n background: #008dff;\n display: none;\n}\n\n.table-wrapper .table-rows-header .table-row-add-button .table-row-add-split-button {\n position: absolute;\n height: 2px;\n left: 22px;\n background: #008dff;\n display: none;\n}\n\n.table-wrapper .table-col-add-button:hover, .table-wrapper .table-row-add-button:hover {\n color: #008dff;\n}\n\n.table-wrapper .table-col-add-button:hover .table-col-add-split-button{\n display: block;\n}\n\n.table-wrapper .table-row-add-button:hover .table-row-add-split-button{\n display: block;\n}\n\n.data-table-reader .data-table tr td {\n border: 1px solid rgb(217, 217, 217);\n cursor: auto;\n padding: 4px 8px;\n}\n\n.data-table-reader .data-table[data-table-no-border="true"] tr td {\n border:0 none\n}\n\n.data-table-reader.data-scrollable.scroll-x {\n padding-bottom: 10px;\n}\n\n.data-table-reader .scrollbar-shadow-left, .data-table-reader .scrollbar-shadow-right {\n bottom: 10px;\n}\n\n.data-table-reader.scrollbar-show.data-scrollable.scroll-x .data-scrollbar-x{\n margin-bottom: 2px;\n}\n\n.data-table-reader.data-scrollable .data-scrollbar.data-scrollbar-x {\n height: 6px;\n}\n\n.data-table-reader.data-scrollable .data-scrollbar.data-scrollbar-x .data-scrollbar-trigger {\n height: 6px;\n}\n\n[data-card-key="table"].data-card-block-max > [data-card-element="body"] > [data-card-element="center"] {\n padding: 48px;\n margin-top: 4px;\n}\n/**\n表格可溢出样式\n**/\n.table-wrapper.table-overflow {\n width: auto;\n}\n';dv(bv);var yv=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.onCopy=function(e){var n=t.editor;if(!Object(D["isEngine"])(n))return!0;var r=n.change,i=n.card,o=r.range.get(),a=i.find(o.commonAncestorNode,!0);if(a&&a.name===fv.cardName&&!a.isCursor(o.startNode)){var s=a.getSelectionNodes();if(s.length>1)return e.preventDefault(),a.command.copy(),n.messageSuccess("copy",n.language.get("copy","success")),!1}return!0},t.onCut=function(e){var n=t.editor;if(!Object(D["isEngine"])(n)||n.readonly)return!0;var r=n.change,i=n.card,o=r.range.get(),a=i.find(o.commonAncestorNode,!0);if(a&&a.name===fv.cardName&&!a.isCursor(o.startNode)){var s=a.getSelectionNodes();if(s.length>1)return e.preventDefault(),a.command.cut(),!1}return!0},t.onPaste=function(e){var n=t.editor;if(!Object(D["isEngine"])(n)||n.readonly)return!0;var r=n.change,i=n.card,o=r.range.get(),a=i.find(o.commonAncestorNode,!0);if(a&&a.name===fv.cardName&&!a.isCursor(o.startNode)){var s=n.clipboard.getData(e);return!s||!/<meta\s+name="aomao"\s+content="table"\s{0,}\/?>/gi.test(s.html||"")||(e.preventDefault(),a.command.paste(s),!1)}return!0},t.pasteSchema=function(t){t.data.blocks.forEach((function(t){t.allowIn||(t.allowIn=[]),t.allowIn.indexOf("td")<0&&t.allowIn.push("td")}));var e=t.find((function(t){return"table"===t.name}))[0];e.attributes={class:["data-table"],"data-table-no-border":"*","data-width":"@length",style:{width:"@length",background:"@color","background-color":"@color"}};var n=e.allowIn;n?n.push("div"):e.allowIn=["div"],t.find((function(t){return"div"===t.name}))[0].attributes={class:{required:!0,value:["editor-table-wrapper"]}},t.find((function(t){return"tr"===t.name}))[0].attributes={class:["data-table"],"data-table-no-border":"*",style:{height:"@length",background:"@color","background-color":"@color",display:"*"}},t.find((function(t){return"td"===t.name}))[0].attributes={colspan:"@number",rowspan:"@number",class:["table-last-column","table-last-row","table-last-column","table-cell-selection"],style:{"background-color":"@color",background:"@color","vertical-align":["top","middle","bottom"],valign:["top","middle","bottom"]}}},t.pasteEach=function(e){var n;"div"===e.name&&e.hasClass("editor-table-wrapper")&&"table"===(null===(n=e.first())||void 0===n?void 0:n.name)&&t.editor.node.unwrap(e)},t.pasteHtml=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){var r=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"width",r=e.attributes("data-width"),i=r||e.css(n);i.endsWith("%")&&e.css(n,""),i.endsWith("pt")&&e.css(n,t.convertToPX(i))},i=e.find("table");if(0!==i.length){var o=new Zm(n),a=n.change,s=a.range.get(),l=function(t){var e=t.find("thead"),r=e.find("th,td").toArray();r.forEach((function(e){t.before(e.children())}));var i=t.find("tr").toArray();i.forEach((function(e){var r=e.find("td").toArray();r.forEach((function(e){n.node.isEmpty(e)||t.before(e.children())}))}));var o=t.find("tfoot"),a=o.find("th,td").toArray();a.forEach((function(e){t.after(e.children())})),t.remove()},c=s.startNode.closest(D["EDITABLE_SELECTOR"]).length>0;i.each((function(t,e){var a,s,u,d=i.eq(e);if(d)if(c||"td"===(null===(a=d.parent())||void 0===a?void 0:a.name))l(d);else{var h=d.find("tr");h.each((function(t){var e=Object(D["$"])(t),n=e.css("display");"none"===n?e.remove():e.css("display","");var r=e.children();r.each((function(t){var e=Object(D["$"])(t),n=e.text(),r=e.find("table");if(r.length>0&&(r.after(document.createTextNode(r.text())),r.remove()),"td"!==e.name&&["\n","\r\n"].includes(n.trim())){var i=Object(D["$"])("<td></td>");e.before(i),i.append(e)}}))}));var p=d.attributes("data-width");p&&d.css("width",p),d=o.normalizeTable(d),r(d),r(d,"height");var f=d.find("tbody"),g=d.find("thead");g&&g.length>0&&f.prepend(g.children()),g.remove();var m=d.find("tfoot");m&&m.length>0&&f.append(m.children()),m.remove();var v=d.find("th");v.each((function(t,e){var n=v.eq(e);null===n||void 0===n||n.replaceWith(Object(D["$"])("<td>".concat(n.html(),"</td>")))}));var b=d.find("td"),y=Object(D["getDocument"])().createDocumentFragment();b.each((function(t,e){y=Object(D["getDocument"])().createDocumentFragment();var i=b.eq(e);if(i){r(i),r(i,"height");var o=i.css("background");o&&i.css("background-color",o);var a=i.attributes("valign");a&&i.attributes("vertical-align",a);for(var s=i.children(),l=0,c=s.length;l<c;l++){var u=s.eq(l);if((0===l||l===c-1)&&(null===u||void 0===u?void 0:u.isText())){var d=u.text();if(/^\n(\s)*$/.test(d))continue}u&&y.appendChild(u[0])}var h=Object(D["$"])(y);null===i||void 0===i||i.empty().append(n.node.normalize(h))}}));var w=(null===(s=d)||void 0===s?void 0:s.css("background"))||(null===(u=d)||void 0===u?void 0:u.css("background-color"));w&&b.css("background",w),h=d.find("tr");var x=1;h.each((function(t){var e=Object(D["$"])(t),n=null===e||void 0===e?void 0:e.find("td");if(0===(null===n||void 0===n?void 0:n.length)&&x<2&&(null===e||void 0===e||e.remove()),n&&(null===n||void 0===n?void 0:n.length)>0){var i=n.toArray().map((function(t){return t[0].rowSpan}));x=Math.max.apply(Math,Object(T["a"])(i))}e&&(r(e),r(e,"height"));var o=(null===e||void 0===e?void 0:e.css("background"))||(null===e||void 0===e?void 0:e.css("background-color"));o&&(null===n||void 0===n||n.css("background",o))})),n.nodeId.generateAll(d,!0);var C=d.allChildren();C.forEach((function(t){n.node.isInline(t)&&n.inline.repairCursor(t)}));var k=d.get().outerHTML.replace(/\n|\r\n/g,"").replace(/>\s+</g,"><");n.card.replaceNode(d,fv.cardName,{html:k}),d.remove()}})),setTimeout((function(){$m.setValue({width:812})}),1e3)}}},t.parseHtml=function(e,n){var r=t.editor,i=[];return e.find("[".concat(D["CARD_KEY"],'="').concat(fv.cardName,'"],[').concat(D["READY_CARD_KEY"],'="').concat(fv.cardName,'"]')).each((function(t){var e=Object(D["$"])(t),o=e.find("table"),a=Object(D["decodeCardValue"])(e.attributes(D["CARD_VALUE_KEY"]));if(0===o.length){if(!a||!a.html)return;if(o=Object(D["$"])(Object(D["transformCustomTags"])(a.html)),0===o.length)return void e.remove();r.trigger("parse:html",o)}var s=o.attributes("width")||o.css("width");o.css({outline:"none","border-collapse":"collapse",width:"100%"}),o.attributes("data-width",s);var l=o.find("td");l.each((function(t,e){var n=l.eq(e);null===n||void 0===n||n.css({"min-width":"auto","white-space":"flat","word-wrap":"break-word",margin:"4px 8px",border:o.attributes("data-table-no-border")?"0 none":"1px solid #d9d9d9",padding:"4px 8px",cursor:"default","vertical-align":n.css("vertical-align")||"top"})})),o.find(Xm.TABLE_TD_BG_CLASS).remove(),o.find(Xm.TABLE_TD_CONTENT_CLASS).each((function(t){r.node.unwrap(Object(D["$"])(t))})),n&&(o=n(o,a));var c=o.attributes("data-id")+"-table";o=Object(D["$"])("<div class=\"editor-table-wrapper\" style='width:100%;overflow:auto;' data-id='".concat(c,"' data-table-no-border='").concat(!!o.attributes("data-table-no-border"),"'>")).append(o),e.replaceWith(o),i.push(o)})),i},t.markdownIt=function(e){!1!==t.options.markdown&&e.enable("table")},t}return Object(B["a"])(n,[{key:"init",value:function(){var t=this.editor;this.options.colMinWidth||(this.options.colMinWidth=40),this.options.rowMinHeight||(this.options.rowMinHeight=30),t.language.add(vv),t.schema.add(this.schema()),t.conversion.add("th","td"),t.on("parse:html",this.parseHtml),t.on("paste:each",this.pasteEach),t.on("paste:each-after",this.pasteHtml),t.on("paste:schema",this.pasteSchema),Object(D["isEngine"])(t)&&(this.editor.on("markdown-it",this.markdownIt),t.change.event.onDocument("copy",this.onCopy,0),t.change.event.onDocument("cut",this.onCut,0),t.change.event.onDocument("paste",this.onPaste,0))}},{key:"hotkey",value:function(){return this.options.hotkey||""}},{key:"schema",value:function(){return[{name:"table",type:"block",attributes:{class:["data-table"],"data-table-no-border":"*",style:{width:"@length"}}},{name:"colgroup",type:"block",allowIn:["table"]},{name:"col",type:"block",isVoid:!0,attributes:{width:"@number",span:"@number"},allowIn:["colgroup"]},{name:"thead",type:"block",allowIn:["table"]},{name:"tbody",type:"block",allowIn:["table"]},{name:"tr",type:"block",attributes:{style:{height:"@length"}},allowIn:["tbody","thead","tfoot"]},{name:"td",type:"block",attributes:{colspan:"@number",rowspan:"@number",class:["table-last-column","table-last-row","table-last-column","table-cell-selection"],style:{"background-color":"@color","vertical-align":["top","middle","bottom"]}},allowIn:["tr"]},{name:"th",type:"block",attributes:{colspan:"@number",rowspan:"@number"},allowIn:["tr"]}]}},{key:"execute",value:function(t,e){var n=this.editor;if(Object(D["isEngine"])(n)){var r=n.change,i=r.range.get();i.startNode.closest(D["EDITABLE_SELECTOR"]).length>0||n.card.insert(fv.cardName,{rows:t||3,cols:e||3,overflow:!!this.options.overflow})}}},{key:"convertToPX",value:function(t){var e=/([\d\.]+)(pt|px)$/i.exec(t);return e&&"pt"===e[2]?String(Math.round(96*parseInt(e[1],10)/72))+"px":t}},{key:"destroy",value:function(){var t=this.editor;t.off("parse:html",this.parseHtml),t.off("paste:each-after",this.pasteHtml),t.off("paste:schema",this.pasteSchema),t.off("markdown-it",this.markdownIt)}}],[{key:"pluginName",get:function(){return"table"}}]),n}(D["Plugin"]),wv=yv,xv=n("c3ba"),Cv=n.n(xv),kv="paste:each",Av=Object(Cf["a"])("styleName"),Sv=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.tagName="span",Object.defineProperty(Object(wf["a"])(t),Av,{writable:!0,value:"font-family"}),t.style=Object(ef["a"])({},Object(xf["a"])(Object(wf["a"])(t),Av)[Av],"@var0"),t.variable={"@var0":{required:!0,value:"*"}},t.pasteEach=function(e){if(e.name===t.tagName){var n=e.css(),r=n[Object(xf["a"])(Object(wf["a"])(t),Av)[Av]];if(!r)return;var i=t.options.filter;if(i){var o=i(r);!1===o?e.css(Object(xf["a"])(Object(wf["a"])(t),Av)[Av],""):"string"===typeof o&&e.css(Object(xf["a"])(Object(wf["a"])(t),Av)[Av],o)}else e.css(Object(xf["a"])(Object(wf["a"])(t),Av)[Av],"");var a=t.editor.node;a.isMark(e)||a.unwrap(e)}},t}return Object(B["a"])(n,[{key:"init",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var t=this.editor;Object(D["isEngine"])(t)&&t.on(kv,this.pasteEach)}},{key:"isTrigger",value:function(t){var e=this.queryState();return!e||!!t}},{key:"execute",value:function(t){var e=this.editor;if(Object(D["isEngine"])(e)){var n=e.change,r=e.mark,i=Object(D["$"])("<".concat(this.tagName," />")),o=this.queryState();if(!t||o&&t===o[0])o&&(this.setStyle(i,o[0]),r.unwrap(i));else{if(this.setStyle(i,t),!this.followStyle&&n.range.get().collapsed)return;r.wrap(i)}}}},{key:"hotkey",value:function(){return this.options.hotkey||[]}},{key:"destroy",value:function(){var t=this.editor;Object(D["isEngine"])(t)&&t.off(kv,this.pasteEach)}}],[{key:"pluginName",get:function(){return"fontfamily"}}]),n}(D["MarkPlugin"]),Ev=Sv,Ov=Object(Cf["a"])("color"),Tv=Object(Cf["a"])("value"),_v=function(){function t(e){Object(F["a"])(this,t),this.options=void 0,this.container=void 0,Object.defineProperty(this,Ov,{writable:!0,value:void 0}),Object.defineProperty(this,Tv,{writable:!0,value:void 0}),this.options=e}return Object(B["a"])(t,[{key:"focus",value:function(){var t,e;null===(t=this.container)||void 0===t||null===(e=t.find("input").get())||void 0===e||e.focus()}},{key:"change",value:function(){var t=this.options.onChange;t&&t(Object(xf["a"])(this,Tv)[Tv],Object(xf["a"])(this,Ov)[Ov])}},{key:"updateActive",value:function(t){var e,n=null===(e=this.container)||void 0===e?void 0:e.find("svg");null===n||void 0===n||n.css("display","none");var r,i=this.options.colors.findIndex((function(e){return e.background===t.background&&e.color===t.color}));i>-1?null===n||void 0===n||null===(r=n.eq(i))||void 0===r||r.css("display","block"):Object(xf["a"])(this,Ov)[Ov]=void 0}},{key:"render",value:function(t,e,n){var r=this;this.destroy(),Object(xf["a"])(this,Tv)[Tv]=e,Object(xf["a"])(this,Ov)[Ov]=n,this.container=Object(D["$"])('<div class="data-card-status-editor'.concat(D["isMobile"]?" data-card-status-editor-mobile":"",'" ').concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" ').concat(D["TRIGGER_CARD_ID"],'="').concat(t,'"></div>'));var i=this.options,o=i.colors,a=i.onBlur,s=i.onFocus,l=i.onOk,c=Object(D["$"])('<input value="'.concat(e,'" />'));c.on("focus",(function(){s&&s()})),c.on("blur",(function(){a&&a()})),c.on("input",(function(t){Object(xf["a"])(r,Tv)[Tv]=t.target.value,r.change()})),c.on(D["isMobile"]?"touchstart":"mousedown",(function(t){})),l&&c.on("keydown",(function(t){-1!==[13,27].indexOf(t.keyCode)&&l(t)})),this.container.append(c);var u=Object(D["$"])('<div class="data-status-editor-color-panle"></div>');return o.forEach((function(t){var e=Object(D["$"])('<span><span style="background-color:'.concat(t.background,'"><svg \n style="fill: ').concat("#8C8C8C"===t.background.toUpperCase()?"#FFFFFF":"#8C8C8C","; \n display: ").concat(t.background===n.background&&t.color===n.color?"block":"none",';" \n viewBox="0 0 18 18"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /></svg></span></span>'));e.on("mousedown",(function(e){e.preventDefault(),Object(xf["a"])(r,Ov)[Ov]=t,r.change()})),u.append(e)})),this.container.append(u),this.container}},{key:"destroy",value:function(){var t;null===(t=this.container)||void 0===t||t.remove();var e=this.options.onDestroy;e&&e()}}]),t}();function Mv(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var Nv='.am-engine [data-card-key="status"].card-selected:not(.card-activated) [data-card-element="center"] .data-label-container::before\r\n{\r\n content: "";\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n background: #1890FF;\r\n opacity: 0.2;\r\n border-radius: 2px;\r\n}\r\n\r\n.am-engine [data-card-key="status"].card-activated ::-moz-selection {\r\n background: transparent !important;\r\n}\r\n\r\n.am-engine [data-card-key="status"].card-activated ::selection {\r\n background: transparent !important;\r\n}\r\n\r\n.data-label-container {\r\n overflow: hidden;\r\n max-width: 200px;\r\n white-space: nowrap;\r\n text-overflow: ellipsis;\r\n cursor: pointer;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n display: inline-block;\r\n border-radius: 4px;\r\n vertical-align: top;\r\n}\r\n\r\n.data-label-container * {\r\n display: inline-block;\r\n}\r\n\r\n.data-label-container .data-label-background {\r\n padding: 0 3px;\r\n}\r\n\r\n.data-label-container.data-label-empty {\r\n opacity: 0.45;\r\n}\r\n\r\n.data-card-status-editor {\r\n outline: none;\r\n width: 162px;\r\n border-radius: 3px 3px;\r\n position: absolute;\r\n border: 1px solid #e8e8e8;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\r\n z-index: 125;\r\n text-indent: 0;\r\n top:0;\r\n padding: 8px;\r\n background: #fff;\r\n}\r\n\r\n.data-card-status-editor-mobile {\r\n width: calc(100vw - 40px);\r\n}\r\n \r\n.data-card-status-editor input {\r\n box-sizing: border-box;\r\n margin: 0;\r\n font-variant: tabular-nums;\r\n list-style: none;\r\n font-feature-settings: "tnum","tnum";\r\n position: relative;\r\n display: inline-block;\r\n width: 100%;\r\n min-width: 0;\r\n padding: 4px 11px;\r\n color: #595959;\r\n font-size: 14px;\r\n line-height: 24px;\r\n background-color: #fff;\r\n background-image: none;\r\n border: 1px solid #d9d9d9;\r\n border-radius: 2px;\r\n transition: all .3s;\r\n}\r\n\r\n.data-card-status-editor input:focus\r\n{\r\n border-color: #5c9dff;\r\n border-right-width: 1px!important;\r\n outline: 0;\r\n box-shadow: 0 0 0 2px rgba(52,126,255,.2)\r\n}\r\n\r\n.data-card-status-editor-mobile input{\r\n min-width:auto;\r\n}\r\n\r\n.data-card-status-editor .data-status-editor-color-panle {\r\n position: relative;\r\n text-align: left;\r\n text-indent: 0;\r\n display: flex;\r\n justify-content: space-between;\r\n width: 100%;\r\n height: auto;\r\n margin-top: 8px;\r\n}\r\n\r\n.data-status-editor-color-panle > span {\r\n width: 24px;\r\n height: 24px;\r\n display: inline-block;\r\n cursor: pointer;\r\n background-color: rgb(255, 255, 255);\r\n padding: 2px;\r\n border-radius: 3px;\r\n border-width: 1px;\r\n border-style: solid;\r\n border-color: transparent;\r\n -o-border-image: initial;\r\n border-image: initial;\r\n flex: 0 0 auto;\r\n}\r\n\r\n.data-status-editor-color-panle > span > span\r\n{\r\n position: relative;\r\n width: 18px;\r\n height: 18px;\r\n display: block;\r\n border-radius: 2px;\r\n border-width: 1px;\r\n border-style: solid;\r\n border-color: transparent;\r\n -o-border-image: initial;\r\n border-image: initial;\r\n}\r\n\r\n.data-status-editor-color-panle > span > span > svg {\r\n position: absolute;\r\n top: -1px;\r\n left: 1px;\r\n width: 12px;\r\n height: 12px;\r\n}';Mv(Nv);var Pv=Object(Cf["a"])("position"),Lv=Object(Cf["a"])("container"),Dv=Object(Cf["a"])("editorContainer"),jv=Object(Cf["a"])("statusEditor"),Iv=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Object.defineProperty(Object(wf["a"])(t),Pv,{writable:!0,value:void 0}),t.defaultColors=[{background:"#FFE8E6",color:"#820014"},{background:"#FCFCCA",color:"#614700"},{background:"#E4F7D2",color:"#135200"},{background:"#E9E9E9",color:"#595959"},{background:"#D4EEFC",color:"#003A8C"},{background:"#DEE8FC",color:"#061178"}],Object.defineProperty(Object(wf["a"])(t),Lv,{writable:!0,value:void 0}),Object.defineProperty(Object(wf["a"])(t),Dv,{writable:!0,value:void 0}),Object.defineProperty(Object(wf["a"])(t),jv,{writable:!0,value:void 0}),t.getMaxWidth=function(){var e=t.editor.block.closest(t.root);return e.get().clientWidth-4},t.onWindowResize=function(){t.updateMaxWidth()},t.updateMaxWidth=function(){var e=t.getMaxWidth();t.root.find(".data-label-container").css("max-width",Math.max(e,0)+"px")},t}return Object(B["a"])(n,[{key:"getColors",value:function(){var t=this.editor.plugin.findPlugin("status");return(null===t||void 0===t?void 0:t.options.colors)||this.defaultColors}},{key:"init",value:function(){var t=this;Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this);var e=this.editor,r=e.card;Object(xf["a"])(this,Pv)[Pv]||(Object(xf["a"])(this,Pv)[Pv]=new D["Position"](e)),Object(xf["a"])(this,jv)[jv]||(Object(xf["a"])(this,jv)[jv]=new _v({colors:this.getColors(),onChange:function(e,n){n&&t.setColor(n),t.setValue({text:e}),t.updateContent()},onOk:function(e){e.stopPropagation(),e.preventDefault(),r.activate(Object(D["$"])(document.body)),r.focus(t)},onDestroy:function(){var e;null===(e=Object(xf["a"])(t,Pv)[Pv])||void 0===e||e.destroy()}}))}},{key:"setColor",value:function(t){var e=this.editor.plugin,n=e.findMarkPlugin("backcolor");if(n){var r=n.createElement(t.background);this.executeMark(r,!0)}var i=e.findMarkPlugin("fontcolor");if(i){var o=i.createElement(t.color);this.executeMark(o,!0)}}},{key:"getColor",value:function(){var t,e,n=this.editor.mark,r=this.queryMarks(),i=(null===(t=r.find((function(t){var e;return"backcolor"===(null===(e=n.findPlugin(t))||void 0===e?void 0:e.name)})))||void 0===t?void 0:t.css("background-color"))||"",o=(null===(e=r.find((function(t){var e;return"fontcolor"===(null===(e=n.findPlugin(t))||void 0===e?void 0:e.name)})))||void 0===e?void 0:e.css("color"))||"";return{background:Object(D["toHex"])(i),color:Object(D["toHex"])(o)}}},{key:"updateContent",value:function(){var t=this;if(Object(xf["a"])(this,Lv)[Lv]){var e=this.getValue(),n=e||{text:"",marks:[]},r=n.text,i=n.marks;Object(xf["a"])(this,Lv)[Lv].removeClass("data-label-empty"),r||(r=this.editor.language.get("status")["defaultValue"],Object(xf["a"])(this,Lv)[Lv].addClass("data-label-empty")),Object(xf["a"])(this,Lv)[Lv].html(r);var o=this.getDefaultColor();this.setColor(o),(i||[]).forEach((function(e){t.executeMark(Object(D["$"])(e),!0)}))}}},{key:"getDefaultColor",value:function(){var t=this.getColors();return t.length>0?t[0]:{background:"#FFFFFF",color:"#222222"}}},{key:"getSelectionNodes",value:function(){return Object(xf["a"])(this,Lv)[Lv]?[Object(xf["a"])(this,Lv)[Lv]]:[]}},{key:"executeMark",value:function(t,e){var n;if(Object(xf["a"])(this,Lv)[Lv]){var r=this.editor.mark,i=Object(xf["a"])(this,Lv)[Lv].children();if(t)if(e){var o=r.findPlugin(t);"backcolor"===(null===o||void 0===o?void 0:o.name)&&t.addClass("data-label-background"),i.each((function(e,n){var o=i.eq(n);o&&r.wrapByNode(o,t)}));var a=this.queryMarks().map((function(t){var e;return(null===(e=t.clone().get())||void 0===e?void 0:e.outerHTML)||""}));this.setValue({marks:a})}else{var s=r.findPlugin(t);if("backcolor"===(null===s||void 0===s?void 0:s.name))return;r.unwrapByNodes(this.queryMarks(!1),t);var l=this.queryMarks().map((function(t){var e;return(null===(e=t.get())||void 0===e?void 0:e.outerHTML)||""}));this.setValue({marks:l})}else{var c=this.queryMarks(!1),u=!1;r.unwrapByNodes(c.filter((function(t){if(u)return!0;var e=r.findPlugin(t);return"backcolor"!==(null===e||void 0===e?void 0:e.name)||(u=!0,!1)}))),this.setValue({marks:[]})}null===(n=Object(xf["a"])(this,jv)[jv])||void 0===n||n.updateActive(this.getColor())}}},{key:"queryMarks",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Object(xf["a"])(this,Lv)[Lv]?Object(xf["a"])(this,Lv)[Lv].allChildren().filter((function(e){return e.isElement()&&t.editor.node.isMark(e)})).map((function(t){if(e){var n=t.clone();return n.removeClass("data-label-background"),n}return t})):[]}},{key:"focusEditor",value:function(){var t;null===(t=Object(xf["a"])(this,jv)[jv])||void 0===t||t.focus()}},{key:"onActivate",value:function(t){var e;Object(z["a"])(Object(H["a"])(n.prototype),"onActivate",this).call(this,t);var r=this.editor;Object(D["isEngine"])(r)&&!r.readonly&&(t?this.renderEditor():null===(e=Object(xf["a"])(this,jv)[jv])||void 0===e||e.destroy())}},{key:"renderEditor",value:function(){var t,e;if(Object(xf["a"])(this,jv)[jv]){var n=this.getValue();if(n&&n.id){null===(t=Object(xf["a"])(this,Pv)[Pv])||void 0===t||t.destroy();var r=this.getDefaultColor(),i=this.getColor();Object(xf["a"])(this,Dv)[Dv]=Object(xf["a"])(this,jv)[jv].render(n.id,n.text||"",Object(_["a"])(Object(_["a"])({},r),i)),Object(xf["a"])(this,Lv)[Lv]&&(null===(e=Object(xf["a"])(this,Pv)[Pv])||void 0===e||e.bind(Object(xf["a"])(this,Dv)[Dv],Object(xf["a"])(this,Lv)[Lv]))}}}},{key:"render",value:function(){if(!Object(xf["a"])(this,Lv)[Lv])return Object(xf["a"])(this,Lv)[Lv]=Object(D["$"])('<span class="data-label-container"></span>'),this.updateContent(),Object(D["isEngine"])(this.editor)&&Object(xf["a"])(this,Lv)[Lv].attributes("draggable","true"),Object(xf["a"])(this,Lv)[Lv];this.updateContent()}},{key:"didRender",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.updateMaxWidth(),window.addEventListener("resize",this.onWindowResize),this.editor.on("editor:resize",this.onWindowResize)}},{key:"destroy",value:function(){var t,e;null===(t=Object(xf["a"])(this,jv)[jv])||void 0===t||t.destroy(),null===(e=Object(xf["a"])(this,Pv)[Pv])||void 0===e||e.destroy(),window.removeEventListener("resize",this.onWindowResize),this.editor.off("editor:resize",this.onWindowResize)}}],[{key:"cardName",get:function(){return"status"}},{key:"cardType",get:function(){return D["CardType"].INLINE}},{key:"autoSelected",get:function(){return!1}},{key:"selectStyleType",get:function(){return D["SelectStyleType"].NONE}}]),n}(D["Card"]),Rv={status:{defaultValue:"SET A STATUS"}},Fv={status:{defaultValue:"设置状态"}},Bv={"en-US":Rv,"zh-CN":Fv},zv="parse:html",Hv="paste:each",Vv="paste:schema",qv=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.pasteSchema=function(t){t.add({type:"inline",name:"span",attributes:{"data-type":{required:!0,value:Iv.cardName},"data-value":"*"}})},t.pasteHtml=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){if(e.isElement()){var r=e.attributes(),i=r["data-type"];if(i&&i===Iv.cardName){var o=r["data-value"],a=Object(D["decodeCardValue"])(o);return n.card.replaceNode(e,Iv.cardName,a),e.remove(),!1}}return!0}},t.parseHtml=function(e,n){var r=t.editor,i=[];return e.find("[".concat(D["CARD_KEY"],'="').concat(Iv.cardName,'"],[').concat(D["READY_CARD_KEY"],'="').concat(Iv.cardName,'"]')).each((function(t){var e=Object(D["$"])(t),o=r.card.find(e),a=(null===o||void 0===o?void 0:o.getValue())||Object(D["decodeCardValue"])(e.attributes(D["CARD_VALUE_KEY"]));if(null===a||void 0===a?void 0:a.text){var s='<span data-type="'.concat(Iv.cardName,'" data-value="').concat(Object(D["encodeCardValue"])(a),'"></span>'),l=a.marks||[],c=Object(D["$"])("<div>".concat(a.text,"</div>")),u=c.first();l.forEach((function(t){var e=Object(D["$"])(t);u=r.node.wrap(u,e)})),e.empty();var d=Object(D["$"])(s);d.append(u),d.css({"font-weight":400,overflow:"hidden","max-width":"200px","white-space":"nowrap","border-radius":"4px",border:"2px solid transparent",padding:"0 3px","text-overflow":"ellipsis"}),n&&(d=n(d,a)),e.replaceWith(d),i.push(d)}else e.remove()})),i},t}return Object(B["a"])(n,[{key:"init",value:function(){var t=this.editor;t.language.add(Bv),t.on(zv,this.parseHtml),t.on(Hv,this.pasteHtml),t.on(Vv,this.pasteSchema)}},{key:"execute",value:function(){var t=this.editor;if(Object(D["isEngine"])(t)){var e=t.card,n=e.insert(Iv.cardName);e.activate(n.root),setTimeout((function(){n.focusEditor()}),50)}}},{key:"hotkey",value:function(){return this.options.hotkey||""}},{key:"destroy",value:function(){var t=this.editor;t.off(zv,this.parseHtml),t.off(Hv,this.pasteHtml),t.off(Vv,this.pasteSchema)}}],[{key:"pluginName",get:function(){return"status"}}]),n}(D["Plugin"]),Uv=qv,Wv=n("1b15"),$v=n.n(Wv);n("a4d3");function Gv(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}function Yv(t,e){if(null==t)return{};var n,r,i=Gv(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var Xv=n("4d7f"),Kv=n.n(Xv),Zv=Object(Cf["a"])("position"),Jv=function(){function t(e,n){var r=this;Object(F["a"])(this,t),this.engine=void 0,this.root=void 0,this.target=void 0,this.otpions=void 0,this.SCOPE_NAME="data-mention-component",Object.defineProperty(this,Zv,{writable:!0,value:void 0}),this.renderEmpty=function(){return'<div class="data-mention-item"><span class="data-mention-item-text">Empty Data</span></div>'},this.getPluginOptions=function(){var t=r.engine.plugin.findPlugin("mention");return null===t||void 0===t?void 0:t.options},this.handlePreventDefault=function(t){var e;if(0!==(null===(e=r.root)||void 0===e?void 0:e.closest("body").length))return t.preventDefault(),!1},this.bindItem=function(t,e){var n=r.otpions.onSelect;t.addClass("data-mention-item");var i=e.key,o=e.name;return i?t.attributes({"data-key":Object(D["escape"])(i)}):t.removeAttributes("data-key"),t.attributes({"data-name":Object(D["escape"])(o)}),t.removeAllEvents(),t.on("click",(function(t){i&&(t.stopPropagation(),t.preventDefault(),n&&n(t,e))}),{once:!0}),t.on("mouseenter",(function(){var e;i&&(null===(e=r.root)||void 0===e||e.find(".data-mention-item-active").removeClass("data-mention-item-active"),t.addClass("data-mention-item-active"))})),t},this.otpions=n,this.engine=e,Object(xf["a"])(this,Zv)[Zv]=new D["Position"](this.engine)}return Object(B["a"])(t,[{key:"select",value:function(t){var e,n,r;null===(e=this.root)||void 0===e||e.find(".data-mention-item-active").removeClass("data-mention-item-active"),null===(n=this.root)||void 0===n||null===(r=n.find(".data-mention-item").eq(t))||void 0===r||r.addClass("data-mention-item-active")}},{key:"scroll",value:function(t){var e;if(this.root){var n=this.root.find(".data-mention-item").toArray();if(0!==n.length){var r=n.find((function(t){return t.hasClass("data-mention-item-active")}))||n[0],i=r;r="up"===t?r.prev():r.next();while(1){if(r||(r="up"===t?n[n.length-1]:n[0]),r.attributes("data-key")||i.equal(r))break;r="up"===t?r.prev():r.next()}r&&r.attributes("data-key")?(this.select(n.findIndex((function(t){return t.equal(r)}))),null===(e=r.get())||void 0===e||e.scrollIntoView({block:"nearest"})):this.select(-1)}}}},{key:"unbindEvents",value:function(){var t;Object(Xv["deleteScope"])(this.SCOPE_NAME),Object(Xv["unbind"])("enter",this.SCOPE_NAME),Object(Xv["unbind"])("up",this.SCOPE_NAME),Object(Xv["unbind"])("down",this.SCOPE_NAME),Object(Xv["unbind"])("esc",this.SCOPE_NAME),this.engine.off("keydown:enter",this.handlePreventDefault),null===(t=Object(xf["a"])(this,Zv)[Zv])||void 0===t||t.destroy()}},{key:"bindEvents",value:function(){var t,e=this;this.unbindEvents(),Object(Xv["setScope"])(this.SCOPE_NAME),Kv()("enter",this.SCOPE_NAME,(function(t){var n,r,i;if(0!==(null===(n=e.root)||void 0===n?void 0:n.closest("body").length)){t.preventDefault(),t.stopImmediatePropagation();var o=null===(r=e.root)||void 0===r?void 0:r.find(".data-mention-item-active");null===o||void 0===o||null===(i=o.get())||void 0===i||i.click()}})),Kv()("up",this.SCOPE_NAME,(function(t){var n;0!==(null===(n=e.root)||void 0===n?void 0:n.closest("body").length)&&(t.preventDefault(),e.scroll("up"))})),Kv()("down",this.SCOPE_NAME,(function(t){var n;0!==(null===(n=e.root)||void 0===n?void 0:n.closest("body").length)&&(t.preventDefault(),e.scroll("down"))})),Kv()("esc",this.SCOPE_NAME,(function(t){t.preventDefault(),e.unbindEvents();var n=e.otpions.onCancel;n&&n()})),this.engine.on("keydown:enter",this.handlePreventDefault),this.root&&this.target&&0!==this.target.length&&(null===(t=Object(xf["a"])(this,Zv)[Zv])||void 0===t||t.bind(this.root,this.target))}},{key:"remove",value:function(){this.root&&0!==this.root.length&&(this.unbindEvents(),this.root.remove(),this.root=void 0)}},{key:"renderTemplate",value:function(t){var e=t.name,n=t.avatar;return'<div class="data-mention-item">\n '.concat(n?'<span class="data-mention-item-avatar"><img src="'.concat(n,'" /></span>'):"",'\n <span class="data-mention-item-text">').concat(Object(D["unescape"])(e),"</span>\n </div>")}},{key:"getBody",value:function(){var t;return null===(t=this.root)||void 0===t?void 0:t.find(".data-mention-component-body")}},{key:"createRoot",value:function(){this.root=Object(D["$"])('<div class="data-mention-component-list" '.concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'"><div class="data-mention-component-body"></div></div>'))}},{key:"renderRootEmpty",value:function(){var t,e,n,r=this.getBody(),i=null===r||void 0===r?void 0:r.children();r&&r.length>0&&(0===(null===i||void 0===i?void 0:i.length)||1===(null===i||void 0===i?void 0:i.length)&&(null===(t=i.eq(0))||void 0===t?void 0:t.hasClass("data-scrollbar")))?null===(e=this.root)||void 0===e||e.addClass("data-mention-component-empty"):null===(n=this.root)||void 0===n||n.removeClass("data-mention-component-empty")}},{key:"render",value:function(t,e){var n=this;if(this.root||this.createRoot(),this.root){this.target=t;var r,i=this.getBody(),o=null,a=this.getPluginOptions();if("boolean"===typeof e&&!0===e)o=(null===a||void 0===a?void 0:a.onLoading)?a.onLoading(this.root):this.engine.trigger("mention:loading",this.root),i=this.getBody(),o&&(null===(r=i)||void 0===r||r.empty().append(o));else if(0===e.filter((function(t){return!!t.key})).length){var s,l=this.engine.trigger("mention:empty",this.root)||((null===a||void 0===a?void 0:a.onEmpty)?null===a||void 0===a?void 0:a.onEmpty(this.root):this.renderEmpty(this.root));i=this.getBody(),l&&(null===(s=i)||void 0===s||s.empty().append(l))}else{if((null===a||void 0===a?void 0:a.onRender)||(o=this.engine.trigger("mention:render",this.root,e,this.bindItem)))return((null===a||void 0===a?void 0:a.onRender)?a.onRender(this.root,e,this.bindItem):o).then((function(t){var e=n.getBody();t&&(null===e||void 0===e||e.empty().append(t)),n.select(0),n.bindEvents()})),void this.renderRootEmpty();var c;i&&0!==i.length||(this.createRoot(),i=this.getBody()),null===(c=i)||void 0===c||c.empty(),e.forEach((function(t){var e,r=n.engine.trigger("mention:render-item",t,n.root),o=r||((null===a||void 0===a?void 0:a.onRenderItem)?a.onRenderItem(t,n.root):n.renderTemplate(t));o&&(null===(e=i)||void 0===e||e.append(n.bindItem(Object(D["$"])(o),t)))})),this.select(0)}this.renderRootEmpty(),this.bindEvents()}}}]),t}();function Qv(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var tb='.am-engine .data-mention-component, .am-engine-view .data-mention-component {\n color: #1890ff !important;\n cursor: pointer;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n display: inline-block;\n vertical-align: top;\n}\n\n.am-engine [data-card-key="mention"].card-selected [data-card-element="center"].data-card-border-selected {\n outline: 0 none;\n}\n\n.am-engine [data-card-key="mention"].card-activated ::-moz-selection {\n background: transparent !important;\n}\n\n.am-engine [data-card-key="mention"].card-activated ::selection {\n background: transparent !important;\n}\n\n.data-mention-component-list {\n position: absolute;\n font-size: 12px;\n background: #ffffff;\n border: 1px solid #e8e8e8;\n border-radius: 3px 3px;\n box-shadow: 0 2px 10px rgb(0 0 0 / 12%);\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n z-index: 999;\n overflow: hidden;\n padding: 5px 0;\n max-width: 250px;\n}\n\n.data-mention-component-empty {\n padding: 0;\n box-shadow: none;\n border: none;\n}\n\n.data-mention-component-body {\n max-height: calc(40vh);\n overflow-y: auto;\n}\n\n.data-mention-component-placeholder {\n color: rgba(0,0,0,0.25);\n pointer-events: none;\n min-width: 78px;\n}\n\n.data-mention-item {\n display: flex;\n cursor: pointer;\n padding: 4px 16px;\n min-width: 160px;\n align-items: center;\n}\n\n.data-mention-item .data-mention-item-text {\n display: block;\n text-align: left;\n margin-left: 8px;\n color: #595959;\n line-height: 24px;\n font-size: 14px;\n font-weight: normal;\n}\n\n.data-mention-item.data-mention-item-active {\n background-color: #f4f4f4;\n}\n\n.data-mention-item-avatar img {\n max-width: 38px;\n}\n\n.data-mention-component-body.data-scrollable.scroll-y {\n padding-right: 0 !important;\n}\n\n.data-mention-hover-layout {\n position: absolute;\n font-size: 12px;\n background: #ffffff;\n border: 1px solid #e8e8e8;\n border-radius: 3px 3px;\n box-shadow: 0 2px 10px rgb(0 0 0 / 12%);\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n z-index: 999;\n}\n';Qv(tb);var eb=["id","key","name","marks","type"],nb=["id","key","name"],rb=Object(Cf["a"])("container"),ib=Object(Cf["a"])("keyword"),ob=Object(Cf["a"])("placeholder"),ab=Object(Cf["a"])("position"),sb=Object(Cf["a"])("showTimeout"),lb=Object(Cf["a"])("hideTimeout"),cb=Object(Cf["a"])("enterLayout"),ub=Object(Cf["a"])("request"),db=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.component=void 0,Object.defineProperty(Object(wf["a"])(t),rb,{writable:!0,value:void 0}),Object.defineProperty(Object(wf["a"])(t),ib,{writable:!0,value:void 0}),Object.defineProperty(Object(wf["a"])(t),ob,{writable:!0,value:void 0}),Object.defineProperty(Object(wf["a"])(t),ab,{writable:!0,value:void 0}),Object.defineProperty(Object(wf["a"])(t),sb,{writable:!0,value:void 0}),Object.defineProperty(Object(wf["a"])(t),lb,{writable:!0,value:void 0}),Object.defineProperty(Object(wf["a"])(t),cb,{writable:!0,value:void 0}),Object.defineProperty(Object(wf["a"])(t),ub,{writable:!0,value:void 0}),t.getMaxWidth=function(){var e=t.editor.block.closest(t.root);return e.get().clientWidth-4},t.onWindowResize=function(){t.updateMaxWidth()},t.updateMaxWidth=function(){var e,n=t.getMaxWidth();null===(e=Object(xf["a"])(Object(wf["a"])(t),rb)[rb])||void 0===e||e.css("max-width",Math.max(n,0)+"px")},t.getPluginOptions=function(){var e=t.editor.plugin.findPlugin("mention");return null===e||void 0===e?void 0:e.options},t.search=function(e){var n=t.getPluginOptions(),r=t.editor;if(n&&n.onSearch)return n.onSearch(e);var i=r.trigger("mention:search",e);if(void 0!==i)return i;var o=r.request;return new Promise((function(r){if(null===n||void 0===n?void 0:n.action){var i,a=n.type,s=n.contentType,l=n.parse,c=n.headers;null===(i=Object(xf["a"])(Object(wf["a"])(t),ub)[ub])||void 0===i||i.abort(),Object(xf["a"])(Object(wf["a"])(t),ub)[ub]=o.ajax({url:n.action,contentType:s||"",type:void 0===a?"json":a,data:{keyword:e},headers:c,success:function(t){var e=l?l(t):t,n=e.result,i=e.data;n&&r(i)},method:"GET"})}else r([])}))},t.hideEnter=function(){Object(xf["a"])(Object(wf["a"])(t),lb)[lb]=setTimeout((function(){var e,n;null===(e=Object(xf["a"])(Object(wf["a"])(t),ab)[ab])||void 0===e||e.destroy(),null===(n=Object(xf["a"])(Object(wf["a"])(t),cb)[cb])||void 0===n||n.remove()}),200)},t.showEnter=function(){var e=t.getPluginOptions();if(Object(xf["a"])(Object(wf["a"])(t),rb)[rb]&&(null===e||void 0===e?void 0:e.onMouseEnter)){var n=t.getValue();if(null===n||void 0===n?void 0:n.name){n.id;var r=n.key,i=n.name,o=(n.marks,n.type,Yv(n,eb));Object(xf["a"])(Object(wf["a"])(t),lb)[lb]&&clearTimeout(Object(xf["a"])(Object(wf["a"])(t),lb)[lb]),Object(xf["a"])(Object(wf["a"])(t),sb)[sb]&&clearTimeout(Object(xf["a"])(Object(wf["a"])(t),sb)[sb]),Object(xf["a"])(Object(wf["a"])(t),cb)[cb]&&Object(xf["a"])(Object(wf["a"])(t),cb)[cb].length>0||(Object(xf["a"])(Object(wf["a"])(t),sb)[sb]=setTimeout((function(){Object(xf["a"])(Object(wf["a"])(t),rb)[rb]&&(Object(xf["a"])(Object(wf["a"])(t),cb)[cb]=Object(D["$"])('<div class="data-mention-hover-layout" '.concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'"></div>')),Object(xf["a"])(Object(wf["a"])(t),cb)[cb].on("mouseenter",(function(){Object(xf["a"])(Object(wf["a"])(t),lb)[lb]&&clearTimeout(Object(xf["a"])(Object(wf["a"])(t),lb)[lb])})),Object(xf["a"])(Object(wf["a"])(t),cb)[cb].on("mouseleave",t.hideEnter),t.editor.trigger("mention:enter",Object(xf["a"])(Object(wf["a"])(t),cb)[cb],Object(_["a"])({key:Object(D["unescape"])(r||""),name:Object(D["unescape"])(i)},o)),e.onMouseEnter(Object(xf["a"])(Object(wf["a"])(t),cb)[cb],Object(_["a"])({key:Object(D["unescape"])(r||""),name:Object(D["unescape"])(i)},o)),setTimeout((function(){var e;null===(e=Object(xf["a"])(Object(wf["a"])(t),ab)[ab])||void 0===e||e.bind(Object(xf["a"])(Object(wf["a"])(t),cb)[cb],Object(xf["a"])(Object(wf["a"])(t),rb)[rb])}),10))}),200))}}},t}return Object(B["a"])(n,[{key:"init",value:function(){var t=this,e=this.editor;if(Object(xf["a"])(this,ab)[ab]||(Object(xf["a"])(this,ab)[ab]=new D["Position"](e)),Object(D["isEngine"])(e)&&!D["isServer"]&&(Object(z["a"])(Object(H["a"])(n.prototype),"init",this).call(this),!this.component)){var r=this.getPluginOptions();this.component=new Jv(e,{onCancel:function(){t.changeToText()},onSelect:function(i,o){var a,s,l=e.trigger("mention:select",o)||{};delete l["id"],(null===r||void 0===r?void 0:r.onSelect)&&(l=r.onSelect(o)||{},delete l["id"]);var c=e.card,u=t.getValue();null===(a=t.component)||void 0===a||a.remove(),t.component=void 0,null===(s=Object(xf["a"])(t,ib)[ib])||void 0===s||s.remove(),c.focus(t,!1);var d=c.insert(n.cardName,Object(_["a"])(Object(_["a"])({},o),{},{marks:u.marks},l));if(c.removeNode(t),e.trigger("mention:insert",d),(null===r||void 0===r?void 0:r.onInsert)&&r.onInsert(d),Object(D["isEngine"])(e)){var h=e.change,p=h.range.get().cloneRange();p.setStartAfter(d.root.get()),p.collapse(!0),h.range.select(p)}else c.focus(d,!1)}})}}},{key:"remove",value:function(){var t,e,n=this.editor;Object(D["isEngine"])(n)&&(null===(t=this.component)||void 0===t||t.remove(),null===(e=Object(xf["a"])(this,ib)[ib])||void 0===e||e.remove(),n.card.remove(this.id))}},{key:"changeToText",value:function(){var t,e,n=this.editor;if(this.root.inEditor()&&Object(D["isEngine"])(n)){var r=(null===(t=Object(xf["a"])(this,ib)[ib])||void 0===t||null===(e=t.get())||void 0===e?void 0:e.innerText)||"";this.remove(),n.node.insertText(r)}}},{key:"activate",value:function(t){var e;(Object(z["a"])(Object(H["a"])(n.prototype),"activate",this).call(this,t),!t&&Object(xf["a"])(this,ib)[ib]&&Object(xf["a"])(this,ib)[ib].length>0)&&(null===(e=this.component)||void 0===e||e.unbindEvents(),this.changeToText())}},{key:"handleInput",value:function(){var t,e,n,r,i=this,o=this.editor;if(Object(D["isEngine"])(o)){var a=o.change,s=o.card;if(!a.isComposing()){var l,c=(null===(t=Object(xf["a"])(this,ib)[ib])||void 0===t||null===(e=t.get())||void 0===e?void 0:e.innerText.replace(/[\r\n]/g,""))||"";if(""===c)return null===(l=this.component)||void 0===l||l.remove(),void s.remove(this.id);var u=c.substr(1),d=o.trigger("mention:default")||(null===(n=this.getPluginOptions())||void 0===n?void 0:n.defaultData);if(""===u&&d){var h;null===(h=this.component)||void 0===h||h.render(this.root,d)}else{null===(r=this.component)||void 0===r||r.render(this.root,!0);o.trigger("mention:search",u);this.search(u).then((function(t){var e;null===(e=i.component)||void 0===e||e.render(i.root,t)}))}}}}},{key:"resetPlaceHolder",value:function(){var t,e,n,r;"@"===(null===(t=Object(xf["a"])(this,ib)[ib])||void 0===t||null===(e=t.get())||void 0===e?void 0:e.innerText)?null===(n=Object(xf["a"])(this,ob)[ob])||void 0===n||n.show():null===(r=Object(xf["a"])(this,ob)[ob])||void 0===r||r.hide()}},{key:"executeMark",value:function(t,e){if(Object(xf["a"])(this,rb)[rb]){var n=this.editor.mark,r=Object(xf["a"])(this,rb)[rb].children();if(t)if(e){r.each((function(e,i){var o=r.eq(i);o&&n.wrapByNode(o,t)}));var i=this.queryMarks().map((function(t){var e;return(null===(e=t.clone().get())||void 0===e?void 0:e.outerHTML)||""}));this.setValue({marks:i})}else{n.unwrapByNodes(this.queryMarks(!1),t);var o=this.queryMarks().map((function(t){var e;return(null===(e=t.get())||void 0===e?void 0:e.outerHTML)||""}));this.setValue({marks:o})}else n.unwrapByNodes(this.queryMarks(!1)),this.setValue({marks:[]})}}},{key:"queryMarks",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Object(xf["a"])(this,rb)[rb]?Object(xf["a"])(this,rb)[rb].allChildren().filter((function(e){return e.isElement()&&t.editor.node.isMark(e)})).map((function(t){return e?t.clone():t})):[]}},{key:"toolbar",value:function(){var t,e=null===(t=this.editor.plugin.findPlugin("mention"))||void 0===t?void 0:t.options;return(null===e||void 0===e?void 0:e.cardToolbars)?e.cardToolbars([],this.editor):[]}},{key:"render",value:function(){var t=this,e=this.getValue(),n=this.editor;if((null===e||void 0===e?void 0:e.name)&&!Object(xf["a"])(this,rb)[rb]){e.id;var r=e.key,i=e.name,o=Yv(e,nb);Object(xf["a"])(this,rb)[rb]=Object(D["$"])('<span class="data-mention-component">@'.concat(Object(D["unescape"])(i),"</span>")),(e.marks||[]).forEach((function(e){t.executeMark(Object(D["$"])(e),!0)})),Object(xf["a"])(this,rb)[rb].on("click",(function(){Object(xf["a"])(t,rb)[rb]&&(n.trigger("mention:item-click",Object(xf["a"])(t,rb)[rb],Object(_["a"])({key:Object(D["unescape"])(r||""),name:Object(D["unescape"])(i)},o)),(null===d||void 0===d?void 0:d.itemClick)&&(null===d||void 0===d||d.itemClick(Object(xf["a"])(t,rb)[rb],Object(_["a"])({key:Object(D["unescape"])(r||""),name:Object(D["unescape"])(i)},o))))})),Object(xf["a"])(this,rb)[rb].on("mouseenter",this.showEnter),Object(xf["a"])(this,rb)[rb].on("mouseleave",this.hideEnter)}else if(Object(xf["a"])(this,rb)[rb])return void(e&&(Object(xf["a"])(this,rb)[rb].html("@".concat(Object(D["unescape"])(e.name||""))),((null===e||void 0===e?void 0:e.marks)||[]).forEach((function(e){t.executeMark(Object(D["$"])(e),!0)}))));if(!Object(D["isEngine"])(n))return Object(xf["a"])(this,rb)[rb];var a,s,l,c=n.language.get("mention"),u=void 0,d=this.getPluginOptions();if(Object(xf["a"])(this,rb)[rb])return null===(a=this.component)||void 0===a||a.remove(),Object(xf["a"])(this,rb)[rb];Object(xf["a"])(this,rb)[rb]=Object(D["$"])('<span class="data-mention-component-keyword data-mention-component" '.concat(D["DATA_CONTENTEDITABLE_KEY"],'="true">@</span><span class="data-mention-component-placeholder">').concat(c["placeholder"],"</span>")),Object(xf["a"])(this,ib)[ib]=Object(xf["a"])(this,rb)[rb].eq(0),Object(xf["a"])(this,ob)[ob]=Object(xf["a"])(this,rb)[rb].eq(1),null===(s=Object(xf["a"])(this,ib)[ib])||void 0===s||s.on("keydown",(function(t){Object(D["isHotkey"])("enter",t)&&t.preventDefault()}));var h,p=Date.now();null===(l=Object(xf["a"])(this,ib)[ib])||void 0===l||l.on("input",(function(){if(t.resetPlaceHolder(),Date.now()-p<200){var e,n=null===(e=Object(xf["a"])(t,ib)[ib])||void 0===e?void 0:e.allChildren().find((function(t){return t.isText()}));if(n&&n.isText()&&"@@"===n[0].nodeValue){var r,i=null===(r=n.get())||void 0===r?void 0:r.splitText(1);null===i||void 0===i||i.remove()}}u&&clearTimeout(u),u=setTimeout((function(){t.handleInput()}),100)})),this.getCenter().append(Object(xf["a"])(this,rb)[rb]),setTimeout((function(){if(Object(D["isEngine"])(n)){var e,r=n.change.range.get();Object(xf["a"])(t,ib)[ib]=null===(e=Object(xf["a"])(t,rb)[rb])||void 0===e?void 0:e.eq(0),r.select(Object(xf["a"])(t,ib)[ib],!0).collapse(!1);var i=window.getSelection();null===i||void 0===i||i.removeAllRanges(),null===i||void 0===i||i.addRange(r.toRange())}}),10),((null===d||void 0===d?void 0:d.defaultData)?null===d||void 0===d?void 0:d.defaultData:n.trigger("mention:default"))?null===(h=this.component)||void 0===h||h.render(this.root,n.trigger("mention:default")||(null===d||void 0===d?void 0:d.defaultData)||[]):setTimeout((function(){t.handleInput()}),50)}},{key:"didRender",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.updateMaxWidth(),window.addEventListener("resize",this.onWindowResize),this.editor.on("editor:resize",this.onWindowResize)}},{key:"destroy",value:function(){var t,e;null===(t=this.component)||void 0===t||t.remove(),null===(e=Object(xf["a"])(this,ab)[ab])||void 0===e||e.destroy(),window.removeEventListener("resize",this.onWindowResize),this.editor.off("editor:resize",this.onWindowResize)}}],[{key:"cardName",get:function(){return"mention"}},{key:"cardType",get:function(){return D["CardType"].INLINE}},{key:"autoSelected",get:function(){return!1}},{key:"selectStyleType",get:function(){return D["SelectStyleType"].NONE}}]),n}(D["Card"]),hb={mention:{placeholder:"User name"}},pb={mention:{placeholder:"用户名"}},fb={"en-US":hb,"zh-CN":pb},gb=["key","name"],mb="parse:value",vb="parse:html",bb="paste:schema",yb="paste:each",wb="keydown:at",xb=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.paserValue=function(t){if(t.isCard()&&t.attributes("name")===db.cardName){var e=t.attributes("value"),n=Object(D["decodeCardValue"])(e);if(!n||!n["name"])return!1}return!0},t.renderTime=Date.now(),t.onAt=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){if(Date.now()-t.renderTime<200)return!1;var r=n.change,i=r.range.get();if(t.options.spaceTrigger){var o=i.createSelection();if(o.anchor){var a=Object(D["$"])(o.anchor).prev(),s=a&&a.isText()?a[0].nodeValue:"";if(o.move(),s&&/[^\s@]$/.test(s))return}}if(e.preventDefault(),i.collapsed){e.preventDefault();var l=n.card.insert(db.cardName);l.root.attributes(D["DATA_TRANSIENT_ELEMENT"],"true"),n.card.activate(l.root),i=r.range.get();var c=l.find(".data-mention-component-keyword");i.select(c,!0),i.collapse(!1),r.range.select(i)}return t.renderTime=Date.now(),!1}},t.pasteSchema=function(t){t.add({type:"inline",name:"span",attributes:{"data-type":{required:!0,value:db.cardName},"data-value":"*"}})},t.pasteHtml=function(e){var n=t.editor;if(Object(D["isEngine"])(n)){if(e.isElement()){var r=e.attributes(),i=r["data-type"];if(i&&i===db.cardName){var o=r["data-value"],a=Object(D["decodeCardValue"])(o);if(!a.name)return;return n.card.replaceNode(e,db.cardName,a),e.remove(),!1}}return!0}},t.parseHtml=function(e,n){var r=t.editor,i=[];return e.find("[".concat(D["CARD_KEY"],'="').concat(db.cardName,'"],[').concat(D["READY_CARD_KEY"],'="').concat(db.cardName,'"]')).each((function(t){var e=Object(D["$"])(t),o=r.card.find(e),a=(null===o||void 0===o?void 0:o.getValue())||Object(D["decodeCardValue"])(e.attributes(D["CARD_VALUE_KEY"]));if((null===a||void 0===a?void 0:a.id)&&a.name){var s='<span data-type="'.concat(db.cardName,'" data-value="').concat(Object(D["encodeCardValue"])(a),'" style="color:#1890ff"></span>'),l=a.marks||[],c=Object(D["$"])("<div>@".concat(a.name,"</div>")),u=c.first();l.forEach((function(t){var e=Object(D["$"])(t);u=r.node.wrap(u,e)})),e.empty();var d=Object(D["$"])(s);d.append(u),n&&(d=n(d,a)),e.replaceWith(d),i.push(d)}else e.remove()})),i},t}return Object(B["a"])(n,[{key:"init",value:function(){var t=this.editor;t.on(mb,this.paserValue),t.on(vb,this.parseHtml),t.on(yb,this.pasteHtml),t.on(bb,this.pasteSchema),Object(D["isEngine"])(t)&&t.on(wb,this.onAt),t.language.add(fb)}},{key:"getList",value:function(){var t=[];return this.editor.card.each((function(e){if(e.name===db.cardName){var n=e.getValue()||{},r=n.key,i=n.name,o=Yv(n,gb);i&&r&&t.push(Object(_["a"])({key:Object(D["unescape"])(r),name:Object(D["unescape"])(i)},o))}})),t}},{key:"execute",value:function(){}},{key:"destroy",value:function(){var t=this.editor;t.off(mb,this.paserValue),t.off(vb,this.parseHtml),t.off(yb,this.pasteHtml),t.off(bb,this.pasteSchema),Object(D["isEngine"])(t)&&t.off(wb,this.onAt)}}],[{key:"pluginName",get:function(){return"mention"}}]),n}(D["Plugin"]),Cb=xb,kb=n("2b0e"),Ab=(n("4f1c"),n("3b2f")),Sb=n.n(Ab);function Eb(t){for(var e="",n=0;n<t;n++)e+=Math.floor(10*Math.random());return e}function Ob(t,e,n){var r="mindmap".concat(Date.now()).concat(Eb(5)),i=document.createElement("div"),o=document.createElement("div");o.id="container".concat(r),o.className="mindmap-container",i.className="mindmap-parent",i.appendChild(o),e.html(i),s(r);var a=function(){var t=new Ip({container:document.getElementById("container".concat(r)),panning:{enabled:!0,eventTypes:["leftMouseDown","mouseWheel"]},interacting:!1,grid:!0,modes:{},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:"ctrl",minScale:.5,maxScale:3},connecting:{router:{name:"manhattan",args:{padding:1}},connector:{name:"rounded",args:{radius:8}},anchor:"center",connectionPoint:"anchor",allowBlank:!1,snap:{radius:20},createEdge:function(){return new A.Edge({attrs:{line:{stroke:"#A2B1C3",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},zIndex:0})},validateConnection:function(t){var e=t.targetMagnet;return!!e}},keyboard:{enabled:!0,format:function(t){return t.replace(/\s/g,"").replace("cmd","command")}}}),e=new S.Stencil({title:"流程图",target:t,stencilGraphWidth:200,stencilGraphHeight:180,collapsable:!0,groups:[{title:"基础流程图",name:"group1"},{title:"系统设计图",name:"group2",graphHeight:250,layoutOptions:{rowHeight:70}}],layoutOptions:{columns:2,columnWidth:80,rowHeight:55}});t.bindKey(["meta+c","ctrl+c"],(function(){var e=t.getSelectedCells();return e.length&&t.copy(e),!1})),t.bindKey(["meta+x","ctrl+x"],(function(){var e=t.getSelectedCells();return e.length&&t.cut(e),!1})),t.bindKey(["meta+v","ctrl+v"],(function(){if(!t.isClipboardEmpty()){var e=t.paste({offset:32});t.cleanSelection(),t.select(e)}return!1})),t.bindKey(["meta+z","ctrl+z"],(function(){return t.history.canUndo()&&t.history.undo(),!1})),t.bindKey(["meta+shift+z","ctrl+shift+z"],(function(){return t.history.canRedo()&&t.history.redo(),!1})),t.bindKey(["meta+a","ctrl+a"],(function(){var e=t.getNodes();e&&t.select(e)})),t.bindKey("backspace",(function(){var e=t.getSelectedCells();e.length&&t.removeCells(e)})),t.bindKey("delete",(function(){var e=t.getSelectedCells();e.length&&t.removeCells(e)})),t.bindKey(["ctrl+1","meta+1"],(function(){var e=t.zoom();e<1.5&&t.zoom(.1)})),t.bindKey(["ctrl+2","meta+2"],(function(){var e=t.zoom();e>.5&&t.zoom(-.1)}));var n={groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#5F95FF",strokeWidth:1,fill:"#fff",style:{visibility:"hidden"}}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#5F95FF",strokeWidth:1,fill:"#fff",style:{visibility:"hidden"}}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#5F95FF",strokeWidth:1,fill:"#fff",style:{visibility:"hidden"}}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#5F95FF",strokeWidth:1,fill:"#fff",style:{visibility:"hidden"}}}}},items:[{group:"top"},{group:"right"},{group:"bottom"},{group:"left"}]};Ip.registerNode("custom-rect",{inherit:"rect",width:66,height:36,attrs:{body:{strokeWidth:1,stroke:"#5F95FF",fill:"#EFF4FF"},text:{fontSize:12,fill:"#262626"}},ports:Object(_["a"])({},n)},!0),Ip.registerNode("custom-polygon",{inherit:"polygon",width:66,height:36,attrs:{body:{strokeWidth:1,stroke:"#5F95FF",fill:"#EFF4FF"},text:{fontSize:12,fill:"#262626"}},ports:Object(_["a"])(Object(_["a"])({},n),{},{items:[{group:"top"},{group:"bottom"}]})},!0),Ip.registerNode("custom-circle",{inherit:"circle",width:45,height:45,attrs:{body:{strokeWidth:1,stroke:"#5F95FF",fill:"#EFF4FF"},text:{fontSize:12,fill:"#262626"}},ports:Object(_["a"])({},n)},!0),Ip.registerNode("custom-image",{inherit:"rect",width:52,height:52,markup:[{tagName:"rect",selector:"body"},{tagName:"image"},{tagName:"text",selector:"label"}],attrs:{body:{stroke:"#5F95FF",fill:"#5F95FF"},image:{width:26,height:26,refX:13,refY:16},label:{refX:3,refY:2,textAnchor:"left",textVerticalAnchor:"top",fontSize:12,fill:"#fff"}},ports:Object(_["a"])({},n)},!0);var i=t.createNode({shape:"custom-rect",label:"开始",disableMove:!0,attrs:{body:{rx:20,ry:26}}}),o=t.createNode({shape:"custom-rect",label:"过程"}),a=t.createNode({shape:"custom-rect",attrs:{body:{rx:6,ry:6}},label:"可选过程"}),s=t.createNode({shape:"custom-polygon",attrs:{body:{refPoints:"0,10 10,0 20,10 10,20"}},label:"决策"}),l=t.createNode({shape:"custom-polygon",attrs:{body:{refPoints:"10,0 40,0 30,20 0,20"}},label:"数据"}),c=t.createNode({shape:"custom-circle",label:"连接"});e.load([i,o,a,s,l,c],"group1");var u=[{label:"Client",image:"https://gw.alipayobjects.com/zos/bmw-prod/687b6cb9-4b97-42a6-96d0-34b3099133ac.svg"},{label:"Http",image:"https://gw.alipayobjects.com/zos/bmw-prod/dc1ced06-417d-466f-927b-b4a4d3265791.svg"},{label:"Api",image:"https://gw.alipayobjects.com/zos/bmw-prod/c55d7ae1-8d20-4585-bd8f-ca23653a4489.svg"},{label:"Sql",image:"https://gw.alipayobjects.com/zos/bmw-prod/6eb71764-18ed-4149-b868-53ad1542c405.svg"},{label:"Clound",image:"https://gw.alipayobjects.com/zos/bmw-prod/c36fe7cb-dc24-4854-aeb5-88d8dc36d52e.svg"},{label:"Mq",image:"https://gw.alipayobjects.com/zos/bmw-prod/2010ac9f-40e7-49d4-8c4a-4fcf2f83033b.svg"}],d=u.map((function(e){return t.createNode({shape:"custom-image",label:e.label,attrs:{image:{"xlink:href":e.image}}})}));return e.load(d,"group2"),t};function s(t){setTimeout((function(){var e=document.getElementById("container".concat(t)),r=document.createElement("div");r.id="graph-container".concat(t),null===e||void 0===e||e.appendChild(r);var i=a();i.fromJSON(n),Kp()("\n #container".concat(t," {\n display: flex;\n border: 1px solid #dfe3e8;\n }\n #stencil").concat(t," {\n width: 180px;\n height: 100%;\n position: relative;\n border-right: 1px solid #dfe3e8;\n }\n #graph-container").concat(t," {\n width: calc(100% - 180px);\n height: 100%;\n }\n .x6-widget-stencil {\n background-color: #fff;\n }\n .x6-widget-stencil-title {\n background-color: #fff;\n }\n .x6-widget-stencil-group-title {\n background-color: #fff !important;\n }\n .x6-widget-transform {\n margin: -1px 0 0 -1px;\n padding: 0px;\n border: 1px solid #239edd;\n }\n .x6-widget-transform > div {\n border: 1px solid #239edd;\n }\n .x6-widget-transform > div:hover {\n background-color: #3dafe4;\n }\n .x6-widget-transform-active-handle {\n background-color: #3dafe4;\n }\n .x6-widget-transform-resize {\n border-radius: 0;\n }\n .x6-widget-selection-inner {\n border: 1px solid #239edd;\n }\n .x6-widget-selection-box {\n opacity: 0;\n }\n ")),i.zoomToFit({padding:10,maxScale:1})}),200)}}var Tb=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"didRender",value:function(){var t,e;Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.type===D["CardType"].BLOCK?null===(t=this.toolbarModel)||void 0===t||t.setOffset([-120,0]):null===(e=this.toolbarModel)||void 0===e||e.setOffset([0,0])}},{key:"editorCard",value:function(t){var e;this.setValue({value:t});var n=Object(D["$"])('<span class="mindmap-box"></span>');Ob(this,n,t),null===(e=this.container)||void 0===e||e.html(n)}},{key:"toolbar",value:function(){var t=this;if(!Object(D["isEngine"])(this.editor)||this.editor.readonly)return[];this.editor.language;var e=[{type:"button",title:"编辑公式",content:'<span class="data-icon data-icon-edit"></span>',didMount:function(t){},onClick:function(e,n){var r=kb["default"].extend(tf),i=new r;i.value=t.getValue().value,i.showMindMap=!0,i.$mount(),i.isEditor=!0;var o=t;i.closeMindMap=function(){i.value?o.editorCard(i.value):o.editorCard({}),i.showMindMap=!1},document.body.appendChild(i.$el)}},{type:"delete"}];return e.concat()}},{key:"render",value:function(){var t=this.getValue();this.container=Object(D["$"])('<div class="mindmap-box"></div>');var e=Object(D["$"])('<span class="mindmap-box"></span>');if(t.value){var n;Ob(this,e,t.value),null===(n=this.container)||void 0===n||n.html(e)}else{var r=kb["default"].extend(tf),i=new r;i.showMindMap=!0,i.$mount(),i.isEditor=!0;var o=this;i.closeMindMap=function(){i.value?o.editorCard(i.value):o.editorCard({}),i.showMindMap=!1},document.body.appendChild(i.$el)}return this.container}},{key:"destroy",value:function(){var t;this.container[0].parentElement.innerHTML="",Object(z["a"])(Object(H["a"])(n.prototype),"destroy",this).call(this),null===(t=this.vm)||void 0===t||t.$destroy()}}],[{key:"cardName",get:function(){return"mindmap"}},{key:"cardType",get:function(){return D["CardType"].BLOCK}}]),n}(D["Card"]),_b=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"init",value:function(){var t=this;this.editor.on("paser:html",(function(e){return t.parseHtml(e)})),this.editor.on("paste:schema",(function(e){return t.pasteSchema(e)})),this.editor.on("paste:each",(function(e){return t.pasteHtml(e)}))}},{key:"execute",value:function(t){if(Object(D["isEngine"])(this.editor)){var e=this.editor.card;e.insert(tf.cardName,Object(_["a"])({},t))}}},{key:"hotkey",value:function(){return this.options.hotkey||"ctrl+|"}},{key:"pasteSchema",value:function(t){t.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:tf.cardName},"data-value":"*"}})}},{key:"pasteHtml",value:function(t){if(Object(D["isEngine"])(this.editor)){if(t.isElement()){var e=t.attributes("data-type");if(e===tf.cardName){var n=t.attributes("data-value"),r=decodeCardValue(n);if(!r.url)return;return this.editor.card.replaceNode(t,tf.cardName,r),t.remove(),!1}}return!0}}},{key:"parseHtml",value:function(t){var e=this;t.find("[".concat(CARD_KEY,"=").concat(tf.cardName)).each((function(t){var n=Object(D["$"])(t),r=e.editor.card.find(n),i=null===r||void 0===r?void 0:r.getValue();if(i){var o=r.type===D["CardType"].INLINE?"span":"div",a="<".concat(o,' data-type="').concat(r.type,'" data-value="').concat(encodeCardValue(i),'"></').concat(o,">");n.empty(),n.replaceWith(Object(D["$"])(a))}else n.remove()}))}}],[{key:"pluginName",get:function(){return"mindmap"}}]),n}(D["Plugin"]),Mb=function(){var t=this,e=t._self._c;return t.isShowEditor?e("div",{ref:"example",staticClass:"example",on:{keydown:function(t){t.stopPropagation()}}},[e("div",{staticClass:"toolbar-codemirror"},[e("div",{staticClass:"toolbar-codemirror-left"},[e("a-tooltip",{attrs:{title:"".concat(t.cmOption.isFold?"收起":"展开")}},[t.cmOption.isFold?e("span",{staticClass:"code-fold-button",on:{mousedown:function(e){return e.stopPropagation(),t.foldCode(!1)}}},[e("a-icon",{attrs:{type:"caret-down"}})],1):e("span",{staticClass:"code-fold-button",on:{mousedown:function(e){return e.stopPropagation(),t.foldCode(!0)}}},[e("a-icon",{attrs:{type:"caret-right"}})],1)]),t.isEditor?e("span",{staticClass:"toolbar-codemirror-title"},[t._v("名称: "),e("a-input",{staticStyle:{width:"200px"},attrs:{placeholder:"请输入代码块名称"},on:{blur:function(e){return t.onCmBlur(t.cmOption,t.value,t.title,t.codeType)}},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}})],1):e("span",{staticClass:"toolbar-codemirror-title"},[t._v("名称:"+t._s(t.title))])],1),e("div",{staticClass:"toolbar-codemirror-right"},[t.isEditor?e("a-select",{staticStyle:{width:"120px"},on:{change:function(e){return t.onCmBlur(t.cmOption,t.value,t.title,t.codeType)}},model:{value:t.cmOption.theme,callback:function(e){t.$set(t.cmOption,"theme",e)},expression:"cmOption.theme"}},[e("a-select-option",{attrs:{value:"duotone-dark"}},[t._v(" 默认 ")]),e("a-select-option",{attrs:{value:"base16-dark"}},[t._v(" 暗黑 ")]),e("a-select-option",{attrs:{value:"duotone-light"}},[t._v(" 暖色 ")]),e("a-select-option",{attrs:{value:"idea"}},[t._v(" 高亮 ")])],1):t._e(),t.isEditor?e("a-select",{staticStyle:{width:"120px"},on:{change:function(e){return t.onCmBlur(t.cmOption,t.value,t.title,t.codeType)}},model:{value:t.cmOption.mode,callback:function(e){t.$set(t.cmOption,"mode",e)},expression:"cmOption.mode"}},t._l(t.language,(function(n,r){return e("a-select-option",{key:r,attrs:{value:n.value}},[t._v(" "+t._s(n.title))])})),1):e("span",{staticClass:"toolbar-codemirror-title"},[t._v("语言:"+t._s(t.languageTitle))]),t.isEditor?e("div",{staticClass:"more-seting-box",on:{mouseenter:function(e){t.$refs.moresetingmenu.style.display="block"},mouseleave:function(e){t.$refs.moresetingmenu.style.display="none"}}},[e("div",{staticClass:"more-seting-button"},[e("a-icon",{attrs:{type:"menu"}})],1),e("div",{ref:"moresetingmenu",staticClass:"more-seting-menu"},[e("div",[t._v(" 缩进宽度 "),e("div",{staticClass:"seting-menu-children-box"},[e("div",{staticClass:"more-seting-menu-children",on:{click:function(e){return e.stopPropagation(),t.changeTaleSize(2)}}},[t._v(" 2格 ")]),e("div",{staticClass:"more-seting-menu-children",on:{click:function(e){return e.stopPropagation(),t.changeTaleSize(4)}}},[t._v(" 4格 ")]),e("div",{staticClass:"more-seting-menu-children",on:{click:function(e){return e.stopPropagation(),t.changeTaleSize(6)}}},[t._v(" 6格 ")])])])])]):t._e()],1)]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.cmOption.isFold,expression:"cmOption.isFold"}],staticClass:"codemirror",style:{"--xheight":(t.cmOption.boxHeight||200)+"px"}},[e("codemirror",{staticClass:"xxxxxxxxxxxx",attrs:{id:t.id,options:t.cmOption},on:{cursorActivity:t.onCmCursorActivity,ready:t.onCmReady,focus:t.onCmFocus,blur:function(e){return t.onCmBlur(t.cmOption,t.value,t.title,t.codeType)}},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1),t.showSetSizeButton?e("div",{staticClass:"site-size-box"},[e("div",{ref:"setSizeButton",staticClass:"site-size-button"})]):t._e()]):t._e()},Nb=[],Pb=n("8f94"),Lb=(n("a7be"),n("8c2e"),n("e8b0"),n("b6fc"),n("b866"),n("693d8"),n("31c5"),n("9948"),n("b933"),n("9c7b"),n("715d"),n("23de"),n("4ba6"),n("8c33"),n("7289"),n("2aed"),n("d72f"),n("0b6c"),n("9a48"),n("697eb"),n("aedd"),n("164b"),n("4895"),n("cbc8"),n("8d70"),n("9f09"),n("a2c1"),{cardName:"codeblock",name:"codemirror-example-vue",title:"Mode: text/x-vue & Theme: base16-dark",components:{codemirror:Pb["codemirror"]},props:{engine:{default:null},onChange:{type:Function,default:function(t){}}},created:function(){},mounted:function(){var t=this;this.cmOption.readOnly=!this.isEditor,this.$nextTick((function(){t.isShowEditor=!0})),document.addEventListener("keydown",(function(t){if(t.stopPropagation(),90==t.keyCode&&t.ctrlKey)return!1}))},data:function(){return{isEditor:!1,isShowEditor:!1,boxEle:null,title:"",language:[{title:"C",value:"text/x-csrc"},{title:"C++",value:"text/x-c++src"},{title:"Java",value:"text/x-java"},{title:"C#",value:"text/x-csharp"},{title:"Objective-C",value:"text/x-objectivec"},{title:"Scala",value:"text/x-scala"},{title:"Css",value:"text/css"},{title:"Sess",value:"text/x-scss"},{title:"Less",value:"text/x-less"},{title:"Vue",value:"text/x-vue"},{title:"Diff",value:"text/x-diff"},{title:"Mysql",value:"text/x-mysql"},{title:"Javascript",value:"text/javascript"},{title:"Typescript",value:"text/typescript"},{title:"Html",value:"text/html"}],codeType:"",id:"mindmap".concat(Date.now()).concat(this.getRandomNum(5)),value:"",cmOption:{},baseOption:{},showSetSizeButton:!1}},methods:{onCmCursorActivity:function(t){},onCmReady:function(t){},onCmFocus:function(t){},foldCode:function(t){this.$set(this.cmOption,"isFold",t),this.engine.setValue({options:this.cmOption,value:this.value,title:this.title})},onCmBlur:function(t){},getRandomNum:function(t){for(var e="",n=0;n<t;n++)e+=Math.floor(10*Math.random());return e},changeTaleSize:function(t){this.$refs.moresetingmenu.style.display="none",this.cmOption.tabSize=t,this.onCmBlur(this.cmOption,this.value,this.title,this.codeType)},setSizeEvent:function(){var t=this,e=this.$refs.setSizeButton,n=0;e.onmousedown=function(e){n=e.clientY,document.onmousemove=function(e){var r=e.clientY-n;t.SetSizeMoveHandle(r),n=e.clientY},document.onmouseup=function(t){document.onmousemove=null,document.onmouseup=null}}},SetSizeMoveHandle:function(t){this.cmOption.boxHeight+=t}},computed:{languageTitle:function(){var t=this,e=this.language.findIndex((function(e){if(e.value==t.cmOption.mode)return!0}));return-1!==e?this.language[e].title:""}},watch:{isShowEditor:function(){this.isShowEditor||this.$nextTick((function(){}))},showSetSizeButton:function(t,e){var n=this;this.$nextTick((function(){t&&n.setSizeEvent()}))}}}),Db=Lb,jb=(n("1659"),Object(it["a"])(Db,Mb,Nb,!1,null,"6c8b822b",null)),Ib=jb.exports,Rb=(n("637e"),n("a7ef")),Fb=n.n(Rb);function Bb(t){for(var e="",n=0;n<t;n++)e+=Math.floor(10*Math.random());return e}"mindmap".concat(Date.now()).concat(Bb(5));var zb=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Object(ef["a"])(Object(wf["a"])(t),"components",{}),t}return Object(B["a"])(n,[{key:"didRender",value:function(){var t,e;Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.type===D["CardType"].BLOCK?null===(t=this.toolbarModel)||void 0===t||t.setOffset([-120,0]):null===(e=this.toolbarModel)||void 0===e||e.setOffset([0,0])}},{key:"toolbar",value:function(){if(!Object(D["isEngine"])(this.editor)||this.editor.readonly)return[];this.editor.language;var t=[{type:"delete"}];return t.concat()}},{key:"render",value:function(){var t=this,e=Object(D["$"])('<div class="codeblock-box"></div>'),n=kb["default"].extend(Ib);n=new n,this.editor._readonly?n.isEditor=!1:n.isEditor=!0,n.engine=this,n.value=Fb()(this.getValue().value||""),n.title=this.getValue().title||"";var r={},i={};return this.components=n,n.cmOption=this.getValue().options||{tabSize:4,foldGutter:!0,styleActiveLine:!0,lineNumbers:!0,line:!0,boxHeight:200,keyMap:"sublime",mode:"text/x-vue",theme:"duotone-dark",readOnly:!0,lineWrapping:!0,isFold:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter","CodeMirror-lint-markers"],extraKeys:{F11:function(t){t.setOption("fullScreen",!t.getOption("fullScreen"))},Esc:function(t){t.getOption("fullScreen")&&t.setOption("fullScreen",!1)}}},n.cmOption.indentWithTab=!0,n.cmOption.indentUnit=4,n.cmOption.lineWrapping=!0,n.cmOption.gutters=["CodeMirror-linenumbers","CodeMirror-foldgutter","CodeMirror-lint-markers"],n=n.$mount(),n.onCmBlur=function(e,n,o){t.setValue({options:e,value:n,title:o}),setTimeout((function(){i.style.background=getComputedStyle(r).backgroundColor,i.style.color=getComputedStyle(r).color}),0)},setTimeout((function(){r=e[0].getElementsByClassName("CodeMirror-gutters")[0],i=e[0].getElementsByClassName("toolbar-codemirror")[0],i.style.background=getComputedStyle(r).background,i.style.color=getComputedStyle(r).color}),0),e[0].appendChild(n.$el),this.container=e,this.container}},{key:"destroy",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"destroy",this).call(this),this.container[0].parentElement.innerHTML="",this.components.isShowEditor=!1,this.components=void 0}},{key:"onActivate",value:function(t){this.components.showSetSizeButton=t}}],[{key:"cardName",get:function(){return"codeblock"}},{key:"cardType",get:function(){return D["CardType"].BLOCK}}]),n}(D["Card"]),Hb=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"init",value:function(){var t=this;this.editor.on("paser:html",(function(e){return t.parseHtml(e)})),this.editor.on("paste:schema",(function(e){return t.pasteSchema(e)})),this.editor.on("paste:each",(function(e){return t.pasteHtml(e)}))}},{key:"execute",value:function(t){if(Object(D["isEngine"])(this.editor)){var e=this.editor.card;e.insert(Ib.cardName,Object(_["a"])({},t))}}},{key:"hotkey",value:function(){return this.options.hotkey||"ctrl+|"}},{key:"pasteSchema",value:function(t){t.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:Ib.cardName},"data-value":"*"}})}},{key:"pasteHtml",value:function(t){if(Object(D["isEngine"])(this.editor)){if(t.isElement()){var e=t.attributes("data-type");if(e===Ib.cardName){var n=t.attributes("data-value"),r=decodeCardValue(n);if(!r.url)return;return this.editor.card.replaceNode(t,Ib.cardName,r),t.remove(),!1}}return!0}}},{key:"parseHtml",value:function(t){var e=this;t.find("[".concat(CARD_KEY,"=").concat(Ib.cardName)).each((function(t){var n=Object(D["$"])(t),r=e.editor.card.find(n),i=null===r||void 0===r?void 0:r.getValue();if(i){var o=r.type===D["CardType"].INLINE?"span":"div",a="<".concat(o,' data-type="').concat(r.type,'" data-value="').concat(encodeCardValue(i),'"></').concat(o,">");n.empty(),n.replaceWith(Object(D["$"])(a))}else n.remove()}))}}],[{key:"pluginName",get:function(){return"codeblock"}}]),n}(D["Plugin"]),Vb=function(){var t=this,e=t._self._c;return t.isDestroy?t._e():e("div",{staticClass:"image-box",style:" box-sizing: content-box;"},[t.isUploade?t._e():e("div",{ref:"imageBox",class:"container ".concat(t.isSelect?"select-box-image":"no-select-box-image"," "),style:{width:t.option.width+"px"}},[e("div",{class:"img-container img-style-".concat(t.option.style),style:{"--cropper-height":t.option.height+"px"}},[e("img",{directives:[{name:"show",rawName:"v-show",value:t.option.src&&!t.isEditorImage,expression:"option.src && !isEditorImage"}],ref:"image",staticClass:"image-self",attrs:{src:t.$fileLinkTransfer(t.option.src),alt:t.option.explain||t.option.number},on:{click:function(e){return t.skipTargetPage(t.option.src)}}}),t.option.src||t.isEditorImage?t._e():e("span",{staticStyle:{color:"red"}},[t._v("图片上传失败")]),t.isEditorImage?e("VueCropper",{ref:"imgCropper",attrs:{img:t.$fileLinkTransfer(t.option.src),outputSize:1,autoCrop:!0,autoCropWidth:t.option.width,autoCropHeight:t.option.height,canMoveBox:!0,full:!0,centerBox:!0,enlarge:1,mode:"cover"}}):t._e()],1),e("span",{directives:[{name:"show",rawName:"v-show",value:t.isSelect&&!t.isEditorImage,expression:"isSelect && !isEditorImage"}]},[e("span",{staticClass:"dragdDot dragdDot-topLeft",on:{mousedown:function(e){return t.resize(e,"topLeft")}}}),e("span",{staticClass:"dragdDot dragdDot-topRight",on:{mousedown:function(e){return t.resize(e,"topRight")}}}),e("span",{staticClass:"dragdDot dragdDot-bottomLeft",on:{mousedown:function(e){return t.resize(e,"bottomLeft")}}}),e("span",{staticClass:"dragdDot dragdDot-bottomRight",on:{mousedown:function(e){return t.resize(e,"bottomRight")}}})])]),t.isDrag?e("div",{staticClass:"containe-old",style:"width: ".concat(t.oldWidth,"px;height:").concat(t.oldHeight,"px")},[e("img",{staticStyle:{width:"100%"},attrs:{src:t.$fileLinkTransfer(t.option.src),alt:""}})]):t._e(),t.isUploade?e("div",{ref:t.isUploade?"upLoadImage":"",staticClass:"containe-preview",style:"width: ".concat(t.option.width,"px;")},[t._v(" "+t._s(t.UploadProgress)+" "),e("img",{staticStyle:{width:"100%",opacity:"0.3"},attrs:{src:t.$fileLinkTransfer(t.option.src),alt:""}})]):t._e(),e("div",{directives:[{name:"show",rawName:"v-show",value:t.option.isShowExplain&&!t.isDrag,expression:"option.isShowExplain && !isDrag"}],staticClass:"image-explain",style:"width: ".concat(t.option.width,"px;")},[e("span",{ref:"imgNumber",staticClass:"img-number"}),t.engine.editor._readonly?e("span",[t._v(" "+t._s(t.option.explain)+" ")]):e("input",{directives:[{name:"model",rawName:"v-model",value:t.option.explain,expression:"option.explain"}],ref:"explainInput",staticClass:"image-explain-input",attrs:{type:"tel",placeholder:"请输入描述信息"},domProps:{value:t.option.explain},on:{blur:t.changExplain,input:function(e){e.target.composing||t.$set(t.option,"explain",e.target.value)}}})])])},qb=[],Ub=(n("81b2"),n("0eb6"),n("b7ef"),n("8bd4"),n("ace4"),n("5cc6"),n("907a"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("72f7"),n("fa9e"),n("77d9"),n("d9e2"),n("bab4"),n("6107"),n("dbdf")),Wb=(n("741a"),n("5ff5"),n("7e79")),$b={cardName:"imageuploader",data:function(){return{isEditorImage:!1,imageEditorInstance:{},confirmLoading:!1,isUploade:!1,fileData:null,isDragToUpload:!1,myCropper:null,isDestroy:!1,engine:{},afterImg:"",width:300,height:"",oldWidth:"",widthInput:{},heightInput:{},oldHeight:"",isSelect:!1,element:{},imageElement:{},isDrag:!1,isTailor:!1,baseImageSrc:"",UploadProgress:"",option:{src:"",width:"",explain:"",targetSrc:"",openInPage:!1,style:"",isShowExplain:!1}}},props:{upLoading:{type:Boolean,default:!1}},components:{VueCropper:Wb["VueCropper"]},created:function(){},beforeMount:function(){this.option||(this.option={src:"",width:"",explain:"",align:"",targetSrc:"",openInPage:!1,style:""})},mounted:function(){var t=this;return Object(N["a"])(Object(M["a"])().mark((function e(){var n,r,i,o,a,s;return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isUploade){e.next=10;break}n=document.createElement("input"),n.type="file",n.accept="image/*",n.click(),r=function e(){document.removeEventListener("mousemove",e),n.files&&n.files.length<=0&&(t.$message.error("用户取消上传图片"),t.engine.editor.history.undo(),t.engine.destroy(),t.isDestroy=!0)},n.onchange=Object(N["a"])(Object(M["a"])().mark((function e(){var r,i,o,a,s;return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,r=n.files[0],r.type.includes("image")){e.next=8;break}return t.$message.error("请上传符合图片类型文件"),t.engine.editor.history.undo(),t.isDestroy=!0,t.engine.destroy(),e.abrupt("return");case 8:return i=new FormData,i.append("file",r),t.option.isShowExplain=!1,o=new FileReader,o.readAsDataURL(r),t.option.src="",o.onload=function(e){t.option.src=e.currentTarget.result},a=function(e){t.UploadProgress=Math.ceil(e.loaded/e.total*100)+"%"},e.next=18,Object(Ub["a"])(i,a);case 18:s=e.sent,t.$set(t.option,"src",s.data.data.diskname),t.isUploade=!1,t.initPageSize(),t.saveChange(),setTimeout((function(){t.engine.saveHistory=!0}),0),e.next=30;break;case 26:e.prev=26,e.t0=e["catch"](0),t.isUploade=!1,t.option.src="";case 30:case"end":return e.stop()}}),e,null,[[0,26]])}))),setTimeout((function(){document.addEventListener("mousemove",r,!1)}),0),e.next=32;break;case 10:if(!t.isDragToUpload){e.next=30;break}return t.isUploade=!0,i=new FormData,i.append("file",t.fileData),t.option.isShowExplain=!1,o=new FileReader,o.readAsDataURL(t.fileData),t.option.src="",o.onload=function(e){var n;t.option.src=e.currentTarget.result,t.option.width=t.imageElement.offsetWidth,t.option.height=null===(n=t.imageElement)||void 0===n?void 0:n.offsetHeight},a=function(e){t.UploadProgress=Math.ceil(e.loaded/e.total*100)+"%"},e.next=22,Object(Ub["a"])(i,a);case 22:s=e.sent,t.$set(t.option,"src",s.data.data.diskname),t.isUploade=!1,t.initPageSize(),t.saveChange(),setTimeout((function(){t.engine.saveHistory=!0}),0),e.next=32;break;case 30:t.initPageSize(),t.engine.saveHistory=!0;case 32:case"end":return e.stop()}}),e)})))()},methods:{initPageSize:function(){var t=this;this.$nextTick((function(){var e;if(t.option.explain&&(t.option.isShowExplain=!0),t.option.align&&t.changeAlign(t.option.align),!t.option.width||!t.option.height){var n=new Image;n.onload=function(){n.naturalWidth>810?t.option.width=810:n.naturalWidth<50?t.option.width=50:t.option.width=n.naturalWidth,t.option.height=n.naturalHeight},n.src=t.$fileLinkTransfer(t.option.src)}t.element=t.$refs.imageBox,t.imageElement=t.$refs.image,t.oldWidth=t.option.width,t.oldHeight=null===(e=t.element)||void 0===e?void 0:e.offsetHeight}))},cancelEditor:function(){this.isEditorImage=!1,this.imageEditorInstance.destroy()},imgCropper:function(t){var e=this;if(this.isEditorImage=t,!t){var n=this.$refs.imgCropper;n.getCropData(function(){var t=Object(N["a"])(Object(M["a"])().mark((function t(n){var r;return Object(M["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.option.src=n,t.next=3,e.loadImg(n);case 3:r=t.sent,e.option.width=r.width,e.option.height=r.height,e.saveChange();case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},saveEditor:function(){var t=this;return Object(N["a"])(Object(M["a"])().mark((function e(){var n,r,i,o,a,s,l;return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:for(e.prev=0,n=t.imageEditorInstance.toDataURL(),r=window.atob(n.split(",")[1]),i=new Uint8Array(r.length),o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return a=new Blob([i],{type:"image/png"}),s=new FormData,s.append("file",a),e.next=10,Object(Ub["a"])(s);case 10:if(l=e.sent,200===l.data.code){e.next=13;break}throw"图片保存失败,请稍后再试!";case 13:t.option.src=l.data.data.path,t.isEditorImage=!1,t.saveChange(),e.next=21;break;case 18:e.prev=18,e.t0=e["catch"](0),t.$message.error(e.t0.toString());case 21:case"end":return e.stop()}}),e,null,[[0,18]])})))()},changExplain:function(){this.saveChange()},changeAlign:function(t){var e=this.engine.container[0].parentNode.parentNode.parentNode.parentNode;e.style.textAlign=t,this.option.align=t,this.saveChange()},saveChange:function(){var t;this.option.width||(this.option.height=null===(t=this.element)||void 0===t?void 0:t.offsetHeight);this.option.isShowExplain||(this.option.explain=""),this.engine.setValue({value:this.option})},resize:function(t,e){var n,r=this;this.isDrag=!0;var i=t.clientX;this.element.style.zIndex=1e3;var o=this.element.offsetWidth,a=null===(n=this.element)||void 0===n?void 0:n.offsetHeight;this.element.style.position="absolute",this.oldWidth=o,this.oldHeight=a;var s=o/a;this.$set(this,"option",Object(_["a"])({},this.option)),this.imageElement.style.opacity=.2,document.onmousemove=function(t){var n=t.clientX,l=(t.clientY,0);switch(e){case"topLeft":l=i-n+o,l>810?r.option.width=810:l<50?r.option.width=50:(r.$set(r.option,"width",l),r.element.style.left=n-i+"px",r.element.style.top=a-l/s+"px");break;case"topRight":if(l=n-i+o,l>810){r.option.width=810;break}if(l<50){r.option.width=50;break}r.option.width=l,r.element.style.left=0,r.element.style.top=a-l/s+"px";break;case"bottomLeft":if(l=i-n+o,l>810){r.option.width=810;break}if(l<50){r.option.width=50;break}r.option.width=l,r.element.style.right=0,r.element.style.top="0px";break;case"bottomRight":if(l=n-i+o,l>810){r.option.width=810;break}if(l<50){r.option.width=50;break}r.option.width=l,r.element.style.top="0px",r.element.style.left=0;default:break}},document.onmouseup=function(){var t,e,n;r.engine.saveHistory=!0,r.element.style.position="relative",r.element.style.zIndex=0,r.element.style.left="",r.element.style.top="",r.oldHeight=null===(t=r.element)||void 0===t?void 0:t.offsetHeight,r.oldWidth=r.option.width,r.imageElement.style.opacity="",document.onmousemove=null,r.widthInput.value=r.option.width,r.heightInput.value=null===(e=r.imageElement)||void 0===e?void 0:e.offsetHeight,r.option.height=null===(n=r.imageElement)||void 0===n?void 0:n.offsetHeight,r.isDrag&&(r.isDrag=!1,r.saveChange()),document.onmouseup=null}},skipTargetPage:function(t){if(this.engine.editor._readonly&&this.option.targetSrc)this.option.openInPage?window.location.href="http://www.baidu.com":window.open("http://www.baidu.com");else if(this.engine.editor._readonly){var e=this.engine.editor.outlineOtherData.imageListData.indexOf(t);-1==e;var n=this.$viewerApi({images:this.engine.editor.outlineOtherData.imageListData,options:{title:!1},view:1});n.index=e}},addLink:function(t){var e=this,n=document.getElementById("add-link-box");if(n){var r=document.getElementById("add-link-input");r.focus()}else{var i="";i="svg"==t.nodeName?t.parentNode:"path"==t.nodeName?t.parentNode.parentNode:t;var o=document.createElement("div"),a=document.createElement("input"),s='<div></div><div class="ant-checkbox-box"><span class="ant-checkbox"><input type="checkbox" id="add-link-checkbox" class="ant-checkbox-input" ><span class="ant-checkbox-inner"></span></span><span class="ant-checkbox-input-text">是否在当前页面打开</span></div>';o.className="add-link-box",i.id="add-link-icon",a.className="ant-input",a.value=this.option.targetSrc,a.id="add-link-input",a.placeholder="请输入链接地址",o.id="add-link-box",o.innerHTML=s,o.firstChild.appendChild(a),o.onclick=function(t){t.stopPropagation()};this.$nextTick((function(){var t=document.getElementById("add-link-checkbox");t.checked=e.option.openInPage,t.parentElement.classList.add(t.checked?"ant-checkbox-checked":"ant-checkbox"),t.onclick=function(n){n.stopPropagation(),e.option.openInPage=t.checked,t.checked?t.parentElement.classList.add("ant-checkbox-checked"):t.parentElement.classList.remove("ant-checkbox-checked")},a.oninput=function(t){e.option.targetSrc=a.value}})),i.appendChild(o),a.focus(),document.onmousedown=function(t){var e=!1;t.path.forEach((function(t){"add-link-box"!=t.id&&"add-link-icon"!=t.id||(e=!0)})),e||(o.remove(),document.onmousedown="")}}},rotateImg:function(){var t=arguments,e=this;return Object(N["a"])(Object(M["a"])().mark((function n(){var r,i,o,a,s,l,c;return Object(M["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=t.length>0&&void 0!==t[0]?t[0]:e.$fileLinkTransfer(e.option.src),i=t.length>1&&void 0!==t[1]?t[1]:e.option.deg,i>=360?e.option.deg=0:void 0==i?e.option.deg=90:e.option.deg,i=e.option.deg,n.next=6,e.loadImg(r);case 6:o=n.sent,a=o.width,s=o.height,[90,270].includes(i)?(a=o.height,s=o.width):[180,360,0].includes(i)||(a=o.width*Math.cos(i*Math.PI/180)+o.height*Math.sin(i*Math.PI/180),s=o.height*Math.cos(i*Math.PI/180)+o.width*Math.sin(i*Math.PI/180)),l=document.createElement("canvas"),c=l.getContext("2d"),l.width=a,l.height=s,c.save(),c.translate(l.width/2,l.height/2),c.rotate(i*Math.PI/180),c.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),c.translate(-l.width/2,-l.height/2),c.restore(),e.option.src=l.toDataURL("image/png"),e.option.width=a,e.option.height=s,e.saveChange();case 24:case"end":return n.stop()}}),n)})))()},loadImg:function(t){return new Promise((function(e,n){var r=new Image;r.crossOrigin="",r.onload=function(){e(r)},r.onerror=function(){n(new Error("image load error"))},r.src=t}))},perview:function(){}},watch:{"option.isShowExplain":{handler:function(t,e){},deep:!0}}},Gb=$b,Yb=(n("63d0"),Object(it["a"])(Gb,Vb,qb,!1,null,"0bfbd68a",null)),Xb=Yb.exports,Kb=(n("2e46"),n("f724")),Zb=!1,Jb=null,Qb=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Object(ef["a"])(Object(wf["a"])(t),"context",void 0),Object(ef["a"])(Object(wf["a"])(t),"ImageVue",{}),Object(ef["a"])(Object(wf["a"])(t),"dropdownEle",{}),Object(ef["a"])(Object(wf["a"])(t),"widthInputEnter",(function(e){var n=Object(Kb["toNumber"])(e);isNaN(n)?t.ImageVue.$message.warn("请输入纯数字"):(t.ImageVue.option.width=e>810?810:e,t.ImageVue.$nextTick((function(){t.ImageVue.heightInput.value=t.ImageVue.imageElement.offsetHeight,t.ImageVue.widthInput.value=t.ImageVue.option.width})))})),Object(ef["a"])(Object(wf["a"])(t),"heightInputEnter",(function(e){var n=Object(Kb["toNumber"])(e);if(isNaN(n))t.ImageVue.$message.warn("请输入纯数字");else{var r=t.ImageVue.option.width,i=t.ImageVue.imageElement.offsetHeight,o=r/i,a=Math.round(e*o);a>810?(t.ImageVue.option.width=810,t.ImageVue.widthInput.value=810,t.ImageVue.heightInput.value=Math.round(810/o)):(t.ImageVue.option.width=a,t.ImageVue.widthInput.value=a)}})),Object(ef["a"])(Object(wf["a"])(t),"saveHistory",!1),t}return Object(B["a"])(n,[{key:"isInlineCard",value:function(){return!1}},{key:"resizeModel",value:function(){return!0}},{key:"didRender",value:function(){var t,e;Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.type===D["CardType"].BLOCK?null===(t=this.toolbarModel)||void 0===t||t.setOffset([-120,0]):null===(e=this.toolbarModel)||void 0===e||e.setOffset([0,10])}},{key:"toolbar",value:function(){var t=this;if(!Object(D["isEngine"])(this.editor)||this.editor.readonly)return[];this.editor.language;var e=[{type:"button",title:"图片裁剪",content:'<span class="data-icon data-icon-cut"></span>',onClick:function(){t.ImageVue.imgCropper(!0)}},{type:"button",title:"添加图片链接",content:'<span class="data-icon"><svg t="1658891505408" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2281" width="16" height="16"><path d="M451.2 598.4c-9.6 0-16-3.2-22.4-9.6-38.4-38.4-60.8-89.6-60.8-144s22.4-105.6 60.8-144l182.4-182.4c38.4-38.4 89.6-60.8 144-60.8 54.4 0 105.6 22.4 144 60.8 80 80 80 208 0 288l-83.2 83.2c-12.8 12.8-32 12.8-44.8 0s-12.8-32 0-44.8l83.2-83.2c54.4-54.4 54.4-144 0-198.4-25.6-25.6-60.8-41.6-99.2-41.6-38.4 0-73.6 16-99.2 41.6l-182.4 182.4c-25.6 25.6-41.6 60.8-41.6 99.2s16 73.6 41.6 99.2c12.8 12.8 12.8 32 0 44.8-6.4 6.4-12.8 9.6-22.4 9.6z" fill="#333333" p-id="2282"></path><path d="M268.8 953.6c-51.2 0-105.6-19.2-144-60.8C86.4 854.4 64 803.2 64 748.8c0-54.4 22.4-105.6 60.8-144l83.2-83.2c12.8-12.8 32-12.8 44.8 0s12.8 32 0 44.8l-83.2 83.2c-25.6 25.6-41.6 60.8-41.6 99.2 0 38.4 16 73.6 41.6 99.2 54.4 54.4 144 54.4 198.4 0l182.4-182.4c25.6-25.6 41.6-60.8 41.6-99.2 0-38.4-16-73.6-41.6-99.2-12.8-12.8-12.8-32 0-44.8s32-12.8 44.8 0c38.4 38.4 60.8 89.6 60.8 144 0 54.4-22.4 105.6-60.8 144l-182.4 182.4c-38.4 38.4-92.8 60.8-144 60.8z" fill="#333333" p-id="2283"></path></svg></span>',onClick:function(e,n){t.ImageVue.addLink(e.target)}},{type:"button",title:"旋转",content:'<span class="data-icon data-icon-rotate-right"></span>',onClick:function(e,n){t.ImageVue.rotateImg()}},{type:"button",title:"添加描述",content:'<span class="data-icon"><svg t="1678690521091" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9797" width="16" height="16"><path d="M512 768c-211.2 0-384-172.8-384-384s172.8-384 384-384 384 172.8 384 384S723.2 768 512 768zM512 64C332.8 64 192 204.8 192 384s140.8 320 320 320 320-140.8 320-320S691.2 64 512 64z" fill="#231815" p-id="9798"></path><path d="M512 1024c-108.8 0-192-83.2-192-192l0-12.8c0-12.8 6.4-19.2 12.8-25.6 6.4-6.4 19.2-6.4 32 0 89.6 44.8 198.4 44.8 288 0 12.8-6.4 19.2-6.4 32 0 6.4 6.4 12.8 19.2 12.8 25.6L697.6 832C704 940.8 620.8 1024 512 1024zM390.4 864C403.2 921.6 454.4 960 512 960s108.8-38.4 121.6-96C556.8 896 467.2 896 390.4 864z" fill="#231815" p-id="9799"></path><path d="M627.2 556.8c-19.2 0-32-12.8-32-32L595.2 416 531.2 473.6c-12.8 12.8-32 12.8-44.8 0L435.2 416l0 108.8c0 19.2-12.8 32-32 32S371.2 544 371.2 524.8L371.2 345.6C371.2 332.8 377.6 320 384 313.6c12.8-6.4 25.6 0 32 6.4L512 403.2 601.6 320C614.4 313.6 627.2 313.6 640 313.6c12.8 6.4 19.2 19.2 19.2 32l0 179.2C652.8 544 640 556.8 627.2 556.8z" fill="#231815" p-id="9800"></path></svg></span>',onClick:function(e,n){var r,i=null===(r=t.getValue())||void 0===r?void 0:r.value;t.ImageVue.option=Object(_["a"])(Object(_["a"])({},i),{},{isShowExplain:!i.isShowExplain}),t.ImageVue.saveChange(),t.ImageVue.option.isShowExplain?(n.addClass("active"),t.ImageVue.$nextTick((function(){t.ImageVue.$refs.explainInput.focus()}))):n.removeClass("active")},didMount:function(e){var n,r=null===(n=t.getValue())||void 0===n?void 0:n.value;r&&r.isShowExplain?e.addClass("active"):e.removeClass("active")}},{type:"button",title:"左对齐",content:'<span class="data-icon"><svg t="1658819492386" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3171" width="16" height="16"><path d="M96 192h832a32 32 0 0 1 0 64H96a32 32 0 1 1 0-64z m0 192h512a32 32 0 0 1 0 64H96a32 32 0 1 1 0-64z m0 192h832a32 32 0 0 1 0 64H96a32 32 0 0 1 0-64z m0 192h512a32 32 0 0 1 0 64H96a32 32 0 0 1 0-64z" fill="#000000" p-id="3172"></path></svg></span>',onClick:function(e,n){t.ImageVue.changeAlign("left")}},{type:"button",title:"居中",content:'<span class="data-icon"><svg t="1658819539594" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4558" width="16" height="16"><path d="M96 192h832a32 32 0 0 1 0 64H96a32 32 0 1 1 0-64z m160 192h512a32 32 0 0 1 0 64H256a32 32 0 1 1 0-64z m-160 192h832a32 32 0 0 1 0 64H96a32 32 0 0 1 0-64z m160 192h512a32 32 0 0 1 0 64H256a32 32 0 0 1 0-64z" fill="#000000" p-id="4559"></path></svg></span>',onClick:function(e,n){t.ImageVue.changeAlign("center")}},{type:"button",title:"右对齐",content:'<span class="data-icon"><svg t="1658819555668" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4784" width="16" height="16"><path d="M96 192h832a32 32 0 0 1 0 64H96a32 32 0 1 1 0-64z m320 192h512a32 32 0 0 1 0 64H416a32 32 0 0 1 0-64zM96 576h832a32 32 0 0 1 0 64H96a32 32 0 0 1 0-64z m320 192h512a32 32 0 0 1 0 64H416a32 32 0 0 1 0-64z" fill="#000000" p-id="4785"></path></svg></span>',onClick:function(e,n){t.ImageVue.changeAlign("right")}},{type:"input",prefix:"宽度:",placeholder:"请输入宽度",value:this.ImageVue.option.width,onEnter:function(e){t.widthInputEnter(e)},didMount:function(e){t.ImageVue.widthInput=e[0].lastElementChild,e[0].lastElementChild.onblur=function(){t.widthInputEnter(e[0].lastElementChild.value)}}},{type:"input",prefix:"高度:",placeholder:"请输入宽度",value:this.ImageVue.imageElement.offsetHeight,onEnter:function(e){t.heightInputEnter(e)},onInput:function(){},didMount:function(e){t.ImageVue.heightInput=e[0].lastElementChild,e[0].lastElementChild.onblur=function(){t.heightInputEnter(e[0].lastElementChild.value)}}},{type:"dropdown",title:"样式设置",content:'<div class="data-icon-customtext-box"><span class="data-icon-customtext">样式</span><span class="data-icon"><svg t="1658909755182" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2288" width="16" height="16"><path d="M512.726547 675.318646c-8.063653 0-15.790638-3.245927-21.435195-9.006118L231.175103 400.906809c-11.603269-11.837606-11.410887-30.840402 0.427742-42.442648 11.837606-11.601222 30.841426-11.410887 42.442648 0.427742l238.681054 243.534596L751.407602 358.891903c11.601222-11.839653 30.602995-12.033058 42.442648-0.427742 11.839653 11.603269 12.031011 30.605042 0.427742 42.442648L534.161742 666.312528C528.517185 672.072719 520.791224 675.318646 512.726547 675.318646z" p-id="2289"></path></svg></span></div>',didMount:function(e){t.dropdownEle=e[0];var n=e[0],r=n.querySelectorAll('[customclass="icon-checked"]'),i=t.ImageVue.option.style;r.forEach((function(t){var e=t.getAttribute("type");t.style.display=e==i?"inline-block":"none"}))},items:[{type:"button",content:'<span class="checked-item-icon"><svg type="" customclass="icon-checked" t="1658910153536" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3393" width="16" height="16"><path d="M422.4 802.133333L128 512l29.866667-29.866667 264.533333 264.533334L908.8 256l29.866667 29.866667L422.4 802.133333z" fill="#444444" p-id="3394"></path></svg></span>无样式',onClick:function(e,n){t.ImageVue.$set(t.ImageVue.option,"style","");var r=t.dropdownEle,i=r.querySelectorAll('[customclass="icon-checked"]'),o=t.ImageVue.option.style;i.forEach((function(t){var e=t.getAttribute("type");t.style.display=e==o?"inline-block":"none"}))}},{type:"button",content:'<span class="checked-item-icon"><svg type="shadow" customclass="icon-checked" t="1658910153536" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3393" width="16" height="16"><path d="M422.4 802.133333L128 512l29.866667-29.866667 264.533333 264.533334L908.8 256l29.866667 29.866667L422.4 802.133333z" fill="#444444" p-id="3394"></path></svg></span>图片阴影',onClick:function(e,n){t.ImageVue.$set(t.ImageVue.option,"style","shadow");var r=t.dropdownEle,i=r.querySelectorAll('[customclass="icon-checked"]'),o=t.ImageVue.option.style;i.forEach((function(t){var e=t.getAttribute("type");t.style.display=e==o?"inline-block":"none"}))}},{type:"button",content:'<span class="checked-item-icon"><svg type="border" customclass="icon-checked" t="1658910153536" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3393" width="16" height="16"><path d="M422.4 802.133333L128 512l29.866667-29.866667 264.533333 264.533334L908.8 256l29.866667 29.866667L422.4 802.133333z" fill="#444444" p-id="3394"></path></svg></span>图片描边',onClick:function(e,n){t.ImageVue.$set(t.ImageVue.option,"style","border");var r=t.dropdownEle,i=r.querySelectorAll('[customclass="icon-checked"]'),o=t.ImageVue.option.style;i.forEach((function(t){var e=t.getAttribute("type");t.style.display=e==o?"inline-block":"none"}))}}]},{type:"delete"}];return e.concat()}},{key:"render",value:function(t){var e=Object(D["$"])('<div class="ImageUploader-box"></div>'),n=this.getValue().value,r=kb["default"].extend(Xb),i=new r;return i.engine=this,i.$set(i,"option",n),Zb&&(i.fileData=Jb,i.isDragToUpload=Zb),n||Zb||(i.isUploade=!0),i.baseImageSrc=(null===n||void 0===n?void 0:n.src)||"",i.$mount(),e[0].appendChild(i.$el),this.ImageVue=i,this.container=e,e}},{key:"writeHistoryOnValueChange",value:function(){return this.saveHistory}},{key:"destroy",value:function(t){return this.ImageVue.$destroy(),this.container&&(this.container[0].parentElement.innerHTML=""),!1}},{key:"select",value:function(t){var e,n,r;!this.editor.readonly&&this.getValue()&&(this.ImageVue&&(this.ImageVue.isSelect=t),!t&&(null===(e=this.ImageVue)||void 0===e||e.isUploade),!t&&null!==(n=this.ImageVue)&&void 0!==n&&n.isEditorImage&&(null===(r=this.ImageVue)||void 0===r||r.imgCropper(!1)))}}],[{key:"cardName",get:function(){return"imageuploader"}},{key:"cardType",get:function(){return D["CardType"].INLINE}},{key:"focus",get:function(){return!1}},{key:"lazyRender",get:function(){return!1}}]),n}(D["Card"]),ty=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"init",value:function(){var t=this;this.editor.on("paser:html",(function(e){return t.parseHtml(e)})),this.editor.on("paste:schema",(function(e){return t.pasteSchema(e)})),this.editor.on("paste:each",(function(e){return t.pasteHtml(e)}))}},{key:"execute",value:function(t){if(t&&(Zb=t.isDragToUpload,Jb=t.file),Object(D["isEngine"])(this.editor)){var e=this.editor.card;e.insert(Xb.cardName,Object(_["a"])({},t))}}},{key:"hotkey",value:function(){return this.options.hotkey||"ctrl+|"}},{key:"pasteSchema",value:function(t){t.add({type:"inline",name:"div",attributes:{"data-type":{required:!0,value:Xb.cardName},"data-value":"*"}})}},{key:"pasteHtml",value:function(t){if(Object(D["isEngine"])(this.editor)){if(t.isElement()){var e=t.attributes("data-type");if(e===Xb.cardName){var n=t.attributes("data-value"),r=decodeCardValue(n);if(!r.url)return;return this.editor.card.replaceNode(t,Xb.cardName,r),t.remove(),!1}}return!0}}},{key:"parseHtml",value:function(t){var e=this;t.find("[".concat(CARD_KEY,"=").concat(Xb.cardName)).each((function(t){var n=Object(D["$"])(t),r=e.editor.card.find(n),i=null===r||void 0===r?void 0:r.getValue();if(i){var o=r.type===D["CardType"].INLINE?"span":"div",a="<".concat(o,' data-type="').concat(r.type,'" data-value="').concat(encodeCardValue(i),'"></').concat(o,">");n.empty(),n.replaceWith(Object(D["$"])(a))}else n.remove()}))}}],[{key:"pluginName",get:function(){return"imageuploader"}}]),n}(D["Plugin"]),ey=n("30ac"),ny=function(){var t,e,n,r=this,i=r._self._c;return i("div",{staticClass:"math-box"},[i("div",{ref:"mathContent",staticClass:"math-content",style:{"--size":(null!==(t=null===(e=r.option)||void 0===e?void 0:e.size)&&void 0!==t?t:1)+"em",color:null===(n=r.option)||void 0===n?void 0:n.color},domProps:{innerHTML:r._s("$$".concat(r.option.value,"$$"))}}),i("a-modal",{staticClass:"math-content-editor",attrs:{title:"公式编辑器",cancelText:"取消",okText:"确定",visible:r.isShowEditor,"confirm-loading":r.confirmLoading},on:{ok:r.handleOk,cancel:r.handleCancel}},[i("div",{staticClass:"editor-content-box"},[i("div",{staticClass:"content-editor-left"},[i("a-textarea",{staticClass:"content-editor-input",attrs:{placeholder:"Controlled autosize","auto-size":{minRows:3,maxRows:5}},on:{focus:r.foucusInput,change:r.renderPreview},model:{value:r.editorMathValue,callback:function(t){r.editorMathValue=t},expression:"editorMathValue"}}),i("div",{ref:"mathPreview",staticClass:"content-editor-preview"},[r._v(" $$"+r._s(r.editorMathValue)+"$$ ")])],1),i("div",{staticClass:"content-editor-right"},[i("a-tabs",{style:{height:"100%"},attrs:{activeKey:r.activeKey,destroyOnClose:!0,"tab-position":"right",size:"small"},on:{change:r.changePanel}},r._l(r.mathList,(function(t,e){return i("a-tab-pane",{key:e+1,attrs:{tab:t.name}},r._l(t.children,(function(t,e){return i("div",{key:"".concat(e+1),staticClass:"math-model-node",on:{click:function(e){return r.addToEditorValue(t)}}},[r._v(" $$"+r._s(t)+"$$ ")])})),0)})),1)],1)])])],1)},ry=[];n("7cd2");const iy=function(t,e,n){let r=n,i=0;const o=t.length;while(r<e.length){const n=e[r];if(i<=0&&e.slice(r,r+o)===t)return r;"\\"===n?r++:"{"===n?i++:"}"===n&&i--,r++}return-1},oy=function(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},ay=/^\\begin{/,sy=function(t,e){let n;const r=[],i=new RegExp("("+e.map(t=>oy(t.left)).join("|")+")");while(1){if(n=t.search(i),-1===n)break;n>0&&(r.push({type:"text",data:t.slice(0,n)}),t=t.slice(n));const o=e.findIndex(e=>t.startsWith(e.left));if(n=iy(e[o].right,t,e[o].left.length),-1===n)break;const a=t.slice(0,n+e[o].right.length),s=ay.test(a)?a:t.slice(e[o].left.length,n);r.push({type:"math",data:s,rawData:a,display:e[o].display}),t=t.slice(n+e[o].right.length)}return""!==t&&r.push({type:"text",data:t}),r};var ly=sy;const cy=function(t,e){const n=ly(t,e.delimiters);if(1===n.length&&"text"===n[0].type)return null;const r=document.createDocumentFragment();for(let o=0;o<n.length;o++)if("text"===n[o].type)r.appendChild(document.createTextNode(n[o].data));else{const t=document.createElement("span");let a=n[o].data;e.displayMode=n[o].display;try{e.preProcess&&(a=e.preProcess(a)),Sb.a.render(a,t,e)}catch(i){if(!(i instanceof Sb.a.ParseError))throw i;e.errorCallback("KaTeX auto-render: Failed to parse `"+n[o].data+"` with ",i),r.appendChild(document.createTextNode(n[o].rawData));continue}r.appendChild(t)}return r},uy=function(t,e){for(let n=0;n<t.childNodes.length;n++){const r=t.childNodes[n];if(3===r.nodeType){const i=cy(r.textContent,e);i&&(n+=i.childNodes.length-1,t.replaceChild(i,r))}else if(1===r.nodeType){const t=" "+r.className+" ",n=-1===e.ignoredTags.indexOf(r.nodeName.toLowerCase())&&e.ignoredClasses.every(e=>-1===t.indexOf(" "+e+" "));n&&uy(r,e)}}},dy=function(t,e){if(!t)throw new Error("No element provided to render");const n={};for(const r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=n.ignoredTags||["script","noscript","style","textarea","pre","code","option"],n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},uy(t,n)};var hy=dy,py=[{name:"积分",children:["a^2","a_2","a^{2+2}","a_{i,j}","{}_1^2\\!X_3^4","\\overset{\\frown} {AB}","\\overline{hij}","\\underline{klm}","\\overbrace{1+2+\\cdots+100}","\\begin{matrix} 5050 \\\\ \\overbrace{ 1+2+\\cdots+100 }\\end{matrix}","\\underbrace{a+b+\\cdots+z}","\\sum_{k=1}^N k^2","\\begin{matrix} \\sum_{k=1}^N k^2 \\end{matrix}","\\prod_{i=1}^N x_i","\\begin{matrix} \\prod_{i=1}^N x_i \\end{matrix}","\\coprod_{i=1}^N x_i","\\begin{matrix} \\coprod_{i=1}^N x_i \\end{matrix}","\\lim_{n \\to \\infty}x_n","\\begin{matrix} \\ lim_{n \\to \\infty}x_n \\end{matrix}","\\int_{-N}^{N} e^x\\, \\mathrm{d}x","\\begin{matrix} \\int_{_N}^{N} e^x\\, \\mathrm{d}x \\end{matrix}","\\iint_{D}^{W} \\, \\mathrm{d}x\\,\\mathrm{d}y","\\iiint_{E}^{V} \\,\\mathrm{d}x\\,\\mathrm{d}y,\\mathrm{d}z","\\oint_{C} x^3\\, \\mathrm{d}x + 4y^2\\, \\mathrm{d}y","\\bigcap_1^{n} p","\\bigcup_1^{k} p"]},{name:"分隔符",children:["\\left(\\frac{a}{b} \\right)","\\left[\\frac{a}{b} \\right]","\\left\\{\\frac{a}{b} \\right\\}","\\left \\langle \\frac{a}{b} \\right \\rangle","\\left|\\frac{a}{b} \\right|","\\left \\lceil \\frac{c}{d} \\right \\rceil","\\left / \\frac{a}{b} \\right \\backslash","\\left \\Uparrow \\frac{a}{b} \\right \\Downarrow","\\left \\updownarrow \\frac{a}{b} \\right \\Updownarrow","\\left [ 0,1 \\right ) \\left \\langle \\psi \\right |","\\left \\{ \\frac{a}{b} \\right.","\\left . \\frac{a}{b} \\right \\}","\\langle","\\rangle","\\lceil","\\rceil","\\lfloor","\\rfloor","\\lbrace","\\rbrace","\\lvert","\\rvert"]},{name:"函数",children:["\\sin\\theta","\\cos\\theta","\\tan\\theta","\\arcsin\\frac{L}{r}","\\arccos\\frac{T}{r}","\\arctan\\frac{L}{T}","\\sinh g","\\cosh h","\\tanh i","\\coth j","\\operatorname{sh}j","\\operatorname{ch}h","\\operatorname{th}i","\\operatorname{argsh}k","\\operatorname{argch}l","\\operatorname{argth}m","\\limsup S","\\liminf I","\\max H","\\min L","\\inf s","\\sup t","\\exp\\!t","\\ln X","\\lg X","\\log X","\\log_\\alpha X","\\ker x","\\deg x","\\gcd(T,U,V,W,X)","\\Pr x","\\det x","\\hom x","\\arg x","\\dim x","\\lim_{t\\to n}T"]},{name:"微分导数",children:["\\nabla\\psi","\\partial x","\\mathrm{d}x","\\dot x","\\ddot y","X^\\prime","\\backprime","f^{(3)}"]},{name:"运算符",children:["\\pm","\\times","\\div","\\mid","\\nmid","\\cdot","\\circ","\\ast","\\bigodot","\\bigoplus","\\leq","\\geq","\\leqq","\\geqq","=","\\neq","\\approx","\\equiv","\\not\\equiv","\\sum","\\prod","\\coprod","\\backslash","\\sim","\\backsim","\\simeq","\\cong","\\dot=","\\ggg","\\gg",">","<","\\ll","\\lll","\\propto"]},{name:"逻辑符号",children:["、emptyset","\\varnothing","\\in","\\not\\in","\\subset","\\supset","\\subseteq","\\sqsupseteq","\\cap","\\cup","\\bigcup","\\sqcap","\\sqcup","\\uplus","\\biguplus","\\bigsqcup","\\top","\\bot","\\complement","\\vee","\\wedge","\\bigvee","\\bigwedge","\\forall","\\exists","\\not\\subset","\\not=","\\not<","\\not>","\\because","\\therefore","\\neg","\\bar{q} \\to p","\\setminus","\\smallsetminus"]},{name:"几何符号",children:["\\Diamond","\\Box","\\triangle","\\perp","\\angle\\Alpha\\Beta\\Gamma","60^\\circ"]},{name:"戴帽符号",children:["\\vec{c}","\\overleftarrow{ab}","\\overrightarrow{cd}","\\overleftrightarrow{ab}","\\widehat{efg}","\\overset{\\frown} {AB}","\\hat{xyz}","\\tilde{xy}","\\bar{y}","\\widetilde{xyz}","\\acute{y}","\\breve{y}","\\check{y}","\\grave{y}"]},{name:"箭头符号",children:["\\to","\\mapsto","\\underrightarrow{1^circ/min}","\\implies","\\impliedby","\\iff","\\downarrow","\\Uparrow","\\Downarrow","\\leftarrow","\\rightarrow","\\leftrightarrow","\\Leftarrow","\\Rightarrow","\\Leftrightarrow","\\longleftarrow","\\longrightarrow","\\longleftrightarrow","\\Longleftarrow","\\Longrightarrow","\\Longleftrightarrow"]},{name:"特殊符号",children:["\\eth","\\%","\\dagger","\\ddagger","\\star","*","\\ldots","\\smile","\\frown","\\wr"]},{name:"分数多行",children:["\\frac{2}{4}=0.5","{2 \\over 3}","{{a+b} \\over {a-b}}","\\tfrac{2}{4} = 0.5","\\cfrac{2}{c + \\cfrac{2}{d + \\cfrac{2}{4}}} = a","\\begin{matrix}x & y \\\\z & v\\end{matrix}","\\begin{Vmatrix}x & y \\\\z & v\\end{Vmatrix}","\\begin{bmatrix}0& \\cdots & 0\\\\\\vdots & \\ddots & \\vdots \\\\0& \\cdots & 0\\end{bmatrix}","\\begin{Bmatrix}x & y \\\\z & v\\end{Bmatrix}","\\begin{pmatrix}x & y \\\\z & v\\end{pmatrix}","\\begin{cases}3x + 5y + z \\\\7x - 2y + 4z \\\\-6x + 3y + 2z\\end{cases}","\\begin{array}{|c|c||c|} a & b & S \\\\\\hline0&0&1\\\\0&1&1\\\\1&0&1\\\\1&1&0\\\\\\end{array}"]},{name:"希腊字母",children:["\\alpha","\\beta","\\gamma","\\delta","\\epsilon","\\epsilon","\\zeta","\\eta","\\theta","\\iota","\\kappa","\\lambda","\\mu","\\nu","\\xi","o","\\pi","\\rho","\\sigma","\\tau","\\upsilon","\\phi"]}],fy={delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],throwOnError:!1},gy=function(t){hy(t,fy)},my={cardName:"matheditor",data:function(){return{engine:{},option:{size:5},editorMathValue:"",isShowEditor:!1,confirmLoading:!1,mathList:py,activeKey:""}},beforeMount:function(){this.option&&this.option.value||(this.option.value="\\begin{matrix} \\sum_{k=1}^N k^2 \\end{matrix}"),this.option&&!this.option.algin&&(this.option.algin="left")},created:function(){},mounted:function(){gy(this.$refs.mathContent)},methods:{handleOk:function(){var t=this;this.option.value=this.editorMathValue,this.saveChange(),this.isShowEditor=!1,this.$nextTick((function(){gy(t.$refs.mathContent)}))},handleCancel:function(){this.isShowEditor=!1},changePanel:function(t){this.activeKey=t,this.$nextTick((function(){for(var t=document.getElementsByClassName("math-model-node"),e=0;e<t.length;e++)gy(t[e])}))},editorMath:function(){this.editorMathValue=this.option.value,this.isShowEditor=!0,this.renderPreview()},renderPreview:function(){var t=this;this.$nextTick((function(){t.changeAlign(t.option.algin),t.$refs.mathPreview.innerHTML="$$".concat(t.editorMathValue,"$$"),gy(t.$refs.mathPreview),t.changePanel(1)}))},addToEditorValue:function(t){var e=this;this.editorMathValue+=t,this.$nextTick((function(){e.$refs.mathPreview.innerHTML="$$".concat(e.editorMathValue,"$$"),gy(e.$refs.mathPreview)}))},foucusInput:function(t){var e=this;t.srcElement.onkeydown=function(t){"Enter"==t.code&&(e.editorMathValue+=" \\\\")}},changeAlign:function(t){var e=this.engine.container[0].parentNode.parentNode.parentNode.parentNode;e.style.textAlign=t,this.option.align=t,this.saveChange()},saveChange:function(){this.engine.setValue({value:this.option})},setJJSize:function(t){this.option.size=t,this.option=Object(_["a"])(Object(_["a"])({},this.option),{},{size:t}),this.engine.setValue({value:this.option})},setColor:function(t){this.option.color=t,this.option=Object(_["a"])(Object(_["a"])({},this.option),{},{color:t}),this.engine.setValue({value:this.option})}}},vy=my,by=(n("ef66"),Object(it["a"])(vy,ny,ry,!1,null,"a6781db2",null)),yy=by.exports;n("1c49");function wy(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xy(t,e,n){wy(t,e),e.set(t,n)}function Cy(t,e){return e.get?e.get.call(t):e.value}function ky(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Ay(t,e){var n=ky(t,e,"get");return Cy(t,n)}function Sy(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function Ey(t,e,n){var r=ky(t,e,"set");return Sy(t,r,n),n}n("10d1");var Oy,Ty,_y=n("fbdf"),My=(n("d459"),new WeakMap),Ny=new WeakMap,Py=new WeakMap,Ly=new WeakMap,Dy=new WeakMap,jy=new WeakMap,Iy=new WeakMap,Ry=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(F["a"])(this,t),xy(this,My,{writable:!0,value:null}),xy(this,Ny,{writable:!0,value:null}),xy(this,Py,{writable:!0,value:null}),xy(this,Ly,{writable:!0,value:null}),xy(this,Dy,{writable:!0,value:null}),xy(this,jy,{writable:!0,value:null}),xy(this,Iy,{writable:!0,value:null}),Object(ef["a"])(this,"viewComponent",null),Object(ef["a"])(this,"value",null),Object(ef["a"])(this,"windowClick",(function(t){var e=t.target;e&&0===Object(D["$"])(e).closest(".data-table-color-tool,.table-color-dropdown-arrow").length&&r.remove()})),Ey(this,My,e),Ey(this,Dy,n),Ey(this,Ny,i),Ey(this,Iy,new D["Position"](Ay(this,My))),Ey(this,Py,i.defaultColor||"transparent"),Ey(this,Ly,Object(D["$"])('<div class="table-color-dropdown-trigger">\n <div type="button" class="table-color-dropdown-arrow" >\n <span class="table-color-dropdown-empty"></span>\n <span class="data-icon data-icon-moremark ">\n </span>\n </div>\n </div>')),Ay(this,Ly).find(".table-color-dropdown-arrow").on("mousedown",(function(t){t.preventDefault(),Ay(r,jy)&&Ay(r,jy).length>0?r.remove():r.render()})),Ay(this,Ly).find(".table-color-dropdown-button-text").on("mousedown",(function(t){t.preventDefault();var e=Ay(r,Ny),n=e.onChange;n&&n(Ay(r,Py))}))}return Object(B["a"])(t,[{key:"getButton",value:function(){return Ay(this,Ly)}},{key:"select",value:function(t){rectElement.attributes("fill",t),Ay(this,Ly).find("svg").css("margin-bottom","transparent"===t?-5:-3)}},{key:"change",value:function(t){Ey(this,Py,t),this.select(t);var e=Ay(this,Ny),n=e.onChange;n&&n(t)}},{key:"toState",value:function(t,e){var n=t["hex"]?bm()(t["hex"]):bm()(t),r=n.toHsl(),i=n.toHsv(),o=n.toRgb(),a=n.toHex();0===r.s&&(r.h=e||0,i.h=e||0);var s="000000"===a&&0===o.a;return{hsl:r,hex:s?"transparent":"#".concat(a),rgb:o,hsv:i,oldHue:t["h"]||e||r.h,source:t["source"]}}},{key:"render",value:function(){var t,e,n=this;Ey(this,jy,Object(D["$"])('<div class="data-table-color-tool data-math-slider-tool'.concat(D["isMobile"]?" data-table-color-tool-mobile":"",'" ').concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" ').concat(D["TRIGGER_CARD_ID"],'="').concat(Ay(this,Dy),'"></div>')));var r=kb["default"].extend(_y["a"]),i=(new r).$mount();i.$refs.sliderRef.value=(null===(t=this.value)||void 0===t?void 0:t.size)||1,i.min=1,i.max=10,i.$refs.sliderRef.$on("change",(function(t){n.viewComponent.setJJSize(t)})),Ay(this,jy).append(i.$el),Ay(this,Iy).setOffset([11,-5]),null===(e=Ay(this,Iy))||void 0===e||e.bind(Ay(this,jy),Ay(this,Ly)),document.addEventListener("mousedown",this.windowClick,!0)}},{key:"remove",value:function(){var t,e;null===(t=Ay(this,jy))||void 0===t||t.remove(),null===(e=Ay(this,Iy))||void 0===e||e.destroy(),document.removeEventListener("mousedown",this.windowClick,!0),Ey(this,jy,void 0)}},{key:"destroy",value:function(){this.remove();var t=Ay(this,Ny),e=t.onDestroy;e&&e()}}]),t}(),Fy=Ry,By=function(){var t=this,e=t._self._c;return e("div",{staticClass:"color-picker"},[e("div",{staticClass:"picker-item"},[e("div",{staticClass:"picker-item-title"},[t._v("边框颜色")]),e("Sketch",{attrs:{"preset-colors":t.BorderPresetColors},model:{value:t.textColor,callback:function(e){t.textColor=e},expression:"textColor"}})],1)])},zy=[],Hy=n("c345a"),Vy={data:function(){return{textColor:[],viewComponent:{},BorderPresetColors:["#eff0f1","#fbbfbc","#fed4a4","#fff67a","#b7edb1","#bacefd","#cdb2fa"]}},mounted:function(){},components:{Sketch:Hy["Sketch"]},watch:{textColor:function(t,e){this.viewComponent&&this.viewComponent.setColor(t.hex)}}},qy=Vy,Uy=(n("1c08"),Object(it["a"])(qy,By,zy,!1,null,"06e2f726",null)),Wy=Uy.exports,$y=new WeakMap,Gy=new WeakMap,Yy=new WeakMap,Xy=new WeakMap,Ky=new WeakMap,Zy=new WeakMap,Jy=new WeakMap,Qy=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(F["a"])(this,t),xy(this,$y,{writable:!0,value:null}),xy(this,Gy,{writable:!0,value:null}),xy(this,Yy,{writable:!0,value:null}),xy(this,Xy,{writable:!0,value:null}),xy(this,Ky,{writable:!0,value:null}),xy(this,Zy,{writable:!0,value:null}),xy(this,Jy,{writable:!0,value:null}),Object(ef["a"])(this,"viewComponent",null),Object(ef["a"])(this,"windowClick",(function(t){var e=t.target;e&&0===Object(D["$"])(e).closest(".data-table-color-tool,.table-color-dropdown-arrow").length&&r.remove()})),Ey(this,$y,e),Ey(this,Ky,n),Ey(this,Gy,i),Ey(this,Jy,new D["Position"](Ay(this,$y))),Ey(this,Yy,i.defaultColor||"transparent"),Ey(this,Xy,Object(D["$"])('<div class="table-color-dropdown-trigger">\n <button type="button" class="table-color-dropdown-button-text">\n <svg width="16px" height="16px" viewBox="0 0 16 16" style="margin-bottom: '.concat("transparent"===Ay(this,Yy)?-5:-3,'">\n <g ="none" strokeWidth="1" fill="none" fillRule="evenodd">\n <path d="M11.9745711,7.921875 C11.9745711,7.921875 13.2147672,9.2863447 13.2147672,10.1226326 C13.2147672,10.8142992 12.6566789,11.3802083 11.9745711,11.3802083 C11.2924632,11.3802083 10.734375,10.8142992 10.734375,10.1226326 C10.734375,9.2863447 11.9745711,7.921875 11.9745711,7.921875 Z M9.07958999,6.47535893 L6.28501575,3.68078468 L3.4904415,6.47535893 L9.07958999,6.47535893 Z M5.3326566,3.04215357 L4.28223263,1.9917296 C4.22692962,1.93642659 4.22692962,1.84676271 4.28223263,1.7914597 L5.03228902,1.0414033 C5.08759203,0.986100299 5.17725591,0.986100299 5.23255892,1.0414033 L6.4546098,2.26345418 C6.46530408,2.27146914 6.4755605,2.28033918 6.48528564,2.29006432 L10.4848531,6.28963174 C10.5954591,6.40023775 10.5954591,6.57956552 10.4848531,6.69017153 L6.4838816,10.691143 C6.37327559,10.801749 6.19394782,10.801749 6.08334181,10.691143 L2.08377439,6.69157557 C1.97316838,6.58096956 1.97316838,6.40164179 2.08377439,6.29103578 L5.3326566,3.04215357 Z" fill="#595959"/>\n strokeWidth="0.5" x="2" y="12.75" width="12" height="1.5" rx="0.125" />\n </g>\n </svg>\n </button>\n <button type="button" class="table-color-dropdown-arrow">\n <span class="table-color-dropdown-empty"></span>\n <span class="data-icon data-icon-arrow"></span>\n </button>\n </div>'))),Ay(this,Xy).find(".table-color-dropdown-arrow").on("mousedown",(function(t){t.preventDefault(),Ay(r,Zy)&&Ay(r,Zy).length>0?r.remove():r.render()})),Ay(this,Xy).find(".table-color-dropdown-button-text").on("mousedown",(function(t){t.preventDefault();var e=Ay(r,Gy),n=e.onChange;n&&n(Ay(r,Yy))}))}return Object(B["a"])(t,[{key:"getButton",value:function(){return Ay(this,Xy)}},{key:"change",value:function(t){Ey(this,Yy,t),this.select(t);var e=Ay(this,Gy),n=e.onChange;n&&n(t)}},{key:"toState",value:function(t,e){var n=t["hex"]?bm()(t["hex"]):bm()(t),r=n.toHsl(),i=n.toHsv(),o=n.toRgb(),a=n.toHex();0===r.s&&(r.h=e||0,i.h=e||0);var s="000000"===a&&0===o.a;return{hsl:r,hex:s?"transparent":"#".concat(a),rgb:o,hsv:i,oldHue:t["h"]||e||r.h,source:t["source"]}}},{key:"render",value:function(){var t;Ey(this,Zy,Object(D["$"])('<div class="data-table-color-tool'.concat(D["isMobile"]?" data-table-color-tool-mobile":"",'" ').concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" ').concat(D["TRIGGER_CARD_ID"],'="').concat(Ay(this,Ky),'"></div>')));var e=kb["default"].extend(Wy),n=new e;n.viewComponent=this.viewComponent,n.onChange=Ay(this,Gy).onChange,n.$mount(),Ay(this,Zy).append(n.$el),null===(t=Ay(this,Jy))||void 0===t||t.bind(Ay(this,Zy),Ay(this,Xy)),document.addEventListener("mousedown",this.windowClick,!0)}},{key:"remove",value:function(){var t,e;null===(t=Ay(this,Zy))||void 0===t||t.remove(),null===(e=Ay(this,Jy))||void 0===e||e.destroy(),document.removeEventListener("mousedown",this.windowClick,!0),Ey(this,Zy,void 0)}},{key:"destroy",value:function(){this.remove();var t=Ay(this,Gy),e=t.onDestroy;e&&e()}}]),t}(),tw=Qy,ew=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t,r,i;Object(F["a"])(this,n);for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=e.call.apply(e,[this].concat(a)),Object(ef["a"])(Object(wf["a"])(i),"colorTool",new tw(i.editor,i.id,{colors:null===(t=i.getValue().color)||void 0===t?void 0:t.background,defaultColor:null===(r=i.getValue().color)||void 0===r?void 0:r.background,view:i.lightblockVue,onChange:function(t){i.onChange("local")}})),Object(ef["a"])(Object(wf["a"])(i),"MathVue",{}),Object(ef["a"])(Object(wf["a"])(i),"slider",new Fy(i.editor,i.id,{onChange:function(t){i.onChange("local")}})),i}return Object(B["a"])(n,[{key:"didRender",value:function(){var t,e;Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.type===D["CardType"].BLOCK?null===(t=this.toolbarModel)||void 0===t||t.setOffset([-120,0]):null===(e=this.toolbarModel)||void 0===e||e.setOffset([0,0])}},{key:"toolbar",value:function(){var t;if(!Object(D["isEngine"])(this.editor)||this.editor.readonly)return[];this.editor.language;var e=[{type:"button",title:"编辑公式",content:'<span class="data-icon data-icon-edit"></span>',onClick:this.MathVue.editorMath},(t={key:"slider",type:"node",title:this.editor.language.get("table","color","title")},Object(ef["a"])(t,"title","调整大小"),Object(ef["a"])(t,"node",this.slider.getButton()),t),{key:"color",type:"node",title:"换色",node:this.colorTool.getButton()},{type:"delete"}];return e.concat()}},{key:"render",value:function(t){var e=this.getValue().value,n=kb["default"].extend(yy),r=new n;this.MathVue=r,r.engine=this,r.$set(r,"option",e||{}),e||(r.isUploade=!0),r.$mount();var i=Object(D["$"])('<div class="mathComponent-box"></div>');return i[0].appendChild(r.$el),this.container=i,this.slider.viewComponent=r,this.colorTool.viewComponent=r,this.slider.value=e,this.container}},{key:"destroy",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"destroy",this).call(this),this.container[0].parentElement.innerHTML="",this.MathVue.isDestroy=!0,this.MathVue.$destroy(),this.MathVue=void 0}}],[{key:"cardName",get:function(){return"matheditor"}},{key:"cardType",get:function(){return D["CardType"].INLINE}}]),n}(D["Card"]),nw=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"init",value:function(){var t=this;this.editor.on("paser:html",(function(e){return t.parseHtml(e)})),this.editor.on("paste:schema",(function(e){return t.pasteSchema(e)})),this.editor.on("paste:each",(function(e){return t.pasteHtml(e)}))}},{key:"execute",value:function(t){if(Object(D["isEngine"])(this.editor)){var e=this.editor.card;e.insert(yy.cardName,Object(_["a"])({},t))}}},{key:"hotkey",value:function(){return this.options.hotkey||"ctrl+|"}},{key:"pasteSchema",value:function(t){t.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:yy.cardName},"data-value":"*"}})}},{key:"pasteHtml",value:function(t){if(Object(D["isEngine"])(this.editor)){if(t.isElement()){var e=t.attributes("data-type");if(e===yy.cardName){var n=t.attributes("data-value"),r=decodeCardValue(n);if(!r.url)return;return this.editor.card.replaceNode(t,yy.cardName,r),t.remove(),!1}}return!0}}},{key:"parseHtml",value:function(t){var e=this;t.find("[".concat(CARD_KEY,"=").concat(yy.cardName)).each((function(t){var n=Object(D["$"])(t),r=e.editor.card.find(n),i=null===r||void 0===r?void 0:r.getValue();if(i){var o=r.type===D["CardType"].INLINE?"span":"div",a="<".concat(o,' data-type="').concat(r.type,'" data-value="').concat(encodeCardValue(i),'"></').concat(o,">");n.empty(),n.replaceWith(Object(D["$"])(a))}else n.remove()}))}}],[{key:"pluginName",get:function(){return"matheditor"}}]),n}(D["Plugin"]),rw=function(){var t=this,e=t._self._c;return e("div",{staticClass:"fold-card-box"},[e("div",{staticClass:"fold-card-header",on:{keydown:t.listenEnter,focus:function(e){!t.option.headerText&&(e.target.innerHTML="")},blur:function(e){!t.option.headerText&&(e.target.innerHTML="请输入折叠块标题内容")}}}),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.option.flod,expression:"!option.flod"}],ref:"foldCardBody",staticClass:"fold-card-body",attrs:{contenteditable:"true"},on:{focus:function(e){!t.option.bodyText&&(e.target.innerHTML="")},blur:function(e){!t.option.bodyText&&(e.target.innerHTML="请输入折叠块标题内容")}}}),e("span",{staticClass:"flod-button",on:{click:t.changeFlod}},[e("a-icon",{directives:[{name:"show",rawName:"v-show",value:t.option.flod,expression:"option.flod"}],attrs:{type:"caret-right"}}),e("a-icon",{directives:[{name:"show",rawName:"v-show",value:!t.option.flod,expression:"!option.flod"}],attrs:{type:"caret-down"}})],1)])},iw=[],ow={cardName:"flodcard",data:function(){return{engine:{},option:{title:"123213",content:'"这里是文本内容"',flod:!1}}},mounted:function(){},methods:{listenEnter:function(t){var e=this;"Enter"==t.key&&(this.option.flod=!1,this.$nextTick((function(){e.$refs.foldCardBody.focus()})))},changeFlod:function(){this.option.flod=!this.option.flod,this.engine.onChange("local")},changeVlue:function(t){}}},aw=ow,sw=(n("a280"),Object(it["a"])(aw,rw,iw,!1,null,"a65f1294",null)),lw=sw.exports,cw=(n("609e"),new WeakMap),uw=new WeakMap,dw=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Object(ef["a"])(Object(wf["a"])(t),"flodcardVue",{}),xy(Object(wf["a"])(t),cw,{writable:!0,value:""}),xy(Object(wf["a"])(t),uw,{writable:!0,value:void 0}),Object(ef["a"])(Object(wf["a"])(t),"isEditable",!0),Object(ef["a"])(Object(wf["a"])(t),"contenteditable",["div.fold-card-body","div.fold-card-header"]),t}return Object(B["a"])(n,[{key:"didRender",value:function(){var t,e;Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.type===D["CardType"].BLOCK?null===(t=this.toolbarModel)||void 0===t||t.setOffset([-120,0]):null===(e=this.toolbarModel)||void 0===e||e.setOffset([0,0])}},{key:"didInsert",value:function(){}},{key:"getValue",value:function(){var t=".fold-card-header",e=".fold-card-body",r=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",this).call(this),i=!!Ay(this,uw)&&Ay(this,uw).find(t),o=!!Ay(this,uw)&&Ay(this,uw).find(e);if(!i||!o)return r;var a=this.editor,s=a.schema,l=a.conversion,c=Object(D["$"])("<div></div>"),u=Object(D["$"])("<div></div>");c.append(i.clone(!0).children()),u.append(o.clone(!0).children());var d=new D["Parser"](i,a),h=new D["Parser"](o,a),p=d.toValue(s,l,!1,!1),f=d.toText(s,l,!1,!1),g=h.toValue(s,l,!1,!1),m=h.toText(s,l,!1,!1);return this.flodcardVue&&this.flodcardVue.$set(this.flodcardVue.option,"headerText",f),this.flodcardVue&&this.flodcardVue.$set(this.flodcardVue.option,"bodyText",m),Object(D["isEngine"])(a),Object(_["a"])(Object(_["a"])({},r),{},{html:{headerHTML:p,bodyHTML:g,headerText:f,bodyText:m},flod:this.flodcardVue.option.flod})}},{key:"render",value:function(t){var e,n,r=this.getValue(),i=kb["default"].extend(lw),o=new i,a=(this.editor.card,".fold-card-header"),s=".fold-card-body";o.option.flod=r.flod,o.$mount();var l=Object(D["$"])('<div class="flodCardComponent-box"></div>');l[0].appendChild(o.$el);var c=l.find(a)[0],u=l.find(s)[0];return c.innerHTML=new D["Parser"](r.html?r.html.headerHTML:"请输入折叠块标题内容",this.editor).toValue()||"<br />",u.innerHTML=new D["Parser"](r.html?r.html.bodyHTML:"请输入折叠块标题内容",this.editor).toValue()||"<br />",this.flodcardVue=o,this.flodcardVue&&this.flodcardVue.$set(this.flodcardVue.option,"headerText",null===(e=r.html)||void 0===e?void 0:e.headerText),this.flodcardVue&&this.flodcardVue.$set(this.flodcardVue.option,"bodyText",null===(n=r.html)||void 0===n?void 0:n.bodyText),Ey(this,uw,l),this.flodcardVue.engine=this,Ay(this,uw)}},{key:"onSelect",value:function(){}},{key:"toolbar",value:function(){if(!Object(D["isEngine"])(this.editor)||this.editor.readonly)return[];this.editor.language;var t=[{type:"copy"},{type:"delete"}];return t.concat()}},{key:"onChange",value:function(t,e,n){var r=this,i=this.editor;Object(D["isEngine"])(i)&&"local"===t&&i.ot.isStopped()||(Ay(this,cw)&&clearTimeout(Ay(this,cw)),Ey(this,cw,setTimeout((function(){var e=r.getValue().html;"local"===t&&Object(D["isEngine"])(i)&&e&&r.setValue({html:{headerHTML:e.headerHTML,bodyHTML:e.bodyHTML,headerText:e.headerText,bodyText:e.bodyText},flod:r.flodcardVue.option.flod})}),50)))}},{key:"select",value:function(){}},{key:"destroy",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"destroy",this).call(this),Ay(this,uw)[0].parentElement.innerHTML="",this.flodcardVue.isDestroy=!0,this.flodcardVue.$destroy(),this.flodcardVue=void 0}}],[{key:"cardName",get:function(){return"flodcard"}},{key:"cardType",get:function(){return D["CardType"].BLOCK}}]),n}(D["Card"]),hw=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"init",value:function(){var t=this;this.editor.on("paser:html",(function(e){return t.parseHtml(e)})),this.editor.on("paste:schema",(function(e){return t.pasteSchema(e)})),this.editor.on("paste:each",(function(e){return t.pasteHtml(e)}))}},{key:"execute",value:function(t){if(Object(D["isEngine"])(this.editor)){var e=this.editor.card;e.insert(lw.cardName,Object(_["a"])({},t))}}},{key:"hotkey",value:function(){return this.options.hotkey||"ctrl+|"}},{key:"pasteSchema",value:function(t,e){t.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:lw.cardName},"data-value":"*"}})}},{key:"pasteHtml",value:function(t,e){if(Object(D["isEngine"])(this.editor)){if(t.isElement()){var n=t.attributes("data-type");if(n===lw.cardName){var r=t.attributes("data-value"),i=decodeCardValue(r);if(!i.url)return;return this.editor.card.replaceNode(t,lw.cardName,i),t.remove(),!1}}return!0}}},{key:"parseHtml",value:function(t){var e=this;t.find("[".concat(CARD_KEY,"=").concat(lw.cardName)).each((function(t){var n=Object(D["$"])(t),r=e.editor.card.find(n),i=null===r||void 0===r?void 0:r.getValue();if(i){var o=r.type===D["CardType"].INLINE?"span":"div",a="<".concat(o,' data-type="').concat(r.type,'" data-value="').concat(encodeCardValue(i),'"></').concat(o,">");n.empty(),n.replaceWith(Object(D["$"])(a))}else n.remove()}))}}],[{key:"pluginName",get:function(){return"flodcard"}}]),n}(D["Plugin"]),pw=n("f744"),fw=n.n(pw),gw=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"show",rawName:"v-show",value:!t.isUploade,expression:"!isUploade"}],staticClass:"model-image-box"},[e("img",{staticClass:"model-image",attrs:{"model-name":t.modelName,name:t.name,src:t.$fileLinkTransfer(t.src),alt:""},on:{click:t.toPreview}}),e("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],attrs:{disabled:this.engine.editor.readonly,type:"text"},domProps:{value:t.name},on:{keydown:function(t){t.stopPropagation()},input:function(e){e.target.composing||(t.name=e.target.value)}}}),t.isPreview?e("div",{staticClass:"model-preview",on:{click:function(e){t.isPreview=!1}}},[e("iframe",{ref:"iframeBody",staticClass:"iframe-body",attrs:{seamless:"",src:t.iframeSrc},on:{click:function(t){t.stopPropagation()}}},[t._v(" 您的浏览器暂不支持该功能请使用最新版chrome浏览器")]),e("div",{staticClass:"model-preview-close"},[e("a-icon",{attrs:{type:"close"}})],1)]):t._e()])},mw=[],vw={cardName:"iframe",data:function(){return{src:"",engine:{},name:"",iframeSrc:"",modelName:"",isUploade:!1,isPreview:!1}},mounted:function(){var t=this;return Object(N["a"])(Object(M["a"])().mark((function e(){var n,r,i,o,a;return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isUploade){e.next=31;break}return e.prev=1,e.next=4,t.$selectFile(".png",!1);case 4:return r=e.sent,i=new FormData,i.append("file",r),o=function(e){t.UploadProgress=Math.ceil(e.loaded/e.total*100)+"%"},e.next=10,Object(Ub["a"])(i,o);case 10:a=e.sent,t.src=a.data.data.diskname,t.modelName=r.name.split("."),t.modelName.pop(),t.modelName=t.modelName.join("."),t.name=t.modelName,t.engine.saveHistory=!0,t.engine.setValue({src:t.src,name:t.name,modelName:t.modelName}),window.article_model_list||(window.article_model_list={}),window.article_model_list[t.modelName]=t,t.isUploade=!1,e.next=29;break;case 23:e.prev=23,e.t0=e["catch"](1),t.engine.saveHistory=!1,t.$destroy(),t.engine.destroy(),t.engine.editor.history.undo();case 29:e.next=32;break;case 31:null!==(n=t.name)&&void 0!==n&&n.trim()||(t.name=t.modelName);case 32:window.article_model_list||(window.article_model_list={}),window.article_model_list[t.modelName]=t;case 34:case"end":return e.stop()}}),e,null,[[1,23]])})))()},methods:{toPreview:function(){var t=this;return Object(N["a"])(Object(M["a"])().mark((function e(){var n,r;return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,tt({webglUrl:t.modelName});case 3:n=e.sent,r=n.data,t.iframeSrc=r,t.isPreview=!0,e.next=12;break;case 9:e.prev=9,e.t0=e["catch"](0),t.$message.error("未连接到UNITY服务器");case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))()}},watch:{modelName:function(t,e){this.engine.setValue({name:t})}}},bw=vw,yw=(n("98ba"),Object(it["a"])(bw,gw,mw,!1,null,"89f861a0",null)),ww=yw.exports,xw=(n("60d5"),function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Object(ef["a"])(Object(wf["a"])(t),"saveHistory",!1),Object(ef["a"])(Object(wf["a"])(t),"autoActivate",!1),Object(ef["a"])(Object(wf["a"])(t),"iframeVue",{}),t}return Object(B["a"])(n,[{key:"didRender",value:function(){var t,e;Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.type===D["CardType"].BLOCK?null===(t=this.toolbarModel)||void 0===t||t.setOffset([-120,0]):null===(e=this.toolbarModel)||void 0===e||e.setOffset([0,0])}},{key:"toolbar",value:function(){var t=[{type:"dnd"},{type:"copy"},{type:"delete"}];return t.concat()}},{key:"isEditable",value:function(){return!0}},{key:"writeHistoryOnValueChange",value:function(){return this.saveHistory}},{key:"render",value:function(t){var e=this.getValue().name,n=this.getValue().modelName,r=this.getValue().src,i=kb["default"].extend(ww),o=new i;this.iframeVue=o,r||(r="",o.isUploade=!0),o.engine=this,o.name=e,o.modelName=n,o.src=r,o.$mount();var a=Object(D["$"])('<div class="iframeComponent-box"></div>');return a[0].appendChild(o.$el),this.container=a,this.container}},{key:"destroy",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"destroy",this).call(this)}}],[{key:"cardName",get:function(){return"iframe"}},{key:"cardType",get:function(){return D["CardType"].BLOCK}}]),n}(D["Card"])),Cw=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"init",value:function(){var t=this;this.editor.on("paser:html",(function(e){return t.parseHtml(e)})),this.editor.on("paste:schema",(function(e){return t.pasteSchema(e)})),this.editor.on("paste:each",(function(e){return t.pasteHtml(e)}))}},{key:"execute",value:function(t){if(Object(D["isEngine"])(this.editor)){var e=this.editor.card;e.insert(ww.cardName,Object(_["a"])({},t))}}},{key:"hotkey",value:function(){return this.options.hotkey||"ctrl+|"}},{key:"pasteSchema",value:function(t){t.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:ww.cardName},"data-value":"*"}})}},{key:"pasteHtml",value:function(t){if(Object(D["isEngine"])(this.editor)){if(t.isElement()){var e=t.attributes("data-type");if(e===ww.cardName){var n=t.attributes("data-value"),r=decodeCardValue(n);if(!r.url)return;return this.editor.card.replaceNode(t,ww.cardName,r),t.remove(),!1}}return!0}}},{key:"parseHtml",value:function(t){var e=this;t.find("[".concat(CARD_KEY,"=").concat(ww.cardName)).each((function(t){var n=Object(D["$"])(t),r=e.editor.card.find(n),i=null===r||void 0===r?void 0:r.getValue();if(i){var o=r.type===D["CardType"].INLINE?"span":"div",a="<".concat(o,' data-type="').concat(r.type,'" data-value="').concat(encodeCardValue(i),'"></').concat(o,">");n.empty(),n.replaceWith(Object(D["$"])(a))}else n.remove()}))}}],[{key:"pluginName",get:function(){return"iframe"}}]),n}(D["Plugin"]),kw=n("0381"),Aw=n.n(kw),Sw=function(){var t=this,e=t._self._c;return t.isDestroy?t._e():e("div",{staticClass:"document-main"},["pdf"==t.documentInfo.type?e("pdf",{attrs:{engine:t.engine,pdfInfo:t.documentInfo}}):t._e(),"other"==t.documentInfo.type?e("div",{staticClass:"other-file"},[t.isUploade?e("div",[t._v("上传进度:"+t._s(t.UploadProgress))]):t._e(),t.isError?e("div",[t._v("上传失败:"+t._s(t.isError))]):e("div",{staticClass:"document-download",domProps:{textContent:t._s(t.documentInfo.name)}})]):t._e()],1)},Ew=[],Ow=function(){var t=this,e=t._self._c;return e("div",{staticClass:"pdf"},[e("div",{staticClass:"pdf-header"},[e("div",{staticClass:"pdf-title document-title"},[e("svg",{staticClass:"svg-custom",attrs:{t:"1659427118257",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2327",width:"16",height:"16"}},[e("path",{attrs:{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":"2328"}}),e("path",{attrs:{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":"2329"}}),e("path",{attrs:{d:"M768 320l256 256V320z",opacity:".1","p-id":"2330"}}),e("path",{attrs:{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#CD4050","p-id":"2331"}}),e("path",{attrs:{d:"M192 544.256h-48.128c-8.704 0-15.872 7.168-15.872 15.872v192c0 8.704 7.168 15.872 15.872 15.872s15.872-7.168 15.872-15.872v-79.872h31.744c35.328 0 64-28.672 64-64s-28.16-64-63.488-64z m158.72 0c34.816 0 62.976 27.648 64 62.464v97.792c0 34.816-27.648 62.976-62.464 64h-49.664c-8.704 0-15.36-6.656-15.872-14.848V560.64c0-8.704 6.656-15.36 14.848-15.872h49.152z m227.328 0c8.704 0 15.872 7.168 15.872 15.872S586.752 576 578.048 576h-80.384v64h48.128c8.704 0 15.872 7.168 15.872 15.872s-7.168 15.872-15.872 15.872h-48.128v79.872c0 8.704-7.168 15.872-15.872 15.872s-15.872-7.168-15.872-15.872v-192c0-8.704 7.168-15.872 15.872-15.872h96.256zM350.72 576h-31.744v159.744h31.744c17.408 0 31.232-13.824 31.744-30.72v-97.28C382.976 590.336 368.64 576 350.72 576zM192 576c17.92 0 31.744 14.336 31.744 31.744S209.92 640 192 640h-31.744v-64H192z",fill:"#FFFFFF","p-id":"2332"}})]),e("span",{staticClass:"document-title-text"},[t._v(t._s(t.pdfInfo.name))])]),e("div",{staticClass:"pdf-header-right"},[t.downloadAuthior||t.isEditor?e("a-tooltip",{attrs:{title:"下载"}},[e("div",{staticClass:"document-button",on:{click:function(e){return t.download(t.pdfInfo.path,t.pdfInfo.name)}}},[e("svg",{staticClass:"svg-custom",attrs:{t:"1659427489090",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3394",width:"16",height:"16"}},[e("path",{attrs:{d:"M828.975746 894.125047 190.189132 894.125047c-70.550823 0-127.753639-57.18542-127.753639-127.752616L62.435493 606.674243c0-17.634636 14.308891-31.933293 31.93227-31.933293l63.889099 0c17.634636 0 31.93227 14.298658 31.93227 31.933293l0 95.821369c0 35.282574 28.596292 63.877843 63.87682 63.877843L765.098927 766.373455c35.281551 0 63.87682-28.595268 63.87682-63.877843l0-95.821369c0-17.634636 14.298658-31.933293 31.943526-31.933293l63.877843 0c17.634636 0 31.933293 14.298658 31.933293 31.933293l0 159.699212C956.729385 836.939627 899.538849 894.125047 828.975746 894.125047L828.975746 894.125047zM249.938957 267.509636c12.921287-12.919241 33.884738-12.919241 46.807049 0l148.97087 148.971893L445.716876 94.89323c0-17.634636 14.300704-31.94762 31.933293-31.94762l63.875796 0c17.637706 0 31.945573 14.312984 31.945573 31.94762l0 321.588299 148.97087-148.971893c12.921287-12.919241 33.875528-12.919241 46.796816 0l46.814212 46.818305c12.921287 12.922311 12.921287 33.874505 0 46.807049L552.261471 624.930025c-1.140986 1.137916-21.664416 13.68365-42.315758 13.69286-20.87647 0.010233-41.878806-12.541641-43.020816-13.69286L203.121676 361.13499c-12.922311-12.933567-12.922311-33.884738 0-46.807049L249.938957 267.509636 249.938957 267.509636z","p-id":"3395"}})])])]):t._e(),e("a-tooltip",{attrs:{title:"预览"}},[e("a",{staticClass:"document-button",attrs:{target:"_blank",href:t.pdfInfo.path}},[e("svg",{staticClass:"icon",attrs:{t:"1659428598079",viewBox:"0 0 1792 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5034",width:"16",height:"16"}},[e("path",{attrs:{d:"M1694.74304 320A1344 1344 0 0 0 896.02304 0 1344 1344 0 0 0 97.30304 320a238.08 238.08 0 0 0 0 384A1344 1344 0 0 0 896.02304 1024a1344 1344 0 0 0 798.72-320 238.08 238.08 0 0 0 0-384zM896.02304 896a384 384 0 1 1 384-384 384 384 0 0 1-384 384z","p-id":"5035"}}),e("path",{attrs:{d:"M896.02304 512m-256 0a256 256 0 1 0 512 0 256 256 0 1 0-512 0Z","p-id":"5036"}})])])])],1)]),e("div",{staticClass:"show"},[e("pdf",{ref:"pdf",attrs:{src:t.pdfInfo.path,page:t.pageNum,rotate:t.pageRotate},on:{password:t.password,"page-loaded":function(e){return t.pageLoaded(e)},"num-pages":function(e){t.pageTotalNum=e},error:function(e){return t.pdfError(e)},"link-clicked":function(e){t.page=e}}})],1),e("div",{staticClass:"pdf_footer"},[e("div",{staticClass:"btn",on:{click:function(e){return e.stopPropagation(),t.clock.apply(null,arguments)}}},[t._v("顺时针")]),e("div",{staticClass:"btn",on:{click:function(e){return e.stopPropagation(),t.counterClock.apply(null,arguments)}}},[t._v("逆时针")]),e("div",{staticClass:"page-controller"},[e("div",{staticClass:"btn",on:{click:function(e){return e.stopPropagation(),t.prePage.apply(null,arguments)}}},[t._v("上一页")]),e("div",[t._v(t._s(t.pageNum)+"/"+t._s(t.pageTotalNum))]),e("div",{staticClass:"btn",on:{click:function(e){return e.stopPropagation(),t.nextPage.apply(null,arguments)}}},[t._v("下一页")])]),e("div",{staticClass:"btn",on:{click:t.scaleD}},[t._v("放大")]),e("div",{staticClass:"btn",on:{click:t.scaleX}},[t._v("缩小")])])])},Tw=[],_w=(n("13d5"),{props:{initial:{type:Boolean,default:!1}},data:function(){return{size:{width:-1,height:-1}}},methods:{reset:function(){var t=this.$el.firstChild,e=this.$el.lastChild;t.scrollLeft=1e5,t.scrollTop=1e5,e.scrollLeft=1e5,e.scrollTop=1e5},update:function(){this.size.width=this.$el.offsetWidth,this.size.height=this.$el.offsetHeight}},watch:{size:{deep:!0,handler:function(t){this.reset(),this.$emit("resize",{width:this.size.width,height:this.size.height})}}},render:function(t){var e="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;",n="position: absolute; left: 0; top: 0;";return t("div",{style:e+"animation-name: resizeSensorVisibility;",on:{"~animationstart":this.update}},[t("div",{style:e,on:{scroll:this.update}},[t("div",{style:n+"width: 100000px; height: 100000px;"})]),t("div",{style:e,on:{scroll:this.update}},[t("div",{style:n+"width: 200%; height: 200%;"})])])},beforeDestroy:function(){this.$emit("resize",{width:0,height:0}),this.$emit("resizeSensorBeforeDestroy")},mounted:function(){if(!0===this.initial&&this.$nextTick(this.update),this.$el.offsetParent!==this.$el.parentNode&&(this.$el.parentNode.style.position="relative"),"attachEvent"in this.$el&&!("AnimationEvent"in window)){var t=function(){this.update(),e()}.bind(this),e=function(){this.$el.detachEvent("onresize",t),this.$off("resizeSensorBeforeDestroy",e)}.bind(this);this.$el.attachEvent("onresize",t),this.$on("resizeSensorBeforeDestroy",e),this.reset()}}}),Mw=_w,Nw=(n("2613"),Object(it["a"])(Mw,Oy,Ty,!1,null,null,null)),Pw=Nw.exports,Lw=function(t){var e=t.createLoadingTask,n=t.PDFJSWrapper;return{createLoadingTask:e,render:function(t){return t("span",{attrs:{style:"position: relative; display: block"}},[t("canvas",{attrs:{style:"display: inline-block; width: 100%; height: 100%; vertical-align: top"},ref:"canvas"}),t("span",{style:"display: inline-block; width: 100%; height: 100%",class:"annotationLayer",ref:"annotationLayer"}),t(Pw,{props:{initial:!0},on:{resize:this.resize}})])},props:{src:{type:[String,Object,Uint8Array],default:""},page:{type:Number,default:1},rotate:{type:Number}},watch:{src:function(){this.pdf.loadDocument(this.src)},page:function(){this.pdf.loadPage(this.page,this.rotate)},rotate:function(){this.pdf.renderPage(this.rotate)}},methods:{resize:function(t){if(null!==this.$el.parentNode&&(0!==t.width||0!==t.height)){this.$refs.canvas.style.height=this.$refs.canvas.offsetWidth*(this.$refs.canvas.height/this.$refs.canvas.width)+"px";var e=this.pdf.getResolutionScale();(e<.85||e>1.15)&&this.pdf.renderPage(this.rotate)}},print:function(t,e){this.pdf.printPage(t,e)}},mounted:function(){this.pdf=new n(this.$refs.canvas,this.$refs.annotationLayer,this.$emit.bind(this)),this.$on("loaded",(function(){this.pdf.loadPage(this.page,this.rotate)})),this.$on("page-size",(function(t,e){this.$refs.canvas.style.height=this.$refs.canvas.offsetWidth*(e/t)+"px"})),this.pdf.loadDocument(this.src)},destroyed:function(){this.pdf.destroy()}}};if("server"!==Object({NODE_ENV:"production",VUE_APP_API_BASE_URL:"",VUE_APP_NAME:"Admin",VUE_APP_PERMISSIONS_KEY:"admin.permissions",VUE_APP_PUBLIC_PATH:"/",VUE_APP_ROLES_KEY:"admin.roles",VUE_APP_ROUTES_KEY:"admin.routes",VUE_APP_SETTING_KEY:"admin.setting",VUE_APP_TBAS_KEY:"admin.tabs",VUE_APP_TBAS_TITLES_KEY:"admin.tabs.titles",VUE_APP_USER_KEY:"admin.user",BASE_URL:""}).VUE_ENV){var Dw=n("a068").default,jw=n("4383");if("undefined"!==typeof window&&"Worker"in window&&-1===navigator.appVersion.indexOf("MSIE 10")){var Iw=n("2639");jw.GlobalWorkerOptions.workerPort=new Iw}var Rw=Lw(Dw(jw))}else Rw=Lw({});var Fw,Bw,zw=Rw,Hw=zw,Vw=(n("0610"),Object(it["a"])(Hw,Fw,Bw,!1,null,null,null)),qw=Vw.exports,Uw=(n("2b3d"),n("9861"),function(t,e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(){200===n.status&&e(n.response)},n.send()}),Ww=function(t,e){if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(t,e);else{var n=document.createElement("a"),r=document.querySelector("body");n.href=window.URL.createObjectURL(t),n.download=e,n.style.display="none",r.appendChild(n),n.click(),r.removeChild(n),window.URL.revokeObjectURL(n.href)}},$w={name:"vue_pdf_preview",components:{pdf:qw},props:{pdfInfo:{type:Object,default:function(){}},engine:{type:Object,default:function(){}}},data:function(){return{pageTotalNum:1,pageNum:1,loadedRatio:0,curPageNum:0,scale:100,pageRotate:0,page:0,downloadAuthior:!1,isEditor:!1}},watch:{pdfInfo:{handler:function(){this.downloadAuthior=JSON.parse(localStorage.getItem("NOW_ARTICLE_DOWNLOAD")||""),this.isEditor=this.engine&&!this.engine.editor._readonly},deep:!0,immediate:!0}},computed:{},created:function(){},mounted:function(){},methods:{download:function(t,e){Uw(t,(function(t){Ww(t,e)}))},scaleD:function(){this.scale+=5,this.$refs.pdf.$el.style.width=parseInt(this.scale)+"%"},scaleX:function(){100!=this.scale&&(this.scale+=-5,this.$refs.pdf.$el.style.width=parseInt(this.scale)+"%")},prePage:function(){var t=this.pageNum;t=t>1?t-1:this.pageTotalNum,this.pageNum=t},nextPage:function(){var t=this.pageNum;t=t<this.pageTotalNum?t+1:1,this.pageNum=t},clock:function(){this.pageRotate+=90},counterClock:function(){this.pageRotate-=90},password:function(t,e){t(prompt('password is "test"'))},pageLoaded:function(t){this.$emit("current",t),this.curPageNum=t},pdfError:function(t){},pdfPrintAll:function(){this.$refs.pdf.print()},pdfPrint:function(){this.$refs.pdf.print(100,[1,2])},logContent:function(){this.$refs.pdf.pdf.forEachPage((function(t){return t.getTextContent().then((function(t){t.items.map((function(t){return t.str})),t.items.reduce((function(t,e){return t+e.str}),"")}))}))}}},Gw=$w,Yw=(n("a073"),Object(it["a"])(Gw,Ow,Tw,!1,null,"e8702f62",null)),Xw=Yw.exports,Kw={cardName:"document",data:function(){return{documentInfo:{name:"",path:"",type:"other"},isDestroy:!1,isUploade:!1,UploadProgress:"",isError:!1,engine:{}}},mounted:function(){var t=this;if(this.isUploade){var e=document.createElement("input");e.type="file",e.click();var n=function n(){document.removeEventListener("mousemove",n),e.files&&e.files.length<=0&&(t.engine.editor.history.undo(),t.isDestroy=!0,t.$destroy())};document.addEventListener("mousemove",n,!1),e.onchange=Object(N["a"])(Object(M["a"])().mark((function n(){var r,i,o,a,s;return Object(M["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,r=e.files[0],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application / vnd.ms - powerpoint","application/pdf"].includes(r.type)?t.documentInfo.type="pdf":t.$nextTick((function(){t.documentInfo.type="other"})),t.documentInfo.name=r.name,t.$forceUpdate(),i=new FormData,i.append("file",r),t.isShowExplain=!1,o=new FileReader,o.readAsDataURL(r),t.documentInfo.path="",o.onload=function(e){t.documentInfo.path=e.currentTarget.result},a=function(e){t.UploadProgress=Math.ceil(e.loaded/e.total*100)+"%"},n.next=15,Object(Ub["a"])(i,a);case 15:s=n.sent,t.documentInfo.path=s.data.data.diskname,t.isUploade=!1,t.saveChange(),n.next=27;break;case 21:n.prev=21,n.t0=n["catch"](0),t.$message.error("附件上传失败"),t.isError=n.t0,t.isUploade=!1,t.documentInfo.path="";case 27:case"end":return n.stop()}}),n,null,[[0,21]])})))}},components:{pdf:Xw},methods:{download:function(){var t=this;Uw(this.$fileLinkTransfer(this.documentInfo.path),(function(e){Ww(e,t.documentInfo.name)}))},saveChange:function(){this.engine.setValue({value:this.documentInfo})}}},Zw=Kw,Jw=(n("390f"),Object(it["a"])(Zw,Sw,Ew,!1,null,"111617da",null)),Qw=Jw.exports,tx=(n("e947"),function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t;Object(F["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),Object(ef["a"])(Object(wf["a"])(t),"authroity",JSON.parse(localStorage.getItem("NOW_ARTICLE_DOWNLOAD")||"")),Object(ef["a"])(Object(wf["a"])(t),"documentVue",{}),Object(ef["a"])(Object(wf["a"])(t),"dropdownEle",{}),t}return Object(B["a"])(n,[{key:"writeHistoryOnValueChange",value:function(){var t=this.getValue().value;return!(!t||!t.src)}},{key:"didRender",value:function(){var t,e;Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.type===D["CardType"].BLOCK?null===(t=this.toolbarModel)||void 0===t||t.setOffset([-50,0]):null===(e=this.toolbarModel)||void 0===e||e.setOffset([0,0])}},{key:"toolbar",value:function(){var t=this;if(!Object(D["isEngine"])(this.editor)||this.editor.readonly)return"pdf"!==this.documentVue.documentInfo.type&&this.authroity?[{type:"button",title:"下载",content:' <svg style="vertical-align: sub;" t="1659432443994" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2327" width="16" height="16"><path d="M502.010485 765.939573c3.773953 3.719718 8.686846 5.573949 13.596669 5.573949 0.075725 0 0.151449-0.010233 0.227174-0.011256 0.329505 0.016373 0.654916 0.050142 0.988514 0.050142 0.706081 0 1.400906-0.042979 2.087545-0.116657 4.352121-0.366344 8.607028-2.190899 11.961426-5.496178l335.053985-330.166675c7.619538-7.509021 7.709589-19.773346 0.200568-27.393907s-19.774369-7.711636-27.39493-0.201591L536.193005 706.304358 536.193005 50.019207c0-10.698666-8.67252-19.371186-19.371186-19.371186s-19.371186 8.67252-19.371186 19.371186l0 657.032164-306.881342-302.44838c-7.618515-7.509021-19.883863-7.419993-27.393907 0.199545-7.509021 7.619538-7.419993 19.884886 0.199545 27.393907L502.010485 765.939573z" p-id="2328"></path><path d="M867.170139 711.020776c-10.698666 0-19.371186 8.67252-19.371186 19.371186l0 165.419494c0 13.054317-10.620895 23.675212-23.676236 23.675212L205.182103 919.486668c-13.054317 0-23.676236-10.620895-23.676236-23.675212L181.505867 730.391962c0-10.698666-8.67252-19.371186-19.371186-19.371186s-19.371186 8.67252-19.371186 19.371186l0 165.419494c0 34.416857 28.000728 62.416562 62.417585 62.416562l618.941638 0c34.417881 0 62.417585-27.999704 62.417585-62.416562L886.540302 730.391962C886.541325 719.693296 877.868805 711.020776 867.170139 711.020776z" p-id="2329"></path></svg>',onClick:function(){t.documentVue.download()}}]:[];var e=[{type:"delete"},{type:"button",title:"下载",content:' <svg style="vertical-align: sub;" t="1659432443994" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2327" width="16" height="16"><path d="M502.010485 765.939573c3.773953 3.719718 8.686846 5.573949 13.596669 5.573949 0.075725 0 0.151449-0.010233 0.227174-0.011256 0.329505 0.016373 0.654916 0.050142 0.988514 0.050142 0.706081 0 1.400906-0.042979 2.087545-0.116657 4.352121-0.366344 8.607028-2.190899 11.961426-5.496178l335.053985-330.166675c7.619538-7.509021 7.709589-19.773346 0.200568-27.393907s-19.774369-7.711636-27.39493-0.201591L536.193005 706.304358 536.193005 50.019207c0-10.698666-8.67252-19.371186-19.371186-19.371186s-19.371186 8.67252-19.371186 19.371186l0 657.032164-306.881342-302.44838c-7.618515-7.509021-19.883863-7.419993-27.393907 0.199545-7.509021 7.619538-7.419993 19.884886 0.199545 27.393907L502.010485 765.939573z" p-id="2328"></path><path d="M867.170139 711.020776c-10.698666 0-19.371186 8.67252-19.371186 19.371186l0 165.419494c0 13.054317-10.620895 23.675212-23.676236 23.675212L205.182103 919.486668c-13.054317 0-23.676236-10.620895-23.676236-23.675212L181.505867 730.391962c0-10.698666-8.67252-19.371186-19.371186-19.371186s-19.371186 8.67252-19.371186 19.371186l0 165.419494c0 34.416857 28.000728 62.416562 62.417585 62.416562l618.941638 0c34.417881 0 62.417585-27.999704 62.417585-62.416562L886.540302 730.391962C886.541325 719.693296 877.868805 711.020776 867.170139 711.020776z" p-id="2329"></path></svg>',didMount:function(e){"pdf"==t.documentVue.documentInfo.type&&(e[0].style.display="none")},onClick:function(){t.documentVue.download()}}];return e.concat()}},{key:"render",value:function(){var t=this.getValue().value,e=kb["default"].extend(Qw),n=new e;this.documentVue=n,n.engine=this,t?n.documentInfo=t:t||this.editor._readonly||(n.isUploade=!0),n.$mount();var r=Object(D["$"])('<div class="document-box"></div>');return r[0].appendChild(n.$el),this.documentVue=n,this.container=r,this.container}},{key:"destroy",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"destroy",this).call(this),this.container[0].parentElement.innerHTML="",this.documentVue.isDestroy=!0,this.documentVue.$destroy(),this.documentVue=void 0}}],[{key:"cardName",get:function(){return"document"}},{key:"cardType",get:function(){return D["CardType"].BLOCK}},{key:"autoSelected",get:function(){return!1}},{key:"singleSelectable",get:function(){return!1}}]),n}(D["Card"])),ex=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"init",value:function(){var t=this;this.editor.on("paser:html",(function(e){return t.parseHtml(e)})),this.editor.on("paste:schema",(function(e){return t.pasteSchema(e)})),this.editor.on("paste:each",(function(e){return t.pasteHtml(e)}))}},{key:"execute",value:function(t){if(Object(D["isEngine"])(this.editor)){var e=this.editor.card;e.insert(Qw.cardName,Object(_["a"])({},t))}}},{key:"hotkey",value:function(){return this.options.hotkey||"ctrl+|"}},{key:"pasteSchema",value:function(t){t.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:Qw.cardName},"data-value":"*"}})}},{key:"pasteHtml",value:function(t){if(Object(D["isEngine"])(this.editor)){if(t.isElement()){var e=t.attributes("data-type");if(e===Qw.cardName){var n=t.attributes("data-value"),r=decodeCardValue(n);if(!r.url)return;return this.editor.card.replaceNode(t,Qw.cardName,r),t.remove(),!1}}return!0}}},{key:"parseHtml",value:function(t){var e=this;t.find("[".concat(CARD_KEY,"=").concat(Qw.cardName)).each((function(t){var n=Object(D["$"])(t),r=e.editor.card.find(n),i=null===r||void 0===r?void 0:r.getValue();if(i){var o=r.type===D["CardType"].INLINE?"span":"div",a="<".concat(o,' data-type="').concat(r.type,'" data-value="').concat(encodeCardValue(i),'"></').concat(o,">");n.empty(),n.replaceWith(Object(D["$"])(a))}else n.remove()}))}}],[{key:"pluginName",get:function(){return"document"}}]),n}(D["Plugin"]),nx=function(){var t=this,e=t._self._c;return e("div",{staticClass:"lightblock-countent-box",staticStyle:{"--a":"1","--c":"1"},style:{borderColor:t.color.border,backgroundColor:t.color.background}},[e("div",{staticClass:"lightblock-icon"},[e("svg",{attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13148",width:"24",height:"24"}},[e("path",{attrs:{d:"M833.5 330.5C833.5 153 689.6 7.6 512 7.6S190.5 153 190.5 330.5c0 70.3 37.3 161 97.2 227.9 59.4 66.3 103.5 177.9 103.5 266.9v34.9h241.6v-34.6c0-89 44.1-200.4 103.2-266.9 60.1-67.6 97.5-166.4 97.5-228.2z",fill:"#FFC807","p-id":"13149"}}),e("path",{attrs:{d:"M636.5 790.6l-193.9-268L596.4 202l199.2 266.4c-17.4 36.4-39.3 67.4-63.9 95.2C685.3 621 664.1 671.1 644 741l-7.5 49.6z",fill:"#FFB300","p-id":"13150"}}),e("path",{attrs:{d:"M499.5 378.3h-82.7c-12.6 0-21.4-12.7-16.8-24.5l59.2-153c2.7-6.9 9.4-11.5 16.8-11.5h105c13.6 0 22.3 14.5 15.9 26.5l-81.5 153c-3.2 5.8-9.3 9.5-15.9 9.5z",fill:"#FFF8E1","p-id":"13151"}}),e("path",{attrs:{d:"M466.2 518.3l160-171c12-12.8 2.9-33.7-14.6-33.7h-105c-8.7 0-16.4 5.6-19.1 13.9l-55 171c-6.6 20.4 19.1 35.5 33.7 19.8z",fill:"#FFF8E1","p-id":"13152"}}),e("path",{attrs:{d:"M593.6 1016.4H430.4c-5.7 0-10.9-3.7-14-9.8l-22.2-44.2h235.6l-22.2 44.2c-3.1 6.1-8.3 9.8-14 9.8z",fill:"#455A64","p-id":"13153"}}),e("path",{attrs:{d:"M625.7 980.4H398.3c-22.1 0-40.1-17.9-40.1-40.1V776.7c0-22.1 17.9-40.1 40.1-40.1h227.5c22.1 0 40.1 17.9 40.1 40.1v163.7c-0.1 22.1-18 40-40.2 40z",fill:"#ECEFF1","p-id":"13154"}}),e("path",{attrs:{d:"M539.8 808.6H359v-36h180.8c9.9 0 18 8.1 18 18 0 10-8.1 18-18 18zM359 840.1h306v36H359zM665 943.6H494.8c-9.9 0-18-8.1-18-18s8.1-18 18-18H665v36z",fill:"#CFD8DC","p-id":"13155"}})])]),e("div",{staticClass:"lightblock-countent"})])},rx=[],ix={cardName:"lightblock",data:function(){return{color:{border:"#ccc",background:"black"}}},methods:{bgChange:function(t){this.color=Object(_["a"])(Object(_["a"])({},this.color),{},{background:t})},borderChange:function(t){this.color=Object(_["a"])(Object(_["a"])({},this.color),{},{border:t})}}},ox=ix,ax=Object(it["a"])(ox,nx,rx,!1,null,null,null),sx=ax.exports,lx=(n("8dba"),Object(B["a"])((function t(){Object(F["a"])(this,t)})));Object(ef["a"])(lx,"colors",void 0),Object(ef["a"])(lx,"_map",void 0),Object(ef["a"])(lx,"getStroke",void 0),Object(ef["a"])(lx,"getColors",void 0),lx.colors=[["#eff0f1","#fbbfbc","#fed4a4","#fff67a","#b7edb1","#bacefd","#cdb2fa"],["#f2f3f5","#fef1f1","#fff5eb","#fefff0","#f0fbef","#f0f4ff","#f6f1fe"]],lx._map=function(){for(var t={},e=lx.colors,n=0,r=e.length;n<r;n++)for(var i=e[n],o=0,a=i.length;o<a;o++){var s=e[n][o];t[s]={y:n,x:o}}return t}(),lx.getStroke=function(t){var e=lx._map[t];return e&&(2===e.y||3===e.y&&e.x>2&&e.x<5)?this.colors[4][e.x]:t},lx.getColors=function(){return this.colors};var cx,ux=lx,dx=function(){var t=this,e=t._self._c;return e("div",{staticClass:"color-picker"},[e("div",{staticClass:"picker-item"},[e("div",{staticClass:"picker-item-title"},[t._v("边框颜色")]),e("Sketch",{attrs:{"preset-colors":t.BorderPresetColors},model:{value:t.borderColors,callback:function(e){t.borderColors=e},expression:"borderColors"}})],1),e("div",{staticClass:"picker-item"},[e("div",{staticClass:"picker-item-title"},[t._v("背景颜色")]),e("Sketch",{attrs:{"preset-colors":t.bgPresetColors},model:{value:t.bgColors,callback:function(e){t.bgColors=e},expression:"bgColors"}})],1)])},hx=[],px={data:function(){return{borderColors:[],bgColors:[],viewComponent:{},BorderPresetColors:["#eff0f1","#fbbfbc","#fed4a4","#fff67a","#b7edb1","#bacefd","#cdb2fa"],bgPresetColors:["#f2f3f5","#fef1f1","#fff5eb","#fefff0","#f0fbef","#f0f4ff","#f6f1fe"]}},mounted:function(){},components:{Sketch:Hy["Sketch"]},watch:{borderColors:function(t,e){this.viewComponent.borderChange(t.hex),this.onChange()},bgColors:function(t,e){this.viewComponent.bgChange(t.hex),this.onChange()}}},fx=px,gx=(n("8505"),Object(it["a"])(fx,dx,hx,!1,null,"6594d8c1",null)),mx=gx.exports,vx=new WeakMap,bx=new WeakMap,yx=new WeakMap,wx=new WeakMap,xx=new WeakMap,Cx=new WeakMap,kx=new WeakMap,Ax=function(){function t(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(F["a"])(this,t),xy(this,vx,{writable:!0,value:null}),xy(this,bx,{writable:!0,value:null}),xy(this,yx,{writable:!0,value:null}),xy(this,wx,{writable:!0,value:null}),xy(this,xx,{writable:!0,value:null}),xy(this,Cx,{writable:!0,value:null}),xy(this,kx,{writable:!0,value:null}),Object(ef["a"])(this,"viewComponent",null),Object(ef["a"])(this,"windowClick",(function(t){var e=t.target;e&&0===Object(D["$"])(e).closest(".data-table-color-tool,.table-color-dropdown-arrow").length&&r.remove()})),Ey(this,vx,e),Ey(this,xx,n),Ey(this,bx,i),Ey(this,kx,new D["Position"](Ay(this,vx))),Ey(this,yx,i.defaultColor||"transparent"),Ey(this,wx,Object(D["$"])('<div class="table-color-dropdown-trigger">\n <button type="button" class="table-color-dropdown-button-text">\n <svg width="16px" height="16px" viewBox="0 0 16 16" style="margin-bottom: '.concat("transparent"===Ay(this,yx)?-5:-3,'">\n <g ="none" strokeWidth="1" fill="none" fillRule="evenodd">\n <path d="M11.9745711,7.921875 C11.9745711,7.921875 13.2147672,9.2863447 13.2147672,10.1226326 C13.2147672,10.8142992 12.6566789,11.3802083 11.9745711,11.3802083 C11.2924632,11.3802083 10.734375,10.8142992 10.734375,10.1226326 C10.734375,9.2863447 11.9745711,7.921875 11.9745711,7.921875 Z M9.07958999,6.47535893 L6.28501575,3.68078468 L3.4904415,6.47535893 L9.07958999,6.47535893 Z M5.3326566,3.04215357 L4.28223263,1.9917296 C4.22692962,1.93642659 4.22692962,1.84676271 4.28223263,1.7914597 L5.03228902,1.0414033 C5.08759203,0.986100299 5.17725591,0.986100299 5.23255892,1.0414033 L6.4546098,2.26345418 C6.46530408,2.27146914 6.4755605,2.28033918 6.48528564,2.29006432 L10.4848531,6.28963174 C10.5954591,6.40023775 10.5954591,6.57956552 10.4848531,6.69017153 L6.4838816,10.691143 C6.37327559,10.801749 6.19394782,10.801749 6.08334181,10.691143 L2.08377439,6.69157557 C1.97316838,6.58096956 1.97316838,6.40164179 2.08377439,6.29103578 L5.3326566,3.04215357 Z" fill="#595959"/>\n strokeWidth="0.5" x="2" y="12.75" width="12" height="1.5" rx="0.125" />\n </g>\n </svg>\n </button>\n <button type="button" class="table-color-dropdown-arrow">\n <span class="table-color-dropdown-empty"></span>\n <span class="data-icon data-icon-arrow"></span>\n </button>\n </div>'))),Ay(this,wx).find(".table-color-dropdown-arrow").on("mousedown",(function(t){t.preventDefault(),Ay(r,Cx)&&Ay(r,Cx).length>0?r.remove():r.render()})),Ay(this,wx).find(".table-color-dropdown-button-text").on("mousedown",(function(t){t.preventDefault();var e=Ay(r,bx),n=e.onChange;n&&n(Ay(r,yx))}))}return Object(B["a"])(t,[{key:"getButton",value:function(){return Ay(this,wx)}},{key:"select",value:function(t){var e=ux.getStroke(t),n=Ay(this,wx).find("rect");n.attributes("stroke",e),n.attributes("fill",t),Ay(this,wx).find("svg").css("margin-bottom","transparent"===t?-5:-3)}},{key:"change",value:function(t){Ey(this,yx,t),this.select(t);var e=Ay(this,bx),n=e.onChange;n&&n(t)}},{key:"toState",value:function(t,e){var n=t["hex"]?bm()(t["hex"]):bm()(t),r=n.toHsl(),i=n.toHsv(),o=n.toRgb(),a=n.toHex();0===r.s&&(r.h=e||0,i.h=e||0);var s="000000"===a&&0===o.a;return{hsl:r,hex:s?"transparent":"#".concat(a),rgb:o,hsv:i,oldHue:t["h"]||e||r.h,source:t["source"]}}},{key:"render",value:function(){var t;Ey(this,Cx,Object(D["$"])('<div class="data-table-color-tool'.concat(D["isMobile"]?" data-table-color-tool-mobile":"",'" ').concat(D["DATA_ELEMENT"],'="').concat(D["UI"],'" ').concat(D["TRIGGER_CARD_ID"],'="').concat(Ay(this,xx),'"></div>')));var e=kb["default"].extend(mx),n=new e;n.viewComponent=this.viewComponent,n.onChange=Ay(this,bx).onChange,n.$mount(),Ay(this,Cx).append(n.$el),null===(t=Ay(this,kx))||void 0===t||t.bind(Ay(this,Cx),Ay(this,wx)),document.addEventListener("mousedown",this.windowClick,!0)}},{key:"remove",value:function(){var t,e;null===(t=Ay(this,Cx))||void 0===t||t.remove(),null===(e=Ay(this,kx))||void 0===e||e.destroy(),document.removeEventListener("mousedown",this.windowClick,!0),Ey(this,Cx,void 0)}},{key:"destroy",value:function(){this.remove();var t=Ay(this,bx),e=t.onDestroy;e&&e()}}]),t}(),Sx=Ax,Ex=(n("3fa3"),new WeakMap),Ox=new WeakMap,Tx=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){var t,r,i;Object(F["a"])(this,n);for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=e.call.apply(e,[this].concat(a)),Object(ef["a"])(Object(wf["a"])(i),"lightblockVue",{}),xy(Object(wf["a"])(i),Ex,{writable:!0,value:""}),xy(Object(wf["a"])(i),Ox,{writable:!0,value:void 0}),Object(ef["a"])(Object(wf["a"])(i),"isEditable",!0),Object(ef["a"])(Object(wf["a"])(i),"contenteditable",[".lightblock-countent"]),Object(ef["a"])(Object(wf["a"])(i),"colors",ux.getColors().map((function(t){return t.map((function(t){return{color:t,border:ux.getStroke(t)}}))}))),Object(ef["a"])(Object(wf["a"])(i),"colorTool",new Sx(i.editor,i.id,{colors:null===(t=i.getValue().color)||void 0===t?void 0:t.background,defaultColor:null===(r=i.getValue().color)||void 0===r?void 0:r.background,view:i.lightblockVue,onChange:function(t){i.onChange("local")}})),i}return Object(B["a"])(n,[{key:"didRender",value:function(){var t,e;Object(z["a"])(Object(H["a"])(n.prototype),"didRender",this).call(this),this.type===D["CardType"].BLOCK?null===(t=this.toolbarModel)||void 0===t||t.setOffset([-120,0]):null===(e=this.toolbarModel)||void 0===e||e.setOffset([0,0])}},{key:"didInsert",value:function(){}},{key:"getValue",value:function(){var t,e,r,i,o,a=".lightblock-countent",s=Object(z["a"])(Object(H["a"])(n.prototype),"getValue",this).call(this),l=!!Ay(this,Ox)&&Ay(this,Ox).find(a);if(!l)return s;var c=this.editor,u=c.schema,d=c.conversion,h=Object(D["$"])("<div></div>");h.append(l.clone(!0).children());var p=new D["Parser"](l,c),f=p.toValue(u,d,!1,!1);return Object(D["isEngine"])(c)?Object(_["a"])(Object(_["a"])({},s),{},{html:f,color:{border:null===(i=this.lightblockVue.color)||void 0===i?void 0:i.border,background:null===(o=this.lightblockVue.color)||void 0===o?void 0:o.background}}):Object(_["a"])(Object(_["a"])({},s),{},{html:f,color:{border:null===(t=this.lightblockVue)||void 0===t||null===(e=t.color)||void 0===e?void 0:e.border,background:null===(r=this.lightblockVue.color)||void 0===r?void 0:r.background}})}},{key:"render",value:function(){var t=this.getValue(),e=kb["default"].extend(sx),n=new e,r=".lightblock-countent";n.$set(n,"color",t.color||{}),n.$mount();var i=Object(D["$"])('<div class="lightblock-box"></div>');i[0].appendChild(n.$el);var o=i.find(r)[0];return o.innerHTML=new D["Parser"](t?t.html:"",this.editor).toValue()||"<br />",Ey(this,Ox,i),this.lightblockVue=n,this.lightblockVue.engine=this,this.colorTool.viewComponent=n,Ay(this,Ox)}},{key:"onSelect",value:function(){}},{key:"toolbar",value:function(){if(!Object(D["isEngine"])(this.editor)||this.editor.readonly)return[];var t=[{type:"delete"},{type:"copy"},{key:"color",type:"node",title:"换色",node:this.colorTool.getButton()}];return t.concat()}},{key:"onChange",value:function(t){var e=this,n=this.editor;Object(D["isEngine"])(n)&&"local"===t&&n.ot.isStopped()||(Ay(this,Ex)&&clearTimeout(Ay(this,Ex)),Ey(this,Ex,setTimeout((function(){var r=e.getValue();"local"===t&&Object(D["isEngine"])(n)&&r&&e.setValue({html:r.html,color:e.lightblockVue.color})}),50)))}},{key:"select",value:function(){}},{key:"destroy",value:function(){Object(z["a"])(Object(H["a"])(n.prototype),"destroy",this).call(this),Ay(this,Ox)[0].parentElement.innerHTML="",this.lightblockVue.isDestroy=!0,this.lightblockVue.$destroy(),this.lightblockVue=void 0}}],[{key:"cardName",get:function(){return"lightblock"}},{key:"cardType",get:function(){return D["CardType"].BLOCK}}]),n}(D["Card"]),_x=function(t){Object(V["a"])(n,t);var e=Object(q["a"])(n);function n(){return Object(F["a"])(this,n),e.apply(this,arguments)}return Object(B["a"])(n,[{key:"init",value:function(){var t=this;this.editor.on("paser:html",(function(e){return t.parseHtml(e)})),this.editor.on("paste:schema",(function(e){return t.pasteSchema(e)})),this.editor.on("paste:each",(function(e){return t.pasteHtml(e)}))}},{key:"execute",value:function(t){if(Object(D["isEngine"])(this.editor)){var e=this.editor.card;e.insert(sx.cardName,Object(_["a"])({},t))}}},{key:"hotkey",value:function(){return this.options.hotkey||"ctrl+|"}},{key:"pasteSchema",value:function(t){t.add({type:"block",name:"div",attributes:{"data-type":{required:!0,value:sx.cardName},"data-value":"*"}})}},{key:"pasteHtml",value:function(t){if(Object(D["isEngine"])(this.editor)){if(t.isElement()){var e=t.attributes("data-type");if(e===sx.cardName){var n=t.attributes("data-value"),r=decodeCardValue(n);if(!r.url)return;return this.editor.card.replaceNode(t,sx.cardName,r),t.remove(),!1}}return!0}}},{key:"parseHtml",value:function(t){var e=this;t.find("[".concat(CARD_KEY,"=").concat(sx.cardName)).each((function(t){var n=Object(D["$"])(t),r=e.editor.card.find(n),i=null===r||void 0===r?void 0:r.getValue();if(i){var o=r.type===D["CardType"].INLINE?"span":"div",a="<".concat(o,' data-type="').concat(r.type,'" data-value="').concat(encodeCardValue(i),'"></').concat(o,">");n.empty(),n.replaceWith(Object(D["$"])(a))}else n.remove()}))}}],[{key:"pluginName",get:function(){return"lightblock"}}]),n}(D["Plugin"]),Mx="/",Nx=function(t,e,n){return n.command.execute(e),!1};kb["default"].prototype.customCard=[ew.cardName,Qb.cardName,zb.cardName,Tb.cardName,dw.cardName];var Px=[ey["ToolbarPlugin"],rf,af,cf,gf,vf,yf,Ef,fw.a,_f,Nf,zf,mg,bg,xg,Tg,Pg,Y,jg,zg,Wg,Yg,rm,lm,um,pm,wv,Cv.a,xv["VideoUploader"],Ev,Uv,$v.a,Cb,_b,Hb,ty,nw,hw,Cw,Aw.a,ex,kw["AudioUploader"],_x],Lx=[ey["ToolbarComponent"],Df,lg,fv,xv["VideoComponent"],Iv,db,kw["AudioComponent"],Tb,zb,Qb,ew,dw,xw,tx,Tx],Dx=(cx={},Object(ef["a"])(cx,af.pluginName,{hotkey:"ctrl+z"}),Object(ef["a"])(cx,rf.pluginName,{hotkey:"ctrl+y"}),Object(ef["a"])(cx,_f.pluginName,{markdown:"*"}),Object(ef["a"])(cx,cf.pluginName,{hotkey:"ctrl+b"}),Object(ef["a"])(cx,_f.pluginName,{hotkey:"ctrl+i"}),Object(ef["a"])(cx,jg.pluginName,{hotkey:"ctrl+shift+x"}),Object(ef["a"])(cx,Nf.pluginName,{hotkey:"ctrl+u"}),Object(ef["a"])(cx,zg.pluginName,{hotkey:"ctrl+shift+,"}),Object(ef["a"])(cx,Wg.pluginName,{hotkey:"ctrl+shift+."}),Object(ef["a"])(cx,gf.pluginName,{hotkey:"ctrl+e"}),Object(ef["a"])(cx,xg.pluginName,{hotkey:"ctrl+shift+8"}),Object(ef["a"])(cx,bg.pluginName,{hotkey:"ctrl+shift+7"}),Object(ef["a"])(cx,mg.pluginName,{hotkey:"ctrl+shift+9"}),Object(ef["a"])(cx,fw.a.pluginName,{hotkey:"ctrl+k"}),Object(ef["a"])(cx,rm.pluginName,{hotkey:"ctrl+shift+u"}),Object(ef["a"])(cx,zf.pluginName,{hotkey:"ctrl+alt+e"}),Object(ef["a"])(cx,xv["VideoUploader"].pluginName,{action:"".concat(Mx,"api/resource/upload"),crossOrigin:!1,limitSize:52428800,headers:{Authorization:localStorage.getItem("token")},parse:function(t){var e={};return"success"==t.msg?(e.result=!0,e.data=t.data.diskname):(e.result=!1,e.data=t.message||t.data.message),e}}),Object(ef["a"])(cx,Cv.a.pluginName,{onBeforeRender:function(t,e){return e+"?token=12323"}}),Object(ef["a"])(cx,Cb.pluginName,{action:"".concat(Mx,"/user/search"),onLoading:function(){},onEmpty:function(){},onClick:function(t,e){e.key,e.name},onMouseEnter:function(){}}),Object(ef["a"])(cx,wv.pluginName,{lazyRender:!1,overflow:{maxLeftWidth:function(){return 100},maxRightWidth:function(){return 100}}}),Object(ef["a"])(cx,$v.a.pluginName,{filter:function(t){return"14px"===t?"1":"16px"===t?"1.15":"21px"===t?"1.5":"28px"===t?"2":"35px"===t?"2.5":"42px"===t?"3":["1","1.15","1.5","2","2.5","3"].indexOf(t)>-1},onMouseEnter:function(t,e){e.name}}),Object(ef["a"])(cx,kw["AudioUploader"].pluginName,{action:"".concat(Mx,"api/resource/upload"),crossOrigin:!1,limitSize:52428800,headers:{Authorization:localStorage.getItem("token")},parse:function(t){var e={};return"success"==t.msg?(e.result=!0,e.data=t.data.diskname):(e.result=!1,e.data=t.message||t.data.message),e}}),Object(ef["a"])(cx,ey["ToolbarPlugin"].pluginName,{popup:{items:[["undo","redo","bold","italic","strikethrough","underline","backcolor","moremark"]]},config:[{title:"分组标题",items:[{name:"lightblock",title:"高亮块",search:"高亮块,ightblock,gaoliangkuai,glk",icon:"highlight"},{name:"imageuploader",title:"图片",search:"图片,image,tupian,tp",icon:"image"},{name:"flodcard",title:"折叠块",autoExecute:!1,search:"折叠块,zhediekuai,flod,zdk",icon:"outdent",onClick:function(t,e,n){return n.command.execute("flodcard"),!1}},{name:"matheditor",title:"公式",autoExecute:!1,search:"公式,math,gongshi,gs",icon:"math",onClick:function(t,e,n){return n.command.execute(e),!1}},{name:"codeblock",title:"代码块",icon:"code-example",search:"代码块,code,daimakuai,dmk,dm",onClick:Nx},{name:"audio-uploader",icon:'<svg t="1678173062430" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4145" width="16" height="16"><path d="M156.060444 819.470222c0-7.864889-6.357333-14.222222-14.208-14.222222h-0.014222a14.222222 14.222222 0 0 0-14.222222 14.193778 85.703111 85.703111 0 0 0 24.248889 59.975111 14.179556 14.179556 0 0 0 20.124444 0.341333 14.222222 14.222222 0 0 0 0.327111-20.110222 57.358222 57.358222 0 0 1-16.256-40.177778zM724.949333 705.706667a14.222222 14.222222 0 1 0-28.444444-0.028445 85.660444 85.660444 0 0 0 24.220444 59.960889 14.222222 14.222222 0 0 0 20.465778-19.768889 57.201778 57.201778 0 0 1-16.241778-40.163555zM213.816889 877.255111c-1.692444 0-3.271111 0.085333-4.750222 0.341333a14.222222 14.222222 0 0 0-7.594667 27.363556c3.214222 1.080889 5.959111 1.507556 8.32 1.507556 1.962667 0 3.655111-0.327111 5.105778-0.810667 7.352889-0.554667 13.141333-6.712889 13.141333-14.193778a14.193778 14.193778 0 0 0-14.222222-14.208z" p-id="4146"></path><path d="M986.567111 582.997333c0.014222-0.298667 0.085333-0.568889 0.085333-0.867555l-2.375111-509.198222a31.118222 31.118222 0 0 0-0.583111-5.617778 27.875556 27.875556 0 0 0 0.099556-11.022222 28.472889 28.472889 0 0 0-33.28-22.613334l-583.111111 111.388445a28.458667 28.458667 0 0 0-22.613334 33.28c0.028444 0.199111 0.113778 0.369778 0.156445 0.568889a29.44 29.44 0 0 0-0.654222 6.144l2.161777 478.961777c-34.389333-6.314667-88.803556-14.520889-139.633777-14.520889-94.108444 0-170.666667 76.544-170.666667 170.652445s76.558222 170.666667 170.666667 170.666667c55.651556 0 100.977778-18.901333 134.712888-56.120889 74.268444-81.976889 63.146667-224.853333 61.952-237.838223l-1.749333-386.631111 526.279111-100.551111 1.578667 340.551111c-34.389333-6.300444-88.846222-14.520889-139.690667-14.520889-94.108444 0-170.666667 76.558222-170.666666 170.666667 0 94.094222 76.558222 170.652444 170.666666 170.652445 55.651556 0 101.006222-18.901333 134.727111-56.120889 74.453333-82.176 63.089778-225.550222 61.937778-237.909334zM299.278222 896.611556c-22.812444 25.116444-53.048889 37.304889-92.458666 37.304888-62.734222 0-113.777778-51.029333-113.777778-113.777777 0-62.72 51.043556-113.763556 113.777778-113.763556 52.167111 0 110.549333 9.870222 140.928 15.786667 0.654222 39.168-3.541333 124.970667-48.469334 174.449778z m102.200889-644.266667l-0.256-55.808L927.502222 96l0.256 55.808-526.279111 100.536889z m480.896 530.488889c-22.812444 25.116444-53.034667 37.304889-92.458667 37.304889-62.734222 0-113.777778-51.029333-113.777777-113.763556s51.043556-113.777778 113.777777-113.777778c52.181333 0 110.549333 9.870222 140.928 15.786667 0.654222 39.168-3.541333 124.970667-48.469333 174.449778z" p-id="4147"></path></svg>',title:"音频",search:"音频,audio,yinpin,yp"},{name:"document",icon:"attachment",title:"附件",search:"附件,document,fj,fujian"},{name:"table",search:"表格,table,bg,biaoge",icon:"table"},{name:"video-uploader",icon:"video"},{name:"status",icon:"toc"}]}]}),cx),jx=(n("0849"),{name:"HelloWorld",components:{AmToolbar:ct["a"],mindMap:tf},data:function(){return{engine:null,isShowCustom:!1,items:[],scrollEditorWinodw:0,imageExtension:[".jpg",".gif",".jpeg",".png",".bmp",".webp"]}},props:{msg:String,isEditor:{type:Boolean,default:!1},articleInfo:{type:Object,default:function(){}},isLoading:{type:Boolean,default:!0}},mounted:function(){this.initEditor()},methods:{initEditor:function(){var t=this,e={},n=document.getElementById("article-contents"),r=this.articleInfo.content;localStorage.setItem("NOW_ARTICLE_DOWNLOAD",JSON.stringify(this.articleInfo.resourceAuthority)),this.$nextTick((function(){t.isEditor?(e=new D["default"](n,{cards:Lx,config:Dx,plugins:Px,autoAppend:!0,placeholder:"请输入内容!"}),e.setValue(r,(function(){t.loading=!1})),t.engine=e,t.listenDrag()):(e=new D["default"](n,{cards:Lx,plugins:Px,readonly:!0}),e.setValue(r,(function(){t.loading=!1}))),t.$emit("initOver",e),t.initEngineEvent(e)}))},closeCustom:function(){this.isShowCustom=""},initEngineEvent:function(t){var e=this;t.on("change",(function(){var n;e.engineChange(t),null===(n=e.intersectionObserver)||void 0===n||n.disconnect(),e.intersectionObserver=null,e.intersectionObserver=new IntersectionObserver((function(t,n){t[t.length-1].isIntersecting&&(e.$refs.outline.selectKeys=[t[t.length-1].target.id])})),e.baseOutline.forEach((function(t){var n=t.node;e.intersectionObserver.observe(n)}))})),t.removeTableDescribe=function(e){t.addTableDescribe(e)},t.addTableDescribe=function(e,n){var r=Array.from(document.querySelectorAll('#article-contents > div[data-card-key="table"]')),i=0,o=[];r.forEach((function(n){e.editor.card.components.forEach((function(e){var r=e.getValue();if(r.showDescribe&&e.root[0]===n){i+=1,o.push(e);var a=document.createElement("div");a.className="table-describe";var s=document.createElement("input");s.value=r.describe||"",s.className="describe-input",t._readonly?s.disabled=!0:(s.placeholder="请输入表格描述,可为空!",s.onblur=function(){e.setValue({describe:s.value})}),a.innerHTML="表-".concat(i," "),a.appendChild(s);var l=e.root[0].querySelector('[contenteditable="false"] .table-wrapper'),c=e.root[0].querySelector('[contenteditable="false"] .table-describe');a.style.width="100%",null===c||void 0===c||c.parentNode.removeChild(c);var u=r.describePosition;u&&"bottom"!=u?(a.style.marginBottom="10px",null===l||void 0===l||l.parentElement.prepend(a)):null===l||void 0===l||l.appendChild(a)}else if(!r.showDescribe){var d=e.root[0].querySelector('[contenteditable="false"] .table-describe');null===d||void 0===d||d.parentNode.removeChild(d)}}))}))}},listenDrag:function(){var t=this,e=document.getElementById("editor-window");e.ondragover=function(t){t.stopPropagation(),t.preventDefault()},e.ondrop=function(e){var n;e.stopPropagation(),e.preventDefault();var r=null===(n=e.dataTransfer.files[0])||void 0===n?void 0:n.name;if(r){var i=t.checkType(r);"image"==i?t.engine.command.execute("imageuploader",{isDragToUpload:!0,file:e.dataTransfer.files[0]}):t.$message.warn("暂不支持拖拽上传此类型文件!")}},e.onpaste=function(e){var n;if("file"===(null===(n=e.clipboardData.items[0])||void 0===n?void 0:n.kind)){var r=e.clipboardData.items[0].getAsFile().name,i=t.checkType(r);"image"==i?t.engine.command.execute("imageuploader",{isDragToUpload:!0,file:e.clipboardData.items[0].getAsFile()}):t.$message.warn("暂不支持拖拽上传此类型文件!")}}},checkType:function(t){var e=t.substring(t.lastIndexOf("."),t.length);e=e.toLowerCase();var n=null;if(n=this.imageExtension.indexOf(e),-1!==n)return"image"}},watch:{isEditor:function(){this.initEditor()},articleInfo:function(){this.initEditor()}}}),Ix=jx,Rx=(n("1f0a"),Object(it["a"])(Ix,st,lt,!1,null,"5b0ea699",null)),Fx=Rx.exports,Bx={data:function(){return{isShowMenu:!1,expandedCatalogTreeKeys:[],nowSelectArticleKey:[],nowSelectArticle:{},articleInfo:{},pageLoading:!1}},created:function(){return Object(N["a"])(Object(M["a"])().mark((function t(){return Object(M["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))()},mounted:function(){},props:{manualsInfo:{type:Object},isLoading:{type:Boolean},treeArticleList:{type:Array},routerQueryInfo:{type:Object}},components:{editor:Fx},computed:Object(_["a"])(Object(_["a"])({},Object(P["b"])("account",["user"])),Object(P["d"])("setting",["pageData"])),methods:Object(_["a"])(Object(_["a"])({},Object(P["c"])("setting",["setPageData"])),{},{showMenu:function(){this.isShowMenu=!this.isShowMenu,this.isShowMenu?(this.$refs.mobildViewManusals.style.transform="translateX(0)",this.$refs.mobildViewManusalsMenu.style.left="80%"):(this.$refs.mobildViewManusals.style.transform="translateX(-100%)",this.$refs.mobildViewManusalsMenu.style.left="0")},expandCatalogTreeNode:function(t,e){for(var n=!1,r=e.nativeEvent.path,i=0;i<r.length;i++)r[i].classList&&r[i].classList.contains("ant-tree-switcher")&&(n=!0);n&&(this.expandedCatalogTreeKeys=t)},selectCatalogTree:function(t,e){var n=this;this.pageLoading=!0,this.isEditor?this.$message.warn("当前处于编辑模式,请保存文章后再切换!"):(this.nowSelectArticleKey=t,this.articleInfo=e.node.dataRef,setTimeout((function(){n.pageLoading=!1,n.articleInfo.resourceAuthority||n.checkDownLoadAuthority}),500))},checkDownLoadAuthority:function(){this.$nextTick((function(){var t=document.getElementsByTagName("video"),e=document.getElementsByTagName("audio"),n=document.getElementsByClassName("image-self");if(t)for(var r=0;r<t.length;r++)t[r].controlsList.value="nodownload",t[r].oncontextmenu=function(){return!1};if(e)for(var i=0;i<e.length;i++)e[i].controlsList.value="nodownload",e[i].oncontextmenu=function(){return!1};if(n)for(var o=0;o<n.length;o++){var a=document.getElementsByClassName("mobild_view_box")[0];n[o].clientWidth>=.09*a.clientWidth&&(n[o].parentElement.parentElement.style.width=.9*a.clientWidth+"px"),n[o].draggable=!1,n[o].oncontextmenu=function(){return!1}}}))}}),watch:{articleInfo:function(){var t=this;setTimeout((function(){t.articleInfo.resourceAuthority?t.checkDownLoadAuthority():t.$nextTick((function(){for(var t=document.getElementsByClassName("image-self"),e=0;e<t.length;e++){var n=document.getElementsByClassName("mobild_view_box")[0];t[e].clientWidth>=.09*n.clientWidth&&(t[e].parentElement.parentElement.style.width=.9*n.clientWidth+"px")}}))}),0)}}},zx=Bx,Hx=(n("42453"),Object(it["a"])(zx,X,K,!1,null,"60002376",null)),Vx=Hx.exports,qx=function(){var t=this,e=t._self._c;return e("div",{staticClass:"article-catalog"},[e("div",{staticClass:"article-catalog-toolbar"},[e("h2",[t._v("目录")]),e("a-select",{staticStyle:{flex:"1","margin-left":"20px","margin-right":"10px"},attrs:{"show-search":"",size:"small",placeholder:"请输入搜索内容"},on:{change:t.onSearchCatalog}},[e("a-icon",{attrs:{slot:"suffixIcon",type:"search"},slot:"suffixIcon"}),t._l(t.allArticleList,(function(n){return e("a-select-option",{key:"".concat(n.title,"-$$-").concat(n.id)},[t._v(t._s(n.title))])}))],2),e("a-tooltip",{attrs:{placement:"top"}},[e("div",{staticClass:"hint-box-center",attrs:{slot:"title"},slot:"title"},[e("div",[t._v(t._s(t.flodCatlog?"收缩":"展开"))])]),t.flodCatlog?e("a-icon",{staticStyle:{margin:"0 5px"},attrs:{type:"menu-fold"},on:{click:function(e){return t.changCatalogFold(!1)}}}):e("a-icon",{staticStyle:{margin:"0 5px"},attrs:{type:"menu-unfold"},on:{click:function(e){return t.changCatalogFold(!0)}}})],1),e("a-tooltip",{attrs:{placement:"top"}},[e("div",{attrs:{slot:"title"},slot:"title"},[e("div",[t._v("隐藏目录")]),e("div",[t._v("Crtl+alt+,")])]),e("a-icon",{attrs:{type:"close"},on:{click:function(e){return e.stopPropagation(),t.changeShowCatalog.apply(null,arguments)}}})],1)],1),e("div",{staticStyle:{flex:"1","overflow-y":"auto"}},[e("a-directory-tree",{attrs:{"tree-data":t.treeArticleList,"default-expand-all":"",expandAction:!1,expandedKeys:t.expandedCatalogTreeKeys,selectedKeys:t.nowSelectArticleKey},on:{expand:t.expandCatalogTreeNode,select:t.selectCatalogTree}})],1),t.showCatalog?t._e():e("div",{staticClass:"show-catalog-button",on:{click:t.changeShowCatalog}},[t._v(" 目录 ")])])},Ux=[],Wx={props:{treeArticleList:Array,manualsInfo:Object,allArticleList:Array,isEditor:Boolean,defaultCheckKey:String},data:function(){return{nowSelectArticleKey:[],nowSelectArticle:{},expandedCatalogTreeKeys:[],showCatalog:!0,flodCatlog:!1}},mounted:function(){this.hideOrShowCatelog_KEY()},watch:{treeArticleList:function(t,e){var n=this;this.allArticleList&&this.allArticleList.length<=0?this.$message.warn("当前手册无文章"):(this.defaultCheckKey?this.nowSelectArticle=this.allArticleList.filter((function(t){if(t.id==n.defaultCheckKey)return!0}))[0]:this.nowSelectArticle=t[0],this.nowSelectArticle||(this.$message.error("当前文章不存在,或权限不足,默认为您切换至第一章"),this.nowSelectArticle=t[0]),this.nowSelectArticle=this.nowSelectArticle,this.nowSelectArticleKey=[this.nowSelectArticle.key||this.nowSelectArticle.id],this.toNewPage(this.nowSelectArticle),this.$emit("selectArticle",this.nowSelectArticle))}},methods:{expandCatalogTreeNode:function(t,e){this.expandedCatalogTreeKeys=t},toNewPage:function(t){var e=this.$router.resolve({path:"/article",query:{manuals:t.manuals,article:t.id,isEditor:this.isEditor}});window.open(e.href,"_self")},selectCatalogTree:function(t,e){this.$emit("selectArticle",e.node.dataRef),this.isEditor||(this.nowSelectArticleKey=t,this.nowSelectArticle=e.node.dataRef,this.toNewPage(this.nowSelectArticle))},hideOrShowCatelog_KEY:function(){var t=arguments,e=this;document.onkeydown=function(n){var r=n||window.event||t.callee.caller.arguments[0];if(r&&r.ctrlKey&&r.altKey&&188==r.keyCode)return e.changeShowCatalog(),!1}},onSearchCatalog:function(t){if(!(t&&t.length<=0)){var e=parseInt(t.split("-$$-")[1]);if(e){var n=this.allArticleList.findIndex((function(t){if(t.id==e)return!0}));if(this.$emit("selectArticle",this.allArticleList[n]),this.toNewPage(this.nowSelectArticle),this.isEditor)return;this.nowSelectArticle=this.allArticleList[n],this.nowSelectArticleKey=[this.nowSelectArticle.key]}}},changCatalogFold:function(t){var e=this;this.expandedCatalogTreeKeys=[],this.flodCatlog=t,t&&this.allArticleList.forEach((function(t){e.expandedCatalogTreeKeys.push(t.key)}))},changeShowCatalog:function(){var t=document.querySelector(".article-catalog");this.showCatalog?(this.showCatalog=!1,t.style.transform="translateX(-100%)"):(t.style.transform="translateX(0)",this.showCatalog=!0)}}},$x=Wx,Gx=(n("cf51"),Object(it["a"])($x,qx,Ux,!1,null,"76019aea",null)),Yx=Gx.exports,Xx=function(){var t=this,e=t._self._c;return e("div",{staticClass:"search-replace-box"},[e("div",{staticClass:"search-box-header"},[e("div",{staticClass:"search-box-title"},[t._v("查找替换")]),e("div",{staticClass:"search-box-close",on:{click:function(e){return t.$emit("close")}}},[e("a-icon",{attrs:{type:"close"}})],1)]),e("div",{staticClass:"cut-off-rule"}),e("a-input",{staticClass:"replace-input",staticStyle:{width:"200px"},attrs:{placeholder:"请输入搜索内容",size:"small"},model:{value:t.searchValue,callback:function(e){t.searchValue=e},expression:"searchValue"}}),t._v(" 替换为 "),e("a-input",{staticClass:"replace-input",staticStyle:{width:"200px"},attrs:{placeholder:"请输入替换内容",size:"small"},model:{value:t.replaceValue,callback:function(e){t.replaceValue=e},expression:"replaceValue"}}),e("div",{staticClass:"search-box-floor"},[e("a-button",{attrs:{type:"primary",size:"small",disabled:!t.searchValue.trim()},on:{click:function(e){return t.$emit("searchContent",t.searchValue)}}},[t._v("查找 ")]),e("a-button",{attrs:{size:"small",disabled:!t.searchValue.trim()||!t.replaceValue.trim()},on:{click:function(e){return t.$emit("replaceContent",t.replaceValue)}}},[t._v(" 替换 ")])],1)],1)},Kx=[],Zx={data:function(){return{searchValue:"",replaceValue:""}}},Jx=Zx,Qx=(n("bc8c"),Object(it["a"])(Jx,Xx,Kx,!1,null,"0f2e828d",null)),tC=Qx.exports,eC=function(){var t=this,e=t._self._c;return e("div",{staticClass:"floating-sidebar"},[e("div",{on:{click:function(e){return t.$emit("showHelpInfo")}}},[e("a-icon",{attrs:{type:"question-circle",theme:"filled"}})],1),e("div",{on:{click:function(e){return t.$emit("scrollToTop")}}},[e("a-icon",{attrs:{type:"up-circle",theme:"filled"}})],1)])},nC=[],rC={},iC=rC,oC=(n("b7fa"),Object(it["a"])(iC,eC,nC,!1,null,"1243d570",null)),aC=oC.exports,sC=function(){var t=this,e=t._self._c;return e("a-drawer",{attrs:{title:"快捷键参考",placement:"right",closable:!0,mask:!1,visible:t.isShowHelpInfo,width:"550"},on:{close:function(e){return t.$emit("closeHelpInfo")}}},[e("div",{staticClass:"keyborad-header"},[e("span",[t._v("格式")]),e("span",[t._v("快捷键")]),e("span",[t._v("MarkDown")])]),e("div",{staticClass:"keyborad-body"},t._l(t.KeyboradHelpData,(function(n,r){return e("div",{key:r,staticClass:"keyborad-item"},[e("span",[t._v(t._s(n.title))]),e("span",t._l(n.key,(function(n,r){return e("span",{key:r},[t._v(" "+t._s(n)+" ")])})),0),e("span",t._l(n.MarkDownKey,(function(n,r){return e("span",{key:r},[t._v(" "+t._s(n)+" ")])})),0)])})),0)])},lC=[],cC={props:{isShowHelpInfo:{type:Boolean,default:!1},KeyboradHelpData:{type:Array,default:function(){return[{title:"插入卡片-行内",key:["Ctrl","/"],MarkDownKey:[]},{title:"插入卡片-行首",key:["/"],MarkDownKey:[]},{title:"撤销",key:["Ctrl","Z"],MarkDownKey:[]},{title:"重做",key:["Ctrl","Y"],MarkDownKey:[]},{title:"清除格式",key:["Ctrl","\\"],MarkDownKey:[]},{title:"标题1",key:["Ctrl","alt","1"],MarkDownKey:["#","Space"]},{title:"标题2",key:["Ctrl","alt","2"],MarkDownKey:["##","Space"]},{title:"标题3",key:["Ctrl","alt","3"],MarkDownKey:["###","Space"]},{title:"标题4",key:["Ctrl","alt","4"],MarkDownKey:["####","Space"]},{title:"标题5",key:["Ctrl","alt","5"],MarkDownKey:["#####","Space"]},{title:"标题6",key:["Ctrl","alt","6"],MarkDownKey:["######","Space"]},{title:"粗体",key:["Ctrl","B"],MarkDownKey:["**文字**","Space"]},{title:"斜体",key:["Ctrl","I"],MarkDownKey:["_文字_","Space"]},{title:"删除线",key:["Ctrl","Shift","I"],MarkDownKey:["_文字_","Space"]},{title:"下划线",key:["Ctrl","U"],MarkDownKey:[]},{title:"左对齐",key:["Ctrl","Shift","L"],MarkDownKey:[]},{title:"右对齐",key:["Ctrl","Shift","R"],MarkDownKey:[]},{title:"居中对齐",key:["Ctrl","Shift","C"],MarkDownKey:[]},{title:"两端对齐",key:["Ctrl","Shift","J"],MarkDownKey:[]},{title:"有序列表",key:["Ctrl","Shift","7"],MarkDownKey:["1.","Space"]},{title:"无序列表",key:["Ctrl","Shift","8"],MarkDownKey:["-","Space"]},{title:"任务列表",key:["Ctrl","Shift","9"],MarkDownKey:[]},{title:"增加缩进",key:["Ctrl","]"],MarkDownKey:[]},{title:"减少缩进",key:["Ctrl","["],MarkDownKey:[]},{title:"链接",key:["Ctrl","K"],MarkDownKey:""},{title:"插入引用",key:["Ctrl","Shift","U"],MarkDownKey:""},{title:"插入分割线",key:["Ctrl","Shift","E"],MarkDownKey:""}]}}},data:function(){return{}}},uC=cC,dC=Object(it["a"])(uC,sC,lC,!1,null,null,null),hC=dC.exports,pC={data:function(){return{isMobile:!1,pageLoading:!1,showSetting:!1,baseRole:null,isLogin:!1,items:[],flodCatlog:!0,routerQueryInfo:{},manualsInfo:{},allArticleList:[],treeArticleList:[],showCatlogSearch:!1,nowSelectArticle:{},nowSelectArticleKey:[],expandedCatalogTreeKeys:[],showCatalog:!0,showCatalogHiddenButton:!0,isEditor:!1,outlinToolbarActive:1,editorLoading:!0,outline:new U,outlineData:[],baseOutline:[],outlineOtherData:{},isShowReplaceInput:!1,isShowArtileModal:!1,rules:{title:[{required:!0,message:"请输入名称",trigger:"blur"}]},isShowHelpInfo:!1,labelCol:{span:4},wrapperCol:{span:14},searchElementList:[],searchTimeout:null,searchValue:"",engine:void 0,isFirst:!0,imageExtension:[".jpg",".gif",".jpeg",".png",".bmp",".webp"]}},created:function(){var t=this;return Object(N["a"])(Object(M["a"])().mark((function e(){return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.pageLoading=!0,e.next=3,t.getInitData();case 3:case"end":return e.stop()}}),e)})))()},mounted:function(){},components:{Drawer:I["a"],Setting:R["a"],ArticleOutline:at,mobileIndex:Vx,AmToolbar:ct["a"],Catalog:Yx,ReplaceForm:tC,FloatingSidebar:aC,HelpInfo:hC},computed:Object(_["a"])(Object(_["a"])({},Object(P["b"])("account",["user"])),Object(P["d"])("setting",["pageData"])),methods:Object(_["a"])(Object(_["a"])({},Object(P["c"])("setting",["setPageData"])),{},{onClose:function(){this.showSetting=!1},initEditor:function(){var t;this.pageLoading=!0,localStorage.setItem("NOW_ARTICLE_DOWNLOAD",JSON.stringify(this.nowSelectArticle.resourceAuthority)),this.engine&&this.engine.destroy();var e=void 0,n=document.getElementById("article-contents"),r=null===(t=this.nowSelectArticle)||void 0===t?void 0:t.content;this.isEditor?(e=new D["default"](n,{config:Dx,cards:Lx,plugins:Px,autoAppend:!0,placeholder:"请输入内容!",scrollNode:n.parentElement,root:n.parentElement}),this.listenDrag()):e=new D["default"](n,{cards:Lx,plugins:Px,lazyRender:!0,placeholder:"暂无内容,请编辑!",scrollNode:n.parentElement,root:n.parentElement,readonly:!0}),this.engine=e,e.maxWidth=n.offsetWidth,e.setValue(r),this.engineClick(),this.initEngineEvent(e)},initEngineEvent:function(t){var e=this;t.on("change",(function(n){var r;e.engineChange(t),null===(r=e.intersectionObserver)||void 0===r||r.disconnect(),e.intersectionObserver=null,e.intersectionObserver=new IntersectionObserver((function(t,n){t[t.length-1].isIntersecting&&(e.$refs.outline.selectKeys=[t[t.length-1].target.id])})),e.baseOutline.forEach((function(t){var n=t.node;e.intersectionObserver.observe(n)}))})),this.colorChange(t),t.removeTableDescribe=function(e){t.addTableDescribe(e)},t.addTableDescribe=function(n,r){if(r){var i,o=n.root[0].querySelector('[contenteditable="false"] .table-wrapper'),a=n.Tabledescribe;return null===(i=a.parentNode)||void 0===i||i.removeChild(a),void("top"==r||o.appendChild(a))}var s=e.engine.getValue(),l=/<card type="block" name="table"+.*?>([\\s\\S]*?)<\/card>/gi,c=s.match(l),u=document.createElement("div"),d={};n.editor.card.components.forEach((function(t){d[t.root[0].getAttribute("data-id")]=t}));var h=0;null===c||void 0===c||c.forEach((function(e){u.innerHTML=e;var n=u.firstChild.getAttribute("data-id"),r=d[n],i=r.getValue();if(i.showDescribe){var o;if(h++,r.Tabledescribe)null===(o=r.Tabledescribe.parentNode)||void 0===o||o.removeChild(r.Tabledescribe);var a=document.createElement("input");a.value=i.describe||"",a.className="describe-input",a.addEventListener("focus",(function(t){return a.style.marginBottom="10px",!1})),a.addEventListener("blur",(function(t){return a.style.marginBottom="0",!1})),t._readonly?a.disabled=!0:(a.placeholder="请输入表格描述,可为空!",a.onblur=function(){r.setValue({describe:a.value})});var s=document.createElement("div"),l=document.createElement("span");l.innerHTML="表-".concat(h," "),s.className="table-describe",s.appendChild(l),s.appendChild(a);var c=r.root[0].querySelector('[contenteditable="false"] .table-wrapper');s.style.width="100%";var p=i.describePosition;p&&"top"!=p?null===c||void 0===c||c.appendChild(s):null===c||void 0===c||c.parentElement.prepend(s),r.Tabledescribe=s,r.TabledescribeInput=a,r.tableNumber=l}else{var f=r.root[0].querySelector('[contenteditable="false"] .table-describe');null===f||void 0===f||f.parentNode.removeChild(f),r.Tabledescribe=null,r.TabledescribeInput=null,r.tableNumber=null}}))},setTimeout((function(){e.pageLoading=!1}),100)},colorChange:function(t){var e=this;this.$nextTick((function(){var n=e.$refs.editorToolbar&&e.$refs.editorToolbar.$el.querySelector(".icon--53 .path1"),r=e.$refs.editorToolbar&&e.$refs.editorToolbar.$el.querySelector(".icon--54 .path1");t.on("select",(function(i){n&&r||(n=e.$refs.editorToolbar.$el.querySelector(".icon--53 .path1"),r=e.$refs.editorToolbar.$el.querySelector(".icon--54 .path1"));var o=t.command.queryState("fontcolor"),a=t.command.queryState("backcolor");n&&n.style.setProperty("--icon--53--before-color",o?o[0]:"rgb(0, 204, 194)"),r&&r.style.setProperty("--icon--54--before-color",a?a[0]:"rgb(0, 204, 194)")}))}))},engineChange:function(t){if(this.isFirst){var e=document.getElementById("article-contents");e.scrollTo(0,0)}this.nowSelectArticle.content=t.getValue(),document.engine=t,this.isFirst=!1,this.engine=t,this.getMetaData(t),this.getAritcleTitle(t),this.checkDownLoadAuthority()},getItmes:function(){var t=this;return[[{type:"collapse",icon:'<span class="icon--41"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></span>',groups:[{items:[{name:"imageuploader",title:"图片",search:"图片,math",icon:"image",onClick:function(){}},{name:"lightblock",title:"高亮块",icon:"highlight",onClick:function(){return t.engine.command.execute("lightblock"),!1}},{name:"flodcard",title:"折叠块",autoExecute:!1,icon:"outdent",onClick:function(){return t.engine.command.execute("flodcard"),!1}},{name:"matheditor",title:"公式",autoExecute:!1,search:"公式,math",icon:"math",onClick:function(){return t.engine.command.execute("matheditor"),!1}},{name:"codeblock",search:"代码块,codeblock",icon:"code-example"},{name:"table",title:"表格",icon:"table",overflow:{maxLeftWidth:1e3,maxRightWidth:1e3}},{name:"video-uploader",title:"视频",icon:"video"},{name:"status",title:"状态",icon:"toc"},{name:"audio-uploader",icon:'<svg t="1678173062430" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4145" width="16" height="16"><path d="M156.060444 819.470222c0-7.864889-6.357333-14.222222-14.208-14.222222h-0.014222a14.222222 14.222222 0 0 0-14.222222 14.193778 85.703111 85.703111 0 0 0 24.248889 59.975111 14.179556 14.179556 0 0 0 20.124444 0.341333 14.222222 14.222222 0 0 0 0.327111-20.110222 57.358222 57.358222 0 0 1-16.256-40.177778zM724.949333 705.706667a14.222222 14.222222 0 1 0-28.444444-0.028445 85.660444 85.660444 0 0 0 24.220444 59.960889 14.222222 14.222222 0 0 0 20.465778-19.768889 57.201778 57.201778 0 0 1-16.241778-40.163555zM213.816889 877.255111c-1.692444 0-3.271111 0.085333-4.750222 0.341333a14.222222 14.222222 0 0 0-7.594667 27.363556c3.214222 1.080889 5.959111 1.507556 8.32 1.507556 1.962667 0 3.655111-0.327111 5.105778-0.810667 7.352889-0.554667 13.141333-6.712889 13.141333-14.193778a14.193778 14.193778 0 0 0-14.222222-14.208z" p-id="4146"></path><path d="M986.567111 582.997333c0.014222-0.298667 0.085333-0.568889 0.085333-0.867555l-2.375111-509.198222a31.118222 31.118222 0 0 0-0.583111-5.617778 27.875556 27.875556 0 0 0 0.099556-11.022222 28.472889 28.472889 0 0 0-33.28-22.613334l-583.111111 111.388445a28.458667 28.458667 0 0 0-22.613334 33.28c0.028444 0.199111 0.113778 0.369778 0.156445 0.568889a29.44 29.44 0 0 0-0.654222 6.144l2.161777 478.961777c-34.389333-6.314667-88.803556-14.520889-139.633777-14.520889-94.108444 0-170.666667 76.544-170.666667 170.652445s76.558222 170.666667 170.666667 170.666667c55.651556 0 100.977778-18.901333 134.712888-56.120889 74.268444-81.976889 63.146667-224.853333 61.952-237.838223l-1.749333-386.631111 526.279111-100.551111 1.578667 340.551111c-34.389333-6.300444-88.846222-14.520889-139.690667-14.520889-94.108444 0-170.666667 76.558222-170.666666 170.666667 0 94.094222 76.558222 170.652444 170.666666 170.652445 55.651556 0 101.006222-18.901333 134.727111-56.120889 74.453333-82.176 63.089778-225.550222 61.937778-237.909334zM299.278222 896.611556c-22.812444 25.116444-53.048889 37.304889-92.458666 37.304888-62.734222 0-113.777778-51.029333-113.777778-113.777777 0-62.72 51.043556-113.763556 113.777778-113.763556 52.167111 0 110.549333 9.870222 140.928 15.786667 0.654222 39.168-3.541333 124.970667-48.469334 174.449778z m102.200889-644.266667l-0.256-55.808L927.502222 96l0.256 55.808-526.279111 100.536889z m480.896 530.488889c-22.812444 25.116444-53.034667 37.304889-92.458667 37.304889-62.734222 0-113.777778-51.029333-113.777777-113.763556s51.043556-113.777778 113.777777-113.777778c52.181333 0 110.549333 9.870222 140.928 15.786667 0.654222 39.168-3.541333 124.970667-48.469333 174.449778z" p-id="4147"></path></svg>',title:"音频",search:"音频,audio"},{name:"document",icon:"attachment",autoExecute:!1,title:"附件",search:"附件,document",onClick:function(e,n,r,i){return t.engine.command.execute("document"),!1}},{name:"mindmap",icon:'<svg t="1678173506693" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4513" width="15" height="15"><path d="M903.526 542.788c-11.476-109.267-69.113-209.266-157.91-273.966 1.775-42.203-8.091-85.392-30.916-124.607C651.078 34.909 510.893-2.126 401.587 61.495c-75.837 44.141-116.869 125.136-113.649 207.104-69.606 50.492-123.007 124.277-147.063 213.792a391.809 391.809 0 0 0-11.196 59.809c-37.458 19.563-69.947 49.713-92.506 89.106-62.851 109.751-24.832 249.672 84.919 312.523 76.13 43.597 166.769 38.645 236.139-5.102a391.907 391.907 0 0 0 57.362 20.29c89.516 24.056 180.13 14.833 258.713-20.088 35.68 22.675 78.051 35.746 123.464 35.587 126.472-0.444 228.638-103.331 228.194-229.803-0.31-87.709-49.894-163.714-122.438-201.925zM343.497 234.956c7.264-51.226 37.068-98.744 85.254-126.791 83.531-48.619 190.659-20.317 239.278 63.214 11.79 20.256 19.044 41.901 22.096 63.762a175.057 175.057 0 0 1-2.102 60.33c-9.855 46.729-38.683 89.27-83.209 115.186-83.531 48.619-190.659 20.317-239.278-63.214-9.688-16.645-16.312-34.228-20.063-52.097a174.622 174.622 0 0 1-1.976-60.39z m9.101 640.606a174.59 174.59 0 0 1-51.354 31.888c-47.97 19.273-103.973 17.204-152.318-10.482-83.87-48.03-112.925-154.957-64.894-238.828 11.641-20.328 26.749-37.424 44.142-50.994a175.094 175.094 0 0 1 53.336-28.371c45.394-14.826 96.646-11.13 141.349 14.471 83.871 48.031 112.925 154.957 64.894 238.828-9.586 16.742-21.526 31.292-35.155 43.488z m77.009 31.305a339.803 339.803 0 0 1-24.38-7.545 229.776 229.776 0 0 0 29.388-40.412c62.851-109.751 24.832-249.672-84.919-312.523-51.188-29.314-108.937-36.677-162.371-25.063a339.779 339.779 0 0 1 5.7-24.919c18.21-67.764 55.959-125.048 105.538-167.454a229.77 229.77 0 0 0 20.304 45.656c63.621 109.306 203.806 146.341 313.112 82.72 51.001-29.685 86.26-76.04 102.911-128.148 57.693 49.633 96.988 117.799 111.025 192.597a229.761 229.761 0 0 0-49.756-5.258c-126.472 0.444-228.638 103.331-228.194 229.803 0.207 58.987 22.705 112.68 59.48 153.148-61.556 21.657-130.06 25.612-197.838 7.398z m367.972 13.649c-23.467 0.082-45.866-4.47-66.346-12.777a175.093 175.093 0 0 1-51.198-32.023c-35.495-31.897-57.89-78.104-58.07-129.584-0.34-96.649 77.735-175.274 174.384-175.614 19.296-0.068 37.87 2.998 55.249 8.705a174.572 174.572 0 0 1 53.254 28.504c40.693 31.906 66.915 81.451 67.111 137.175 0.34 96.649-77.735 175.274-174.384 175.614z" p-id="4514"></path></svg>',title:"思维导图",search:"思维导图,mindmap"}]}]}],[{type:"button",name:"undo",icon:'<span class="icon--42"><span class="path1"></span><span class="path2"></span></span>',onDisabled:function(){return!t.engine.command.queryState("undo")||!t.engine.command.queryEnabled("undo")},onActive:function(){return!1}},{name:"redo",icon:'<span class="icon--43"><span class="path1"></span><span class="path2"></span></span>',title:"重做"},{name:"paintformat",icon:'<span class="icon--44"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span>',title:"格式刷"},{name:"removeformat",icon:'<span class="icon--45"><span class="path1"></span><span class="path2"></span></span>',title:"橡皮擦"},"links"],["heading","fontfamily","fontsize"],[{name:"bold",icon:'<span class="icon--46"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span>',title:"加粗"},{name:"italic",icon:'<span class="icon--47"><span class="path1"></span><span class="path2"></span></span>',title:"斜体"},{name:"strikethrough",icon:'<span class="icon--48"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span>',title:"删除线"},{name:"underline",icon:'<span class="icon--49"><span class="path1"></span><span class="path2"></span></span>',title:"下划线"},{name:"moremark",content:'<span class="icon--50"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span>',title:"更多文本样式"}],[{name:"fontcolor",content:'<span style="--icon--53--before-color:rgb(0, 204, 194);" class="icon--53"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span>',title:"文字颜色"},{name:"backcolor",content:'<span style="--icon--54--before-color:rgb(0, 204, 194);" class="icon--54"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span>',title:"文字背景颜色"}],[{name:"alignment",content:'<span class="icon--55"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></span>',title:"对齐方式"}],[{name:"unorderedlist",icon:'<span class="icon--59"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span><span class="path5"></span><span class="path6"></span></span>',title:"无序列表"},{name:"orderedlist",icon:'<span class="icon--60"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span><span class="path5"></span></span>',title:"有序列表"},{name:"tasklist",icon:'<span class="icon--61"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span><span class="path5"></span></span>',title:"任务列表"}],[{name:"indent",title:"缩进"},"line-height"],[{name:"link",icon:'<span class="icon--65"><span class="path1"></span><span class="path2"></span></span>',title:"链接"},{name:"quote",icon:'<span class="icon--66"><span class="path1"></span><span class="path2"></span></span>',title:"引用"},{name:"hr",icon:'<span class="icon--67"></span>',title:"分割线"}]]},engineClick:function(){},checkDownLoadAuthority:function(){this.$nextTick((function(){var t=document.getElementsByTagName("video"),e=document.getElementsByTagName("audio"),n=document.getElementsByClassName("image-self");if(t)for(var r=0;r<t.length;r++)t[r].controlsList.value="nodownload",t[r].oncontextmenu=function(){return!1};if(e)for(var i=0;i<e.length;i++)e[i].controlsList.value="nodownload",e[i].oncontextmenu=function(){return!1};if(n)for(var o=0;o<n.length;o++)n[o].draggable=!1,n[o].oncontextmenu=function(){return!1}}))},getMetaData:function(t){var e=this;setTimeout((function(){var n=[],r=[],i=[],o=[],a=[],s=t.getHtml(),l=document.getElementById("article-contents"),c=document.createElement("div");c.innerHTML=s;for(var u=c.getElementsByClassName("image-self"),d=l.querySelectorAll(".data-video-content video"),h=l.querySelectorAll("div[data-card-key=audio] audio"),p=c.querySelectorAll(".iframeComponent-box .model-image-box img"),f=0;f<u.length;f++)r.push(u[f].src),n.push({src:u[f].src,alt:u[f].alt});for(var g=function(t){e.$nextTick((function(){var e,n=null===(e=d[t].parentNode.parentNode.querySelector(".video-name-box input"))||void 0===e?void 0:e.value;i.push({src:d[t].src,alt:n})}))},m=0;m<d.length;m++)g(m);for(var v=0;v<h.length;v++)"INPUT"==h[v].parentElement.lastChild.tagName?o.push({src:h[v].src,alt:h[v].parentElement.lastChild.value}):o.push({src:h[v].src,alt:h[v].parentElement.lastChild.innerText});for(var b=0;b<p.length;b++)a.push({src:p[b].src,modelName:p[b].getAttribute("model-name"),name:p[b].getAttribute("name")});e.outlineOtherData={imageData:n,videoData:i,audioData:o,moduleData:a,imageListData:r},e.engine.outlineOtherData=e.outlineOtherData}),0)},getAritcleTitle:function(t){var e=[],n=t.card;t.container.find("h1,h2,h3,h4,h5,h6").each((function(t){var r,i=Object(D["$"])(t);n.closest(i)||null!==(r=i.parent())&&void 0!==r&&r.isRoot()&&e.push(i.get())}));var r=this.outline.normalize(e);this.baseOutline=Object(T["a"])(r);for(var i=0;i<r.length;i++){var o=r[i];o.children=[],o.scopedSlots={title:"title"};for(var a=i+1;a<r.length;a++){if(o.level==r[a].level)break;o.depth<r[a].depth&&(r[a].isChildren=!0,o.children.push(r[a]))}}var s=function t(e){var n=!0;if(e.forEach((function(r,i){e.forEach((function(t){r.level!==t.level&&(n=!1)})),r.children.length>1&&t(r.children)})),!n){e.sort((function(t,e){return e-t}));for(var r=e.length-1;r>0;r--)e[r].level!==e[0].level&&e.splice(r,1)}};s(r),this.outlineData=r},openSearchInput:function(){this.showCatlogSearch=!0,this.$nextTick((function(){var t=document.querySelector(".catalog-toolbar .ant-select-search__field");t.focus()}))},getTreeData:function(t,e){for(var n=0;n<t.length;n++)t[n].level==e&&n},editorArticle:function(){this.isEditor?this.isShowArtileModal=!0:(this.isEditor=!this.isEditor,this.changeAddress(),this.initEditor())},addArticle:function(){var t=this,e={content:"",title:"新增文章",id:0,manuals:+this.routerQueryInfo.manuals,key:(new Date).getTime(),resourceAuthority:!1};this.routerQueryInfo.article="".concat(e.id),this.allArticleList.push(e),this.treeArticleList.push(e),setTimeout((function(){t.isEditor=!0,t.changeAddress(),t.initEditor()}),0)},deleteArticle:function(){var t=this;this.$confirm({title:"确定要删除".concat(this.nowSelectArticle.title,"吗?"),okText:"确定",cancelText:"取消",onOk:function(){return Object(N["a"])(Object(M["a"])().mark((function e(){return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(L["c"])({data:{delFlag:1,id:t.nowSelectArticle.id}});case 2:t.nowSelectArticle=t.treeArticleList[0],t.changeAddress(),location.reload();case 5:case"end":return e.stop()}}),e)})))()}})},listenDrag:function(){var t=this,e=document.getElementById("article-contents");e.ondragover=function(t){t.stopPropagation(),t.preventDefault()},e.ondrop=function(e){var n;e.stopPropagation(),e.preventDefault();var r=null===(n=e.dataTransfer.files[0])||void 0===n?void 0:n.name;if(r){var i=t.checkType(r);"image"==i?t.engine.command.execute("imageuploader",{isDragToUpload:!0,file:e.dataTransfer.files[0]}):t.$message.warn("暂不支持拖拽上传此类型文件!")}},e.onpaste=function(e){var n;if("file"===(null===(n=e.clipboardData.items[0])||void 0===n?void 0:n.kind)){var r=e.clipboardData.items[0].getAsFile().name,i=t.checkType(r);"image"==i?t.engine.command.execute("imageuploader",{isDragToUpload:!0,file:e.clipboardData.items[0].getAsFile()}):t.$message.warn("暂不支持拖拽上传此类型文件!")}}},selectArticle:function(t){this.isEditor&&void 0!==this.nowSelectArticle.id?this.$message.warn("当前处于编辑模式,请保存文章后再切换!"):(this.nowSelectArticle=t,this.changeAddress(),this.initEditor())},checkType:function(t){var e=t.substring(t.lastIndexOf("."),t.length);e=e.toLowerCase();var n=null;if(n=this.imageExtension.indexOf(e),-1!==n)return"image"},backHome:function(){this.$router.push({path:"/home"})},saveEditor:function(){var t=this;return Object(N["a"])(Object(M["a"])().mark((function e(){return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.$refs.ruleForm.validate(function(){var e=Object(N["a"])(Object(M["a"])().mark((function e(n){var r,i,o,a,s,l,c;return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!n){e.next=26;break}return e.prev=1,t.isShowReplaceInput=!1,t.pageLoading=!0,t.editorLoading=!0,t.isShowArtileModal=!1,t.nowSelectArticle&&(t.nowSelectArticle.content=t.engine.getValue()),r=t.nowSelectArticle,i=r.id,o=r.content,a=r.title,s=r.resourceAuthority,l=r.manuals,e.next=10,Object(L["c"])({data:Object(_["a"])({content:o,title:a,id:i,manuals:l,resourceAuthority:s},t.getArticleResource())});case 10:c=e.sent,t.nowSelectArticle=c.data.data,t.isEditor=!1,t.changeAddress(),t.initEditor(),location.reload(),t.editorLoading=!1,t.pageLoading=!1,e.next=26;break;case 20:e.prev=20,e.t0=e["catch"](1),t.editorLoading=!1,t.pageLoading=!1,t.isShowArtileModal=!0,t.$message.error("文章保存失败");case 26:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(t){return e.apply(this,arguments)}}());case 1:case"end":return e.stop()}}),e)})))()},getArticleResource:function(){return{model:this.outlineOtherData.moduleData.length,video:this.outlineOtherData.videoData.length,image:this.outlineOtherData.imageData.length,audio:this.outlineOtherData.audioData.length}},changeAddress:function(){this.$router.push({path:"/article",query:Object(_["a"])(Object(_["a"])({isEditor:this.isEditor},this.routerQueryInfo),{},{article:this.nowSelectArticle.id})})},initArticleTree:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=[];return o=t.filter((function(t){if(t.parentId==n)return!0})),o.length>0&&(i++,o.forEach((function(n,o){n.scopedSlots={title:"title"},n.isShowButton=!1,n.level=i,n.status="",n.updateTime=e.$getTime(n.updateTime),n.key=Object(j["isUndefined"])(r)?o:r+"-"+o,n.key=n.key.toString(),n.children=e.initArticleTree(t,n.id,n.key,i)}))),o.sort((function(t,e){return t.index-e.index})),o},logout:function(){this.$router.push("/login")},getInitData:function(){var t=this;return Object(N["a"])(Object(M["a"])().mark((function e(){var n;return Object(M["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,t.routerQueryInfo=t.$route.query,t.editorLoading=!0,t.baseRole=t.routerQueryInfo.baseRole,t.routerQueryInfo.token&&localStorage.setItem("editor_token",t.routerQueryInfo.token),e.next=7,Object(L["j"])(t.routerQueryInfo.manuals);case 7:n=e.sent,t.allArticleList=n.data.data,t.treeArticleList=t.initArticleTree(t.allArticleList),t.isEditor="true"===t.routerQueryInfo.isEditor,t.editorLoading=!1,t.pageLoading=!1,e.next=19;break;case 15:e.prev=15,e.t0=e["catch"](0),t.$message.error(e.t0.message),t.pageLoading=!1;case 19:case"end":return e.stop()}}),e,null,[[0,15]])})))()},clearSearch:function(){for(var t=0;t<this.searchElementList.length;t++){var e=document.createElement("span"),n=this.searchElementList[t].innerText;e.innerHTML=n,this.searchElementList[t].parentElement.replaceChild(e.firstChild,this.searchElementList[t])}this.searchElementList=[]},scrollToTop:function(){this.$refs.editorBody.scrollTo(0,0)},searchContent:function(t,e){var n=this;t=t.trim();var r=document.getElementById("article-contents");t.length<=0?this.clearSearch():(this.searchValue=t,this.isEditor&&(this.isShowReplaceInput=!0),this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null),this.searchTimeout=setTimeout((function(){n.clearSearch();for(var e=r.querySelectorAll("h1,h2,h3,h4,h5,h6,p,span"),i=[],o=0;o<e.length;o++)for(var a=0;a<e[o].childNodes.length;a++){var s=e[o].childNodes[a];if(3==s.nodeType&&s.nodeValue.includes(t)){var l=document.createElement("span");l.className="need-delete-ele";var c=s.nodeValue.split(t);l.innerHTML=c.join('<font class="searchText">'.concat(t,"</font>")),e[o].replaceChild(l,s),i.push(l)}}n.searchElementList=i}),300))},replaceContent:function(t){if(t.length<=0)this.$message.warn("请输入替换内容");else{for(var e=new RegExp(this.searchValue,"g"),n=0;n<this.searchElementList.length;n++){var r=document.createElement("span"),i=this.searchElementList[n].innerText;i=i.replace(e,t),r.innerHTML=i;var o=this.searchElementList[n].parentElement;o.replaceChild(r.firstChild,this.searchElementList[n])}this.searchElementList=[],this.searchContent(this.searchValue)}}}),watch:{}},fC=pC,gC=(n("411f"),Object(it["a"])(fC,E,O,!1,null,"4a73b6ac",null));e["default"]=gC.exports},"35fe":function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Curve=void 0;var i=n("6762"),o=n("5c2e"),a=n("70e6"),s=n("3911"),l=n("722a"),c=function(t){function e(e,n,r,o){var a=t.call(this)||this;return a.PRECISION=3,a.start=i.Point.create(e),a.controlPoint1=i.Point.create(n),a.controlPoint2=i.Point.create(r),a.end=i.Point.create(o),a}return r(e,t),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),e.prototype.bbox=function(){for(var t,e,n,r,i,o,s,l,c,u,d,h=this.start,p=this.controlPoint1,f=this.controlPoint2,g=this.end,m=h.x,v=h.y,b=p.x,y=p.y,w=f.x,x=f.y,C=g.x,k=g.y,A=[],S=[],E=[[],[]],O=0;O<2;O+=1)if(0===O?(e=6*m-12*b+6*w,t=-3*m+9*b-9*w+3*C,n=3*b-3*m):(e=6*v-12*y+6*x,t=-3*v+9*y-9*x+3*k,n=3*y-3*v),Math.abs(t)<1e-12){if(Math.abs(e)<1e-12)continue;r=-n/e,r>0&&r<1&&S.push(r)}else s=e*e-4*n*t,l=Math.sqrt(s),s<0||(i=(-e+l)/(2*t),i>0&&i<1&&S.push(i),o=(-e-l)/(2*t),o>0&&o<1&&S.push(o));var T=S.length,_=T;while(T)T-=1,r=S[T],d=1-r,c=d*d*d*m+3*d*d*r*b+3*d*r*r*w+r*r*r*C,E[0][T]=c,u=d*d*d*v+3*d*d*r*y+3*d*r*r*x+r*r*r*k,E[1][T]=u,A[T]={X:c,Y:u};S[_]=0,S[_+1]=1,A[_]={X:m,Y:v},A[_+1]={X:C,Y:k},E[0][_]=m,E[1][_]=v,E[0][_+1]=C,E[1][_+1]=k,S.length=_+2,E[0].length=_+2,E[1].length=_+2,A.length=_+2;var M=Math.min.apply(null,E[0]),N=Math.min.apply(null,E[1]),P=Math.max.apply(null,E[0]),L=Math.max.apply(null,E[1]);return new a.Rectangle(M,N,P-M,L-N)},e.prototype.closestPoint=function(t,e){return void 0===e&&(e={}),this.pointAtT(this.closestPointT(t,e))},e.prototype.closestPointLength=function(t,e){void 0===e&&(e={});var n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)},e.prototype.closestPointNormalizedLength=function(t,e){void 0===e&&(e={});var n=this.getOptions(e),r=this.closestPointLength(t,n);if(!r)return 0;var i=this.length(n);return 0===i?0:r/i},e.prototype.closestPointT=function(t,e){void 0===e&&(e={});var n=this.getPrecision(e),r=this.getDivisions(e),i=Math.pow(10,-n),o=null,a=0,s=0,l=0,c=0,u=0,d=null,h=r.length,p=h>0?1/h:0;r.forEach((function(e,n){var r=e.start.distance(t),i=e.end.distance(t),h=r+i;(null==d||h<d)&&(o=e,a=n*p,s=(n+1)*p,l=r,c=i,d=h,u=e.endpointDistance())}));while(1){var f=l?Math.abs(l-c)/l:0,g=null!=c?Math.abs(l-c)/c:0,m=f<i||g<i,v=!l||l<u*i,b=!c||c<u*i,y=v||b;if(m||y)return l<=c?a:s;var w=o.divide(.5);p/=2;var x=w[0].start.distance(t),C=w[0].end.distance(t),k=x+C,A=w[1].start.distance(t),S=w[1].end.distance(t),E=A+S;k<=E?(o=w[0],s-=p,l=x,c=C):(o=w[1],a+=p,l=A,c=S)}},e.prototype.closestPointTangent=function(t,e){return void 0===e&&(e={}),this.tangentAtT(this.closestPointT(t,e))},e.prototype.containsPoint=function(t,e){void 0===e&&(e={});var n=this.toPolyline(e);return n.containsPoint(t)},e.prototype.divideAt=function(t,e){if(void 0===e&&(e={}),t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);var n=this.tAt(t,e);return this.divideAtT(n)},e.prototype.divideAtLength=function(t,e){void 0===e&&(e={});var n=this.tAtLength(t,e);return this.divideAtT(n)},e.prototype.divide=function(t){return this.divideAtT(t)},e.prototype.divideAtT=function(t){var n=this.start,r=this.controlPoint1,i=this.controlPoint2,o=this.end;if(t<=0)return[new e(n,n,n,n),new e(n,r,i,o)];if(t>=1)return[new e(n,r,i,o),new e(o,o,o,o)];var a=this.getSkeletonPoints(t),s=a.startControlPoint1,l=a.startControlPoint2,c=a.divider,u=a.dividerControlPoint1,d=a.dividerControlPoint2;return[new e(n,s,l,c),new e(c,u,d,o)]},e.prototype.endpointDistance=function(){return this.start.distance(this.end)},e.prototype.getSkeletonPoints=function(t){var e=this.start,n=this.controlPoint1,r=this.controlPoint2,i=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:r.clone()};if(t>=1)return{startControlPoint1:n.clone(),startControlPoint2:r.clone(),divider:i.clone(),dividerControlPoint1:i.clone(),dividerControlPoint2:i.clone()};var a=new o.Line(e,n).pointAt(t),s=new o.Line(n,r).pointAt(t),l=new o.Line(r,i).pointAt(t),c=new o.Line(a,s).pointAt(t),u=new o.Line(s,l).pointAt(t),d=new o.Line(c,u).pointAt(t);return{startControlPoint1:a,startControlPoint2:c,divider:d,dividerControlPoint1:u,dividerControlPoint2:l}},e.prototype.getSubdivisions=function(t){void 0===t&&(t={});var n=this.getPrecision(t),r=[new e(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===n)return r;var i=this.endpointDistance(),o=Math.pow(10,-n),a=0,s=function(){a+=1;var t=[];r.forEach((function(e){var n=e.divide(.5);t.push(n[0],n[1])}));var e=t.reduce((function(t,e){return t+e.endpointDistance()}),0),n=0!==e?(e-i)/e:0;if(a>1&&n<o)return{value:t};r=t,i=e};while(1){var l=s();if("object"===typeof l)return l.value}},e.prototype.length=function(t){void 0===t&&(t={});var e=this.getDivisions(t);return e.reduce((function(t,e){return t+e.endpointDistance()}),0)},e.prototype.lengthAtT=function(t,e){if(void 0===e&&(e={}),t<=0)return 0;var n=void 0===e.precision?this.PRECISION:e.precision,r=this.divide(t)[0];return r.length({precision:n})},e.prototype.pointAt=function(t,e){if(void 0===e&&(e={}),t<=0)return this.start.clone();if(t>=1)return this.end.clone();var n=this.tAt(t,e);return this.pointAtT(n)},e.prototype.pointAtLength=function(t,e){void 0===e&&(e={});var n=this.tAtLength(t,e);return this.pointAtT(n)},e.prototype.pointAtT=function(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider},e.prototype.isDifferentiable=function(){var t=this.start,e=this.controlPoint1,n=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(r))},e.prototype.tangentAt=function(t,e){if(void 0===e&&(e={}),!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);var n=this.tAt(t,e);return this.tangentAtT(n)},e.prototype.tangentAtLength=function(t,e){if(void 0===e&&(e={}),!this.isDifferentiable())return null;var n=this.tAtLength(t,e);return this.tangentAtT(n)},e.prototype.tangentAtT=function(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);var e=this.getSkeletonPoints(t),n=e.startControlPoint2,r=e.dividerControlPoint1,i=e.divider,a=new o.Line(n,r);return a.translate(i.x-n.x,i.y-n.y),a},e.prototype.getPrecision=function(t){return void 0===t&&(t={}),null==t.precision?this.PRECISION:t.precision},e.prototype.getDivisions=function(t){if(void 0===t&&(t={}),null!=t.subdivisions)return t.subdivisions;var e=this.getPrecision(t);return this.getSubdivisions({precision:e})},e.prototype.getOptions=function(t){void 0===t&&(t={});var e=this.getPrecision(t),n=this.getDivisions(t);return{precision:e,subdivisions:n}},e.prototype.tAt=function(t,e){if(void 0===e&&(e={}),t<=0)return 0;if(t>=1)return 1;var n=this.getOptions(e),r=this.length(n),i=r*t;return this.tAtLength(i,n)},e.prototype.tAtLength=function(t,e){void 0===e&&(e={});var n=!0;t<0&&(n=!1,t=-t);for(var r,i,o=this.getPrecision(e),a=this.getDivisions(e),s={precision:o,subdivisions:a},l=null,c=0,u=0,d=0,h=a.length,p=h>0?1/h:0,f=0;f<h;f+=1){var g=n?f:h-1-f,m=a[f],v=m.endpointDistance();if(t<=d+v){l=m,r=g*p,i=(g+1)*p,c=n?t-d:v+d-t,u=n?v+d-t:t-d;break}d+=v}if(null==l)return n?1:0;var b=this.length(s),y=Math.pow(10,-o);while(1){var w=void 0;if(w=0!==b?c/b:0,w<y)return r;if(w=0!==b?u/b:0,w<y)return i;var x=void 0,C=void 0,k=l.divide(.5);p/=2;var A=k[0].endpointDistance(),S=k[1].endpointDistance();c<=A?(l=k[0],i-=p,x=c,C=A-x):(l=k[1],r+=p,x=c-A,C=S-x),c=x,u=C}},e.prototype.toPoints=function(t){void 0===t&&(t={});var e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach((function(t){return n.push(t.end.clone())})),n},e.prototype.toPolyline=function(t){return void 0===t&&(t={}),new s.Polyline(this.toPoints(t))},e.prototype.scale=function(t,e,n){return this.start.scale(t,e,n),this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this},e.prototype.rotate=function(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this},e.prototype.translate=function(t,e){return"number"===typeof t?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this},e.prototype.equals=function(t){return null!=t&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)},e.prototype.clone=function(){return new e(this.start,this.controlPoint1,this.controlPoint2,this.end)},e.prototype.toJSON=function(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}},e.prototype.serialize=function(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")},e}(l.Geometry);e.Curve=c,function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;try{if((null==n||n===t.toStringTag)&&i.Point.isPoint(r.start)&&i.Point.isPoint(r.controlPoint1)&&i.Point.isPoint(r.controlPoint2)&&i.Point.isPoint(r.end)&&"function"===typeof r.toPoints&&"function"===typeof r.toPolyline)return!0}catch(o){return!1}return!1}t.toStringTag="X6.Geometry."+t.name,t.isCurve=e}(c=e.Curve||(e.Curve={})),e.Curve=c,function(t){function e(t){var e=t.length,n=[],r=[],i=2;n[0]=t[0]/i;for(var o=1;o<e;o+=1)r[o]=1/i,i=(o<e-1?4:3.5)-r[o],n[o]=(t[o]-n[o-1])/i;for(o=1;o<e;o+=1)n[e-o-1]-=r[e-o]*n[e-o];return n}function n(t){var n=t.map((function(t){return i.Point.clone(t)})),r=[],o=[],a=n.length-1;if(1===a)return r[0]=new i.Point((2*n[0].x+n[1].x)/3,(2*n[0].y+n[1].y)/3),o[0]=new i.Point(2*r[0].x-n[0].x,2*r[0].y-n[0].y),[r,o];for(var s=[],l=1;l<a-1;l+=1)s[l]=4*n[l].x+2*n[l+1].x;s[0]=n[0].x+2*n[1].x,s[a-1]=(8*n[a-1].x+n[a].x)/2;var c=e(s);for(l=1;l<a-1;l+=1)s[l]=4*n[l].y+2*n[l+1].y;s[0]=n[0].y+2*n[1].y,s[a-1]=(8*n[a-1].y+n[a].y)/2;var u=e(s);for(l=0;l<a;l+=1)r.push(new i.Point(c[l],u[l])),l<a-1?o.push(new i.Point(2*n[l+1].x-c[l+1],2*n[l+1].y-u[l+1])):o.push(new i.Point((n[a].x+c[a-1])/2,(n[a].y+u[a-1])/2));return[r,o]}function r(e){if(null==e||Array.isArray(e)&&e.length<2)throw new Error("At least 2 points are required");for(var r=n(e),o=[],a=0,s=r[0].length;a<s;a+=1){var l=new i.Point(r[0][a].x,r[0][a].y),c=new i.Point(r[1][a].x,r[1][a].y);o.push(new t(e[a],l,c,e[a+1]))}return o}t.throughPoints=r}(c=e.Curve||(e.Curve={})),e.Curve=c},3615:function(t,e,n){"use strict";function r(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}t.exports=function(t,e){var n=t.pos;while(n<t.posMax&&!r(t.src.charCodeAt(n)))n++;return n!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}},"38cf":function(t,e,n){var r=n("23e7"),i=n("1148");r({target:"String",proto:!0},{repeat:i})},"390f":function(t,e,n){"use strict";n("8609")},3911:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Polyline=void 0;var i=n("6762"),o=n("70e6"),a=n("5c2e"),s=n("722a"),l=function(t){function e(n){var r=t.call(this)||this;if(null!=n){if("string"===typeof n)return e.parse(n);r.points=n.map((function(t){return i.Point.create(t)}))}else r.points=[];return r}return r(e,t),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return 0===this.points.length?null:this.points[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return 0===this.points.length?null:this.points[this.points.length-1]},enumerable:!1,configurable:!0}),e.prototype.scale=function(t,e,n){return void 0===n&&(n=new i.Point),this.points.forEach((function(r){return r.scale(t,e,n)})),this},e.prototype.rotate=function(t,e){return this.points.forEach((function(n){return n.rotate(t,e)})),this},e.prototype.translate=function(t,e){var n=i.Point.create(t,e);return this.points.forEach((function(t){return t.translate(n.x,n.y)})),this},e.prototype.bbox=function(){if(0===this.points.length)return new o.Rectangle;for(var t=1/0,e=-1/0,n=1/0,r=-1/0,i=this.points,a=0,s=i.length;a<s;a+=1){var l=i[a],c=l.x,u=l.y;c<t&&(t=c),c>e&&(e=c),u<n&&(n=u),u>r&&(r=u)}return new o.Rectangle(t,n,e-t,r-n)},e.prototype.closestPoint=function(t){var e=this.closestPointLength(t);return this.pointAtLength(e)},e.prototype.closestPointLength=function(t){var e=this.points,n=e.length;if(0===n||1===n)return 0;for(var r=0,i=0,o=1/0,s=0,l=n-1;s<l;s+=1){var c=new a.Line(e[s],e[s+1]),u=c.length(),d=c.closestPointNormalizedLength(t),h=c.pointAt(d),p=h.squaredDistance(t);p<o&&(o=p,i=r+d*u),r+=u}return i},e.prototype.closestPointNormalizedLength=function(t){var e=this.closestPointLength(t);if(0===e)return 0;var n=this.length();return 0===n?0:e/n},e.prototype.closestPointTangent=function(t){var e=this.closestPointLength(t);return this.tangentAtLength(e)},e.prototype.containsPoint=function(t){if(0===this.points.length)return!1;for(var e=i.Point.clone(t),n=e.x,r=e.y,o=this.points,s=o.length,l=s-1,c=0,u=0;u<s;u+=1){var d=o[l],h=o[u];if(e.equals(d))return!0;var p=new a.Line(d,h);if(p.containsPoint(t))return!0;if(r<=d.y&&r>h.y||r>d.y&&r<=h.y){var f=d.x-n>h.x-n?d.x-n:h.x-n;if(f>=0){var g=new i.Point(n+f,r),m=new a.Line(t,g);p.intersectsWithLine(m)&&(c+=1)}}l=u}return c%2===1},e.prototype.intersectsWithLine=function(t){for(var e=[],n=0,r=this.points.length-1;n<r;n+=1){var i=this.points[n],o=this.points[n+1],s=t.intersectsWithLine(new a.Line(i,o));s&&e.push(s)}return e.length>0?e:null},e.prototype.isDifferentiable=function(){for(var t=0,e=this.points.length-1;t<e;t+=1){var n=this.points[t],r=this.points[t+1],i=new a.Line(n,r);if(i.isDifferentiable())return!0}return!1},e.prototype.length=function(){for(var t=0,e=0,n=this.points.length-1;e<n;e+=1){var r=this.points[e],i=this.points[e+1];t+=r.distance(i)}return t},e.prototype.pointAt=function(t){var e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();if(t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();var r=this.length(),i=r*t;return this.pointAtLength(i)},e.prototype.pointAtLength=function(t){var e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();var r=!0;t<0&&(r=!1,t=-t);for(var i=0,o=0,s=n-1;o<s;o+=1){var l=r?o:s-1-o,c=e[l],u=e[l+1],d=new a.Line(c,u),h=c.distance(u);if(t<=i+h)return d.pointAtLength((r?1:-1)*(t-i));i+=h}var p=r?e[n-1]:e[0];return p.clone()},e.prototype.tangentAt=function(t){var e=this.points,n=e.length;if(0===n||1===n)return null;t<0&&(t=0),t>1&&(t=1);var r=this.length(),i=r*t;return this.tangentAtLength(i)},e.prototype.tangentAtLength=function(t){var e=this.points,n=e.length;if(0===n||1===n)return null;var r,i=!0;t<0&&(i=!1,t=-t);for(var o=0,s=0,l=n-1;s<l;s+=1){var c=i?s:l-1-s,u=e[c],d=e[c+1],h=new a.Line(u,d),p=u.distance(d);if(h.isDifferentiable()){if(t<=o+p)return h.tangentAtLength((i?1:-1)*(t-o));r=h}o+=p}if(r){var f=i?1:0;return r.tangentAt(f)}return null},e.prototype.simplify=function(t){void 0===t&&(t={});var e=this.points;if(e.length<3)return this;var n=t.threshold||0,r=0;while(e[r+2]){var i=r,o=r+1,s=r+2,l=e[i],c=e[o],u=e[s],d=new a.Line(l,u),h=d.closestPoint(c),p=h.distance(c);p<=n?e.splice(o,1):r+=1}return this},e.prototype.toHull=function(){var t=this.points,n=t.length;if(0===n)return new e;for(var r=t[0],i=1;i<n;i+=1)(t[i].y<r.y||t[i].y===r.y&&t[i].x>r.x)&&(r=t[i]);var o=[];for(i=0;i<n;i+=1){var a=r.theta(t[i]);0===a&&(a=360),o.push([t[i],i,a])}if(o.sort((function(t,e){var n=t[2]-e[2];return 0===n&&(n=e[1]-t[1]),n})),o.length>2){var s=o[o.length-1];o.unshift(s)}var l,c={},u=[],d=function(t){return t[0].toString()+"@"+t[1]};while(0!==o.length){var h=o.pop(),p=h[0];if(!c[d(h)]){var f=!1;while(!f)if(u.length<2)u.push(h),f=!0;else{var g=u.pop(),m=g[0],v=u.pop(),b=v[0],y=b.cross(m,p);if(y<0)u.push(v),u.push(g),u.push(h),f=!0;else if(0===y){var w=1e-10,x=m.angleBetween(b,p);Math.abs(x-180)<w||m.equals(p)||b.equals(m)?(c[d(g)]=m,u.push(v)):Math.abs((x+1)%360-1)<w&&(u.push(v),o.push(g))}else c[d(g)]=m,u.push(v)}}}u.length>2&&u.pop();for(var C=-1,k=(i=0,u.length);i<k;i+=1){var A=u[i][1];(void 0===l||A<l)&&(l=A,C=i)}var S=[];if(C>0){var E=u.slice(C),O=u.slice(0,C);S=E.concat(O)}else S=u;var T=[];for(i=0,k=S.length;i<k;i+=1)T.push(S[i][0]);return new e(T)},e.prototype.equals=function(t){var e=this;return null!=t&&(t.points.length===this.points.length&&t.points.every((function(t,n){return t.equals(e.points[n])})))},e.prototype.clone=function(){return new e(this.points.map((function(t){return t.clone()})))},e.prototype.toJSON=function(){return this.points.map((function(t){return t.toJSON()}))},e.prototype.serialize=function(){return this.points.map((function(t){return t.x+", "+t.y})).join(" ")},e}(s.Geometry);e.Polyline=l,function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"function"===typeof r.toHull&&"function"===typeof r.simplify}t.toStringTag="X6.Geometry."+t.name,t.isPolyline=e}(l=e.Polyline||(e.Polyline={})),e.Polyline=l,function(t){function e(e){var n=e.trim();if(""===n)return new t;for(var r=[],i=n.split(/\s*,\s*|\s+/),o=0,a=i.length;o<a;o+=2)r.push({x:+i[o],y:+i[o+1]});return new t(r)}t.parse=e}(l=e.Polyline||(e.Polyline={})),e.Polyline=l},3919:function(t,e,n){var r=t.exports={name:"text0",uri:"http://sharejs.org/types/textv0",create:function(t){if(null!=t&&"string"!==typeof t)throw new Error("Initial data must be a string");return t||""}},i=function(t,e,n){return t.slice(0,e)+n+t.slice(e)},o=function(t){if("number"!==typeof t.p)throw new Error("component missing position field");if("string"===typeof t.i===("string"===typeof t.d))throw new Error("component needs an i or d field");if(t.p<0)throw new Error("position cannot be negative")},a=function(t){for(var e=0;e<t.length;e++)o(t[e])};r.apply=function(t,e){var n;a(e);for(var r=0;r<e.length;r++){var o=e[r];if(null!=o.i)t=i(t,o.p,o.i);else{if(n=t.slice(o.p,o.p+o.d.length),o.d!==n)throw new Error("Delete component '"+o.d+"' does not match deleted text '"+n+"'");t=t.slice(0,o.p)+t.slice(o.p+o.d.length)}}return t};var s=r._append=function(t,e){if(""!==e.i&&""!==e.d)if(0===t.length)t.push(e);else{var n=t[t.length-1];null!=n.i&&null!=e.i&&n.p<=e.p&&e.p<=n.p+n.i.length?t[t.length-1]={i:i(n.i,e.p-n.p,e.i),p:n.p}:null!=n.d&&null!=e.d&&e.p<=n.p&&n.p<=e.p+e.d.length?t[t.length-1]={d:i(e.d,n.p-e.p,n.d),p:e.p}:t.push(e)}};r.compose=function(t,e){a(t),a(e);for(var n=t.slice(),r=0;r<e.length;r++)s(n,e[r]);return n},r.normalize=function(t){var e=[];null==t.i&&null==t.p||(t=[t]);for(var n=0;n<t.length;n++){var r=t[n];null==r.p&&(r.p=0),s(e,r)}return e};var l=function(t,e,n){return null!=e.i?e.p<t||e.p===t&&n?t+e.i.length:t:t<=e.p?t:t<=e.p+e.d.length?e.p:t-e.d.length};r.transformCursor=function(t,e,n){for(var r="right"===n,i=0;i<e.length;i++)t=l(t,e[i],r);return t};var c=r._tc=function(t,e,n,r){if(o(e),o(n),null!=e.i)s(t,{i:e.i,p:l(e.p,n,"right"===r)});else if(null!=n.i){var i=e.d;e.p<n.p&&(s(t,{d:i.slice(0,n.p-e.p),p:e.p}),i=i.slice(n.p-e.p)),""!==i&&s(t,{d:i,p:e.p+n.i.length})}else if(e.p>=n.p+n.d.length)s(t,{d:e.d,p:e.p-n.d.length});else if(e.p+e.d.length<=n.p)s(t,e);else{var a={d:"",p:e.p};e.p<n.p&&(a.d=e.d.slice(0,n.p-e.p)),e.p+e.d.length>n.p+n.d.length&&(a.d+=e.d.slice(n.p+n.d.length-e.p));var c=Math.max(e.p,n.p),u=Math.min(e.p+e.d.length,n.p+n.d.length),d=e.d.slice(c-e.p,u-e.p),h=n.d.slice(c-n.p,u-n.p);if(d!==h)throw new Error("Delete ops delete different text in the same region of the document");""!==a.d&&(a.p=l(a.p,n),s(t,a))}return t},u=function(t){return null!=t.i?{d:t.i,p:t.p}:{i:t.d,p:t.p}};r.invert=function(t){t=t.slice().reverse();for(var e=0;e<t.length;e++)t[e]=u(t[e]);return t},n("cda8")(r,c,a,s)},"3a7b":function(t,e,n){"use strict";var r=n("ebb5"),i=n("b727").findIndex,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("findIndex",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"3b2f":function(t,e,n){(function(e,n){t.exports=n()})("undefined"!==typeof self&&self,(function(){return function(){"use strict";var t={};!function(){t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})}}(),function(){t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}();var e={};t.d(e,{default:function(){return yo}});var n=function t(e,n){this.position=void 0;var r,i="KaTeX parse error: "+e,o=n&&n.loc;if(o&&o.start<=o.end){var a=o.lexer.input;r=o.start;var s=o.end;r===a.length?i+=" at end of input: ":i+=" at position "+(r+1)+": ";var l,c,u=a.slice(r,s).replace(/[^]/g,"$&̲");l=r>15?"…"+a.slice(r-15,r):a.slice(0,r),c=s+15<a.length?a.slice(s,s+15)+"…":a.slice(s),i+=l+u+c}var d=new Error(i);return d.name="ParseError",d.__proto__=t.prototype,d.position=r,d};n.prototype.__proto__=Error.prototype;var r=n,i=function(t,e){return-1!==t.indexOf(e)},o=function(t,e){return void 0===t?e:t},a=/([A-Z])/g,s=function(t){return t.replace(a,"-$1").toLowerCase()},l={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},c=/[&><"']/g;function u(t){return String(t).replace(c,(function(t){return l[t]}))}var d=function t(e){return"ordgroup"===e.type||"color"===e.type?1===e.body.length?t(e.body[0]):e:"font"===e.type?t(e.body):e},h=function(t){var e=d(t);return"mathord"===e.type||"textord"===e.type||"atom"===e.type},p=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},f=function(t){var e=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(t);return null!=e?e[1]:"_relative"},g={contains:i,deflt:o,escape:u,hyphenate:s,getBaseElem:d,isCharacterBox:h,protocolFromUrl:f},m={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:function(t){return"#"+t}},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:function(t,e){return e.push(t),e}},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:function(t){return Math.max(0,t)},cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:function(t){return Math.max(0,t)},cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:function(t){return Math.max(0,t)},cli:"-e, --max-expand <n>",cliProcessor:function(t){return"Infinity"===t?1/0:parseInt(t)}},globalGroup:{type:"boolean",cli:!1}};function v(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if("string"!==typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}var b=function(){function t(t){for(var e in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{},m)if(m.hasOwnProperty(e)){var n=m[e];this[e]=void 0!==t[e]?n.processor?n.processor(t[e]):t[e]:v(n)}}var e=t.prototype;return e.reportNonstrict=function(t,e,n){var i=this.strict;if("function"===typeof i&&(i=i(t,e,n)),i&&"ignore"!==i){if(!0===i||"error"===i)throw new r("LaTeX-incompatible input and strict mode is set to 'error': "+e+" ["+t+"]",n);"warn"===i?"undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+e+" ["+t+"]"):"undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+i+"': "+e+" ["+t+"]")}},e.useStrictBehavior=function(t,e,n){var r=this.strict;if("function"===typeof r)try{r=r(t,e,n)}catch(i){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+e+" ["+t+"]"),!1):("undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+e+" ["+t+"]"),!1)))},e.isTrusted=function(t){t.url&&!t.protocol&&(t.protocol=g.protocolFromUrl(t.url));var e="function"===typeof this.trust?this.trust(t):this.trust;return Boolean(e)},t}(),y=function(){function t(t,e,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=e,this.cramped=n}var e=t.prototype;return e.sup=function(){return T[_[this.id]]},e.sub=function(){return T[M[this.id]]},e.fracNum=function(){return T[N[this.id]]},e.fracDen=function(){return T[P[this.id]]},e.cramp=function(){return T[L[this.id]]},e.text=function(){return T[D[this.id]]},e.isTight=function(){return this.size>=2},t}(),w=0,x=1,C=2,k=3,A=4,S=5,E=6,O=7,T=[new y(w,0,!1),new y(x,0,!0),new y(C,1,!1),new y(k,1,!0),new y(A,2,!1),new y(S,2,!0),new y(E,3,!1),new y(O,3,!0)],_=[A,S,A,S,E,O,E,O],M=[S,S,S,S,O,O,O,O],N=[C,k,A,S,E,O,E,O],P=[k,k,S,S,O,O,O,O],L=[x,x,k,k,S,S,O,O],D=[w,x,C,k,C,k,C,k],j={DISPLAY:T[w],TEXT:T[C],SCRIPT:T[A],SCRIPTSCRIPT:T[E]},I=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function R(t){for(var e=0;e<I.length;e++)for(var n=I[e],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(t>=i[0]&&t<=i[1])return n.name}return null}var F=[];function B(t){for(var e=0;e<F.length;e+=2)if(t>=F[e]&&t<=F[e+1])return!0;return!1}I.forEach((function(t){return t.blocks.forEach((function(t){return F.push.apply(F,t)}))}));var z=80,H=function(t,e){return"M95,"+(622+t+e)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+t/2.075+" -"+t+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+t)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+t)+" "+e+"h400000v"+(40+t)+"h-400000z"},V=function(t,e){return"M263,"+(601+t+e)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+t/2.084+" -"+t+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+t)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"},q=function(t,e){return"M983 "+(10+t+e)+"\nl"+t/3.13+" -"+t+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+t)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"},U=function(t,e){return"M424,"+(2398+t+e)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+t/4.223+" -"+t+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+t)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+t)+" "+e+"\nh400000v"+(40+t)+"h-400000z"},W=function(t,e){return"M473,"+(2713+t+e)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+t/5.298+" -"+t+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+t)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+t)+" "+e+"h400000v"+(40+t)+"H1017.7z"},$=function(t){var e=t/2;return"M400000 "+t+" H0 L"+e+" 0 l65 45 L145 "+(t-80)+" H400000z"},G=function(t,e,n){var r=n-54-e-t;return"M702 "+(t+e)+"H400000"+(40+t)+"\nH742v"+r+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+e+"H400000v"+(40+t)+"H742z"},Y=function(t,e,n){e*=1e3;var r="";switch(t){case"sqrtMain":r=H(e,z);break;case"sqrtSize1":r=V(e,z);break;case"sqrtSize2":r=q(e,z);break;case"sqrtSize3":r=U(e,z);break;case"sqrtSize4":r=W(e,z);break;case"sqrtTall":r=G(e,z,n)}return r},X=function(t,e){switch(t){case"⎜":return"M291 0 H417 V"+e+" H291z M291 0 H417 V"+e+" H291z";case"":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145z";case"∥":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145zM367 0 H410 V"+e+" H367z M367 0 H410 V"+e+" H367z";case"⎟":return"M457 0 H583 V"+e+" H457z M457 0 H583 V"+e+" H457z";case"⎢":return"M319 0 H403 V"+e+" H319z M319 0 H403 V"+e+" H319z";case"⎥":return"M263 0 H347 V"+e+" H263z M263 0 H347 V"+e+" H263z";case"⎪":return"M384 0 H504 V"+e+" H384z M384 0 H504 V"+e+" H384z";case"⏐":return"M312 0 H355 V"+e+" H312z M312 0 H355 V"+e+" H312z";case"‖":return"M257 0 H300 V"+e+" H257z M257 0 H300 V"+e+" H257zM478 0 H521 V"+e+" H478z M478 0 H521 V"+e+" H478z";default:return""}},K={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},Z=function(){function t(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var e=t.prototype;return e.hasClass=function(t){return g.contains(this.classes,t)},e.toNode=function(){for(var t=document.createDocumentFragment(),e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t},e.toMarkup=function(){for(var t="",e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t},e.toText=function(){var t=function(t){return t.toText()};return this.children.map(t).join("")},t}(),J={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Q={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},tt={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function et(t,e){J[t]=e}function nt(t,e,n){if(!J[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),i=J[e][r];if(!i&&t[0]in tt&&(r=tt[t[0]].charCodeAt(0),i=J[e][r]),i||"text"!==n||B(r)&&(i=J[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var rt={};function it(t){var e;if(e=t>=5?0:t>=3?1:2,!rt[e]){var n=rt[e]={cssEmPerMu:Q.quad[e]/18};for(var r in Q)Q.hasOwnProperty(r)&&(n[r]=Q[r][e])}return rt[e]}var ot=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],at=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],st=function(t,e){return e.size<2?t:ot[t-1][e.size-1]},lt=function(){function t(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||t.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=at[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}var e=t.prototype;return e.extend=function(e){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return new t(n)},e.havingStyle=function(t){return this.style===t?this:this.extend({style:t,size:st(this.textSize,t)})},e.havingCrampedStyle=function(){return this.havingStyle(this.style.cramp())},e.havingSize=function(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:at[t-1]})},e.havingBaseStyle=function(e){e=e||this.style.text();var n=st(t.BASESIZE,e);return this.size===n&&this.textSize===t.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})},e.havingBaseSizing=function(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})},e.withColor=function(t){return this.extend({color:t})},e.withPhantom=function(){return this.extend({phantom:!0})},e.withFont=function(t){return this.extend({font:t})},e.withTextFontFamily=function(t){return this.extend({fontFamily:t,font:""})},e.withTextFontWeight=function(t){return this.extend({fontWeight:t,font:""})},e.withTextFontShape=function(t){return this.extend({fontShape:t,font:""})},e.sizingClasses=function(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]},e.baseSizingClasses=function(){return this.size!==t.BASESIZE?["sizing","reset-size"+this.size,"size"+t.BASESIZE]:[]},e.fontMetrics=function(){return this._fontMetrics||(this._fontMetrics=it(this.size)),this._fontMetrics},e.getColor=function(){return this.phantom?"transparent":this.color},t}();lt.BASESIZE=6;var ct=lt,ut={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},dt={ex:!0,em:!0,mu:!0},ht=function(t){return"string"!==typeof t&&(t=t.unit),t in ut||t in dt||"ex"===t},pt=function(t,e){var n;if(t.unit in ut)n=ut[t.unit]/e.fontMetrics().ptPerEm/e.sizeMultiplier;else if("mu"===t.unit)n=e.fontMetrics().cssEmPerMu;else{var i;if(i=e.style.isTight()?e.havingStyle(e.style.text()):e,"ex"===t.unit)n=i.fontMetrics().xHeight;else{if("em"!==t.unit)throw new r("Invalid unit: '"+t.unit+"'");n=i.fontMetrics().quad}i!==e&&(n*=i.sizeMultiplier/e.sizeMultiplier)}return Math.min(t.number*n,e.maxSize)},ft=function(t){return+t.toFixed(4)+"em"},gt=function(t){return t.filter((function(t){return t})).join(" ")},mt=function(t,e,n){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},e){e.style.isTight()&&this.classes.push("mtight");var r=e.getColor();r&&(this.style.color=r)}},vt=function(t){var e=document.createElement(t);for(var n in e.className=gt(this.classes),this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&e.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)e.appendChild(this.children[i].toNode());return e},bt=function(t){var e="<"+t;this.classes.length&&(e+=' class="'+g.escape(gt(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=g.hyphenate(r)+":"+this.style[r]+";");for(var i in n&&(e+=' style="'+g.escape(n)+'"'),this.attributes)this.attributes.hasOwnProperty(i)&&(e+=" "+i+'="'+g.escape(this.attributes[i])+'"');e+=">";for(var o=0;o<this.children.length;o++)e+=this.children[o].toMarkup();return e+="</"+t+">",e},yt=function(){function t(t,e,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,mt.call(this,t,n,r),this.children=e||[]}var e=t.prototype;return e.setAttribute=function(t,e){this.attributes[t]=e},e.hasClass=function(t){return g.contains(this.classes,t)},e.toNode=function(){return vt.call(this,"span")},e.toMarkup=function(){return bt.call(this,"span")},t}(),wt=function(){function t(t,e,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,mt.call(this,e,r),this.children=n||[],this.setAttribute("href",t)}var e=t.prototype;return e.setAttribute=function(t,e){this.attributes[t]=e},e.hasClass=function(t){return g.contains(this.classes,t)},e.toNode=function(){return vt.call(this,"a")},e.toMarkup=function(){return bt.call(this,"a")},t}(),xt=function(){function t(t,e,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=e,this.src=t,this.classes=["mord"],this.style=n}var e=t.prototype;return e.hasClass=function(t){return g.contains(this.classes,t)},e.toNode=function(){var t=document.createElement("img");for(var e in t.src=this.src,t.alt=this.alt,t.className="mord",this.style)this.style.hasOwnProperty(e)&&(t.style[e]=this.style[e]);return t},e.toMarkup=function(){var t="<img src='"+this.src+" 'alt='"+this.alt+"' ",e="";for(var n in this.style)this.style.hasOwnProperty(n)&&(e+=g.hyphenate(n)+":"+this.style[n]+";");return e&&(t+=' style="'+g.escape(e)+'"'),t+="'/>",t},t}(),Ct={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"},kt=function(){function t(t,e,n,r,i,o,a,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=e||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=o||0,this.classes=a||[],this.style=s||{},this.maxFontSize=0;var l=R(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Ct[this.text])}var e=t.prototype;return e.hasClass=function(t){return g.contains(this.classes,t)},e.toNode=function(){var t=document.createTextNode(this.text),e=null;for(var n in this.italic>0&&(e=document.createElement("span"),e.style.marginRight=ft(this.italic)),this.classes.length>0&&(e=e||document.createElement("span"),e.className=gt(this.classes)),this.style)this.style.hasOwnProperty(n)&&(e=e||document.createElement("span"),e.style[n]=this.style[n]);return e?(e.appendChild(t),e):t},e.toMarkup=function(){var t=!1,e="<span";this.classes.length&&(t=!0,e+=' class="',e+=g.escape(gt(this.classes)),e+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=g.hyphenate(r)+":"+this.style[r]+";");n&&(t=!0,e+=' style="'+g.escape(n)+'"');var i=g.escape(this.text);return t?(e+=">",e+=i,e+="</span>",e):i},t}(),At=function(){function t(t,e){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=e||{}}var e=t.prototype;return e.toNode=function(){var t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)e.appendChild(this.children[r].toNode());return e},e.toMarkup=function(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+"='"+this.attributes[e]+"'");t+=">";for(var n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t+="</svg>",t},t}(),St=function(){function t(t,e){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=e}var e=t.prototype;return e.toNode=function(){var t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",K[this.pathName]),e},e.toMarkup=function(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+K[this.pathName]+"'/>"},t}(),Et=function(){function t(t){this.attributes=void 0,this.attributes=t||{}}var e=t.prototype;return e.toNode=function(){var t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);return e},e.toMarkup=function(){var t="<line";for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+"='"+this.attributes[e]+"'");return t+="/>",t},t}();function Ot(t){if(t instanceof kt)return t;throw new Error("Expected symbolNode but got "+String(t)+".")}function Tt(t){if(t instanceof yt)return t;throw new Error("Expected span<HtmlDomNode> but got "+String(t)+".")}var _t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Mt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Nt={math:{},text:{}},Pt=Nt;function Lt(t,e,n,r,i,o){Nt[t][i]={font:e,group:n,replace:r},o&&r&&(Nt[t][r]=Nt[t][i])}var Dt="math",jt="text",It="main",Rt="ams",Ft="accent-token",Bt="bin",zt="close",Ht="inner",Vt="mathord",qt="op-token",Ut="open",Wt="punct",$t="rel",Gt="spacing",Yt="textord";Lt(Dt,It,$t,"≡","\\equiv",!0),Lt(Dt,It,$t,"≺","\\prec",!0),Lt(Dt,It,$t,"≻","\\succ",!0),Lt(Dt,It,$t,"","\\sim",!0),Lt(Dt,It,$t,"⊥","\\perp"),Lt(Dt,It,$t,"⪯","\\preceq",!0),Lt(Dt,It,$t,"⪰","\\succeq",!0),Lt(Dt,It,$t,"≃","\\simeq",!0),Lt(Dt,It,$t,"","\\mid",!0),Lt(Dt,It,$t,"≪","\\ll",!0),Lt(Dt,It,$t,"≫","\\gg",!0),Lt(Dt,It,$t,"≍","\\asymp",!0),Lt(Dt,It,$t,"∥","\\parallel"),Lt(Dt,It,$t,"⋈","\\bowtie",!0),Lt(Dt,It,$t,"⌣","\\smile",!0),Lt(Dt,It,$t,"⊑","\\sqsubseteq",!0),Lt(Dt,It,$t,"⊒","\\sqsupseteq",!0),Lt(Dt,It,$t,"≐","\\doteq",!0),Lt(Dt,It,$t,"⌢","\\frown",!0),Lt(Dt,It,$t,"∋","\\ni",!0),Lt(Dt,It,$t,"∝","\\propto",!0),Lt(Dt,It,$t,"⊢","\\vdash",!0),Lt(Dt,It,$t,"⊣","\\dashv",!0),Lt(Dt,It,$t,"∋","\\owns"),Lt(Dt,It,Wt,".","\\ldotp"),Lt(Dt,It,Wt,"⋅","\\cdotp"),Lt(Dt,It,Yt,"#","\\#"),Lt(jt,It,Yt,"#","\\#"),Lt(Dt,It,Yt,"&","\\&"),Lt(jt,It,Yt,"&","\\&"),Lt(Dt,It,Yt,"ℵ","\\aleph",!0),Lt(Dt,It,Yt,"∀","\\forall",!0),Lt(Dt,It,Yt,"ℏ","\\hbar",!0),Lt(Dt,It,Yt,"∃","\\exists",!0),Lt(Dt,It,Yt,"∇","\\nabla",!0),Lt(Dt,It,Yt,"♭","\\flat",!0),Lt(Dt,It,Yt,"","\\ell",!0),Lt(Dt,It,Yt,"♮","\\natural",!0),Lt(Dt,It,Yt,"♣","\\clubsuit",!0),Lt(Dt,It,Yt,"℘","\\wp",!0),Lt(Dt,It,Yt,"♯","\\sharp",!0),Lt(Dt,It,Yt,"♢","\\diamondsuit",!0),Lt(Dt,It,Yt,"","\\Re",!0),Lt(Dt,It,Yt,"♡","\\heartsuit",!0),Lt(Dt,It,Yt,"","\\Im",!0),Lt(Dt,It,Yt,"♠","\\spadesuit",!0),Lt(Dt,It,Yt,"§","\\S",!0),Lt(jt,It,Yt,"§","\\S"),Lt(Dt,It,Yt,"¶","\\P",!0),Lt(jt,It,Yt,"¶","\\P"),Lt(Dt,It,Yt,"†","\\dag"),Lt(jt,It,Yt,"†","\\dag"),Lt(jt,It,Yt,"†","\\textdagger"),Lt(Dt,It,Yt,"‡","\\ddag"),Lt(jt,It,Yt,"‡","\\ddag"),Lt(jt,It,Yt,"‡","\\textdaggerdbl"),Lt(Dt,It,zt,"⎱","\\rmoustache",!0),Lt(Dt,It,Ut,"⎰","\\lmoustache",!0),Lt(Dt,It,zt,"⟯","\\rgroup",!0),Lt(Dt,It,Ut,"⟮","\\lgroup",!0),Lt(Dt,It,Bt,"∓","\\mp",!0),Lt(Dt,It,Bt,"⊖","\\ominus",!0),Lt(Dt,It,Bt,"⊎","\\uplus",!0),Lt(Dt,It,Bt,"⊓","\\sqcap",!0),Lt(Dt,It,Bt,"","\\ast"),Lt(Dt,It,Bt,"⊔","\\sqcup",!0),Lt(Dt,It,Bt,"◯","\\bigcirc",!0),Lt(Dt,It,Bt,"∙","\\bullet",!0),Lt(Dt,It,Bt,"‡","\\ddagger"),Lt(Dt,It,Bt,"≀","\\wr",!0),Lt(Dt,It,Bt,"⨿","\\amalg"),Lt(Dt,It,Bt,"&","\\And"),Lt(Dt,It,$t,"⟵","\\longleftarrow",!0),Lt(Dt,It,$t,"⇐","\\Leftarrow",!0),Lt(Dt,It,$t,"⟸","\\Longleftarrow",!0),Lt(Dt,It,$t,"⟶","\\longrightarrow",!0),Lt(Dt,It,$t,"⇒","\\Rightarrow",!0),Lt(Dt,It,$t,"⟹","\\Longrightarrow",!0),Lt(Dt,It,$t,"↔","\\leftrightarrow",!0),Lt(Dt,It,$t,"⟷","\\longleftrightarrow",!0),Lt(Dt,It,$t,"⇔","\\Leftrightarrow",!0),Lt(Dt,It,$t,"⟺","\\Longleftrightarrow",!0),Lt(Dt,It,$t,"↦","\\mapsto",!0),Lt(Dt,It,$t,"⟼","\\longmapsto",!0),Lt(Dt,It,$t,"↗","\\nearrow",!0),Lt(Dt,It,$t,"↩","\\hookleftarrow",!0),Lt(Dt,It,$t,"↪","\\hookrightarrow",!0),Lt(Dt,It,$t,"↘","\\searrow",!0),Lt(Dt,It,$t,"↼","\\leftharpoonup",!0),Lt(Dt,It,$t,"⇀","\\rightharpoonup",!0),Lt(Dt,It,$t,"↙","\\swarrow",!0),Lt(Dt,It,$t,"↽","\\leftharpoondown",!0),Lt(Dt,It,$t,"⇁","\\rightharpoondown",!0),Lt(Dt,It,$t,"↖","\\nwarrow",!0),Lt(Dt,It,$t,"⇌","\\rightleftharpoons",!0),Lt(Dt,Rt,$t,"≮","\\nless",!0),Lt(Dt,Rt,$t,"","\\@nleqslant"),Lt(Dt,Rt,$t,"","\\@nleqq"),Lt(Dt,Rt,$t,"⪇","\\lneq",!0),Lt(Dt,Rt,$t,"≨","\\lneqq",!0),Lt(Dt,Rt,$t,"","\\@lvertneqq"),Lt(Dt,Rt,$t,"⋦","\\lnsim",!0),Lt(Dt,Rt,$t,"⪉","\\lnapprox",!0),Lt(Dt,Rt,$t,"⊀","\\nprec",!0),Lt(Dt,Rt,$t,"⋠","\\npreceq",!0),Lt(Dt,Rt,$t,"⋨","\\precnsim",!0),Lt(Dt,Rt,$t,"⪹","\\precnapprox",!0),Lt(Dt,Rt,$t,"≁","\\nsim",!0),Lt(Dt,Rt,$t,"","\\@nshortmid"),Lt(Dt,Rt,$t,"∤","\\nmid",!0),Lt(Dt,Rt,$t,"⊬","\\nvdash",!0),Lt(Dt,Rt,$t,"⊭","\\nvDash",!0),Lt(Dt,Rt,$t,"⋪","\\ntriangleleft"),Lt(Dt,Rt,$t,"⋬","\\ntrianglelefteq",!0),Lt(Dt,Rt,$t,"⊊","\\subsetneq",!0),Lt(Dt,Rt,$t,"","\\@varsubsetneq"),Lt(Dt,Rt,$t,"⫋","\\subsetneqq",!0),Lt(Dt,Rt,$t,"","\\@varsubsetneqq"),Lt(Dt,Rt,$t,"≯","\\ngtr",!0),Lt(Dt,Rt,$t,"","\\@ngeqslant"),Lt(Dt,Rt,$t,"","\\@ngeqq"),Lt(Dt,Rt,$t,"⪈","\\gneq",!0),Lt(Dt,Rt,$t,"≩","\\gneqq",!0),Lt(Dt,Rt,$t,"","\\@gvertneqq"),Lt(Dt,Rt,$t,"⋧","\\gnsim",!0),Lt(Dt,Rt,$t,"⪊","\\gnapprox",!0),Lt(Dt,Rt,$t,"⊁","\\nsucc",!0),Lt(Dt,Rt,$t,"⋡","\\nsucceq",!0),Lt(Dt,Rt,$t,"⋩","\\succnsim",!0),Lt(Dt,Rt,$t,"⪺","\\succnapprox",!0),Lt(Dt,Rt,$t,"≆","\\ncong",!0),Lt(Dt,Rt,$t,"","\\@nshortparallel"),Lt(Dt,Rt,$t,"∦","\\nparallel",!0),Lt(Dt,Rt,$t,"⊯","\\nVDash",!0),Lt(Dt,Rt,$t,"⋫","\\ntriangleright"),Lt(Dt,Rt,$t,"⋭","\\ntrianglerighteq",!0),Lt(Dt,Rt,$t,"","\\@nsupseteqq"),Lt(Dt,Rt,$t,"⊋","\\supsetneq",!0),Lt(Dt,Rt,$t,"","\\@varsupsetneq"),Lt(Dt,Rt,$t,"⫌","\\supsetneqq",!0),Lt(Dt,Rt,$t,"","\\@varsupsetneqq"),Lt(Dt,Rt,$t,"⊮","\\nVdash",!0),Lt(Dt,Rt,$t,"⪵","\\precneqq",!0),Lt(Dt,Rt,$t,"⪶","\\succneqq",!0),Lt(Dt,Rt,$t,"","\\@nsubseteqq"),Lt(Dt,Rt,Bt,"⊴","\\unlhd"),Lt(Dt,Rt,Bt,"⊵","\\unrhd"),Lt(Dt,Rt,$t,"↚","\\nleftarrow",!0),Lt(Dt,Rt,$t,"↛","\\nrightarrow",!0),Lt(Dt,Rt,$t,"⇍","\\nLeftarrow",!0),Lt(Dt,Rt,$t,"⇏","\\nRightarrow",!0),Lt(Dt,Rt,$t,"↮","\\nleftrightarrow",!0),Lt(Dt,Rt,$t,"⇎","\\nLeftrightarrow",!0),Lt(Dt,Rt,$t,"△","\\vartriangle"),Lt(Dt,Rt,Yt,"ℏ","\\hslash"),Lt(Dt,Rt,Yt,"▽","\\triangledown"),Lt(Dt,Rt,Yt,"◊","\\lozenge"),Lt(Dt,Rt,Yt,"Ⓢ","\\circledS"),Lt(Dt,Rt,Yt,"®","\\circledR"),Lt(jt,Rt,Yt,"®","\\circledR"),Lt(Dt,Rt,Yt,"∡","\\measuredangle",!0),Lt(Dt,Rt,Yt,"∄","\\nexists"),Lt(Dt,Rt,Yt,"℧","\\mho"),Lt(Dt,Rt,Yt,"Ⅎ","\\Finv",!0),Lt(Dt,Rt,Yt,"⅁","\\Game",!0),Lt(Dt,Rt,Yt,"","\\backprime"),Lt(Dt,Rt,Yt,"▲","\\blacktriangle"),Lt(Dt,Rt,Yt,"▼","\\blacktriangledown"),Lt(Dt,Rt,Yt,"■","\\blacksquare"),Lt(Dt,Rt,Yt,"⧫","\\blacklozenge"),Lt(Dt,Rt,Yt,"★","\\bigstar"),Lt(Dt,Rt,Yt,"∢","\\sphericalangle",!0),Lt(Dt,Rt,Yt,"∁","\\complement",!0),Lt(Dt,Rt,Yt,"ð","\\eth",!0),Lt(jt,It,Yt,"ð","ð"),Lt(Dt,Rt,Yt,"","\\diagup"),Lt(Dt,Rt,Yt,"╲","\\diagdown"),Lt(Dt,Rt,Yt,"□","\\square"),Lt(Dt,Rt,Yt,"□","\\Box"),Lt(Dt,Rt,Yt,"◊","\\Diamond"),Lt(Dt,Rt,Yt,"¥","\\yen",!0),Lt(jt,Rt,Yt,"¥","\\yen",!0),Lt(Dt,Rt,Yt,"✓","\\checkmark",!0),Lt(jt,Rt,Yt,"✓","\\checkmark"),Lt(Dt,Rt,Yt,"ℶ","\\beth",!0),Lt(Dt,Rt,Yt,"ℸ","\\daleth",!0),Lt(Dt,Rt,Yt,"ℷ","\\gimel",!0),Lt(Dt,Rt,Yt,"ϝ","\\digamma",!0),Lt(Dt,Rt,Yt,"ϰ","\\varkappa"),Lt(Dt,Rt,Ut,"┌","\\@ulcorner",!0),Lt(Dt,Rt,zt,"┐","\\@urcorner",!0),Lt(Dt,Rt,Ut,"└","\\@llcorner",!0),Lt(Dt,Rt,zt,"┘","\\@lrcorner",!0),Lt(Dt,Rt,$t,"≦","\\leqq",!0),Lt(Dt,Rt,$t,"⩽","\\leqslant",!0),Lt(Dt,Rt,$t,"⪕","\\eqslantless",!0),Lt(Dt,Rt,$t,"≲","\\lesssim",!0),Lt(Dt,Rt,$t,"⪅","\\lessapprox",!0),Lt(Dt,Rt,$t,"≊","\\approxeq",!0),Lt(Dt,Rt,Bt,"⋖","\\lessdot"),Lt(Dt,Rt,$t,"⋘","\\lll",!0),Lt(Dt,Rt,$t,"≶","\\lessgtr",!0),Lt(Dt,Rt,$t,"⋚","\\lesseqgtr",!0),Lt(Dt,Rt,$t,"⪋","\\lesseqqgtr",!0),Lt(Dt,Rt,$t,"≑","\\doteqdot"),Lt(Dt,Rt,$t,"≓","\\risingdotseq",!0),Lt(Dt,Rt,$t,"≒","\\fallingdotseq",!0),Lt(Dt,Rt,$t,"∽","\\backsim",!0),Lt(Dt,Rt,$t,"⋍","\\backsimeq",!0),Lt(Dt,Rt,$t,"⫅","\\subseteqq",!0),Lt(Dt,Rt,$t,"⋐","\\Subset",!0),Lt(Dt,Rt,$t,"⊏","\\sqsubset",!0),Lt(Dt,Rt,$t,"≼","\\preccurlyeq",!0),Lt(Dt,Rt,$t,"⋞","\\curlyeqprec",!0),Lt(Dt,Rt,$t,"≾","\\precsim",!0),Lt(Dt,Rt,$t,"⪷","\\precapprox",!0),Lt(Dt,Rt,$t,"⊲","\\vartriangleleft"),Lt(Dt,Rt,$t,"⊴","\\trianglelefteq"),Lt(Dt,Rt,$t,"⊨","\\vDash",!0),Lt(Dt,Rt,$t,"⊪","\\Vvdash",!0),Lt(Dt,Rt,$t,"⌣","\\smallsmile"),Lt(Dt,Rt,$t,"⌢","\\smallfrown"),Lt(Dt,Rt,$t,"≏","\\bumpeq",!0),Lt(Dt,Rt,$t,"≎","\\Bumpeq",!0),Lt(Dt,Rt,$t,"≧","\\geqq",!0),Lt(Dt,Rt,$t,"⩾","\\geqslant",!0),Lt(Dt,Rt,$t,"⪖","\\eqslantgtr",!0),Lt(Dt,Rt,$t,"≳","\\gtrsim",!0),Lt(Dt,Rt,$t,"⪆","\\gtrapprox",!0),Lt(Dt,Rt,Bt,"⋗","\\gtrdot"),Lt(Dt,Rt,$t,"⋙","\\ggg",!0),Lt(Dt,Rt,$t,"≷","\\gtrless",!0),Lt(Dt,Rt,$t,"⋛","\\gtreqless",!0),Lt(Dt,Rt,$t,"⪌","\\gtreqqless",!0),Lt(Dt,Rt,$t,"≖","\\eqcirc",!0),Lt(Dt,Rt,$t,"≗","\\circeq",!0),Lt(Dt,Rt,$t,"≜","\\triangleq",!0),Lt(Dt,Rt,$t,"","\\thicksim"),Lt(Dt,Rt,$t,"≈","\\thickapprox"),Lt(Dt,Rt,$t,"⫆","\\supseteqq",!0),Lt(Dt,Rt,$t,"⋑","\\Supset",!0),Lt(Dt,Rt,$t,"⊐","\\sqsupset",!0),Lt(Dt,Rt,$t,"≽","\\succcurlyeq",!0),Lt(Dt,Rt,$t,"⋟","\\curlyeqsucc",!0),Lt(Dt,Rt,$t,"≿","\\succsim",!0),Lt(Dt,Rt,$t,"⪸","\\succapprox",!0),Lt(Dt,Rt,$t,"⊳","\\vartriangleright"),Lt(Dt,Rt,$t,"⊵","\\trianglerighteq"),Lt(Dt,Rt,$t,"⊩","\\Vdash",!0),Lt(Dt,Rt,$t,"","\\shortmid"),Lt(Dt,Rt,$t,"∥","\\shortparallel"),Lt(Dt,Rt,$t,"≬","\\between",!0),Lt(Dt,Rt,$t,"⋔","\\pitchfork",!0),Lt(Dt,Rt,$t,"∝","\\varpropto"),Lt(Dt,Rt,$t,"◀","\\blacktriangleleft"),Lt(Dt,Rt,$t,"∴","\\therefore",!0),Lt(Dt,Rt,$t,"∍","\\backepsilon"),Lt(Dt,Rt,$t,"▶","\\blacktriangleright"),Lt(Dt,Rt,$t,"∵","\\because",!0),Lt(Dt,Rt,$t,"⋘","\\llless"),Lt(Dt,Rt,$t,"⋙","\\gggtr"),Lt(Dt,Rt,Bt,"⊲","\\lhd"),Lt(Dt,Rt,Bt,"⊳","\\rhd"),Lt(Dt,Rt,$t,"≂","\\eqsim",!0),Lt(Dt,It,$t,"⋈","\\Join"),Lt(Dt,Rt,$t,"≑","\\Doteq",!0),Lt(Dt,Rt,Bt,"∔","\\dotplus",!0),Lt(Dt,Rt,Bt,"","\\smallsetminus"),Lt(Dt,Rt,Bt,"⋒","\\Cap",!0),Lt(Dt,Rt,Bt,"⋓","\\Cup",!0),Lt(Dt,Rt,Bt,"⩞","\\doublebarwedge",!0),Lt(Dt,Rt,Bt,"⊟","\\boxminus",!0),Lt(Dt,Rt,Bt,"⊞","\\boxplus",!0),Lt(Dt,Rt,Bt,"⋇","\\divideontimes",!0),Lt(Dt,Rt,Bt,"⋉","\\ltimes",!0),Lt(Dt,Rt,Bt,"⋊","\\rtimes",!0),Lt(Dt,Rt,Bt,"⋋","\\leftthreetimes",!0),Lt(Dt,Rt,Bt,"⋌","\\rightthreetimes",!0),Lt(Dt,Rt,Bt,"⋏","\\curlywedge",!0),Lt(Dt,Rt,Bt,"⋎","\\curlyvee",!0),Lt(Dt,Rt,Bt,"⊝","\\circleddash",!0),Lt(Dt,Rt,Bt,"⊛","\\circledast",!0),Lt(Dt,Rt,Bt,"⋅","\\centerdot"),Lt(Dt,Rt,Bt,"⊺","\\intercal",!0),Lt(Dt,Rt,Bt,"⋒","\\doublecap"),Lt(Dt,Rt,Bt,"⋓","\\doublecup"),Lt(Dt,Rt,Bt,"⊠","\\boxtimes",!0),Lt(Dt,Rt,$t,"⇢","\\dashrightarrow",!0),Lt(Dt,Rt,$t,"⇠","\\dashleftarrow",!0),Lt(Dt,Rt,$t,"⇇","\\leftleftarrows",!0),Lt(Dt,Rt,$t,"⇆","\\leftrightarrows",!0),Lt(Dt,Rt,$t,"⇚","\\Lleftarrow",!0),Lt(Dt,Rt,$t,"↞","\\twoheadleftarrow",!0),Lt(Dt,Rt,$t,"↢","\\leftarrowtail",!0),Lt(Dt,Rt,$t,"↫","\\looparrowleft",!0),Lt(Dt,Rt,$t,"⇋","\\leftrightharpoons",!0),Lt(Dt,Rt,$t,"↶","\\curvearrowleft",!0),Lt(Dt,Rt,$t,"↺","\\circlearrowleft",!0),Lt(Dt,Rt,$t,"↰","\\Lsh",!0),Lt(Dt,Rt,$t,"⇈","\\upuparrows",!0),Lt(Dt,Rt,$t,"↿","\\upharpoonleft",!0),Lt(Dt,Rt,$t,"⇃","\\downharpoonleft",!0),Lt(Dt,It,$t,"⊶","\\origof",!0),Lt(Dt,It,$t,"⊷","\\imageof",!0),Lt(Dt,Rt,$t,"⊸","\\multimap",!0),Lt(Dt,Rt,$t,"↭","\\leftrightsquigarrow",!0),Lt(Dt,Rt,$t,"⇉","\\rightrightarrows",!0),Lt(Dt,Rt,$t,"⇄","\\rightleftarrows",!0),Lt(Dt,Rt,$t,"↠","\\twoheadrightarrow",!0),Lt(Dt,Rt,$t,"↣","\\rightarrowtail",!0),Lt(Dt,Rt,$t,"↬","\\looparrowright",!0),Lt(Dt,Rt,$t,"↷","\\curvearrowright",!0),Lt(Dt,Rt,$t,"↻","\\circlearrowright",!0),Lt(Dt,Rt,$t,"↱","\\Rsh",!0),Lt(Dt,Rt,$t,"⇊","\\downdownarrows",!0),Lt(Dt,Rt,$t,"↾","\\upharpoonright",!0),Lt(Dt,Rt,$t,"⇂","\\downharpoonright",!0),Lt(Dt,Rt,$t,"⇝","\\rightsquigarrow",!0),Lt(Dt,Rt,$t,"⇝","\\leadsto"),Lt(Dt,Rt,$t,"⇛","\\Rrightarrow",!0),Lt(Dt,Rt,$t,"↾","\\restriction"),Lt(Dt,It,Yt,"","`"),Lt(Dt,It,Yt,"$","\\$"),Lt(jt,It,Yt,"$","\\$"),Lt(jt,It,Yt,"$","\\textdollar"),Lt(Dt,It,Yt,"%","\\%"),Lt(jt,It,Yt,"%","\\%"),Lt(Dt,It,Yt,"_","\\_"),Lt(jt,It,Yt,"_","\\_"),Lt(jt,It,Yt,"_","\\textunderscore"),Lt(Dt,It,Yt,"∠","\\angle",!0),Lt(Dt,It,Yt,"∞","\\infty",!0),Lt(Dt,It,Yt,"","\\prime"),Lt(Dt,It,Yt,"△","\\triangle"),Lt(Dt,It,Yt,"Γ","\\Gamma",!0),Lt(Dt,It,Yt,"Δ","\\Delta",!0),Lt(Dt,It,Yt,"Θ","\\Theta",!0),Lt(Dt,It,Yt,"Λ","\\Lambda",!0),Lt(Dt,It,Yt,"Ξ","\\Xi",!0),Lt(Dt,It,Yt,"Π","\\Pi",!0),Lt(Dt,It,Yt,"Σ","\\Sigma",!0),Lt(Dt,It,Yt,"Υ","\\Upsilon",!0),Lt(Dt,It,Yt,"Φ","\\Phi",!0),Lt(Dt,It,Yt,"Ψ","\\Psi",!0),Lt(Dt,It,Yt,"Ω","\\Omega",!0),Lt(Dt,It,Yt,"A","Α"),Lt(Dt,It,Yt,"B","Β"),Lt(Dt,It,Yt,"E","Ε"),Lt(Dt,It,Yt,"Z","Ζ"),Lt(Dt,It,Yt,"H","Η"),Lt(Dt,It,Yt,"I","Ι"),Lt(Dt,It,Yt,"K","Κ"),Lt(Dt,It,Yt,"M","Μ"),Lt(Dt,It,Yt,"N","Ν"),Lt(Dt,It,Yt,"O","Ο"),Lt(Dt,It,Yt,"P","Ρ"),Lt(Dt,It,Yt,"T","Τ"),Lt(Dt,It,Yt,"X","Χ"),Lt(Dt,It,Yt,"¬","\\neg",!0),Lt(Dt,It,Yt,"¬","\\lnot"),Lt(Dt,It,Yt,"","\\top"),Lt(Dt,It,Yt,"⊥","\\bot"),Lt(Dt,It,Yt,"∅","\\emptyset"),Lt(Dt,Rt,Yt,"∅","\\varnothing"),Lt(Dt,It,Vt,"α","\\alpha",!0),Lt(Dt,It,Vt,"β","\\beta",!0),Lt(Dt,It,Vt,"γ","\\gamma",!0),Lt(Dt,It,Vt,"δ","\\delta",!0),Lt(Dt,It,Vt,"ϵ","\\epsilon",!0),Lt(Dt,It,Vt,"ζ","\\zeta",!0),Lt(Dt,It,Vt,"η","\\eta",!0),Lt(Dt,It,Vt,"θ","\\theta",!0),Lt(Dt,It,Vt,"ι","\\iota",!0),Lt(Dt,It,Vt,"κ","\\kappa",!0),Lt(Dt,It,Vt,"λ","\\lambda",!0),Lt(Dt,It,Vt,"μ","\\mu",!0),Lt(Dt,It,Vt,"ν","\\nu",!0),Lt(Dt,It,Vt,"ξ","\\xi",!0),Lt(Dt,It,Vt,"ο","\\omicron",!0),Lt(Dt,It,Vt,"π","\\pi",!0),Lt(Dt,It,Vt,"ρ","\\rho",!0),Lt(Dt,It,Vt,"σ","\\sigma",!0),Lt(Dt,It,Vt,"τ","\\tau",!0),Lt(Dt,It,Vt,"υ","\\upsilon",!0),Lt(Dt,It,Vt,"ϕ","\\phi",!0),Lt(Dt,It,Vt,"χ","\\chi",!0),Lt(Dt,It,Vt,"ψ","\\psi",!0),Lt(Dt,It,Vt,"ω","\\omega",!0),Lt(Dt,It,Vt,"ε","\\varepsilon",!0),Lt(Dt,It,Vt,"ϑ","\\vartheta",!0),Lt(Dt,It,Vt,"ϖ","\\varpi",!0),Lt(Dt,It,Vt,"ϱ","\\varrho",!0),Lt(Dt,It,Vt,"ς","\\varsigma",!0),Lt(Dt,It,Vt,"φ","\\varphi",!0),Lt(Dt,It,Bt,"","*",!0),Lt(Dt,It,Bt,"+","+"),Lt(Dt,It,Bt,"","-",!0),Lt(Dt,It,Bt,"⋅","\\cdot",!0),Lt(Dt,It,Bt,"∘","\\circ",!0),Lt(Dt,It,Bt,"÷","\\div",!0),Lt(Dt,It,Bt,"±","\\pm",!0),Lt(Dt,It,Bt,"×","\\times",!0),Lt(Dt,It,Bt,"∩","\\cap",!0),Lt(Dt,It,Bt,"","\\cup",!0),Lt(Dt,It,Bt,"","\\setminus",!0),Lt(Dt,It,Bt,"∧","\\land"),Lt(Dt,It,Bt,"","\\lor"),Lt(Dt,It,Bt,"∧","\\wedge",!0),Lt(Dt,It,Bt,"","\\vee",!0),Lt(Dt,It,Yt,"√","\\surd"),Lt(Dt,It,Ut,"⟨","\\langle",!0),Lt(Dt,It,Ut,"","\\lvert"),Lt(Dt,It,Ut,"∥","\\lVert"),Lt(Dt,It,zt,"?","?"),Lt(Dt,It,zt,"!","!"),Lt(Dt,It,zt,"⟩","\\rangle",!0),Lt(Dt,It,zt,"","\\rvert"),Lt(Dt,It,zt,"∥","\\rVert"),Lt(Dt,It,$t,"=","="),Lt(Dt,It,$t,":",":"),Lt(Dt,It,$t,"≈","\\approx",!0),Lt(Dt,It,$t,"≅","\\cong",!0),Lt(Dt,It,$t,"≥","\\ge"),Lt(Dt,It,$t,"≥","\\geq",!0),Lt(Dt,It,$t,"←","\\gets"),Lt(Dt,It,$t,">","\\gt",!0),Lt(Dt,It,$t,"∈","\\in",!0),Lt(Dt,It,$t,"","\\@not"),Lt(Dt,It,$t,"⊂","\\subset",!0),Lt(Dt,It,$t,"⊃","\\supset",!0),Lt(Dt,It,$t,"⊆","\\subseteq",!0),Lt(Dt,It,$t,"⊇","\\supseteq",!0),Lt(Dt,Rt,$t,"⊈","\\nsubseteq",!0),Lt(Dt,Rt,$t,"⊉","\\nsupseteq",!0),Lt(Dt,It,$t,"⊨","\\models"),Lt(Dt,It,$t,"←","\\leftarrow",!0),Lt(Dt,It,$t,"≤","\\le"),Lt(Dt,It,$t,"≤","\\leq",!0),Lt(Dt,It,$t,"<","\\lt",!0),Lt(Dt,It,$t,"→","\\rightarrow",!0),Lt(Dt,It,$t,"→","\\to"),Lt(Dt,Rt,$t,"≱","\\ngeq",!0),Lt(Dt,Rt,$t,"≰","\\nleq",!0),Lt(Dt,It,Gt," ","\\ "),Lt(Dt,It,Gt," ","\\space"),Lt(Dt,It,Gt," ","\\nobreakspace"),Lt(jt,It,Gt," ","\\ "),Lt(jt,It,Gt," "," "),Lt(jt,It,Gt," ","\\space"),Lt(jt,It,Gt," ","\\nobreakspace"),Lt(Dt,It,Gt,null,"\\nobreak"),Lt(Dt,It,Gt,null,"\\allowbreak"),Lt(Dt,It,Wt,",",","),Lt(Dt,It,Wt,";",";"),Lt(Dt,Rt,Bt,"⊼","\\barwedge",!0),Lt(Dt,Rt,Bt,"⊻","\\veebar",!0),Lt(Dt,It,Bt,"⊙","\\odot",!0),Lt(Dt,It,Bt,"⊕","\\oplus",!0),Lt(Dt,It,Bt,"⊗","\\otimes",!0),Lt(Dt,It,Yt,"∂","\\partial",!0),Lt(Dt,It,Bt,"⊘","\\oslash",!0),Lt(Dt,Rt,Bt,"⊚","\\circledcirc",!0),Lt(Dt,Rt,Bt,"⊡","\\boxdot",!0),Lt(Dt,It,Bt,"△","\\bigtriangleup"),Lt(Dt,It,Bt,"▽","\\bigtriangledown"),Lt(Dt,It,Bt,"†","\\dagger"),Lt(Dt,It,Bt,"⋄","\\diamond"),Lt(Dt,It,Bt,"⋆","\\star"),Lt(Dt,It,Bt,"◃","\\triangleleft"),Lt(Dt,It,Bt,"▹","\\triangleright"),Lt(Dt,It,Ut,"{","\\{"),Lt(jt,It,Yt,"{","\\{"),Lt(jt,It,Yt,"{","\\textbraceleft"),Lt(Dt,It,zt,"}","\\}"),Lt(jt,It,Yt,"}","\\}"),Lt(jt,It,Yt,"}","\\textbraceright"),Lt(Dt,It,Ut,"{","\\lbrace"),Lt(Dt,It,zt,"}","\\rbrace"),Lt(Dt,It,Ut,"[","\\lbrack",!0),Lt(jt,It,Yt,"[","\\lbrack",!0),Lt(Dt,It,zt,"]","\\rbrack",!0),Lt(jt,It,Yt,"]","\\rbrack",!0),Lt(Dt,It,Ut,"(","\\lparen",!0),Lt(Dt,It,zt,")","\\rparen",!0),Lt(jt,It,Yt,"<","\\textless",!0),Lt(jt,It,Yt,">","\\textgreater",!0),Lt(Dt,It,Ut,"⌊","\\lfloor",!0),Lt(Dt,It,zt,"⌋","\\rfloor",!0),Lt(Dt,It,Ut,"⌈","\\lceil",!0),Lt(Dt,It,zt,"⌉","\\rceil",!0),Lt(Dt,It,Yt,"\\","\\backslash"),Lt(Dt,It,Yt,"","|"),Lt(Dt,It,Yt,"","\\vert"),Lt(jt,It,Yt,"|","\\textbar",!0),Lt(Dt,It,Yt,"∥","\\|"),Lt(Dt,It,Yt,"∥","\\Vert"),Lt(jt,It,Yt,"∥","\\textbardbl"),Lt(jt,It,Yt,"~","\\textasciitilde"),Lt(jt,It,Yt,"\\","\\textbackslash"),Lt(jt,It,Yt,"^","\\textasciicircum"),Lt(Dt,It,$t,"↑","\\uparrow",!0),Lt(Dt,It,$t,"⇑","\\Uparrow",!0),Lt(Dt,It,$t,"↓","\\downarrow",!0),Lt(Dt,It,$t,"⇓","\\Downarrow",!0),Lt(Dt,It,$t,"↕","\\updownarrow",!0),Lt(Dt,It,$t,"⇕","\\Updownarrow",!0),Lt(Dt,It,qt,"∐","\\coprod"),Lt(Dt,It,qt,"","\\bigvee"),Lt(Dt,It,qt,"⋀","\\bigwedge"),Lt(Dt,It,qt,"⨄","\\biguplus"),Lt(Dt,It,qt,"⋂","\\bigcap"),Lt(Dt,It,qt,"","\\bigcup"),Lt(Dt,It,qt,"∫","\\int"),Lt(Dt,It,qt,"∫","\\intop"),Lt(Dt,It,qt,"∬","\\iint"),Lt(Dt,It,qt,"∭","\\iiint"),Lt(Dt,It,qt,"∏","\\prod"),Lt(Dt,It,qt,"∑","\\sum"),Lt(Dt,It,qt,"⨂","\\bigotimes"),Lt(Dt,It,qt,"⨁","\\bigoplus"),Lt(Dt,It,qt,"⨀","\\bigodot"),Lt(Dt,It,qt,"∮","\\oint"),Lt(Dt,It,qt,"∯","\\oiint"),Lt(Dt,It,qt,"∰","\\oiiint"),Lt(Dt,It,qt,"⨆","\\bigsqcup"),Lt(Dt,It,qt,"∫","\\smallint"),Lt(jt,It,Ht,"…","\\textellipsis"),Lt(Dt,It,Ht,"…","\\mathellipsis"),Lt(jt,It,Ht,"…","\\ldots",!0),Lt(Dt,It,Ht,"…","\\ldots",!0),Lt(Dt,It,Ht,"⋯","\\@cdots",!0),Lt(Dt,It,Ht,"⋱","\\ddots",!0),Lt(Dt,It,Yt,"⋮","\\varvdots"),Lt(Dt,It,Ft,"ˊ","\\acute"),Lt(Dt,It,Ft,"ˋ","\\grave"),Lt(Dt,It,Ft,"¨","\\ddot"),Lt(Dt,It,Ft,"~","\\tilde"),Lt(Dt,It,Ft,"ˉ","\\bar"),Lt(Dt,It,Ft,"˘","\\breve"),Lt(Dt,It,Ft,"ˇ","\\check"),Lt(Dt,It,Ft,"^","\\hat"),Lt(Dt,It,Ft,"⃗","\\vec"),Lt(Dt,It,Ft,"˙","\\dot"),Lt(Dt,It,Ft,"˚","\\mathring"),Lt(Dt,It,Vt,"","\\@imath"),Lt(Dt,It,Vt,"","\\@jmath"),Lt(Dt,It,Yt,"ı","ı"),Lt(Dt,It,Yt,"ȷ","ȷ"),Lt(jt,It,Yt,"ı","\\i",!0),Lt(jt,It,Yt,"ȷ","\\j",!0),Lt(jt,It,Yt,"ß","\\ss",!0),Lt(jt,It,Yt,"æ","\\ae",!0),Lt(jt,It,Yt,"œ","\\oe",!0),Lt(jt,It,Yt,"ø","\\o",!0),Lt(jt,It,Yt,"Æ","\\AE",!0),Lt(jt,It,Yt,"Œ","\\OE",!0),Lt(jt,It,Yt,"Ø","\\O",!0),Lt(jt,It,Ft,"ˊ","\\'"),Lt(jt,It,Ft,"ˋ","\\`"),Lt(jt,It,Ft,"ˆ","\\^"),Lt(jt,It,Ft,"˜","\\~"),Lt(jt,It,Ft,"ˉ","\\="),Lt(jt,It,Ft,"˘","\\u"),Lt(jt,It,Ft,"˙","\\."),Lt(jt,It,Ft,"¸","\\c"),Lt(jt,It,Ft,"˚","\\r"),Lt(jt,It,Ft,"ˇ","\\v"),Lt(jt,It,Ft,"¨",'\\"'),Lt(jt,It,Ft,"˝","\\H"),Lt(jt,It,Ft,"◯","\\textcircled");var Xt={"--":!0,"---":!0,"``":!0,"''":!0};Lt(jt,It,Yt,"","--",!0),Lt(jt,It,Yt,"","\\textendash"),Lt(jt,It,Yt,"—","---",!0),Lt(jt,It,Yt,"—","\\textemdash"),Lt(jt,It,Yt,"","`",!0),Lt(jt,It,Yt,"","\\textquoteleft"),Lt(jt,It,Yt,"","'",!0),Lt(jt,It,Yt,"","\\textquoteright"),Lt(jt,It,Yt,"“","``",!0),Lt(jt,It,Yt,"“","\\textquotedblleft"),Lt(jt,It,Yt,"”","''",!0),Lt(jt,It,Yt,"”","\\textquotedblright"),Lt(Dt,It,Yt,"°","\\degree",!0),Lt(jt,It,Yt,"°","\\degree"),Lt(jt,It,Yt,"°","\\textdegree",!0),Lt(Dt,It,Yt,"£","\\pounds"),Lt(Dt,It,Yt,"£","\\mathsterling",!0),Lt(jt,It,Yt,"£","\\pounds"),Lt(jt,It,Yt,"£","\\textsterling",!0),Lt(Dt,Rt,Yt,"✠","\\maltese"),Lt(jt,Rt,Yt,"✠","\\maltese");for(var Kt='0123456789/@."',Zt=0;Zt<Kt.length;Zt++){var Jt=Kt.charAt(Zt);Lt(Dt,It,Yt,Jt,Jt)}for(var Qt='0123456789!@*()-=+";:?/.,',te=0;te<Qt.length;te++){var ee=Qt.charAt(te);Lt(jt,It,Yt,ee,ee)}for(var ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",re=0;re<ne.length;re++){var ie=ne.charAt(re);Lt(Dt,It,Vt,ie,ie),Lt(jt,It,Yt,ie,ie)}Lt(Dt,Rt,Yt,"C",""),Lt(jt,Rt,Yt,"C",""),Lt(Dt,Rt,Yt,"H",""),Lt(jt,Rt,Yt,"H",""),Lt(Dt,Rt,Yt,"N",""),Lt(jt,Rt,Yt,"N",""),Lt(Dt,Rt,Yt,"P",""),Lt(jt,Rt,Yt,"P",""),Lt(Dt,Rt,Yt,"Q",""),Lt(jt,Rt,Yt,"Q",""),Lt(Dt,Rt,Yt,"R",""),Lt(jt,Rt,Yt,"R",""),Lt(Dt,Rt,Yt,"Z",""),Lt(jt,Rt,Yt,"Z",""),Lt(Dt,It,Vt,"h",""),Lt(jt,It,Vt,"h","");for(var oe="",ae=0;ae<ne.length;ae++){var se=ne.charAt(ae);oe=String.fromCharCode(55349,56320+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe),oe=String.fromCharCode(55349,56372+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe),oe=String.fromCharCode(55349,56424+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe),oe=String.fromCharCode(55349,56580+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe),oe=String.fromCharCode(55349,56736+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe),oe=String.fromCharCode(55349,56788+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe),oe=String.fromCharCode(55349,56840+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe),oe=String.fromCharCode(55349,56944+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe),ae<26&&(oe=String.fromCharCode(55349,56632+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe),oe=String.fromCharCode(55349,56476+ae),Lt(Dt,It,Vt,se,oe),Lt(jt,It,Yt,se,oe))}oe=String.fromCharCode(55349,56668),Lt(Dt,It,Vt,"k",oe),Lt(jt,It,Yt,"k",oe);for(var le=0;le<10;le++){var ce=le.toString();oe=String.fromCharCode(55349,57294+le),Lt(Dt,It,Vt,ce,oe),Lt(jt,It,Yt,ce,oe),oe=String.fromCharCode(55349,57314+le),Lt(Dt,It,Vt,ce,oe),Lt(jt,It,Yt,ce,oe),oe=String.fromCharCode(55349,57324+le),Lt(Dt,It,Vt,ce,oe),Lt(jt,It,Yt,ce,oe),oe=String.fromCharCode(55349,57334+le),Lt(Dt,It,Vt,ce,oe),Lt(jt,It,Yt,ce,oe)}for(var ue="ÐÞþ",de=0;de<ue.length;de++){var he=ue.charAt(de);Lt(Dt,It,Vt,he,he),Lt(jt,It,Yt,he,he)}var pe=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],fe=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],ge=function(t,e){var n=t.charCodeAt(0),i=t.charCodeAt(1),o=1024*(n-55296)+(i-56320)+65536,a="math"===e?0:1;if(119808<=o&&o<120484){var s=Math.floor((o-119808)/26);return[pe[s][2],pe[s][a]]}if(120782<=o&&o<=120831){var l=Math.floor((o-120782)/10);return[fe[l][2],fe[l][a]]}if(120485===o||120486===o)return[pe[0][2],pe[0][a]];if(120486<o&&o<120782)return["",""];throw new r("Unsupported character: "+t)},me=function(t,e,n){return Pt[n][t]&&Pt[n][t].replace&&(t=Pt[n][t].replace),{value:t,metrics:nt(t,e,n)}},ve=function(t,e,n,r,i){var o,a=me(t,e,n),s=a.metrics;if(t=a.value,s){var l=s.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),o=new kt(t,s.height,s.depth,l,s.skew,s.width,i)}else"undefined"!==typeof console&&console.warn("No character metrics for '"+t+"' in style '"+e+"' and mode '"+n+"'"),o=new kt(t,0,0,0,0,0,i);if(r){o.maxFontSize=r.sizeMultiplier,r.style.isTight()&&o.classes.push("mtight");var c=r.getColor();c&&(o.style.color=c)}return o},be=function(t,e,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&me(t,"Main-Bold",e).metrics?ve(t,"Main-Bold",e,n,r.concat(["mathbf"])):"\\"===t||"main"===Pt[e][t].font?ve(t,"Main-Regular",e,n,r):ve(t,"AMS-Regular",e,n,r.concat(["amsrm"]))},ye=function(t,e,n,r,i){return"textord"!==i&&me(t,"Math-BoldItalic",e).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},we=function(t,e,n){var r=t.mode,i=t.text,o=["mord"],a="math"===r||"text"===r&&e.font,s=a?e.font:e.fontFamily;if(55349===i.charCodeAt(0)){var l=ge(i,r),c=l[0],u=l[1];return ve(i,c,r,e,o.concat(u))}if(s){var d,h;if("boldsymbol"===s){var p=ye(i,r,e,o,n);d=p.fontName,h=[p.fontClass]}else a?(d=De[s].fontName,h=[s]):(d=Le(s,e.fontWeight,e.fontShape),h=[s,e.fontWeight,e.fontShape]);if(me(i,d,r).metrics)return ve(i,d,r,e,o.concat(h));if(Xt.hasOwnProperty(i)&&"Typewriter"===d.substr(0,10)){for(var f=[],g=0;g<i.length;g++)f.push(ve(i[g],d,r,e,o.concat(h)));return Te(f)}}if("mathord"===n)return ve(i,"Math-Italic",r,e,o.concat(["mathnormal"]));if("textord"===n){var m=Pt[r][i]&&Pt[r][i].font;if("ams"===m){var v=Le("amsrm",e.fontWeight,e.fontShape);return ve(i,v,r,e,o.concat("amsrm",e.fontWeight,e.fontShape))}if("main"!==m&&m){var b=Le(m,e.fontWeight,e.fontShape);return ve(i,b,r,e,o.concat(b,e.fontWeight,e.fontShape))}var y=Le("textrm",e.fontWeight,e.fontShape);return ve(i,y,r,e,o.concat(e.fontWeight,e.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},xe=function(t,e){if(gt(t.classes)!==gt(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(1===t.classes.length){var n=t.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},Ce=function(t){for(var e=0;e<t.length-1;e++){var n=t[e],r=t[e+1];n instanceof kt&&r instanceof kt&&xe(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,t.splice(e+1,1),e--)}return t},ke=function(t){for(var e=0,n=0,r=0,i=0;i<t.children.length;i++){var o=t.children[i];o.height>e&&(e=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>r&&(r=o.maxFontSize)}t.height=e,t.depth=n,t.maxFontSize=r},Ae=function(t,e,n,r){var i=new yt(t,e,n,r);return ke(i),i},Se=function(t,e,n,r){return new yt(t,e,n,r)},Ee=function(t,e,n){var r=Ae([t],[],e);return r.height=Math.max(n||e.fontMetrics().defaultRuleThickness,e.minRuleThickness),r.style.borderBottomWidth=ft(r.height),r.maxFontSize=1,r},Oe=function(t,e,n,r){var i=new wt(t,e,n,r);return ke(i),i},Te=function(t){var e=new Z(t);return ke(e),e},_e=function(t,e){return t instanceof Z?Ae([],[t],e):t},Me=function(t){if("individualShift"===t.positionType){for(var e=t.children,n=[e[0]],r=-e[0].shift-e[0].elem.depth,i=r,o=1;o<e.length;o++){var a=-e[o].shift-i-e[o].elem.depth,s=a-(e[o-1].elem.height+e[o-1].elem.depth);i+=a,n.push({type:"kern",size:s}),n.push(e[o])}return{children:n,depth:r}}var l;if("top"===t.positionType){for(var c=t.positionData,u=0;u<t.children.length;u++){var d=t.children[u];c-="kern"===d.type?d.size:d.elem.height+d.elem.depth}l=c}else if("bottom"===t.positionType)l=-t.positionData;else{var h=t.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===t.positionType)l=-h.elem.depth-t.positionData;else{if("firstBaseline"!==t.positionType)throw new Error("Invalid positionType "+t.positionType+".");l=-h.elem.depth}}return{children:t.children,depth:l}},Ne=function(t,e){for(var n=Me(t),r=n.children,i=n.depth,o=0,a=0;a<r.length;a++){var s=r[a];if("elem"===s.type){var l=s.elem;o=Math.max(o,l.maxFontSize,l.height)}}o+=2;var c=Ae(["pstrut"],[]);c.style.height=ft(o);for(var u=[],d=i,h=i,p=i,f=0;f<r.length;f++){var g=r[f];if("kern"===g.type)p+=g.size;else{var m=g.elem,v=g.wrapperClasses||[],b=g.wrapperStyle||{},y=Ae(v,[c,m],void 0,b);y.style.top=ft(-o-p-m.depth),g.marginLeft&&(y.style.marginLeft=g.marginLeft),g.marginRight&&(y.style.marginRight=g.marginRight),u.push(y),p+=m.height+m.depth}d=Math.min(d,p),h=Math.max(h,p)}var w,x=Ae(["vlist"],u);if(x.style.height=ft(h),d<0){var C=Ae([],[]),k=Ae(["vlist"],[C]);k.style.height=ft(-d);var A=Ae(["vlist-s"],[new kt("")]);w=[Ae(["vlist-r"],[x,A]),Ae(["vlist-r"],[k])]}else w=[Ae(["vlist-r"],[x])];var S=Ae(["vlist-t"],w);return 2===w.length&&S.classes.push("vlist-t2"),S.height=h,S.depth=-d,S},Pe=function(t,e){var n=Ae(["mspace"],[],e),r=pt(t,e);return n.style.marginRight=ft(r),n},Le=function(t,e,n){var r,i="";switch(t){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=t}return r="textbf"===e&&"textit"===n?"BoldItalic":"textbf"===e?"Bold":"textit"===e?"Italic":"Regular",i+"-"+r},De={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},je={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Ie=function(t,e){var n=je[t],r=n[0],i=n[1],o=n[2],a=new St(r),s=new At([a],{width:ft(i),height:ft(o),style:"width:"+ft(i),viewBox:"0 0 "+1e3*i+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),l=Se(["overlay"],[s],e);return l.height=o,l.style.height=ft(o),l.style.width=ft(i),l},Re={fontMap:De,makeSymbol:ve,mathsym:be,makeSpan:Ae,makeSvgSpan:Se,makeLineSpan:Ee,makeAnchor:Oe,makeFragment:Te,wrapFragment:_e,makeVList:Ne,makeOrd:we,makeGlue:Pe,staticSvg:Ie,svgData:je,tryCombineChars:Ce},Fe={number:3,unit:"mu"},Be={number:4,unit:"mu"},ze={number:5,unit:"mu"},He={mord:{mop:Fe,mbin:Be,mrel:ze,minner:Fe},mop:{mord:Fe,mop:Fe,mrel:ze,minner:Fe},mbin:{mord:Be,mop:Be,mopen:Be,minner:Be},mrel:{mord:ze,mop:ze,mopen:ze,minner:ze},mopen:{},mclose:{mop:Fe,mbin:Be,mrel:ze,minner:Fe},mpunct:{mord:Fe,mop:Fe,mrel:ze,mopen:Fe,mclose:Fe,mpunct:Fe,minner:Fe},minner:{mord:Fe,mop:Fe,mbin:Be,mrel:ze,mopen:Fe,mpunct:Fe,minner:Fe}},Ve={mord:{mop:Fe},mop:{mord:Fe,mop:Fe},mbin:{},mrel:{},mopen:{},mclose:{mop:Fe},mpunct:{},minner:{mop:Fe}},qe={},Ue={},We={};function $e(t){for(var e=t.type,n=t.names,r=t.props,i=t.handler,o=t.htmlBuilder,a=t.mathmlBuilder,s={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l<n.length;++l)qe[n[l]]=s;e&&(o&&(Ue[e]=o),a&&(We[e]=a))}function Ge(t){var e=t.type,n=t.htmlBuilder,r=t.mathmlBuilder;$e({type:e,names:[],props:{numArgs:0},handler:function(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Ye=function(t){return"ordgroup"===t.type&&1===t.body.length?t.body[0]:t},Xe=function(t){return"ordgroup"===t.type?t.body:[t]},Ke=Re.makeSpan,Ze=["leftmost","mbin","mopen","mrel","mop","mpunct"],Je=["rightmost","mrel","mclose","mpunct"],Qe={display:j.DISPLAY,text:j.TEXT,script:j.SCRIPT,scriptscript:j.SCRIPTSCRIPT},tn={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},en=function(t,e,n,r){void 0===r&&(r=[null,null]);for(var i=[],o=0;o<t.length;o++){var a=ln(t[o],e);if(a instanceof Z){var s=a.children;i.push.apply(i,s)}else i.push(a)}if(Re.tryCombineChars(i),!n)return i;var l=e;if(1===t.length){var c=t[0];"sizing"===c.type?l=e.havingSize(c.size):"styling"===c.type&&(l=e.havingStyle(Qe[c.style]))}var u=Ke([r[0]||"leftmost"],[],e),d=Ke([r[1]||"rightmost"],[],e),h="root"===n;return nn(i,(function(t,e){var n=e.classes[0],r=t.classes[0];"mbin"===n&&g.contains(Je,r)?e.classes[0]="mord":"mbin"===r&&g.contains(Ze,n)&&(t.classes[0]="mord")}),{node:u},d,h),nn(i,(function(t,e){var n=an(e),r=an(t),i=n&&r?t.hasClass("mtight")?Ve[n][r]:He[n][r]:null;if(i)return Re.makeGlue(i,l)}),{node:u},d,h),i},nn=function t(e,n,r,i,o){i&&e.push(i);for(var a=0;a<e.length;a++){var s=e[a],l=rn(s);if(l)t(l.children,n,r,null,o);else{var c=!s.hasClass("mspace");if(c){var u=n(s,r.node);u&&(r.insertAfter?r.insertAfter(u):(e.unshift(u),a++))}c?r.node=s:o&&s.hasClass("newline")&&(r.node=Ke(["leftmost"])),r.insertAfter=function(t){return function(n){e.splice(t+1,0,n),a++}}(a)}}i&&e.pop()},rn=function(t){return t instanceof Z||t instanceof wt||t instanceof yt&&t.hasClass("enclosing")?t:null},on=function t(e,n){var r=rn(e);if(r){var i=r.children;if(i.length){if("right"===n)return t(i[i.length-1],"right");if("left"===n)return t(i[0],"left")}}return e},an=function(t,e){return t?(e&&(t=on(t,e)),tn[t.classes[0]]||null):null},sn=function(t,e){var n=["nulldelimiter"].concat(t.baseSizingClasses());return Ke(e.concat(n))},ln=function(t,e,n){if(!t)return Ke();if(Ue[t.type]){var i=Ue[t.type](t,e);if(n&&e.size!==n.size){i=Ke(e.sizingClasses(n),[i],e);var o=e.sizeMultiplier/n.sizeMultiplier;i.height*=o,i.depth*=o}return i}throw new r("Got group of unknown type: '"+t.type+"'")};function cn(t,e){var n=Ke(["base"],t,e),r=Ke(["strut"]);return r.style.height=ft(n.height+n.depth),n.depth&&(r.style.verticalAlign=ft(-n.depth)),n.children.unshift(r),n}function un(t,e){var n=null;1===t.length&&"tag"===t[0].type&&(n=t[0].tag,t=t[0].body);var r,i=en(t,e,"root");2===i.length&&i[1].hasClass("tag")&&(r=i.pop());for(var o,a=[],s=[],l=0;l<i.length;l++)if(s.push(i[l]),i[l].hasClass("mbin")||i[l].hasClass("mrel")||i[l].hasClass("allowbreak")){var c=!1;while(l<i.length-1&&i[l+1].hasClass("mspace")&&!i[l+1].hasClass("newline"))l++,s.push(i[l]),i[l].hasClass("nobreak")&&(c=!0);c||(a.push(cn(s,e)),s=[])}else i[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(cn(s,e)),s=[]),a.push(i[l]));s.length>0&&a.push(cn(s,e)),n?(o=cn(en(n,e,!0)),o.classes=["tag"],a.push(o)):r&&a.push(r);var u=Ke(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),o){var d=o.children[0];d.style.height=ft(u.height+u.depth),u.depth&&(d.style.verticalAlign=ft(-u.depth))}return u}function dn(t){return new Z(t)}var hn=function(){function t(t,e,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=e||[],this.classes=n||[]}var e=t.prototype;return e.setAttribute=function(t,e){this.attributes[t]=e},e.getAttribute=function(t){return this.attributes[t]},e.toNode=function(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&t.setAttribute(e,this.attributes[e]);this.classes.length>0&&(t.className=gt(this.classes));for(var n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t},e.toMarkup=function(){var t="<"+this.type;for(var e in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e)&&(t+=" "+e+'="',t+=g.escape(this.attributes[e]),t+='"');this.classes.length>0&&(t+=' class ="'+g.escape(gt(this.classes))+'"'),t+=">";for(var n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t+="</"+this.type+">",t},e.toText=function(){return this.children.map((function(t){return t.toText()})).join("")},t}(),pn=function(){function t(t){this.text=void 0,this.text=t}var e=t.prototype;return e.toNode=function(){return document.createTextNode(this.text)},e.toMarkup=function(){return g.escape(this.toText())},e.toText=function(){return this.text},t}(),fn=function(){function t(t){this.width=void 0,this.character=void 0,this.width=t,this.character=t>=.05555&&t<=.05556?"":t>=.1666&&t<=.1667?"":t>=.2222&&t<=.2223?"":t>=.2777&&t<=.2778?"":t>=-.05556&&t<=-.05555?"":t>=-.1667&&t<=-.1666?"":t>=-.2223&&t<=-.2222?"":t>=-.2778&&t<=-.2777?"":null}var e=t.prototype;return e.toNode=function(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",ft(this.width)),t},e.toMarkup=function(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+ft(this.width)+'"/>'},e.toText=function(){return this.character?this.character:" "},t}(),gn={MathNode:hn,TextNode:pn,SpaceNode:fn,newDocumentFragment:dn},mn=function(t,e,n){return!Pt[e][t]||!Pt[e][t].replace||55349===t.charCodeAt(0)||Xt.hasOwnProperty(t)&&n&&(n.fontFamily&&"tt"===n.fontFamily.substr(4,2)||n.font&&"tt"===n.font.substr(4,2))||(t=Pt[e][t].replace),new gn.TextNode(t)},vn=function(t){return 1===t.length?t[0]:new gn.MathNode("mrow",t)},bn=function(t,e){if("texttt"===e.fontFamily)return"monospace";if("textsf"===e.fontFamily)return"textit"===e.fontShape&&"textbf"===e.fontWeight?"sans-serif-bold-italic":"textit"===e.fontShape?"sans-serif-italic":"textbf"===e.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===e.fontShape&&"textbf"===e.fontWeight)return"bold-italic";if("textit"===e.fontShape)return"italic";if("textbf"===e.fontWeight)return"bold";var n=e.font;if(!n||"mathnormal"===n)return null;var r=t.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===t.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck";if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var i=t.text;if(g.contains(["\\imath","\\jmath"],i))return null;Pt[r][i]&&Pt[r][i].replace&&(i=Pt[r][i].replace);var o=Re.fontMap[n].fontName;return nt(i,o,r)?Re.fontMap[n].variant:null},yn=function(t,e,n){if(1===t.length){var r=xn(t[0],e);return n&&r instanceof hn&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var i,o=[],a=0;a<t.length;a++){var s=xn(t[a],e);if(s instanceof hn&&i instanceof hn){if("mtext"===s.type&&"mtext"===i.type&&s.getAttribute("mathvariant")===i.getAttribute("mathvariant")){var l;(l=i.children).push.apply(l,s.children);continue}if("mn"===s.type&&"mn"===i.type){var c;(c=i.children).push.apply(c,s.children);continue}if("mi"===s.type&&1===s.children.length&&"mn"===i.type){var u=s.children[0];if(u instanceof pn&&"."===u.text){var d;(d=i.children).push.apply(d,s.children);continue}}else if("mi"===i.type&&1===i.children.length){var h=i.children[0];if(h instanceof pn&&"̸"===h.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var p=s.children[0];p instanceof pn&&p.text.length>0&&(p.text=p.text.slice(0,1)+"̸"+p.text.slice(1),o.pop())}}}o.push(s),i=s}return o},wn=function(t,e,n){return vn(yn(t,e,n))},xn=function(t,e){if(!t)return new gn.MathNode("mrow");if(We[t.type]){var n=We[t.type](t,e);return n}throw new r("Got group of unknown type: '"+t.type+"'")};function Cn(t,e,n,r,i){var o,a=yn(t,n);o=1===a.length&&a[0]instanceof hn&&g.contains(["mrow","mtable"],a[0].type)?a[0]:new gn.MathNode("mrow",a);var s=new gn.MathNode("annotation",[new gn.TextNode(e)]);s.setAttribute("encoding","application/x-tex");var l=new gn.MathNode("semantics",[o,s]),c=new gn.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return Re.makeSpan([u],[c])}var kn=function(t){return new ct({style:t.displayMode?j.DISPLAY:j.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},An=function(t,e){if(e.displayMode){var n=["katex-display"];e.leqno&&n.push("leqno"),e.fleqn&&n.push("fleqn"),t=Re.makeSpan(n,[t])}return t},Sn=function(t,e,n){var r,i=kn(n);if("mathml"===n.output)return Cn(t,e,i,n.displayMode,!0);if("html"===n.output){var o=un(t,i);r=Re.makeSpan(["katex"],[o])}else{var a=Cn(t,e,i,n.displayMode,!1),s=un(t,i);r=Re.makeSpan(["katex"],[a,s])}return An(r,n)},En=function(t,e,n){var r=kn(n),i=un(t,r),o=Re.makeSpan(["katex"],[i]);return An(o,n)},On={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Tn=function(t){var e=new gn.MathNode("mo",[new gn.TextNode(On[t.replace(/^\\/,"")])]);return e.setAttribute("stretchy","true"),e},_n={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Mn=function(t){return"ordgroup"===t.type?t.body.length:1},Nn=function(t,e){function n(){var n=4e5,r=t.label.substr(1);if(g.contains(["widehat","widecheck","widetilde","utilde"],r)){var i,o,a,s=t,l=Mn(s.base);if(l>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,a=.42,o=r+"4"):(i=312,n=2340,a=.34,o="tilde4");else{var c=[1,1,2,2,3,3][l];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][c],i=[0,239,300,360,420][c],a=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],i=[0,260,286,306,312][c],a=[0,.26,.286,.3,.306,.34][c],o="tilde"+c)}var u=new St(o),d=new At([u],{width:"100%",height:ft(a),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"});return{span:Re.makeSvgSpan([],[d],e),minWidth:0,height:a}}var h,p,f=[],m=_n[r],v=m[0],b=m[1],y=m[2],w=y/1e3,x=v.length;if(1===x){var C=m[3];h=["hide-tail"],p=[C]}else if(2===x)h=["halfarrow-left","halfarrow-right"],p=["xMinYMin","xMaxYMin"];else{if(3!==x)throw new Error("Correct katexImagesData or update code here to support\n "+x+" children.");h=["brace-left","brace-center","brace-right"],p=["xMinYMin","xMidYMin","xMaxYMin"]}for(var k=0;k<x;k++){var A=new St(v[k]),S=new At([A],{width:"400em",height:ft(w),viewBox:"0 0 "+n+" "+y,preserveAspectRatio:p[k]+" slice"}),E=Re.makeSvgSpan([h[k]],[S],e);if(1===x)return{span:E,minWidth:b,height:w};E.style.height=ft(w),f.push(E)}return{span:Re.makeSpan(["stretchy"],f,e),minWidth:b,height:w}}var r=n(),i=r.span,o=r.minWidth,a=r.height;return i.height=a,i.style.height=ft(a),o>0&&(i.style.minWidth=ft(o)),i},Pn=function(t,e,n,r,i){var o,a=t.height+t.depth+n+r;if(/fbox|color|angl/.test(e)){if(o=Re.makeSpan(["stretchy",e],[],i),"fbox"===e){var s=i.color&&i.getColor();s&&(o.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(e)&&l.push(new Et({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(e)&&l.push(new Et({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new At(l,{width:"100%",height:ft(a)});o=Re.makeSvgSpan([],[c],i)}return o.height=a,o.style.height=ft(a),o},Ln={encloseSpan:Pn,mathMLnode:Tn,svgSpan:Nn};function Dn(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function jn(t){var e=In(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function In(t){return t&&("atom"===t.type||Mt.hasOwnProperty(t.type))?t:null}var Rn=function(t,e){var n,r,i;t&&"supsub"===t.type?(r=Dn(t.base,"accent"),n=r.base,t.base=n,i=Tt(ln(t,e)),t.base=r):(r=Dn(t,"accent"),n=r.base);var o=ln(n,e.havingCrampedStyle()),a=r.isShifty&&g.isCharacterBox(n),s=0;if(a){var l=g.getBaseElem(n),c=ln(l,e.havingCrampedStyle());s=Ot(c).skew}var u,d="\\c"===r.label,h=d?o.height+o.depth:Math.min(o.height,e.fontMetrics().xHeight);if(r.isStretchy)u=Ln.svgSpan(r,e),u=Re.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:u,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+ft(2*s)+")",marginLeft:ft(2*s)}:void 0}]},e);else{var p,f;"\\vec"===r.label?(p=Re.staticSvg("vec",e),f=Re.svgData.vec[1]):(p=Re.makeOrd({mode:r.mode,text:r.label},e,"textord"),p=Ot(p),p.italic=0,f=p.width,d&&(h+=p.depth)),u=Re.makeSpan(["accent-body"],[p]);var m="\\textcircled"===r.label;m&&(u.classes.push("accent-full"),h=o.height);var v=s;m||(v-=f/2),u.style.left=ft(v),"\\textcircled"===r.label&&(u.style.top=".2em"),u=Re.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-h},{type:"elem",elem:u}]},e)}var b=Re.makeSpan(["mord","accent"],[u],e);return i?(i.children[0]=b,i.height=Math.max(b.height,i.height),i.classes[0]="mord",i):b},Fn=function(t,e){var n=t.isStretchy?Ln.mathMLnode(t.label):new gn.MathNode("mo",[mn(t.label,t.mode)]),r=new gn.MathNode("mover",[xn(t.base,e),n]);return r.setAttribute("accent","true"),r},Bn=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((function(t){return"\\"+t})).join("|"));$e({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(t,e){var n=Ye(e[0]),r=!Bn.test(t.funcName),i=!r||"\\widehat"===t.funcName||"\\widetilde"===t.funcName||"\\widecheck"===t.funcName;return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Rn,mathmlBuilder:Fn}),$e({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:function(t,e){var n=e[0],r=t.parser.mode;return"math"===r&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Rn,mathmlBuilder:Fn}),$e({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(t,e){var n=t.parser,r=t.funcName,i=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:function(t,e){var n=ln(t.base,e),r=Ln.svgSpan(t,e),i="\\utilde"===t.label?.12:0,o=Re.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},e);return Re.makeSpan(["mord","accentunder"],[o],e)},mathmlBuilder:function(t,e){var n=Ln.mathMLnode(t.label),r=new gn.MathNode("munder",[xn(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var zn=function(t){var e=new gn.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};$e({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler:function(t,e,n){var r=t.parser,i=t.funcName;return{type:"xArrow",mode:r.mode,label:i,body:e[0],below:n[0]}},htmlBuilder:function(t,e){var n,r=e.style,i=e.havingStyle(r.sup()),o=Re.wrapFragment(ln(t.body,i,e),e),a="\\x"===t.label.slice(0,2)?"x":"cd";o.classes.push(a+"-arrow-pad"),t.below&&(i=e.havingStyle(r.sub()),n=Re.wrapFragment(ln(t.below,i,e),e),n.classes.push(a+"-arrow-pad"));var s,l=Ln.svgSpan(t,e),c=-e.fontMetrics().axisHeight+.5*l.height,u=-e.fontMetrics().axisHeight-.5*l.height-.111;if((o.depth>.25||"\\xleftequilibrium"===t.label)&&(u-=o.depth),n){var d=-e.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=Re.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:u},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:d}]},e)}else s=Re.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:u},{type:"elem",elem:l,shift:c}]},e);return s.children[0].children[0].children[1].classes.push("svg-align"),Re.makeSpan(["mrel","x-arrow"],[s],e)},mathmlBuilder:function(t,e){var n,r=Ln.mathMLnode(t.label);if(r.setAttribute("minsize","x"===t.label.charAt(0)?"1.75em":"3.0em"),t.body){var i=zn(xn(t.body,e));if(t.below){var o=zn(xn(t.below,e));n=new gn.MathNode("munderover",[r,o,i])}else n=new gn.MathNode("mover",[r,i])}else if(t.below){var a=zn(xn(t.below,e));n=new gn.MathNode("munder",[r,a])}else n=zn(),n=new gn.MathNode("mover",[r,n]);return n}});var Hn={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Vn=function(){return{type:"styling",body:[],mode:"math",style:"display"}},qn=function(t){return"textord"===t.type&&"@"===t.text},Un=function(t,e){return("mathord"===t.type||"atom"===t.type)&&t.text===e};function Wn(t,e,n){var r=Hn[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":var i=n.callFunction("\\\\cdleft",[e[0]],[]),o={type:"atom",text:r,mode:"math",family:"rel"},a=n.callFunction("\\Big",[o],[]),s=n.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,a,s]};return n.callFunction("\\\\cdparent",[l],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":var c={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[c],[]);default:return{type:"textord",text:" ",mode:"math"}}}function $n(t){var e=[];t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();while(1){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===e[e.length-1].length&&e.pop();break}throw new r("Expected \\\\ or \\cr or \\end",t.nextToken)}t.consume()}for(var i=[],o=[i],a=0;a<e.length;a++){for(var s=e[a],l=Vn(),c=0;c<s.length;c++)if(qn(s[c])){i.push(l),c+=1;var u=jn(s[c]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(u)>-1);else{if(!("<>AV".indexOf(u)>-1))throw new r('Expected one of "<>AV=|." after @',s[c]);for(var h=0;h<2;h++){for(var p=!0,f=c+1;f<s.length;f++){if(Un(s[f],u)){p=!1,c=f;break}if(qn(s[f]))throw new r("Missing a "+u+" character to complete a CD arrow.",s[f]);d[h].body.push(s[f])}if(p)throw new r("Missing a "+u+" character to complete a CD arrow.",s[c])}}var g=Wn(u,d,t),m={type:"styling",body:[g],mode:"math",style:"display"};i.push(m),l=Vn()}else l.body.push(s[c]);a%2===0?i.push(l):i.shift(),i=[],o.push(i)}t.gullet.endGroup(),t.gullet.endGroup();var v=new Array(o[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:o,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(o.length+1).fill([])}}$e({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler:function(t,e){var n=t.parser,r=t.funcName;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder:function(t,e){var n=e.havingStyle(e.style.sup()),r=Re.wrapFragment(ln(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=ft(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder:function(t,e){var n=new gn.MathNode("mrow",[xn(t.label,e)]);return n=new gn.MathNode("mpadded",[n]),n.setAttribute("width","0"),"left"===t.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new gn.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),$e({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler:function(t,e){var n=t.parser;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder:function(t,e){var n=Re.wrapFragment(ln(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:function(t,e){return new gn.MathNode("mrow",[xn(t.fragment,e)])}}),$e({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(t,e){for(var n=t.parser,i=Dn(e[0],"ordgroup"),o=i.body,a="",s=0;s<o.length;s++){var l=Dn(o[s],"textord");a+=l.text}var c,u=parseInt(a);if(isNaN(u))throw new r("\\@char has non-numeric argument "+a);if(u<0||u>=1114111)throw new r("\\@char with invalid code point "+a);return u<=65535?c=String.fromCharCode(u):(u-=65536,c=String.fromCharCode(55296+(u>>10),56320+(1023&u))),{type:"textord",mode:n.mode,text:c}}});var Gn=function(t,e){var n=en(t.body,e.withColor(t.color),!1);return Re.makeFragment(n)},Yn=function(t,e){var n=yn(t.body,e.withColor(t.color)),r=new gn.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};$e({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler:function(t,e){var n=t.parser,r=Dn(e[0],"color-token").color,i=e[1];return{type:"color",mode:n.mode,color:r,body:Xe(i)}},htmlBuilder:Gn,mathmlBuilder:Yn}),$e({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler:function(t,e){var n=t.parser,r=t.breakOnTokenText,i=Dn(e[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var o=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:o}},htmlBuilder:Gn,mathmlBuilder:Yn}),$e({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(t,e,n){var r=t.parser,i=n[0],o=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:o,size:i&&Dn(i,"size").value}},htmlBuilder:function(t,e){var n=Re.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=ft(pt(t.size,e)))),n},mathmlBuilder:function(t,e){var n=new gn.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",ft(pt(t.size,e)))),n}});var Xn={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Kn=function(t){var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new r("Expected a control sequence",t);return e},Zn=function(t){var e=t.gullet.popToken();return"="===e.text&&(e=t.gullet.popToken()," "===e.text&&(e=t.gullet.popToken())),e},Jn=function(t,e,n,r){var i=t.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,i,r)};$e({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler:function(t){var e=t.parser,n=t.funcName;e.consumeSpaces();var i=e.fetch();if(Xn[i.text])return"\\global"!==n&&"\\\\globallong"!==n||(i.text=Xn[i.text]),Dn(e.parseFunction(),"internal");throw new r("Invalid token after macro prefix",i)}}),$e({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(t){var e=t.parser,n=t.funcName,i=e.gullet.popToken(),o=i.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new r("Expected a control sequence",i);var a,s=0,l=[[]];while("{"!==e.gullet.future().text)if(i=e.gullet.popToken(),"#"===i.text){if("{"===e.gullet.future().text){a=e.gullet.future(),l[s].push("{");break}if(i=e.gullet.popToken(),!/^[1-9]$/.test(i.text))throw new r('Invalid argument number "'+i.text+'"');if(parseInt(i.text)!==s+1)throw new r('Argument number "'+i.text+'" out of order');s++,l.push([])}else{if("EOF"===i.text)throw new r("Expected a macro definition");l[s].push(i.text)}var c=e.gullet.consumeArg(),u=c.tokens;return a&&u.unshift(a),"\\edef"!==n&&"\\xdef"!==n||(u=e.gullet.expandTokens(u),u.reverse()),e.gullet.macros.set(o,{tokens:u,numArgs:s,delimiters:l},n===Xn[n]),{type:"internal",mode:e.mode}}}),$e({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(t){var e=t.parser,n=t.funcName,r=Kn(e.gullet.popToken());e.gullet.consumeSpaces();var i=Zn(e);return Jn(e,r,i,"\\\\globallet"===n),{type:"internal",mode:e.mode}}}),$e({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(t){var e=t.parser,n=t.funcName,r=Kn(e.gullet.popToken()),i=e.gullet.popToken(),o=e.gullet.popToken();return Jn(e,r,o,"\\\\globalfuture"===n),e.gullet.pushToken(o),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Qn=function(t,e,n){var r=Pt.math[t]&&Pt.math[t].replace,i=nt(r||t,e,n);if(!i)throw new Error("Unsupported symbol "+t+" and font size "+e+".");return i},tr=function(t,e,n,r){var i=n.havingBaseStyle(e),o=Re.makeSpan(r.concat(i.sizingClasses(n)),[t],n),a=i.sizeMultiplier/n.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=i.sizeMultiplier,o},er=function(t,e,n){var r=e.havingBaseStyle(n),i=(1-e.sizeMultiplier/r.sizeMultiplier)*e.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=ft(i),t.height-=i,t.depth+=i},nr=function(t,e,n,r,i,o){var a=Re.makeSymbol(t,"Main-Regular",i,r),s=tr(a,e,r,o);return n&&er(s,r,e),s},rr=function(t,e,n,r){return Re.makeSymbol(t,"Size"+e+"-Regular",n,r)},ir=function(t,e,n,r,i,o){var a=rr(t,e,i,r),s=tr(Re.makeSpan(["delimsizing","size"+e],[a],r),j.TEXT,r,o);return n&&er(s,r,j.TEXT),s},or=function(t,e,n){var r;r="Size1-Regular"===e?"delim-size1":"delim-size4";var i=Re.makeSpan(["delimsizinginner",r],[Re.makeSpan([],[Re.makeSymbol(t,e,n)])]);return{type:"elem",elem:i}},ar=function(t,e,n){var r=J["Size4-Regular"][t.charCodeAt(0)]?J["Size4-Regular"][t.charCodeAt(0)][4]:J["Size1-Regular"][t.charCodeAt(0)][4],i=new St("inner",X(t,Math.round(1e3*e))),o=new At([i],{width:ft(r),height:ft(e),style:"width:"+ft(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*e),preserveAspectRatio:"xMinYMin"}),a=Re.makeSvgSpan([],[o],n);return a.height=e,a.style.height=ft(e),a.style.width=ft(r),{type:"elem",elem:a}},sr=.008,lr={type:"kern",size:-1*sr},cr=["|","\\lvert","\\rvert","\\vert"],ur=["\\|","\\lVert","\\rVert","\\Vert"],dr=function(t,e,n,r,i,o){var a,s,l,c;a=l=c=t,s=null;var u="Size1-Regular";"\\uparrow"===t?l=c="⏐":"\\Uparrow"===t?l=c="‖":"\\downarrow"===t?a=l="⏐":"\\Downarrow"===t?a=l="‖":"\\updownarrow"===t?(a="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===t?(a="\\Uparrow",l="‖",c="\\Downarrow"):g.contains(cr,t)?l="":g.contains(ur,t)?l="∥":"["===t||"\\lbrack"===t?(a="⎡",l="⎢",c="⎣",u="Size4-Regular"):"]"===t||"\\rbrack"===t?(a="⎤",l="⎥",c="⎦",u="Size4-Regular"):"\\lfloor"===t||"⌊"===t?(l=a="⎢",c="⎣",u="Size4-Regular"):"\\lceil"===t||"⌈"===t?(a="⎡",l=c="⎢",u="Size4-Regular"):"\\rfloor"===t||"⌋"===t?(l=a="⎥",c="⎦",u="Size4-Regular"):"\\rceil"===t||"⌉"===t?(a="⎤",l=c="⎥",u="Size4-Regular"):"("===t||"\\lparen"===t?(a="⎛",l="⎜",c="⎝",u="Size4-Regular"):")"===t||"\\rparen"===t?(a="⎞",l="⎟",c="⎠",u="Size4-Regular"):"\\{"===t||"\\lbrace"===t?(a="⎧",s="⎨",c="⎩",l="⎪",u="Size4-Regular"):"\\}"===t||"\\rbrace"===t?(a="⎫",s="⎬",c="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===t||"⟮"===t?(a="⎧",c="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===t||"⟯"===t?(a="⎫",c="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===t||"⎰"===t?(a="⎧",c="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==t&&"⎱"!==t||(a="⎫",c="⎩",l="⎪",u="Size4-Regular");var d=Qn(a,u,i),h=d.height+d.depth,p=Qn(l,u,i),f=p.height+p.depth,m=Qn(c,u,i),v=m.height+m.depth,b=0,y=1;if(null!==s){var w=Qn(s,u,i);b=w.height+w.depth,y=2}var x=h+v+b,C=Math.max(0,Math.ceil((e-x)/(y*f))),k=x+C*y*f,A=r.fontMetrics().axisHeight;n&&(A*=r.sizeMultiplier);var S=k/2-A,E=[];if(E.push(or(c,u,i)),E.push(lr),null===s){var O=k-h-v+2*sr;E.push(ar(l,O,r))}else{var T=(k-h-v-b)/2+2*sr;E.push(ar(l,T,r)),E.push(lr),E.push(or(s,u,i)),E.push(lr),E.push(ar(l,T,r))}E.push(lr),E.push(or(a,u,i));var _=r.havingBaseStyle(j.TEXT),M=Re.makeVList({positionType:"bottom",positionData:S,children:E},_);return tr(Re.makeSpan(["delimsizing","mult"],[M],_),j.TEXT,r,o)},hr=80,pr=.08,fr=function(t,e,n,r,i){var o=Y(t,r,n),a=new St(t,o),s=new At([a],{width:"400em",height:ft(e),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Re.makeSvgSpan(["hide-tail"],[s],i)},gr=function(t,e){var n,r,i=e.havingBaseSizing(),o=Sr("\\surd",t*i.sizeMultiplier,kr,i),a=i.sizeMultiplier,s=Math.max(0,e.minRuleThickness-e.fontMetrics().sqrtRuleThickness),l=0,c=0,u=0;return"small"===o.type?(u=1e3+1e3*s+hr,t<1?a=1:t<1.4&&(a=.7),l=(1+s+pr)/a,c=(1+s)/a,n=fr("sqrtMain",l,u,s,e),n.style.minWidth="0.853em",r=.833/a):"large"===o.type?(u=(1e3+hr)*yr[o.size],c=(yr[o.size]+s)/a,l=(yr[o.size]+s+pr)/a,n=fr("sqrtSize"+o.size,l,u,s,e),n.style.minWidth="1.02em",r=1/a):(l=t+s+pr,c=t+s,u=Math.floor(1e3*t+s)+hr,n=fr("sqrtTall",l,u,s,e),n.style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=ft(l),{span:n,advanceWidth:r,ruleWidth:(e.fontMetrics().sqrtRuleThickness+s)*a}},mr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],vr=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],br=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],yr=[0,1.2,1.8,2.4,3],wr=function(t,e,n,i,o){if("<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),g.contains(mr,t)||g.contains(br,t))return ir(t,e,!1,n,i,o);if(g.contains(vr,t))return dr(t,yr[e],!1,n,i,o);throw new r("Illegal delimiter: '"+t+"'")},xr=[{type:"small",style:j.SCRIPTSCRIPT},{type:"small",style:j.SCRIPT},{type:"small",style:j.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Cr=[{type:"small",style:j.SCRIPTSCRIPT},{type:"small",style:j.SCRIPT},{type:"small",style:j.TEXT},{type:"stack"}],kr=[{type:"small",style:j.SCRIPTSCRIPT},{type:"small",style:j.SCRIPT},{type:"small",style:j.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Ar=function(t){if("small"===t.type)return"Main-Regular";if("large"===t.type)return"Size"+t.size+"-Regular";if("stack"===t.type)return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},Sr=function(t,e,n,r){for(var i=Math.min(2,3-r.style.size),o=i;o<n.length;o++){if("stack"===n[o].type)break;var a=Qn(t,Ar(n[o]),"math"),s=a.height+a.depth;if("small"===n[o].type){var l=r.havingBaseStyle(n[o].style);s*=l.sizeMultiplier}if(s>e)return n[o]}return n[n.length-1]},Er=function(t,e,n,r,i,o){var a;"<"===t||"\\lt"===t||"⟨"===t?t="\\langle":">"!==t&&"\\gt"!==t&&"⟩"!==t||(t="\\rangle"),a=g.contains(br,t)?xr:g.contains(mr,t)?kr:Cr;var s=Sr(t,e,a,r);return"small"===s.type?nr(t,s.style,n,r,i,o):"large"===s.type?ir(t,s.size,n,r,i,o):dr(t,e,n,r,i,o)},Or=function(t,e,n,r,i,o){var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,l=5/r.fontMetrics().ptPerEm,c=Math.max(e-a,n+a),u=Math.max(c/500*s,2*c-l);return Er(t,u,!0,r,i,o)},Tr={sqrtImage:gr,sizedDelim:wr,sizeToMaxHeight:yr,customSizedDelim:Er,leftRightDelim:Or},_r={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Mr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Nr(t,e){var n=In(t);if(n&&g.contains(Mr,n.text))return n;throw new r(n?"Invalid delimiter '"+n.text+"' after '"+e.funcName+"'":"Invalid delimiter type '"+t.type+"'",t)}function Pr(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}$e({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:function(t,e){var n=Nr(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:_r[t.funcName].size,mclass:_r[t.funcName].mclass,delim:n.text}},htmlBuilder:function(t,e){return"."===t.delim?Re.makeSpan([t.mclass]):Tr.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass])},mathmlBuilder:function(t){var e=[];"."!==t.delim&&e.push(mn(t.delim,t.mode));var n=new gn.MathNode("mo",e);"mopen"===t.mclass||"mclose"===t.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ft(Tr.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),$e({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:function(t,e){var n=t.parser.gullet.macros.get("\\current@color");if(n&&"string"!==typeof n)throw new r("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:Nr(e[0],t).text,color:n}}}),$e({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:function(t,e){var n=Nr(e[0],t),r=t.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var o=Dn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:function(t,e){Pr(t);for(var n,r,i=en(t.body,e,!0,["mopen","mclose"]),o=0,a=0,s=!1,l=0;l<i.length;l++)i[l].isMiddle?s=!0:(o=Math.max(i[l].height,o),a=Math.max(i[l].depth,a));if(o*=e.sizeMultiplier,a*=e.sizeMultiplier,n="."===t.left?sn(e,["mopen"]):Tr.leftRightDelim(t.left,o,a,e,t.mode,["mopen"]),i.unshift(n),s)for(var c=1;c<i.length;c++){var u=i[c],d=u.isMiddle;d&&(i[c]=Tr.leftRightDelim(d.delim,o,a,d.options,t.mode,[]))}if("."===t.right)r=sn(e,["mclose"]);else{var h=t.rightColor?e.withColor(t.rightColor):e;r=Tr.leftRightDelim(t.right,o,a,h,t.mode,["mclose"])}return i.push(r),Re.makeSpan(["minner"],i,e)},mathmlBuilder:function(t,e){Pr(t);var n=yn(t.body,e);if("."!==t.left){var r=new gn.MathNode("mo",[mn(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==t.right){var i=new gn.MathNode("mo",[mn(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),n.push(i)}return vn(n)}}),$e({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:function(t,e){var n=Nr(e[0],t);if(!t.parser.leftrightDepth)throw new r("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:function(t,e){var n;if("."===t.delim)n=sn(e,[]);else{n=Tr.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n},mathmlBuilder:function(t,e){var n="\\vert"===t.delim||"|"===t.delim?mn("|","text"):mn(t.delim,t.mode),r=new gn.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Lr=function(t,e){var n,r,i=Re.wrapFragment(ln(t.body,e),e),o=t.label.substr(1),a=e.sizeMultiplier,s=0,l=g.isCharacterBox(t.body);if("sout"===o)n=Re.makeSpan(["stretchy","sout"]),n.height=e.fontMetrics().defaultRuleThickness/a,s=-.5*e.fontMetrics().xHeight;else if("phase"===o){var c=pt({number:.6,unit:"pt"},e),u=pt({number:.35,unit:"ex"},e),d=e.havingBaseSizing();a/=d.sizeMultiplier;var h=i.height+i.depth+c+u;i.style.paddingLeft=ft(h/2+c);var p=Math.floor(1e3*h*a),f=$(p),m=new At([new St("phase",f)],{width:"400em",height:ft(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});n=Re.makeSvgSpan(["hide-tail"],[m],e),n.style.height=ft(h),s=i.depth+c+u}else{/cancel/.test(o)?l||i.classes.push("cancel-pad"):"angl"===o?i.classes.push("anglpad"):i.classes.push("boxpad");var v=0,b=0,y=0;/box/.test(o)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),v=e.fontMetrics().fboxsep+("colorbox"===o?0:y),b=v):"angl"===o?(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),v=4*y,b=Math.max(0,.25-i.depth)):(v=l?.2:0,b=v),n=Ln.encloseSpan(i,o,v,b,e),/fbox|boxed|fcolorbox/.test(o)?(n.style.borderStyle="solid",n.style.borderWidth=ft(y)):"angl"===o&&.049!==y&&(n.style.borderTopWidth=ft(y),n.style.borderRightWidth=ft(y)),s=i.depth+b,t.backgroundColor&&(n.style.backgroundColor=t.backgroundColor,t.borderColor&&(n.style.borderColor=t.borderColor))}if(t.backgroundColor)r=Re.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:i,shift:0}]},e);else{var w=/cancel|phase/.test(o)?["svg-align"]:[];r=Re.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:w}]},e)}return/cancel/.test(o)&&(r.height=i.height,r.depth=i.depth),/cancel/.test(o)&&!l?Re.makeSpan(["mord","cancel-lap"],[r],e):Re.makeSpan(["mord"],[r],e)},Dr=function(t,e){var n=0,r=new gn.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[xn(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===t.label){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};$e({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler:function(t,e,n){var r=t.parser,i=t.funcName,o=Dn(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,body:a}},htmlBuilder:Lr,mathmlBuilder:Dr}),$e({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler:function(t,e,n){var r=t.parser,i=t.funcName,o=Dn(e[0],"color-token").color,a=Dn(e[1],"color-token").color,s=e[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,borderColor:o,body:s}},htmlBuilder:Lr,mathmlBuilder:Dr}),$e({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(t,e){var n=t.parser;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}}),$e({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler:function(t,e){var n=t.parser,r=t.funcName,i=e[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Lr,mathmlBuilder:Dr}),$e({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler:function(t,e){var n=t.parser;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var jr={};function Ir(t){for(var e=t.type,n=t.names,r=t.props,i=t.handler,o=t.htmlBuilder,a=t.mathmlBuilder,s={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l<n.length;++l)jr[n[l]]=s;o&&(Ue[e]=o),a&&(We[e]=a)}var Rr={};function Fr(t,e){Rr[t]=e}var Br=function(){function t(t,e,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=e,this.end=n}return t.range=function(e,n){return n?e&&e.loc&&n.loc&&e.loc.lexer===n.loc.lexer?new t(e.loc.lexer,e.loc.start,n.loc.end):null:e&&e.loc},t}(),zr=function(){function t(t,e){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=e}var e=t.prototype;return e.range=function(e,n){return new t(n,Br.range(this,e))},t}();function Hr(t){var e=[];t.consumeSpaces();var n=t.fetch().text;while("\\hline"===n||"\\hdashline"===n)t.consume(),e.push("\\hdashline"===n),t.consumeSpaces(),n=t.fetch().text;return e}var Vr=function(t){var e=t.parser.settings;if(!e.displayMode)throw new r("{"+t.envName+"} can be used only in display mode.")};function qr(t){if(-1===t.indexOf("ed"))return-1===t.indexOf("*")}function Ur(t,e,n){var i=e.hskipBeforeAndAfter,o=e.addJot,a=e.cols,s=e.arraystretch,l=e.colSeparationType,c=e.autoTag,u=e.singleRow,d=e.emptySingleRow,h=e.maxNumCols,p=e.leqno;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!s){var f=t.gullet.expandMacroAsText("\\arraystretch");if(null==f)s=1;else if(s=parseFloat(f),!s||s<0)throw new r("Invalid \\arraystretch: "+f)}t.gullet.beginGroup();var g=[],m=[g],v=[],b=[],y=null!=c?[]:void 0;function w(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function x(){y&&(t.gullet.macros.get("\\df@tag")?(y.push(t.subparse([new zr("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(c)&&"1"===t.gullet.macros.get("\\@eqnsw")))}w(),b.push(Hr(t));while(1){var C=t.parseExpression(!1,u?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),C={type:"ordgroup",mode:t.mode,body:C},n&&(C={type:"styling",mode:t.mode,style:n,body:[C]}),g.push(C);var k=t.fetch().text;if("&"===k){if(h&&g.length===h){if(u||l)throw new r("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else{if("\\end"===k){x(),1===g.length&&"styling"===C.type&&0===C.body[0].body.length&&(m.length>1||!d)&&m.pop(),b.length<m.length+1&&b.push([]);break}if("\\\\"!==k)throw new r("Expected & or \\\\ or \\cr or \\end",t.nextToken);t.consume();var A=void 0;" "!==t.gullet.future().text&&(A=t.parseSizeGroup(!0)),v.push(A?A.value:null),x(),b.push(Hr(t)),g=[],m.push(g),w()}}return t.gullet.endGroup(),t.gullet.endGroup(),{type:"array",mode:t.mode,addJot:o,arraystretch:s,body:m,cols:a,rowGaps:v,hskipBeforeAndAfter:i,hLinesBeforeRow:b,colSeparationType:l,tags:y,leqno:p}}function Wr(t){return"d"===t.substr(0,1)?"display":"text"}var $r=function(t,e){var n,i,o=t.body.length,a=t.hLinesBeforeRow,s=0,l=new Array(o),c=[],u=Math.max(e.fontMetrics().arrayRuleWidth,e.minRuleThickness),d=1/e.fontMetrics().ptPerEm,h=5*d;if(t.colSeparationType&&"small"===t.colSeparationType){var p=e.havingStyle(j.SCRIPT).sizeMultiplier;h=p/e.sizeMultiplier*.2778}var f="CD"===t.colSeparationType?pt({number:3,unit:"ex"},e):12*d,m=3*d,v=t.arraystretch*f,b=.7*v,y=.3*v,w=0;function x(t){for(var e=0;e<t.length;++e)e>0&&(w+=.25),c.push({pos:w,isDashed:t[e]})}for(x(a[0]),n=0;n<t.body.length;++n){var C=t.body[n],k=b,A=y;s<C.length&&(s=C.length);var S=new Array(C.length);for(i=0;i<C.length;++i){var E=ln(C[i],e);A<E.depth&&(A=E.depth),k<E.height&&(k=E.height),S[i]=E}var O=t.rowGaps[n],T=0;O&&(T=pt(O,e),T>0&&(T+=y,A<T&&(A=T),T=0)),t.addJot&&(A+=m),S.height=k,S.depth=A,w+=k,S.pos=w,w+=A+T,l[n]=S,x(a[n+1])}var _,M,N=w/2+e.fontMetrics().axisHeight,P=t.cols||[],L=[],D=[];if(t.tags&&t.tags.some((function(t){return t})))for(n=0;n<o;++n){var I=l[n],R=I.pos-N,F=t.tags[n],B=void 0;B=!0===F?Re.makeSpan(["eqn-num"],[],e):!1===F?Re.makeSpan([],[],e):Re.makeSpan([],en(F,e,!0),e),B.depth=I.depth,B.height=I.height,D.push({type:"elem",elem:B,shift:R})}for(i=0,M=0;i<s||M<P.length;++i,++M){var z=P[M]||{},H=!0;while("separator"===z.type){if(H||(_=Re.makeSpan(["arraycolsep"],[]),_.style.width=ft(e.fontMetrics().doubleRuleSep),L.push(_)),"|"!==z.separator&&":"!==z.separator)throw new r("Invalid separator type: "+z.separator);var V="|"===z.separator?"solid":"dashed",q=Re.makeSpan(["vertical-separator"],[],e);q.style.height=ft(w),q.style.borderRightWidth=ft(u),q.style.borderRightStyle=V,q.style.margin="0 "+ft(-u/2);var U=w-N;U&&(q.style.verticalAlign=ft(-U)),L.push(q),M++,z=P[M]||{},H=!1}if(!(i>=s)){var W=void 0;(i>0||t.hskipBeforeAndAfter)&&(W=g.deflt(z.pregap,h),0!==W&&(_=Re.makeSpan(["arraycolsep"],[]),_.style.width=ft(W),L.push(_)));var $=[];for(n=0;n<o;++n){var G=l[n],Y=G[i];if(Y){var X=G.pos-N;Y.depth=G.depth,Y.height=G.height,$.push({type:"elem",elem:Y,shift:X})}}$=Re.makeVList({positionType:"individualShift",children:$},e),$=Re.makeSpan(["col-align-"+(z.align||"c")],[$]),L.push($),(i<s-1||t.hskipBeforeAndAfter)&&(W=g.deflt(z.postgap,h),0!==W&&(_=Re.makeSpan(["arraycolsep"],[]),_.style.width=ft(W),L.push(_)))}}if(l=Re.makeSpan(["mtable"],L),c.length>0){var K=Re.makeLineSpan("hline",e,u),Z=Re.makeLineSpan("hdashline",e,u),J=[{type:"elem",elem:l,shift:0}];while(c.length>0){var Q=c.pop(),tt=Q.pos-N;Q.isDashed?J.push({type:"elem",elem:Z,shift:tt}):J.push({type:"elem",elem:K,shift:tt})}l=Re.makeVList({positionType:"individualShift",children:J},e)}if(0===D.length)return Re.makeSpan(["mord"],[l],e);var et=Re.makeVList({positionType:"individualShift",children:D},e);return et=Re.makeSpan(["tag"],[et],e),Re.makeFragment([l,et])},Gr={c:"center ",l:"left ",r:"right "},Yr=function(t,e){for(var n=[],r=new gn.MathNode("mtd",[],["mtr-glue"]),i=new gn.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<t.body.length;o++){for(var a=t.body[o],s=[],l=0;l<a.length;l++)s.push(new gn.MathNode("mtd",[xn(a[l],e)]));t.tags&&t.tags[o]&&(s.unshift(r),s.push(r),t.leqno?s.unshift(i):s.push(i)),n.push(new gn.MathNode("mtr",s))}var c=new gn.MathNode("mtable",n),u=.5===t.arraystretch?.1:.16+t.arraystretch-1+(t.addJot?.09:0);c.setAttribute("rowspacing",ft(u));var d="",h="";if(t.cols&&t.cols.length>0){var p=t.cols,f="",g=!1,m=0,v=p.length;"separator"===p[0].type&&(d+="top ",m=1),"separator"===p[p.length-1].type&&(d+="bottom ",v-=1);for(var b=m;b<v;b++)"align"===p[b].type?(h+=Gr[p[b].align],g&&(f+="none "),g=!0):"separator"===p[b].type&&g&&(f+="|"===p[b].separator?"solid ":"dashed ",g=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(f)&&c.setAttribute("columnlines",f.trim())}if("align"===t.colSeparationType){for(var y=t.cols||[],w="",x=1;x<y.length;x++)w+=x%2?"0em ":"1em ";c.setAttribute("columnspacing",w.trim())}else"alignat"===t.colSeparationType||"gather"===t.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===t.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===t.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var C="",k=t.hLinesBeforeRow;d+=k[0].length>0?"left ":"",d+=k[k.length-1].length>0?"right ":"";for(var A=1;A<k.length-1;A++)C+=0===k[A].length?"none ":k[A][0]?"dashed ":"solid ";return/[sd]/.test(C)&&c.setAttribute("rowlines",C.trim()),""!==d&&(c=new gn.MathNode("menclose",[c]),c.setAttribute("notation",d.trim())),t.arraystretch&&t.arraystretch<1&&(c=new gn.MathNode("mstyle",[c]),c.setAttribute("scriptlevel","1")),c},Xr=function(t,e){-1===t.envName.indexOf("ed")&&Vr(t);var n,i=[],o=t.envName.indexOf("at")>-1?"alignat":"align",a="split"===t.envName,s=Ur(t.parser,{cols:i,addJot:!0,autoTag:a?void 0:qr(t.envName),emptySingleRow:!0,colSeparationType:o,maxNumCols:a?2:void 0,leqno:t.parser.settings.leqno},"display"),l=0,c={type:"ordgroup",mode:t.mode,body:[]};if(e[0]&&"ordgroup"===e[0].type){for(var u="",d=0;d<e[0].body.length;d++){var h=Dn(e[0].body[d],"textord");u+=h.text}n=Number(u),l=2*n}var p=!l;s.body.forEach((function(t){for(var e=1;e<t.length;e+=2){var i=Dn(t[e],"styling"),o=Dn(i.body[0],"ordgroup");o.body.unshift(c)}if(p)l<t.length&&(l=t.length);else{var a=t.length/2;if(n<a)throw new r("Too many math in a row: expected "+n+", but got "+a,t[0])}}));for(var f=0;f<l;++f){var g="r",m=0;f%2===1?g="l":f>0&&p&&(m=1),i[f]={type:"align",align:g,pregap:m,postgap:0}}return s.colSeparationType=p?"align":"alignat",s};Ir({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(t,e){var n=In(e[0]),i=n?[e[0]]:Dn(e[0],"ordgroup").body,o=i.map((function(t){var e=jn(t),n=e.text;if(-1!=="lcr".indexOf(n))return{type:"align",align:n};if("|"===n)return{type:"separator",separator:"|"};if(":"===n)return{type:"separator",separator:":"};throw new r("Unknown column alignment: "+n,t)})),a={cols:o,hskipBeforeAndAfter:!0,maxNumCols:o.length};return Ur(t.parser,a,Wr(t.envName))},htmlBuilder:$r,mathmlBuilder:Yr}),Ir({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler:function(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",i={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===t.envName.charAt(t.envName.length-1)){var o=t.parser;if(o.consumeSpaces(),"["===o.fetch().text){if(o.consume(),o.consumeSpaces(),n=o.fetch().text,-1==="lcr".indexOf(n))throw new r("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),i.cols=[{type:"align",align:n}]}}var a=Ur(t.parser,i,Wr(t.envName)),s=Math.max.apply(Math,[0].concat(a.body.map((function(t){return t.length}))));return a.cols=new Array(s).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:$r,mathmlBuilder:Yr}),Ir({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(t){var e={arraystretch:.5},n=Ur(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:$r,mathmlBuilder:Yr}),Ir({type:"array",names:["subarray"],props:{numArgs:1},handler:function(t,e){var n=In(e[0]),i=n?[e[0]]:Dn(e[0],"ordgroup").body,o=i.map((function(t){var e=jn(t),n=e.text;if(-1!=="lc".indexOf(n))return{type:"align",align:n};throw new r("Unknown column alignment: "+n,t)}));if(o.length>1)throw new r("{subarray} can contain only one column");var a={cols:o,hskipBeforeAndAfter:!1,arraystretch:.5};if(a=Ur(t.parser,a,"script"),a.body.length>0&&a.body[0].length>1)throw new r("{subarray} can contain only one column");return a},htmlBuilder:$r,mathmlBuilder:Yr}),Ir({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler:function(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Ur(t.parser,e,Wr(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:$r,mathmlBuilder:Yr}),Ir({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Xr,htmlBuilder:$r,mathmlBuilder:Yr}),Ir({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler:function(t){g.contains(["gather","gather*"],t.envName)&&Vr(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:qr(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Ur(t.parser,e,"display")},htmlBuilder:$r,mathmlBuilder:Yr}),Ir({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Xr,htmlBuilder:$r,mathmlBuilder:Yr}),Ir({type:"array",names:["equation","equation*"],props:{numArgs:0},handler:function(t){Vr(t);var e={autoTag:qr(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Ur(t.parser,e,"display")},htmlBuilder:$r,mathmlBuilder:Yr}),Ir({type:"array",names:["CD"],props:{numArgs:0},handler:function(t){return Vr(t),$n(t.parser)},htmlBuilder:$r,mathmlBuilder:Yr}),Fr("\\nonumber","\\gdef\\@eqnsw{0}"),Fr("\\notag","\\nonumber"),$e({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler:function(t,e){throw new r(t.funcName+" valid only within array environment")}});var Kr=jr,Zr=Kr;$e({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler:function(t,e){var n=t.parser,i=t.funcName,o=e[0];if("ordgroup"!==o.type)throw new r("Invalid environment name",o);for(var a="",s=0;s<o.body.length;++s)a+=Dn(o.body[s],"textord").text;if("\\begin"===i){if(!Zr.hasOwnProperty(a))throw new r("No such environment: "+a,o);var l=Zr[a],c=n.parseArguments("\\begin{"+a+"}",l),u=c.args,d=c.optArgs,h={mode:n.mode,envName:a,parser:n},p=l.handler(h,u,d);n.expect("\\end",!1);var f=n.nextToken,g=Dn(n.parseFunction(),"environment");if(g.name!==a)throw new r("Mismatch: \\begin{"+a+"} matched by \\end{"+g.name+"}",f);return p}return{type:"environment",mode:n.mode,name:a,nameGroup:o}}});var Jr=Re.makeSpan;function Qr(t,e){var n=en(t.body,e,!0);return Jr([t.mclass],n,e)}function ti(t,e){var n,r=yn(t.body,e);return"minner"===t.mclass?n=new gn.MathNode("mpadded",r):"mord"===t.mclass?t.isCharacterBox?(n=r[0],n.type="mi"):n=new gn.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new gn.MathNode("mo",r),"mbin"===t.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===t.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===t.mclass||"mclose"===t.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===t.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}$e({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler:function(t,e){var n=t.parser,r=t.funcName,i=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.substr(5),body:Xe(i),isCharacterBox:g.isCharacterBox(i)}},htmlBuilder:Qr,mathmlBuilder:ti});var ei=function(t){var e="ordgroup"===t.type&&t.body.length?t.body[0]:t;return"atom"!==e.type||"bin"!==e.family&&"rel"!==e.family?"mord":"m"+e.family};$e({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:function(t,e){var n=t.parser;return{type:"mclass",mode:n.mode,mclass:ei(e[0]),body:Xe(e[1]),isCharacterBox:g.isCharacterBox(e[1])}}}),$e({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler:function(t,e){var n,r=t.parser,i=t.funcName,o=e[1],a=e[0];n="\\stackrel"!==i?ei(o):"mrel";var s={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:Xe(o)},l={type:"supsub",mode:a.mode,base:s,sup:"\\underset"===i?null:a,sub:"\\underset"===i?a:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:g.isCharacterBox(l)}},htmlBuilder:Qr,mathmlBuilder:ti});var ni=function(t,e){var n=t.font,r=e.withFont(n);return ln(t.body,r)},ri=function(t,e){var n=t.font,r=e.withFont(n);return xn(t.body,r)},ii={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};$e({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:function(t,e){var n=t.parser,r=t.funcName,i=Ye(e[0]),o=r;return o in ii&&(o=ii[o]),{type:"font",mode:n.mode,font:o.slice(1),body:i}},htmlBuilder:ni,mathmlBuilder:ri}),$e({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:function(t,e){var n=t.parser,r=e[0],i=g.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:ei(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}}),$e({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:function(t,e){var n=t.parser,r=t.funcName,i=t.breakOnTokenText,o=n.mode,a=n.parseExpression(!0,i),s="math"+r.slice(1);return{type:"font",mode:o,font:s,body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:ni,mathmlBuilder:ri});var oi=function(t,e){var n=e;return"display"===t?n=n.id>=j.SCRIPT.id?n.text():j.DISPLAY:"text"===t&&n.size===j.DISPLAY.size?n=j.TEXT:"script"===t?n=j.SCRIPT:"scriptscript"===t&&(n=j.SCRIPTSCRIPT),n},ai=function(t,e){var n,r=oi(t.size,e.style),i=r.fracNum(),o=r.fracDen();n=e.havingStyle(i);var a=ln(t.numer,n,e);if(t.continued){var s=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=e.havingStyle(o);var c,u,d,h,p,f,g,m,v,b,y=ln(t.denom,n,e);if(t.hasBarLine?(t.barSize?(u=pt(t.barSize,e),c=Re.makeLineSpan("frac-line",e,u)):c=Re.makeLineSpan("frac-line",e),u=c.height,d=c.height):(c=null,u=0,d=e.fontMetrics().defaultRuleThickness),r.size===j.DISPLAY.size||"display"===t.size?(h=e.fontMetrics().num1,p=u>0?3*d:7*d,f=e.fontMetrics().denom1):(u>0?(h=e.fontMetrics().num2,p=d):(h=e.fontMetrics().num3,p=3*d),f=e.fontMetrics().denom2),c){var w=e.fontMetrics().axisHeight;h-a.depth-(w+.5*u)<p&&(h+=p-(h-a.depth-(w+.5*u))),w-.5*u-(y.height-f)<p&&(f+=p-(w-.5*u-(y.height-f)));var x=-(w-.5*u);g=Re.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:f},{type:"elem",elem:c,shift:x},{type:"elem",elem:a,shift:-h}]},e)}else{var C=h-a.depth-(y.height-f);C<p&&(h+=.5*(p-C),f+=.5*(p-C)),g=Re.makeVList({positionType:"individualShift",children:[{type:"elem",elem:y,shift:f},{type:"elem",elem:a,shift:-h}]},e)}return n=e.havingStyle(r),g.height*=n.sizeMultiplier/e.sizeMultiplier,g.depth*=n.sizeMultiplier/e.sizeMultiplier,m=r.size===j.DISPLAY.size?e.fontMetrics().delim1:r.size===j.SCRIPTSCRIPT.size?e.havingStyle(j.SCRIPT).fontMetrics().delim2:e.fontMetrics().delim2,v=null==t.leftDelim?sn(e,["mopen"]):Tr.customSizedDelim(t.leftDelim,m,!0,e.havingStyle(r),t.mode,["mopen"]),b=t.continued?Re.makeSpan([]):null==t.rightDelim?sn(e,["mclose"]):Tr.customSizedDelim(t.rightDelim,m,!0,e.havingStyle(r),t.mode,["mclose"]),Re.makeSpan(["mord"].concat(n.sizingClasses(e)),[v,Re.makeSpan(["mfrac"],[g]),b],e)},si=function(t,e){var n=new gn.MathNode("mfrac",[xn(t.numer,e),xn(t.denom,e)]);if(t.hasBarLine){if(t.barSize){var r=pt(t.barSize,e);n.setAttribute("linethickness",ft(r))}}else n.setAttribute("linethickness","0px");var i=oi(t.size,e.style);if(i.size!==e.style.size){n=new gn.MathNode("mstyle",[n]);var o=i.size===j.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",o),n.setAttribute("scriptlevel","0")}if(null!=t.leftDelim||null!=t.rightDelim){var a=[];if(null!=t.leftDelim){var s=new gn.MathNode("mo",[new gn.TextNode(t.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=t.rightDelim){var l=new gn.MathNode("mo",[new gn.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return vn(a)}return n};$e({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:function(t,e){var n,r=t.parser,i=t.funcName,o=e[0],a=e[1],s=null,l=null,c="auto";switch(i){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(i){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:o,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:ai,mathmlBuilder:si}),$e({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:function(t,e){var n=t.parser,r=(t.funcName,e[0]),i=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:r,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),$e({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler:function(t){var e,n=t.parser,r=t.funcName,i=t.token;switch(r){case"\\over":e="\\frac";break;case"\\choose":e="\\binom";break;case"\\atop":e="\\\\atopfrac";break;case"\\brace":e="\\\\bracefrac";break;case"\\brack":e="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:e,token:i}}});var li=["display","text","script","scriptscript"],ci=function(t){var e=null;return t.length>0&&(e=t,e="."===e?null:e),e};$e({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler:function(t,e){var n,r=t.parser,i=e[4],o=e[5],a=Ye(e[0]),s="atom"===a.type&&"open"===a.family?ci(a.text):null,l=Ye(e[1]),c="atom"===l.type&&"close"===l.family?ci(l.text):null,u=Dn(e[2],"size"),d=null;u.isBlank?n=!0:(d=u.value,n=d.number>0);var h="auto",p=e[3];if("ordgroup"===p.type){if(p.body.length>0){var f=Dn(p.body[0],"textord");h=li[Number(f.text)]}}else p=Dn(p,"textord"),h=li[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:i,denom:o,continued:!1,hasBarLine:n,barSize:d,leftDelim:s,rightDelim:c,size:h}},htmlBuilder:ai,mathmlBuilder:si}),$e({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(t,e){var n=t.parser,r=(t.funcName,t.token);return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Dn(e[0],"size").value,token:r}}}),$e({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(t,e){var n=t.parser,r=(t.funcName,e[0]),i=p(Dn(e[1],"infix").size),o=e[2],a=i.number>0;return{type:"genfrac",mode:n.mode,numer:r,denom:o,continued:!1,hasBarLine:a,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:ai,mathmlBuilder:si});var ui=function(t,e){var n,r,i=e.style;"supsub"===t.type?(n=t.sup?ln(t.sup,e.havingStyle(i.sup()),e):ln(t.sub,e.havingStyle(i.sub()),e),r=Dn(t.base,"horizBrace")):r=Dn(t,"horizBrace");var o,a=ln(r.base,e.havingBaseStyle(j.DISPLAY)),s=Ln.svgSpan(r,e);if(r.isOver?(o=Re.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},e),o.children[0].children[0].children[1].classes.push("svg-align")):(o=Re.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},e),o.children[0].children[0].children[0].classes.push("svg-align")),n){var l=Re.makeSpan(["mord",r.isOver?"mover":"munder"],[o],e);o=r.isOver?Re.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},e):Re.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return Re.makeSpan(["mord",r.isOver?"mover":"munder"],[o],e)},di=function(t,e){var n=Ln.mathMLnode(t.label);return new gn.MathNode(t.isOver?"mover":"munder",[xn(t.base,e),n])};$e({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(t,e){var n=t.parser,r=t.funcName;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:ui,mathmlBuilder:di}),$e({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(t,e){var n=t.parser,r=e[1],i=Dn(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:Xe(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:function(t,e){var n=en(t.body,e,!1);return Re.makeAnchor(t.href,[],n,e)},mathmlBuilder:function(t,e){var n=wn(t.body,e);return n instanceof hn||(n=new hn("mrow",[n])),n.setAttribute("href",t.href),n}}),$e({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(t,e){var n=t.parser,r=Dn(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],o=0;o<r.length;o++){var a=r[o];"~"===a&&(a="\\textasciitilde"),i.push({type:"textord",mode:"text",text:a})}var s={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:Xe(s)}}}),$e({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler:function(t,e){var n=t.parser;return{type:"hbox",mode:n.mode,body:Xe(e[0])}},htmlBuilder:function(t,e){var n=en(t.body,e,!1);return Re.makeFragment(n)},mathmlBuilder:function(t,e){return new gn.MathNode("mrow",yn(t.body,e))}}),$e({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:function(t,e){var n,i=t.parser,o=t.funcName,a=(t.token,Dn(e[0],"raw").string),s=e[1];i.settings.strict&&i.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(o){case"\\htmlClass":l.class=a,n={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,n={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,n={command:"\\htmlStyle",style:a};break;case"\\htmlData":for(var c=a.split(","),u=0;u<c.length;u++){var d=c[u].split("=");if(2!==d.length)throw new r("Error parsing key-value for \\htmlData");l["data-"+d[0].trim()]=d[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return i.settings.isTrusted(n)?{type:"html",mode:i.mode,attributes:l,body:Xe(s)}:i.formatUnsupportedCmd(o)},htmlBuilder:function(t,e){var n=en(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push.apply(r,t.attributes.class.trim().split(/\s+/));var i=Re.makeSpan(r,n,e);for(var o in t.attributes)"class"!==o&&t.attributes.hasOwnProperty(o)&&i.setAttribute(o,t.attributes[o]);return i},mathmlBuilder:function(t,e){return wn(t.body,e)}}),$e({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:function(t,e){var n=t.parser;return{type:"htmlmathml",mode:n.mode,html:Xe(e[0]),mathml:Xe(e[1])}},htmlBuilder:function(t,e){var n=en(t.html,e,!1);return Re.makeFragment(n)},mathmlBuilder:function(t,e){return wn(t.mathml,e)}});var hi=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var e=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!e)throw new r("Invalid size: '"+t+"' in \\includegraphics");var n={number:+(e[1]+e[2]),unit:e[3]};if(!ht(n))throw new r("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};$e({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:function(t,e,n){var i=t.parser,o={number:0,unit:"em"},a={number:.9,unit:"em"},s={number:0,unit:"em"},l="";if(n[0])for(var c=Dn(n[0],"raw").string,u=c.split(","),d=0;d<u.length;d++){var h=u[d].split("=");if(2===h.length){var p=h[1].trim();switch(h[0].trim()){case"alt":l=p;break;case"width":o=hi(p);break;case"height":a=hi(p);break;case"totalheight":s=hi(p);break;default:throw new r("Invalid key: '"+h[0]+"' in \\includegraphics.")}}}var f=Dn(e[0],"url").url;return""===l&&(l=f,l=l.replace(/^.*[\\/]/,""),l=l.substring(0,l.lastIndexOf("."))),i.settings.isTrusted({command:"\\includegraphics",url:f})?{type:"includegraphics",mode:i.mode,alt:l,width:o,height:a,totalheight:s,src:f}:i.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(t,e){var n=pt(t.height,e),r=0;t.totalheight.number>0&&(r=pt(t.totalheight,e)-n);var i=0;t.width.number>0&&(i=pt(t.width,e));var o={height:ft(n+r)};i>0&&(o.width=ft(i)),r>0&&(o.verticalAlign=ft(-r));var a=new xt(t.src,t.alt,o);return a.height=n,a.depth=r,a},mathmlBuilder:function(t,e){var n=new gn.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=pt(t.height,e),i=0;if(t.totalheight.number>0&&(i=pt(t.totalheight,e)-r,n.setAttribute("valign",ft(-i))),n.setAttribute("height",ft(r+i)),t.width.number>0){var o=pt(t.width,e);n.setAttribute("width",ft(o))}return n.setAttribute("src",t.src),n}}),$e({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler:function(t,e){var n=t.parser,r=t.funcName,i=Dn(e[0],"size");if(n.settings.strict){var o="m"===r[1],a="mu"===i.value.unit;o?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:function(t,e){return Re.makeGlue(t.dimension,e)},mathmlBuilder:function(t,e){var n=pt(t.dimension,e);return new gn.SpaceNode(n)}}),$e({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(t,e){var n=t.parser,r=t.funcName,i=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:function(t,e){var n;"clap"===t.alignment?(n=Re.makeSpan([],[ln(t.body,e)]),n=Re.makeSpan(["inner"],[n],e)):n=Re.makeSpan(["inner"],[ln(t.body,e)]);var r=Re.makeSpan(["fix"],[]),i=Re.makeSpan([t.alignment],[n,r],e),o=Re.makeSpan(["strut"]);return o.style.height=ft(i.height+i.depth),i.depth&&(o.style.verticalAlign=ft(-i.depth)),i.children.unshift(o),i=Re.makeSpan(["thinbox"],[i],e),Re.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:function(t,e){var n=new gn.MathNode("mpadded",[xn(t.body,e)]);if("rlap"!==t.alignment){var r="llap"===t.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),$e({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(t,e){var n=t.funcName,r=t.parser,i=r.mode;r.switchMode("math");var o="\\("===n?"\\)":"$",a=r.parseExpression(!1,o);return r.expect(o),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:a}}}),$e({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(t,e){throw new r("Mismatched "+t.funcName)}});var pi=function(t,e){switch(e.style.size){case j.DISPLAY.size:return t.display;case j.TEXT.size:return t.text;case j.SCRIPT.size:return t.script;case j.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};$e({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:function(t,e){var n=t.parser;return{type:"mathchoice",mode:n.mode,display:Xe(e[0]),text:Xe(e[1]),script:Xe(e[2]),scriptscript:Xe(e[3])}},htmlBuilder:function(t,e){var n=pi(t,e),r=en(n,e,!1);return Re.makeFragment(r)},mathmlBuilder:function(t,e){var n=pi(t,e);return wn(n,e)}});var fi=function(t,e,n,r,i,o,a){t=Re.makeSpan([],[t]);var s,l,c,u=n&&g.isCharacterBox(n);if(e){var d=ln(e,r.havingStyle(i.sup()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var h=ln(n,r.havingStyle(i.sub()),r);s={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+t.depth+a;c=Re.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ft(-o)},{type:"kern",size:s.kern},{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:ft(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var f=t.height-a;c=Re.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ft(-o)},{type:"kern",size:s.kern},{type:"elem",elem:t}]},r)}else{if(!l)return t;var m=t.depth+a;c=Re.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:ft(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var v=[c];if(s&&0!==o&&!u){var b=Re.makeSpan(["mspace"],[],r);b.style.marginRight=ft(o),v.unshift(b)}return Re.makeSpan(["mop","op-limits"],v,r)},gi=["\\smallint"],mi=function(t,e){var n,r,i,o=!1;"supsub"===t.type?(n=t.sup,r=t.sub,i=Dn(t.base,"op"),o=!0):i=Dn(t,"op");var a,s=e.style,l=!1;if(s.size===j.DISPLAY.size&&i.symbol&&!g.contains(gi,i.name)&&(l=!0),i.symbol){var c=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==i.name&&"\\oiiint"!==i.name||(u=i.name.substr(1),i.name="oiint"===u?"\\iint":"\\iiint"),a=Re.makeSymbol(i.name,c,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var d=a.italic,h=Re.staticSvg(u+"Size"+(l?"2":"1"),e);a=Re.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},e),i.name="\\"+u,a.classes.unshift("mop"),a.italic=d}}else if(i.body){var p=en(i.body,e,!0);1===p.length&&p[0]instanceof kt?(a=p[0],a.classes[0]="mop"):a=Re.makeSpan(["mop"],p,e)}else{for(var f=[],m=1;m<i.name.length;m++)f.push(Re.mathsym(i.name[m],i.mode,e));a=Re.makeSpan(["mop"],f,e)}var v=0,b=0;return(a instanceof kt||"\\oiint"===i.name||"\\oiiint"===i.name)&&!i.suppressBaseShift&&(v=(a.height-a.depth)/2-e.fontMetrics().axisHeight,b=a.italic),o?fi(a,n,r,e,s,b,v):(v&&(a.style.position="relative",a.style.top=ft(v)),a)},vi=function(t,e){var n;if(t.symbol)n=new hn("mo",[mn(t.name,t.mode)]),g.contains(gi,t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new hn("mo",yn(t.body,e));else{n=new hn("mi",[new pn(t.name.slice(1))]);var r=new hn("mo",[mn("","text")]);n=t.parentIsSupSub?new hn("mrow",[n,r]):dn([n,r])}return n},bi={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","":"\\bigvee","⋂":"\\bigcap","":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};$e({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","","⋂","","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:function(t,e){var n=t.parser,r=t.funcName,i=r;return 1===i.length&&(i=bi[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:mi,mathmlBuilder:vi}),$e({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:function(t,e){var n=t.parser,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Xe(r)}},htmlBuilder:mi,mathmlBuilder:vi});var yi={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};$e({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler:function(t){var e=t.parser,n=t.funcName;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:mi,mathmlBuilder:vi}),$e({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler:function(t){var e=t.parser,n=t.funcName;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:mi,mathmlBuilder:vi}),$e({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler:function(t){var e=t.parser,n=t.funcName,r=n;return 1===r.length&&(r=yi[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:mi,mathmlBuilder:vi});var wi=function(t,e){var n,r,i,o,a=!1;if("supsub"===t.type?(n=t.sup,r=t.sub,i=Dn(t.base,"operatorname"),a=!0):i=Dn(t,"operatorname"),i.body.length>0){for(var s=i.body.map((function(t){var e=t.text;return"string"===typeof e?{type:"textord",mode:t.mode,text:e}:t})),l=en(s,e.withFont("mathrm"),!0),c=0;c<l.length;c++){var u=l[c];u instanceof kt&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=Re.makeSpan(["mop"],l,e)}else o=Re.makeSpan(["mop"],[],e);return a?fi(o,n,r,e,e.style,0,0):o},xi=function(t,e){for(var n=yn(t.body,e.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var o=n[i];if(o instanceof gn.SpaceNode);else if(o instanceof gn.MathNode)switch(o.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":var a=o.children[0];1===o.children.length&&a instanceof gn.TextNode?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var s=n.map((function(t){return t.toText()})).join("");n=[new gn.TextNode(s)]}var l=new gn.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new gn.MathNode("mo",[mn("","text")]);return t.parentIsSupSub?new gn.MathNode("mrow",[l,c]):gn.newDocumentFragment([l,c])};function Ci(t,e,n){for(var r=en(t,e,!1),i=e.sizeMultiplier/n.sizeMultiplier,o=0;o<r.length;o++){var a=r[o].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[o].classes,e.sizingClasses(n)):r[o].classes[a+1]==="reset-size"+e.size&&(r[o].classes[a+1]="reset-size"+n.size),r[o].height*=i,r[o].depth*=i}return Re.makeFragment(r)}$e({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:function(t,e){var n=t.parser,r=t.funcName,i=e[0];return{type:"operatorname",mode:n.mode,body:Xe(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:wi,mathmlBuilder:xi}),Fr("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Ge({type:"ordgroup",htmlBuilder:function(t,e){return t.semisimple?Re.makeFragment(en(t.body,e,!1)):Re.makeSpan(["mord"],en(t.body,e,!0),e)},mathmlBuilder:function(t,e){return wn(t.body,e,!0)}}),$e({type:"overline",names:["\\overline"],props:{numArgs:1},handler:function(t,e){var n=t.parser,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder:function(t,e){var n=ln(t.body,e.havingCrampedStyle()),r=Re.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,o=Re.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},e);return Re.makeSpan(["mord","overline"],[o],e)},mathmlBuilder:function(t,e){var n=new gn.MathNode("mo",[new gn.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new gn.MathNode("mover",[xn(t.body,e),n]);return r.setAttribute("accent","true"),r}}),$e({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:function(t,e){var n=t.parser,r=e[0];return{type:"phantom",mode:n.mode,body:Xe(r)}},htmlBuilder:function(t,e){var n=en(t.body,e.withPhantom(),!1);return Re.makeFragment(n)},mathmlBuilder:function(t,e){var n=yn(t.body,e);return new gn.MathNode("mphantom",n)}}),$e({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:function(t,e){var n=t.parser,r=e[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:function(t,e){var n=Re.makeSpan([],[ln(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=Re.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e),Re.makeSpan(["mord"],[n],e)},mathmlBuilder:function(t,e){var n=yn(Xe(t.body),e),r=new gn.MathNode("mphantom",n),i=new gn.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}}),$e({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:function(t,e){var n=t.parser,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:function(t,e){var n=Re.makeSpan(["inner"],[ln(t.body,e.withPhantom())]),r=Re.makeSpan(["fix"],[]);return Re.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:function(t,e){var n=yn(Xe(t.body),e),r=new gn.MathNode("mphantom",n),i=new gn.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}}),$e({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler:function(t,e){var n=t.parser,r=Dn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder:function(t,e){var n=ln(t.body,e),r=pt(t.dy,e);return Re.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder:function(t,e){var n=new gn.MathNode("mpadded",[xn(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}}),$e({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler:function(t){var e=t.parser;return{type:"internal",mode:e.mode}}}),$e({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler:function(t,e,n){var r=t.parser,i=n[0],o=Dn(e[0],"size"),a=Dn(e[1],"size");return{type:"rule",mode:r.mode,shift:i&&Dn(i,"size").value,width:o.value,height:a.value}},htmlBuilder:function(t,e){var n=Re.makeSpan(["mord","rule"],[],e),r=pt(t.width,e),i=pt(t.height,e),o=t.shift?pt(t.shift,e):0;return n.style.borderRightWidth=ft(r),n.style.borderTopWidth=ft(i),n.style.bottom=ft(o),n.width=r,n.height=i+o,n.depth=-o,n.maxFontSize=1.125*i*e.sizeMultiplier,n},mathmlBuilder:function(t,e){var n=pt(t.width,e),r=pt(t.height,e),i=t.shift?pt(t.shift,e):0,o=e.color&&e.getColor()||"black",a=new gn.MathNode("mspace");a.setAttribute("mathbackground",o),a.setAttribute("width",ft(n)),a.setAttribute("height",ft(r));var s=new gn.MathNode("mpadded",[a]);return i>=0?s.setAttribute("height",ft(i)):(s.setAttribute("height",ft(i)),s.setAttribute("depth",ft(-i))),s.setAttribute("voffset",ft(i)),s}});var ki=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],Ai=function(t,e){var n=e.havingSize(t.size);return Ci(t.body,n,e)};$e({type:"sizing",names:ki,props:{numArgs:0,allowedInText:!0},handler:function(t,e){var n=t.breakOnTokenText,r=t.funcName,i=t.parser,o=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:ki.indexOf(r)+1,body:o}},htmlBuilder:Ai,mathmlBuilder:function(t,e){var n=e.havingSize(t.size),r=yn(t.body,n),i=new gn.MathNode("mstyle",r);return i.setAttribute("mathsize",ft(n.sizeMultiplier)),i}}),$e({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(t,e,n){var r=t.parser,i=!1,o=!1,a=n[0]&&Dn(n[0],"ordgroup");if(a)for(var s="",l=0;l<a.body.length;++l){var c=a.body[l];if(s=c.text,"t"===s)i=!0;else{if("b"!==s){i=!1,o=!1;break}o=!0}}else i=!0,o=!0;var u=e[0];return{type:"smash",mode:r.mode,body:u,smashHeight:i,smashDepth:o}},htmlBuilder:function(t,e){var n=Re.makeSpan([],[ln(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(t.smashDepth&&(n.depth=0,n.children))for(var i=0;i<n.children.length;i++)n.children[i].depth=0;var o=Re.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},e);return Re.makeSpan(["mord"],[o],e)},mathmlBuilder:function(t,e){var n=new gn.MathNode("mpadded",[xn(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}}),$e({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler:function(t,e,n){var r=t.parser,i=n[0],o=e[0];return{type:"sqrt",mode:r.mode,body:o,index:i}},htmlBuilder:function(t,e){var n=ln(t.body,e.havingCrampedStyle());0===n.height&&(n.height=e.fontMetrics().xHeight),n=Re.wrapFragment(n,e);var r=e.fontMetrics(),i=r.defaultRuleThickness,o=i;e.style.id<j.TEXT.id&&(o=e.fontMetrics().xHeight);var a=i+o/4,s=n.height+n.depth+a+i,l=Tr.sqrtImage(s,e),c=l.span,u=l.ruleWidth,d=l.advanceWidth,h=c.height-u;h>n.height+n.depth+a&&(a=(a+h-n.height-n.depth)/2);var p=c.height-n.height-a-u;n.style.paddingLeft=ft(d);var f=Re.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+p)},{type:"elem",elem:c},{type:"kern",size:u}]},e);if(t.index){var g=e.havingStyle(j.SCRIPTSCRIPT),m=ln(t.index,g,e),v=.6*(f.height-f.depth),b=Re.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:m}]},e),y=Re.makeSpan(["root"],[b]);return Re.makeSpan(["mord","sqrt"],[y,f],e)}return Re.makeSpan(["mord","sqrt"],[f],e)},mathmlBuilder:function(t,e){var n=t.body,r=t.index;return r?new gn.MathNode("mroot",[xn(n,e),xn(r,e)]):new gn.MathNode("msqrt",[xn(n,e)])}});var Si={display:j.DISPLAY,text:j.TEXT,script:j.SCRIPT,scriptscript:j.SCRIPTSCRIPT};$e({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(t,e){var n=t.breakOnTokenText,r=t.funcName,i=t.parser,o=i.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:a,body:o}},htmlBuilder:function(t,e){var n=Si[t.style],r=e.havingStyle(n).withFont("");return Ci(t.body,r,e)},mathmlBuilder:function(t,e){var n=Si[t.style],r=e.havingStyle(n),i=yn(t.body,r),o=new gn.MathNode("mstyle",i),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=a[t.style];return o.setAttribute("scriptlevel",s[0]),o.setAttribute("displaystyle",s[1]),o}});var Ei=function(t,e){var n=t.base;if(n){if("op"===n.type){var r=n.limits&&(e.style.size===j.DISPLAY.size||n.alwaysHandleSupSub);return r?mi:null}if("operatorname"===n.type){var i=n.alwaysHandleSupSub&&(e.style.size===j.DISPLAY.size||n.limits);return i?wi:null}if("accent"===n.type)return g.isCharacterBox(n.base)?Rn:null;if("horizBrace"===n.type){var o=!t.sub;return o===n.isOver?ui:null}return null}return null};Ge({type:"supsub",htmlBuilder:function(t,e){var n=Ei(t,e);if(n)return n(t,e);var r,i,o,a=t.base,s=t.sup,l=t.sub,c=ln(a,e),u=e.fontMetrics(),d=0,h=0,p=a&&g.isCharacterBox(a);if(s){var f=e.havingStyle(e.style.sup());r=ln(s,f,e),p||(d=c.height-f.fontMetrics().supDrop*f.sizeMultiplier/e.sizeMultiplier)}if(l){var m=e.havingStyle(e.style.sub());i=ln(l,m,e),p||(h=c.depth+m.fontMetrics().subDrop*m.sizeMultiplier/e.sizeMultiplier)}o=e.style===j.DISPLAY?u.sup1:e.style.cramped?u.sup3:u.sup2;var v,b=e.sizeMultiplier,y=ft(.5/u.ptPerEm/b),w=null;if(i){var x=t.base&&"op"===t.base.type&&t.base.name&&("\\oiint"===t.base.name||"\\oiiint"===t.base.name);(c instanceof kt||x)&&(w=ft(-c.italic))}if(r&&i){d=Math.max(d,o,r.depth+.25*u.xHeight),h=Math.max(h,u.sub2);var C=u.defaultRuleThickness,k=4*C;if(d-r.depth-(i.height-h)<k){h=k-(d-r.depth)+i.height;var A=.8*u.xHeight-(d-r.depth);A>0&&(d+=A,h-=A)}var S=[{type:"elem",elem:i,shift:h,marginRight:y,marginLeft:w},{type:"elem",elem:r,shift:-d,marginRight:y}];v=Re.makeVList({positionType:"individualShift",children:S},e)}else if(i){h=Math.max(h,u.sub1,i.height-.8*u.xHeight);var E=[{type:"elem",elem:i,marginLeft:w,marginRight:y}];v=Re.makeVList({positionType:"shift",positionData:h,children:E},e)}else{if(!r)throw new Error("supsub must have either sup or sub.");d=Math.max(d,o,r.depth+.25*u.xHeight),v=Re.makeVList({positionType:"shift",positionData:-d,children:[{type:"elem",elem:r,marginRight:y}]},e)}var O=an(c,"right")||"mord";return Re.makeSpan([O],[c,Re.makeSpan(["msupsub"],[v])],e)},mathmlBuilder:function(t,e){var n,r,i=!1;t.base&&"horizBrace"===t.base.type&&(r=!!t.sup,r===t.base.isOver&&(i=!0,n=t.base.isOver)),!t.base||"op"!==t.base.type&&"operatorname"!==t.base.type||(t.base.parentIsSupSub=!0);var o,a=[xn(t.base,e)];if(t.sub&&a.push(xn(t.sub,e)),t.sup&&a.push(xn(t.sup,e)),i)o=n?"mover":"munder";else if(t.sub)if(t.sup){var s=t.base;o=s&&"op"===s.type&&s.limits&&e.style===j.DISPLAY||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(e.style===j.DISPLAY||s.limits)?"munderover":"msubsup"}else{var l=t.base;o=l&&"op"===l.type&&l.limits&&(e.style===j.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||e.style===j.DISPLAY)?"munder":"msub"}else{var c=t.base;o=c&&"op"===c.type&&c.limits&&(e.style===j.DISPLAY||c.alwaysHandleSupSub)||c&&"operatorname"===c.type&&c.alwaysHandleSupSub&&(c.limits||e.style===j.DISPLAY)?"mover":"msup"}return new gn.MathNode(o,a)}}),Ge({type:"atom",htmlBuilder:function(t,e){return Re.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder:function(t,e){var n=new gn.MathNode("mo",[mn(t.text,t.mode)]);if("bin"===t.family){var r=bn(t,e);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===t.family?n.setAttribute("separator","true"):"open"!==t.family&&"close"!==t.family||n.setAttribute("stretchy","false");return n}});var Oi={mi:"italic",mn:"normal",mtext:"normal"};Ge({type:"mathord",htmlBuilder:function(t,e){return Re.makeOrd(t,e,"mathord")},mathmlBuilder:function(t,e){var n=new gn.MathNode("mi",[mn(t.text,t.mode,e)]),r=bn(t,e)||"italic";return r!==Oi[n.type]&&n.setAttribute("mathvariant",r),n}}),Ge({type:"textord",htmlBuilder:function(t,e){return Re.makeOrd(t,e,"textord")},mathmlBuilder:function(t,e){var n,r=mn(t.text,t.mode,e),i=bn(t,e)||"normal";return n="text"===t.mode?new gn.MathNode("mtext",[r]):/[0-9]/.test(t.text)?new gn.MathNode("mn",[r]):"\\prime"===t.text?new gn.MathNode("mo",[r]):new gn.MathNode("mi",[r]),i!==Oi[n.type]&&n.setAttribute("mathvariant",i),n}});var Ti={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},_i={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ge({type:"spacing",htmlBuilder:function(t,e){if(_i.hasOwnProperty(t.text)){var n=_i[t.text].className||"";if("text"===t.mode){var i=Re.makeOrd(t,e,"textord");return i.classes.push(n),i}return Re.makeSpan(["mspace",n],[Re.mathsym(t.text,t.mode,e)],e)}if(Ti.hasOwnProperty(t.text))return Re.makeSpan(["mspace",Ti[t.text]],[],e);throw new r('Unknown type of space "'+t.text+'"')},mathmlBuilder:function(t,e){var n;if(!_i.hasOwnProperty(t.text)){if(Ti.hasOwnProperty(t.text))return new gn.MathNode("mspace");throw new r('Unknown type of space "'+t.text+'"')}return n=new gn.MathNode("mtext",[new gn.TextNode(" ")]),n}});var Mi=function(){var t=new gn.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Ge({type:"tag",mathmlBuilder:function(t,e){var n=new gn.MathNode("mtable",[new gn.MathNode("mtr",[Mi(),new gn.MathNode("mtd",[wn(t.body,e)]),Mi(),new gn.MathNode("mtd",[wn(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var Ni={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Pi={"\\textbf":"textbf","\\textmd":"textmd"},Li={"\\textit":"textit","\\textup":"textup"},Di=function(t,e){var n=t.font;return n?Ni[n]?e.withTextFontFamily(Ni[n]):Pi[n]?e.withTextFontWeight(Pi[n]):e.withTextFontShape(Li[n]):e};$e({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler:function(t,e){var n=t.parser,r=t.funcName,i=e[0];return{type:"text",mode:n.mode,body:Xe(i),font:r}},htmlBuilder:function(t,e){var n=Di(t,e),r=en(t.body,n,!0);return Re.makeSpan(["mord","text"],r,n)},mathmlBuilder:function(t,e){var n=Di(t,e);return wn(t.body,n)}}),$e({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(t,e){var n=t.parser;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder:function(t,e){var n=ln(t.body,e),r=Re.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,o=Re.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},e);return Re.makeSpan(["mord","underline"],[o],e)},mathmlBuilder:function(t,e){var n=new gn.MathNode("mo",[new gn.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new gn.MathNode("munder",[xn(t.body,e),n]);return r.setAttribute("accentunder","true"),r}}),$e({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler:function(t,e){var n=t.parser;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder:function(t,e){var n=ln(t.body,e),r=e.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return Re.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},e)},mathmlBuilder:function(t,e){return new gn.MathNode("mpadded",[xn(t.body,e)],["vcenter"])}}),$e({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(t,e,n){throw new r("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(t,e){for(var n=ji(t),r=[],i=e.havingStyle(e.style.text()),o=0;o<n.length;o++){var a=n[o];"~"===a&&(a="\\textasciitilde"),r.push(Re.makeSymbol(a,"Typewriter-Regular",t.mode,i,["mord","texttt"]))}return Re.makeSpan(["mord","text"].concat(i.sizingClasses(e)),Re.tryCombineChars(r),i)},mathmlBuilder:function(t,e){var n=new gn.TextNode(ji(t)),r=new gn.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var ji=function(t){return t.body.replace(/ /g,t.star?"␣":" ")},Ii=qe,Ri=Ii,Fi="[ \r\n\t]",Bi="\\\\[a-zA-Z@]+",zi="\\\\[^\ud800-\udfff]",Hi="("+Bi+")"+Fi+"*",Vi="\\\\(\n|[ \r\t]+\n?)[ \r\t]*",qi="[̀-ͯ]",Ui=new RegExp(qi+"+$"),Wi="("+Fi+"+)|"+Vi+"|([!-\\[\\]-‧‪-퟿豈-￿]"+qi+"*|[\ud800-\udbff][\udc00-\udfff]"+qi+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+Hi+"|"+zi+")",$i=function(){function t(t,e){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=e,this.tokenRegex=new RegExp(Wi,"g"),this.catcodes={"%":14,"~":13}}var e=t.prototype;return e.setCatcode=function(t,e){this.catcodes[t]=e},e.lex=function(){var t=this.input,e=this.tokenRegex.lastIndex;if(e===t.length)return new zr("EOF",new Br(this,e,e));var n=this.tokenRegex.exec(t);if(null===n||n.index!==e)throw new r("Unexpected character: '"+t[e]+"'",new zr(t[e],new Br(this,e,e+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[i]){var o=t.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new zr(i,new Br(this,e,this.tokenRegex.lastIndex))},t}(),Gi=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=e,this.builtins=t,this.undefStack=[]}var e=t.prototype;return e.beginGroup=function(){this.undefStack.push({})},e.endGroup=function(){if(0===this.undefStack.length)throw new r("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var e in t)t.hasOwnProperty(e)&&(null==t[e]?delete this.current[e]:this.current[e]=t[e])},e.endGroups=function(){while(this.undefStack.length>0)this.endGroup()},e.has=function(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)},e.get=function(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]},e.set=function(t,e,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=e)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}null==e?delete this.current[t]:this.current[t]=e},t}(),Yi=Rr,Xi=Yi;Fr("\\noexpand",(function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}})),Fr("\\expandafter",(function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}})),Fr("\\@firstoftwo",(function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}})),Fr("\\@secondoftwo",(function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}})),Fr("\\@ifnextchar",(function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return 1===e[0].length&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}})),Fr("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Fr("\\TextOrMath",(function(t){var e=t.consumeArgs(2);return"text"===t.mode?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}}));var Ki={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Fr("\\char",(function(t){var e,n=t.popToken(),i="";if("'"===n.text)e=8,n=t.popToken();else if('"'===n.text)e=16,n=t.popToken();else if("`"===n.text)if(n=t.popToken(),"\\"===n.text[0])i=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new r("\\char` missing argument");i=n.text.charCodeAt(0)}else e=10;if(e){if(i=Ki[n.text],null==i||i>=e)throw new r("Invalid base-"+e+" digit "+n.text);var o;while(null!=(o=Ki[t.future().text])&&o<e)i*=e,i+=o,t.popToken()}return"\\@char{"+i+"}"}));var Zi=function(t,e,n){var i=t.consumeArg().tokens;if(1!==i.length)throw new r("\\newcommand's first argument must be a macro name");var o=i[0].text,a=t.isDefined(o);if(a&&!e)throw new r("\\newcommand{"+o+"} attempting to redefine "+o+"; use \\renewcommand");if(!a&&!n)throw new r("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var s=0;if(i=t.consumeArg().tokens,1===i.length&&"["===i[0].text){var l="",c=t.expandNextToken();while("]"!==c.text&&"EOF"!==c.text)l+=c.text,c=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new r("Invalid number of arguments: "+l);s=parseInt(l),i=t.consumeArg().tokens}return t.macros.set(o,{tokens:i,numArgs:s}),""};Fr("\\newcommand",(function(t){return Zi(t,!1,!0)})),Fr("\\renewcommand",(function(t){return Zi(t,!0,!1)})),Fr("\\providecommand",(function(t){return Zi(t,!0,!0)})),Fr("\\message",(function(t){var e=t.consumeArgs(1)[0];return console.log(e.reverse().map((function(t){return t.text})).join("")),""})),Fr("\\errmessage",(function(t){var e=t.consumeArgs(1)[0];return console.error(e.reverse().map((function(t){return t.text})).join("")),""})),Fr("\\show",(function(t){var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),Ri[n],Pt.math[n],Pt.text[n]),""})),Fr("\\bgroup","{"),Fr("\\egroup","}"),Fr("~","\\nobreakspace"),Fr("\\lq","`"),Fr("\\rq","'"),Fr("\\aa","\\r a"),Fr("\\AA","\\r A"),Fr("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Fr("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Fr("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Fr("","\\mathscr{B}"),Fr("","\\mathscr{E}"),Fr("","\\mathscr{F}"),Fr("","\\mathscr{H}"),Fr("","\\mathscr{I}"),Fr("","\\mathscr{L}"),Fr("","\\mathscr{M}"),Fr("","\\mathscr{R}"),Fr("","\\mathfrak{C}"),Fr("","\\mathfrak{H}"),Fr("","\\mathfrak{Z}"),Fr("\\Bbbk","\\Bbb{k}"),Fr("·","\\cdotp"),Fr("\\llap","\\mathllap{\\textrm{#1}}"),Fr("\\rlap","\\mathrlap{\\textrm{#1}}"),Fr("\\clap","\\mathclap{\\textrm{#1}}"),Fr("\\mathstrut","\\vphantom{(}"),Fr("\\underbar","\\underline{\\text{#1}}"),Fr("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),Fr("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Fr("\\ne","\\neq"),Fr("≠","\\neq"),Fr("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Fr("∉","\\notin"),Fr("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Fr("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Fr("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Fr("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Fr("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Fr("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Fr("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Fr("⟂","\\perp"),Fr("‼","\\mathclose{!\\mkern-0.8mu!}"),Fr("∌","\\notni"),Fr("⌜","\\ulcorner"),Fr("⌝","\\urcorner"),Fr("⌞","\\llcorner"),Fr("⌟","\\lrcorner"),Fr("©","\\copyright"),Fr("®","\\textregistered"),Fr("","\\textregistered"),Fr("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Fr("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Fr("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Fr("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Fr("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),Fr("⋮","\\vdots"),Fr("\\varGamma","\\mathit{\\Gamma}"),Fr("\\varDelta","\\mathit{\\Delta}"),Fr("\\varTheta","\\mathit{\\Theta}"),Fr("\\varLambda","\\mathit{\\Lambda}"),Fr("\\varXi","\\mathit{\\Xi}"),Fr("\\varPi","\\mathit{\\Pi}"),Fr("\\varSigma","\\mathit{\\Sigma}"),Fr("\\varUpsilon","\\mathit{\\Upsilon}"),Fr("\\varPhi","\\mathit{\\Phi}"),Fr("\\varPsi","\\mathit{\\Psi}"),Fr("\\varOmega","\\mathit{\\Omega}"),Fr("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Fr("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Fr("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Fr("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Fr("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Fr("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Ji={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Fr("\\dots",(function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in Ji?e=Ji[n]:("\\not"===n.substr(0,4)||n in Pt.math&&g.contains(["bin","rel"],Pt.math[n].group))&&(e="\\dotsb"),e}));var Qi={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Fr("\\dotso",(function(t){var e=t.future().text;return e in Qi?"\\ldots\\,":"\\ldots"})),Fr("\\dotsc",(function(t){var e=t.future().text;return e in Qi&&","!==e?"\\ldots\\,":"\\ldots"})),Fr("\\cdots",(function(t){var e=t.future().text;return e in Qi?"\\@cdots\\,":"\\@cdots"})),Fr("\\dotsb","\\cdots"),Fr("\\dotsm","\\cdots"),Fr("\\dotsi","\\!\\cdots"),Fr("\\dotsx","\\ldots\\,"),Fr("\\DOTSI","\\relax"),Fr("\\DOTSB","\\relax"),Fr("\\DOTSX","\\relax"),Fr("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Fr("\\,","\\tmspace+{3mu}{.1667em}"),Fr("\\thinspace","\\,"),Fr("\\>","\\mskip{4mu}"),Fr("\\:","\\tmspace+{4mu}{.2222em}"),Fr("\\medspace","\\:"),Fr("\\;","\\tmspace+{5mu}{.2777em}"),Fr("\\thickspace","\\;"),Fr("\\!","\\tmspace-{3mu}{.1667em}"),Fr("\\negthinspace","\\!"),Fr("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Fr("\\negthickspace","\\tmspace-{5mu}{.277em}"),Fr("\\enspace","\\kern.5em "),Fr("\\enskip","\\hskip.5em\\relax"),Fr("\\quad","\\hskip1em\\relax"),Fr("\\qquad","\\hskip2em\\relax"),Fr("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Fr("\\tag@paren","\\tag@literal{({#1})}"),Fr("\\tag@literal",(function(t){if(t.macros.get("\\df@tag"))throw new r("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),Fr("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Fr("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Fr("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Fr("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Fr("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),Fr("\\newline","\\\\\\relax"),Fr("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var to=ft(J["Main-Regular"]["T".charCodeAt(0)][1]-.7*J["Main-Regular"]["A".charCodeAt(0)][1]);Fr("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+to+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Fr("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+to+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Fr("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Fr("\\@hspace","\\hskip #1\\relax"),Fr("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Fr("\\ordinarycolon",":"),Fr("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Fr("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Fr("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Fr("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Fr("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Fr("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Fr("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Fr("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Fr("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Fr("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Fr("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Fr("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Fr("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Fr("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Fr("∷","\\dblcolon"),Fr("∹","\\eqcolon"),Fr("≔","\\coloneqq"),Fr("≕","\\eqqcolon"),Fr("⩴","\\Coloneqq"),Fr("\\ratio","\\vcentcolon"),Fr("\\coloncolon","\\dblcolon"),Fr("\\colonequals","\\coloneqq"),Fr("\\coloncolonequals","\\Coloneqq"),Fr("\\equalscolon","\\eqqcolon"),Fr("\\equalscoloncolon","\\Eqqcolon"),Fr("\\colonminus","\\coloneq"),Fr("\\coloncolonminus","\\Coloneq"),Fr("\\minuscolon","\\eqcolon"),Fr("\\minuscoloncolon","\\Eqcolon"),Fr("\\coloncolonapprox","\\Colonapprox"),Fr("\\coloncolonsim","\\Colonsim"),Fr("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Fr("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Fr("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Fr("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Fr("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Fr("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Fr("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Fr("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Fr("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Fr("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Fr("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Fr("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Fr("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Fr("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Fr("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Fr("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Fr("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Fr("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Fr("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Fr("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Fr("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Fr("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Fr("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Fr("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Fr("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Fr("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Fr("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Fr("\\imath","\\html@mathml{\\@imath}{ı}"),Fr("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Fr("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Fr("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Fr("⟦","\\llbracket"),Fr("⟧","\\rrbracket"),Fr("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Fr("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Fr("⦃","\\lBrace"),Fr("⦄","\\rBrace"),Fr("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Fr("⦵","\\minuso"),Fr("\\darr","\\downarrow"),Fr("\\dArr","\\Downarrow"),Fr("\\Darr","\\Downarrow"),Fr("\\lang","\\langle"),Fr("\\rang","\\rangle"),Fr("\\uarr","\\uparrow"),Fr("\\uArr","\\Uparrow"),Fr("\\Uarr","\\Uparrow"),Fr("\\N","\\mathbb{N}"),Fr("\\R","\\mathbb{R}"),Fr("\\Z","\\mathbb{Z}"),Fr("\\alef","\\aleph"),Fr("\\alefsym","\\aleph"),Fr("\\Alpha","\\mathrm{A}"),Fr("\\Beta","\\mathrm{B}"),Fr("\\bull","\\bullet"),Fr("\\Chi","\\mathrm{X}"),Fr("\\clubs","\\clubsuit"),Fr("\\cnums","\\mathbb{C}"),Fr("\\Complex","\\mathbb{C}"),Fr("\\Dagger","\\ddagger"),Fr("\\diamonds","\\diamondsuit"),Fr("\\empty","\\emptyset"),Fr("\\Epsilon","\\mathrm{E}"),Fr("\\Eta","\\mathrm{H}"),Fr("\\exist","\\exists"),Fr("\\harr","\\leftrightarrow"),Fr("\\hArr","\\Leftrightarrow"),Fr("\\Harr","\\Leftrightarrow"),Fr("\\hearts","\\heartsuit"),Fr("\\image","\\Im"),Fr("\\infin","\\infty"),Fr("\\Iota","\\mathrm{I}"),Fr("\\isin","\\in"),Fr("\\Kappa","\\mathrm{K}"),Fr("\\larr","\\leftarrow"),Fr("\\lArr","\\Leftarrow"),Fr("\\Larr","\\Leftarrow"),Fr("\\lrarr","\\leftrightarrow"),Fr("\\lrArr","\\Leftrightarrow"),Fr("\\Lrarr","\\Leftrightarrow"),Fr("\\Mu","\\mathrm{M}"),Fr("\\natnums","\\mathbb{N}"),Fr("\\Nu","\\mathrm{N}"),Fr("\\Omicron","\\mathrm{O}"),Fr("\\plusmn","\\pm"),Fr("\\rarr","\\rightarrow"),Fr("\\rArr","\\Rightarrow"),Fr("\\Rarr","\\Rightarrow"),Fr("\\real","\\Re"),Fr("\\reals","\\mathbb{R}"),Fr("\\Reals","\\mathbb{R}"),Fr("\\Rho","\\mathrm{P}"),Fr("\\sdot","\\cdot"),Fr("\\sect","\\S"),Fr("\\spades","\\spadesuit"),Fr("\\sub","\\subset"),Fr("\\sube","\\subseteq"),Fr("\\supe","\\supseteq"),Fr("\\Tau","\\mathrm{T}"),Fr("\\thetasym","\\vartheta"),Fr("\\weierp","\\wp"),Fr("\\Zeta","\\mathrm{Z}"),Fr("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Fr("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Fr("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Fr("\\bra","\\mathinner{\\langle{#1}|}"),Fr("\\ket","\\mathinner{|{#1}\\rangle}"),Fr("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Fr("\\Bra","\\left\\langle#1\\right|"),Fr("\\Ket","\\left|#1\\right\\rangle");var eo=function(t){return function(e){var n=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,o=e.consumeArg().tokens,a=e.macros.get("|"),s=e.macros.get("\\|");e.macros.beginGroup();var l=function(e){return function(n){t&&(n.macros.set("|",a),i.length&&n.macros.set("\\|",s));var o=e;if(!e&&i.length){var l=n.future();"|"===l.text&&(n.popToken(),o=!0)}return{tokens:o?i:r,numArgs:0}}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var c=e.consumeArg().tokens,u=e.expandTokens([].concat(o,c,n));return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}}};Fr("\\bra@ket",eo(!1)),Fr("\\bra@set",eo(!0)),Fr("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Fr("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Fr("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Fr("\\angln","{\\angl n}"),Fr("\\blue","\\textcolor{##6495ed}{#1}"),Fr("\\orange","\\textcolor{##ffa500}{#1}"),Fr("\\pink","\\textcolor{##ff00af}{#1}"),Fr("\\red","\\textcolor{##df0030}{#1}"),Fr("\\green","\\textcolor{##28ae7b}{#1}"),Fr("\\gray","\\textcolor{gray}{#1}"),Fr("\\purple","\\textcolor{##9d38bd}{#1}"),Fr("\\blueA","\\textcolor{##ccfaff}{#1}"),Fr("\\blueB","\\textcolor{##80f6ff}{#1}"),Fr("\\blueC","\\textcolor{##63d9ea}{#1}"),Fr("\\blueD","\\textcolor{##11accd}{#1}"),Fr("\\blueE","\\textcolor{##0c7f99}{#1}"),Fr("\\tealA","\\textcolor{##94fff5}{#1}"),Fr("\\tealB","\\textcolor{##26edd5}{#1}"),Fr("\\tealC","\\textcolor{##01d1c1}{#1}"),Fr("\\tealD","\\textcolor{##01a995}{#1}"),Fr("\\tealE","\\textcolor{##208170}{#1}"),Fr("\\greenA","\\textcolor{##b6ffb0}{#1}"),Fr("\\greenB","\\textcolor{##8af281}{#1}"),Fr("\\greenC","\\textcolor{##74cf70}{#1}"),Fr("\\greenD","\\textcolor{##1fab54}{#1}"),Fr("\\greenE","\\textcolor{##0d923f}{#1}"),Fr("\\goldA","\\textcolor{##ffd0a9}{#1}"),Fr("\\goldB","\\textcolor{##ffbb71}{#1}"),Fr("\\goldC","\\textcolor{##ff9c39}{#1}"),Fr("\\goldD","\\textcolor{##e07d10}{#1}"),Fr("\\goldE","\\textcolor{##a75a05}{#1}"),Fr("\\redA","\\textcolor{##fca9a9}{#1}"),Fr("\\redB","\\textcolor{##ff8482}{#1}"),Fr("\\redC","\\textcolor{##f9685d}{#1}"),Fr("\\redD","\\textcolor{##e84d39}{#1}"),Fr("\\redE","\\textcolor{##bc2612}{#1}"),Fr("\\maroonA","\\textcolor{##ffbde0}{#1}"),Fr("\\maroonB","\\textcolor{##ff92c6}{#1}"),Fr("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Fr("\\maroonD","\\textcolor{##ca337c}{#1}"),Fr("\\maroonE","\\textcolor{##9e034e}{#1}"),Fr("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Fr("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Fr("\\purpleC","\\textcolor{##aa87ff}{#1}"),Fr("\\purpleD","\\textcolor{##7854ab}{#1}"),Fr("\\purpleE","\\textcolor{##543b78}{#1}"),Fr("\\mintA","\\textcolor{##f5f9e8}{#1}"),Fr("\\mintB","\\textcolor{##edf2df}{#1}"),Fr("\\mintC","\\textcolor{##e0e5cc}{#1}"),Fr("\\grayA","\\textcolor{##f6f7f7}{#1}"),Fr("\\grayB","\\textcolor{##f0f1f2}{#1}"),Fr("\\grayC","\\textcolor{##e3e5e6}{#1}"),Fr("\\grayD","\\textcolor{##d6d8da}{#1}"),Fr("\\grayE","\\textcolor{##babec2}{#1}"),Fr("\\grayF","\\textcolor{##888d93}{#1}"),Fr("\\grayG","\\textcolor{##626569}{#1}"),Fr("\\grayH","\\textcolor{##3b3e40}{#1}"),Fr("\\grayI","\\textcolor{##21242c}{#1}"),Fr("\\kaBlue","\\textcolor{##314453}{#1}"),Fr("\\kaGreen","\\textcolor{##71B307}{#1}");var no={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},ro=function(){function t(t,e,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=e,this.expansionCount=0,this.feed(t),this.macros=new Gi(Xi,e.macros),this.mode=n,this.stack=[]}var e=t.prototype;return e.feed=function(t){this.lexer=new $i(t,this.settings)},e.switchMode=function(t){this.mode=t},e.beginGroup=function(){this.macros.beginGroup()},e.endGroup=function(){this.macros.endGroup()},e.endGroups=function(){this.macros.endGroups()},e.future=function(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},e.popToken=function(){return this.future(),this.stack.pop()},e.pushToken=function(t){this.stack.push(t)},e.pushTokens=function(t){var e;(e=this.stack).push.apply(e,t)},e.scanArgument=function(t){var e,n,r;if(t){if(this.consumeSpaces(),"["!==this.future().text)return null;e=this.popToken();var i=this.consumeArg(["]"]);r=i.tokens,n=i.end}else{var o=this.consumeArg();r=o.tokens,e=o.start,n=o.end}return this.pushToken(new zr("EOF",n.loc)),this.pushTokens(r),e.range(n,"")},e.consumeSpaces=function(){for(;;){var t=this.future();if(" "!==t.text)break;this.stack.pop()}},e.consumeArg=function(t){var e=[],n=t&&t.length>0;n||this.consumeSpaces();var i,o=this.future(),a=0,s=0;do{if(i=this.popToken(),e.push(i),"{"===i.text)++a;else if("}"===i.text){if(--a,-1===a)throw new r("Extra }",i)}else if("EOF"===i.text)throw new r("Unexpected end of input in a macro argument, expected '"+(t&&n?t[s]:"}")+"'",i);if(t&&n)if((0===a||1===a&&"{"===t[s])&&i.text===t[s]){if(++s,s===t.length){e.splice(-s,s);break}}else s=0}while(0!==a||n);return"{"===o.text&&"}"===e[e.length-1].text&&(e.pop(),e.shift()),e.reverse(),{tokens:e,start:o,end:i}},e.consumeArgs=function(t,e){if(e){if(e.length!==t+1)throw new r("The length of delimiters doesn't match the number of args!");for(var n=e[0],i=0;i<n.length;i++){var o=this.popToken();if(n[i]!==o.text)throw new r("Use of the macro doesn't match its definition",o)}}for(var a=[],s=0;s<t;s++)a.push(this.consumeArg(e&&e[s+1]).tokens);return a},e.expandOnce=function(t){var e=this.popToken(),n=e.text,i=e.noexpand?null:this._getExpansion(n);if(null==i||t&&i.unexpandable){if(t&&null==i&&"\\"===n[0]&&!this.isDefined(n))throw new r("Undefined control sequence: "+n);return this.pushToken(e),e}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new r("Too many expansions: infinite loop or need to increase maxExpand setting");var o=i.tokens,a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){o=o.slice();for(var s=o.length-1;s>=0;--s){var l=o[s];if("#"===l.text){if(0===s)throw new r("Incomplete placeholder at end of macro body",l);if(l=o[--s],"#"===l.text)o.splice(s+1,1);else{if(!/^[1-9]$/.test(l.text))throw new r("Not a valid argument number",l);var c;(c=o).splice.apply(c,[s,2].concat(a[+l.text-1]))}}}}return this.pushTokens(o),o},e.expandAfterFuture=function(){return this.expandOnce(),this.future()},e.expandNextToken=function(){for(;;){var t=this.expandOnce();if(t instanceof zr)return t.treatAsRelax&&(t.text="\\relax"),this.stack.pop()}throw new Error},e.expandMacro=function(t){return this.macros.has(t)?this.expandTokens([new zr(t)]):void 0},e.expandTokens=function(t){var e=[],n=this.stack.length;this.pushTokens(t);while(this.stack.length>n){var r=this.expandOnce(!0);r instanceof zr&&(r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),e.push(this.stack.pop()))}return e},e.expandMacroAsText=function(t){var e=this.expandMacro(t);return e?e.map((function(t){return t.text})).join(""):e},e._getExpansion=function(t){var e=this.macros.get(t);if(null==e)return e;if(1===t.length){var n=this.lexer.catcodes[t];if(null!=n&&13!==n)return}var r="function"===typeof e?e(this):e;if("string"===typeof r){var i=0;if(-1!==r.indexOf("#")){var o=r.replace(/##/g,"");while(-1!==o.indexOf("#"+(i+1)))++i}var a=new $i(r,this.settings),s=[],l=a.lex();while("EOF"!==l.text)s.push(l),l=a.lex();s.reverse();var c={tokens:s,numArgs:i};return c}return r},e.isDefined=function(t){return this.macros.has(t)||Ri.hasOwnProperty(t)||Pt.math.hasOwnProperty(t)||Pt.text.hasOwnProperty(t)||no.hasOwnProperty(t)},e.isExpandable=function(t){var e=this.macros.get(t);return null!=e?"string"===typeof e||"function"===typeof e||!e.unexpandable:Ri.hasOwnProperty(t)&&!Ri[t].primitive},t}(),io=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,oo=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ao={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},so={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"},lo=function(){function t(t,e){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new ro(t,e,this.mode),this.settings=e,this.leftrightDepth=0}var e=t.prototype;return e.expect=function(t,e){if(void 0===e&&(e=!0),this.fetch().text!==t)throw new r("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());e&&this.consume()},e.consume=function(){this.nextToken=null},e.fetch=function(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},e.switchMode=function(t){this.mode=t,this.gullet.switchMode(t)},e.parse=function(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}},e.subparse=function(t){var e=this.nextToken;this.consume(),this.gullet.pushToken(new zr("}")),this.gullet.pushTokens(t);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=e,n},e.parseExpression=function(e,n){var r=[];while(1){"math"===this.mode&&this.consumeSpaces();var i=this.fetch();if(-1!==t.endOfExpression.indexOf(i.text))break;if(n&&i.text===n)break;if(e&&Ri[i.text]&&Ri[i.text].infix)break;var o=this.parseAtom(n);if(!o)break;"internal"!==o.type&&r.push(o)}return"text"===this.mode&&this.formLigatures(r),this.handleInfixNodes(r)},e.handleInfixNodes=function(t){for(var e,n=-1,i=0;i<t.length;i++)if("infix"===t[i].type){if(-1!==n)throw new r("only one infix operator per group",t[i].token);n=i,e=t[i].replaceWith}if(-1!==n&&e){var o,a,s,l=t.slice(0,n),c=t.slice(n+1);return o=1===l.length&&"ordgroup"===l[0].type?l[0]:{type:"ordgroup",mode:this.mode,body:l},a=1===c.length&&"ordgroup"===c[0].type?c[0]:{type:"ordgroup",mode:this.mode,body:c},s="\\\\abovefrac"===e?this.callFunction(e,[o,t[n],a],[]):this.callFunction(e,[o,a],[]),[s]}return t},e.handleSupSubscript=function(t){var e=this.fetch(),n=e.text;this.consume(),this.consumeSpaces();var i=this.parseGroup(t);if(!i)throw new r("Expected group after '"+n+"'",e);return i},e.formatUnsupportedCmd=function(t){for(var e=[],n=0;n<t.length;n++)e.push({type:"textord",mode:"text",text:t[n]});var r={type:"text",mode:this.mode,body:e},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]};return i},e.parseAtom=function(e){var n,i,o=this.parseGroup("atom",e);if("text"===this.mode)return o;while(1){this.consumeSpaces();var a=this.fetch();if("\\limits"===a.text||"\\nolimits"===a.text){if(o&&"op"===o.type){var s="\\limits"===a.text;o.limits=s,o.alwaysHandleSupSub=!0}else{if(!o||"operatorname"!==o.type)throw new r("Limit controls must follow a math operator",a);o.alwaysHandleSupSub&&(o.limits="\\limits"===a.text)}this.consume()}else if("^"===a.text){if(n)throw new r("Double superscript",a);n=this.handleSupSubscript("superscript")}else if("_"===a.text){if(i)throw new r("Double subscript",a);i=this.handleSupSubscript("subscript")}else if("'"===a.text){if(n)throw new r("Double superscript",a);var l={type:"textord",mode:this.mode,text:"\\prime"},c=[l];this.consume();while("'"===this.fetch().text)c.push(l),this.consume();"^"===this.fetch().text&&c.push(this.handleSupSubscript("superscript")),n={type:"ordgroup",mode:this.mode,body:c}}else{if(!oo[a.text])break;var u=oo[a.text],d=io.test(a.text);this.consume();while(1){var h=this.fetch().text;if(!oo[h])break;if(io.test(h)!==d)break;this.consume(),u+=oo[h]}var p=new t(u,this.settings).parse();d?i={type:"ordgroup",mode:"math",body:p}:n={type:"ordgroup",mode:"math",body:p}}}return n||i?{type:"supsub",mode:this.mode,base:o,sup:n,sub:i}:o},e.parseFunction=function(t,e){var n=this.fetch(),i=n.text,o=Ri[i];if(!o)return null;if(this.consume(),e&&"atom"!==e&&!o.allowedInArgument)throw new r("Got function '"+i+"' with no arguments"+(e?" as "+e:""),n);if("text"===this.mode&&!o.allowedInText)throw new r("Can't use function '"+i+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new r("Can't use function '"+i+"' in math mode",n);var a=this.parseArguments(i,o),s=a.args,l=a.optArgs;return this.callFunction(i,s,l,n,t)},e.callFunction=function(t,e,n,i,o){var a={funcName:t,parser:this,token:i,breakOnTokenText:o},s=Ri[t];if(s&&s.handler)return s.handler(a,e,n);throw new r("No function handler for "+t)},e.parseArguments=function(t,e){var n=e.numArgs+e.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var i=[],o=[],a=0;a<n;a++){var s=e.argTypes&&e.argTypes[a],l=a<e.numOptionalArgs;(e.primitive&&null==s||"sqrt"===e.type&&1===a&&null==o[0])&&(s="primitive");var c=this.parseGroupOfType("argument to '"+t+"'",s,l);if(l)o.push(c);else{if(null==c)throw new r("Null argument, please report this as a bug");i.push(c)}}return{args:i,optArgs:o}},e.parseGroupOfType=function(t,e,n){switch(e){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,e);case"hbox":var i=this.parseArgumentGroup(n,"text");return null!=i?{type:"styling",mode:i.mode,body:[i],style:"text"}:null;case"raw":var o=this.parseStringGroup("raw",n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new r("A primitive argument cannot be optional");var a=this.parseGroup(t);if(null==a)throw new r("Expected group as "+t,this.fetch());return a;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new r("Unknown group type as "+t,this.fetch())}},e.consumeSpaces=function(){while(" "===this.fetch().text)this.consume()},e.parseStringGroup=function(t,e){var n=this.gullet.scanArgument(e);if(null==n)return null;var r,i="";while("EOF"!==(r=this.fetch()).text)i+=r.text,this.consume();return this.consume(),n.text=i,n},e.parseRegexGroup=function(t,e){var n,i=this.fetch(),o=i,a="";while("EOF"!==(n=this.fetch()).text&&t.test(a+n.text))o=n,a+=o.text,this.consume();if(""===a)throw new r("Invalid "+e+": '"+i.text+"'",i);return i.range(o,a)},e.parseColorGroup=function(t){var e=this.parseStringGroup("color",t);if(null==e)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(e.text);if(!n)throw new r("Invalid color: '"+e.text+"'",e);var i=n[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}},e.parseSizeGroup=function(t){var e,n=!1;if(this.gullet.consumeSpaces(),e=t||"{"===this.gullet.future().text?this.parseStringGroup("size",t):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"),!e)return null;t||0!==e.text.length||(e.text="0pt",n=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e.text);if(!i)throw new r("Invalid size: '"+e.text+"'",e);var o={number:+(i[1]+i[2]),unit:i[3]};if(!ht(o))throw new r("Invalid unit: '"+o.unit+"'",e);return{type:"size",mode:this.mode,value:o,isBlank:n}},e.parseUrlGroup=function(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var e=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==e)return null;var n=e.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}},e.parseArgumentGroup=function(t,e){var n=this.gullet.scanArgument(t);if(null==n)return null;var r=this.mode;e&&this.switchMode(e),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:n.loc,body:i};return e&&this.switchMode(r),o},e.parseGroup=function(t,e){var n,i=this.fetch(),o=i.text;if("{"===o||"\\begingroup"===o){this.consume();var a="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,a),l=this.fetch();this.expect(a),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Br.range(i,l),body:s,semisimple:"\\begingroup"===o||void 0}}else if(n=this.parseFunction(e,t)||this.parseSymbol(),null==n&&"\\"===o[0]&&!no.hasOwnProperty(o)){if(this.settings.throwOnError)throw new r("Undefined control sequence: "+o,i);n=this.formatUnsupportedCmd(o),this.consume()}return n},e.formLigatures=function(t){for(var e=t.length-1,n=0;n<e;++n){var r=t[n],i=r.text;"-"===i&&"-"===t[n+1].text&&(n+1<e&&"-"===t[n+2].text?(t.splice(n,3,{type:"textord",mode:"text",loc:Br.range(r,t[n+2]),text:"---"}),e-=2):(t.splice(n,2,{type:"textord",mode:"text",loc:Br.range(r,t[n+1]),text:"--"}),e-=1)),"'"!==i&&"`"!==i||t[n+1].text!==i||(t.splice(n,2,{type:"textord",mode:"text",loc:Br.range(r,t[n+1]),text:i+i}),e-=1)}},e.parseSymbol=function(){var t=this.fetch(),e=t.text;if(/^\\verb[^a-zA-Z]/.test(e)){this.consume();var n=e.slice(5),i="*"===n.charAt(0);if(i&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new r("\\verb assertion failed --\n please report what input caused this bug");return n=n.slice(1,-1),{type:"verb",mode:"text",body:n,star:i}}so.hasOwnProperty(e[0])&&!Pt[this.mode][e[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+e[0]+'" used in math mode',t),e=so[e[0]]+e.substr(1));var o,a=Ui.exec(e);if(a&&(e=e.substring(0,a.index),"i"===e?e="ı":"j"===e&&(e="ȷ")),Pt[this.mode][e]){this.settings.strict&&"math"===this.mode&&ue.indexOf(e)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+e[0]+'" used in math mode',t);var s,l=Pt[this.mode][e].group,c=Br.range(t);if(_t.hasOwnProperty(l)){var u=l;s={type:"atom",mode:this.mode,family:u,loc:c,text:e}}else s={type:l,mode:this.mode,loc:c,text:e};o=s}else{if(!(e.charCodeAt(0)>=128))return null;this.settings.strict&&(B(e.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+e[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+e[0]+'" ('+e.charCodeAt(0)+")",t)),o={type:"textord",mode:"text",loc:Br.range(t),text:e}}if(this.consume(),a)for(var d=0;d<a[0].length;d++){var h=a[0][d];if(!ao[h])throw new r("Unknown accent ' "+h+"'",t);var p=ao[h][this.mode]||ao[h].text;if(!p)throw new r("Accent "+h+" unsupported in "+this.mode+" mode",t);o={type:"accent",mode:this.mode,loc:Br.range(t),label:p,isStretchy:!1,isShifty:!0,base:o}}return o},t}();lo.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var co=function(t,e){if(!("string"===typeof t||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new lo(t,e);delete n.gullet.macros.current["\\df@tag"];var i=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!e.displayMode)throw new r("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:n.subparse([new zr("\\df@tag")])}]}return i},uo=co,ho=function(t,e,n){e.textContent="";var r=mo(t,n).toNode();e.appendChild(r)};"undefined"!==typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!==typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),ho=function(){throw new r("KaTeX doesn't work in quirks mode.")});var po=function(t,e){var n=mo(t,e).toMarkup();return n},fo=function(t,e){var n=new b(e);return uo(t,n)},go=function(t,e,n){if(n.throwOnError||!(t instanceof r))throw t;var i=Re.makeSpan(["katex-error"],[new kt(e)]);return i.setAttribute("title",t.toString()),i.setAttribute("style","color:"+n.errorColor),i},mo=function(t,e){var n=new b(e);try{var r=uo(t,n);return Sn(r,t,n)}catch(i){return go(i,t,n)}},vo=function(t,e){var n=new b(e);try{var r=uo(t,n);return En(r,t,n)}catch(i){return go(i,t,n)}},bo={version:"0.15.6",render:ho,renderToString:po,ParseError:r,SETTINGS_SCHEMA:m,__parse:fo,__renderToDomTree:mo,__renderToHTMLTree:vo,__setFontMetrics:et,__defineSymbol:Lt,__defineMacro:Fr,__domTree:{Span:yt,Anchor:wt,SymbolNode:kt,SvgNode:At,PathNode:St,LineNode:Et}},yo=bo;return e=e["default"],e}()}))},"3b7e":function(t,e,n){"use strict";var r=n("55be").normalizeReference,i=n("55be").isSpace;t.exports=function(t,e){var n,o,a,s,l,c,u,d,h,p="",f="",g=t.pos,m=t.posMax,v=t.pos,b=!0;if(91!==t.src.charCodeAt(t.pos))return!1;if(l=t.pos+1,s=t.md.helpers.parseLinkLabel(t,t.pos,!0),s<0)return!1;if(c=s+1,c<m&&40===t.src.charCodeAt(c)){for(b=!1,c++;c<m;c++)if(o=t.src.charCodeAt(c),!i(o)&&10!==o)break;if(c>=m)return!1;if(v=c,u=t.md.helpers.parseLinkDestination(t.src,c,t.posMax),u.ok){for(p=t.md.normalizeLink(u.str),t.md.validateLink(p)?c=u.pos:p="",v=c;c<m;c++)if(o=t.src.charCodeAt(c),!i(o)&&10!==o)break;if(u=t.md.helpers.parseLinkTitle(t.src,c,t.posMax),c<m&&v!==c&&u.ok)for(f=u.str,c=u.pos;c<m;c++)if(o=t.src.charCodeAt(c),!i(o)&&10!==o)break}(c>=m||41!==t.src.charCodeAt(c))&&(b=!0),c++}if(b){if("undefined"===typeof t.env.references)return!1;if(c<m&&91===t.src.charCodeAt(c)?(v=c+1,c=t.md.helpers.parseLinkLabel(t,c),c>=0?a=t.src.slice(v,c++):c=s+1):c=s+1,a||(a=t.src.slice(l,s)),d=t.env.references[r(a)],!d)return t.pos=g,!1;p=d.href,f=d.title}return e||(t.pos=l,t.posMax=s,h=t.push("link_open","a",1),h.attrs=n=[["href",p]],f&&n.push(["title",f]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,h=t.push("link_close","a",-1)),t.pos=c,t.posMax=m,!0}},"3c5d":function(t,e,n){"use strict";var r=n("da84"),i=n("c65b"),o=n("ebb5"),a=n("07fa"),s=n("182d"),l=n("7b0b"),c=n("d039"),u=r.RangeError,d=r.Int8Array,h=d&&d.prototype,p=h&&h.set,f=o.aTypedArray,g=o.exportTypedArrayMethod,m=!c((function(){var t=new Uint8ClampedArray(2);return i(p,t,{length:1,0:3},1),3!==t[1]})),v=m&&o.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new d(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));g("set",(function(t){f(this);var e=s(arguments.length>1?arguments[1]:void 0,1),n=l(t);if(m)return i(p,this,n,e);var r=this.length,o=a(n),c=0;if(o+e>r)throw u("Wrong length");while(c<o)this[e+c]=n[c++]}),!m||v)},"3d48":function(t,e,n){"use strict";var r=n("55be").normalizeReference,i=n("55be").isSpace;t.exports=function(t,e){var n,o,a,s,l,c,u,d,h,p,f,g,m,v="",b=t.pos,y=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(c=t.pos+2,l=t.md.helpers.parseLinkLabel(t,t.pos+1,!1),l<0)return!1;if(u=l+1,u<y&&40===t.src.charCodeAt(u)){for(u++;u<y;u++)if(o=t.src.charCodeAt(u),!i(o)&&10!==o)break;if(u>=y)return!1;for(m=u,h=t.md.helpers.parseLinkDestination(t.src,u,t.posMax),h.ok&&(v=t.md.normalizeLink(h.str),t.md.validateLink(v)?u=h.pos:v=""),m=u;u<y;u++)if(o=t.src.charCodeAt(u),!i(o)&&10!==o)break;if(h=t.md.helpers.parseLinkTitle(t.src,u,t.posMax),u<y&&m!==u&&h.ok){for(p=h.str,u=h.pos;u<y;u++)if(o=t.src.charCodeAt(u),!i(o)&&10!==o)break}else p="";if(u>=y||41!==t.src.charCodeAt(u))return t.pos=b,!1;u++}else{if("undefined"===typeof t.env.references)return!1;if(u<y&&91===t.src.charCodeAt(u)?(m=u+1,u=t.md.helpers.parseLinkLabel(t,u),u>=0?s=t.src.slice(m,u++):u=l+1):u=l+1,s||(s=t.src.slice(c,l)),d=t.env.references[r(s)],!d)return t.pos=b,!1;v=d.href,p=d.title}return e||(a=t.src.slice(c,l),t.md.inline.parse(a,t.md,t.env,g=[]),f=t.push("image","img",0),f.attrs=n=[["src",v],["alt",""]],f.children=g,f.content=a,p&&n.push(["title",p])),t.pos=u,t.posMax=y,!0}},"3fa3":function(t,e,n){},"3fcc":function(t,e,n){"use strict";var r=n("ebb5"),i=n("b727").map,o=n("b6b7"),a=r.aTypedArray,s=r.exportTypedArrayMethod;s("map",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(o(t))(e)}))}))},"3fe1":function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i,o,a,s,l,c,u,d,h,p=e+1,f=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;for(h=t.parentType,t.parentType="paragraph";p<n&&!t.isEmpty(p);p++)if(!(t.sCount[p]-t.blkIndent>3)){if(t.sCount[p]>=t.blkIndent&&(l=t.bMarks[p]+t.tShift[p],c=t.eMarks[p],l<c&&(d=t.src.charCodeAt(l),(45===d||61===d)&&(l=t.skipChars(l,d),l=t.skipSpaces(l),l>=c)))){u=61===d?1:2;break}if(!(t.sCount[p]<0)){for(i=!1,o=0,a=f.length;o<a;o++)if(f[o](t,p,n,!0)){i=!0;break}if(i)break}}return!!u&&(r=t.getLines(e,p,t.blkIndent,!1).trim(),t.line=p+1,s=t.push("heading_open","h"+String(u),1),s.markup=String.fromCharCode(d),s.map=[e,t.line],s=t.push("inline","",0),s.content=r,s.map=[e,t.line-1],s.children=[],s=t.push("heading_close","h"+String(u),-1),s.markup=String.fromCharCode(d),t.parentType=h,!0)}},4:function(t,e){},"411f":function(t,e,n){"use strict";n("6194")},42453:function(t,e,n){"use strict";n("19b4")},"42c4":function(t,e,n){"use strict";var r=n("55be").arrayReplaceAt;function i(t){return/^<a[>\s]/i.test(t)}function o(t){return/^<\/a\s*>/i.test(t)}t.exports=function(t){var e,n,a,s,l,c,u,d,h,p,f,g,m,v,b,y,w,x=t.tokens;if(t.md.options.linkify)for(n=0,a=x.length;n<a;n++)if("inline"===x[n].type&&t.md.linkify.pretest(x[n].content))for(s=x[n].children,m=0,e=s.length-1;e>=0;e--)if(c=s[e],"link_close"!==c.type){if("html_inline"===c.type&&(i(c.content)&&m>0&&m--,o(c.content)&&m++),!(m>0)&&"text"===c.type&&t.md.linkify.test(c.content)){for(h=c.content,w=t.md.linkify.match(h),u=[],g=c.level,f=0,w.length>0&&0===w[0].index&&e>0&&"text_special"===s[e-1].type&&(w=w.slice(1)),d=0;d<w.length;d++)v=w[d].url,b=t.md.normalizeLink(v),t.md.validateLink(b)&&(y=w[d].text,y=w[d].schema?"mailto:"!==w[d].schema||/^mailto:/i.test(y)?t.md.normalizeLinkText(y):t.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):t.md.normalizeLinkText("http://"+y).replace(/^http:\/\//,""),p=w[d].index,p>f&&(l=new t.Token("text","",0),l.content=h.slice(f,p),l.level=g,u.push(l)),l=new t.Token("link_open","a",1),l.attrs=[["href",b]],l.level=g++,l.markup="linkify",l.info="auto",u.push(l),l=new t.Token("text","",0),l.content=y,l.level=g,u.push(l),l=new t.Token("link_close","a",-1),l.level=--g,l.markup="linkify",l.info="auto",u.push(l),f=w[d].lastIndex);f<h.length&&(l=new t.Token("text","",0),l.content=h.slice(f),l.level=g,u.push(l)),x[n].children=s=r(s,e,u)}}else{e--;while(s[e].level!==c.level&&"link_open"!==s[e].type)e--}}},4383:function(module,exports,__webpack_require__){(function(Buffer,process,global){(function(t,e){module.exports=e()})(0,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLinkAttributes",{enumerable:!0,get:function(){return r.addLinkAttributes}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(e,"LinkTarget",{enumerable:!0,get:function(){return r.LinkTarget}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return i.build}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return i.getDocument}}),Object.defineProperty(e,"LoopbackPort",{enumerable:!0,get:function(){return i.LoopbackPort}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return i.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return i.PDFWorker}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return i.version}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return o.CMapCompressionType}}),Object.defineProperty(e,"createObjectURL",{enumerable:!0,get:function(){return o.createObjectURL}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return o.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return o.createValidAbsoluteUrl}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return o.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return o.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return o.OPS}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return o.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return o.PermissionFlag}}),Object.defineProperty(e,"removeNullCharacters",{enumerable:!0,get:function(){return o.removeNullCharacters}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return o.shadow}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return o.UnexpectedResponseException}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return o.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return o.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return o.VerbosityLevel}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return a.AnnotationLayer}}),Object.defineProperty(e,"apiCompatibilityParams",{enumerable:!0,get:function(){return s.apiCompatibilityParams}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return c.renderTextLayer}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return u.SVGGraphics}});var r=n(1),i=n(202),o=n(5),a=n(216),s=n(206),l=n(209),c=n(217),u=n(218),d=n(7),h=d.isNodeJS;if(h){var p=n(219).PDFNodeStream;(0,i.setPDFNetworkStreamFactory)((function(t){return new p(t)}))}else{var f,g=n(222).PDFNetworkStream;(0,r.isFetchSupported)()&&(f=n(223).PDFFetchStream),(0,i.setPDFNetworkStreamFactory)((function(t){return f&&(0,r.isValidFetchUrl)(t.url)?new f(t):new g(t)}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addLinkAttributes=P,e.getFilenameFromUrl=L,e.isFetchSupported=I,e.isValidFetchUrl=R,e.loadScript=F,e.deprecated=B,e.PDFDateString=e.StatTimer=e.DOMSVGFactory=e.DOMCMapReaderFactory=e.BaseCMapReaderFactory=e.DOMCanvasFactory=e.BaseCanvasFactory=e.DEFAULT_LINK_REL=e.LinkTarget=e.RenderingCancelledException=e.PageViewport=void 0;var r=o(n(2)),i=n(5);function o(t){return t&&t.__esModule?t:{default:t}}function a(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=s(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(l)throw o}}}}function s(t,e){if(t){if("string"===typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){c(o,r,i,a,s,"next",t)}function s(t){c(o,r,i,a,s,"throw",t)}a(void 0)}))}}function d(t){return d="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}function p(t,e){return p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},p(t,e)}function f(t){var e=v();return function(){var n,r=b(t);if(e){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function g(t,e){return!e||"object"!==d(e)&&"function"!==typeof e?m(t):e}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},b(t)}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e,n){return e&&w(t.prototype,e),n&&w(t,n),t}var C="noopener noreferrer nofollow";e.DEFAULT_LINK_REL=C;var k="http://www.w3.org/2000/svg",A=function(){function t(){y(this,t),this.constructor===t&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}return x(t,[{key:"create",value:function(t,e){(0,i.unreachable)("Abstract method `create` called.")}},{key:"reset",value:function(t,e,n){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||n<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=n}},{key:"destroy",value:function(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}}]),t}();e.BaseCanvasFactory=A;var S=function(t){h(n,t);var e=f(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.ownerDocument,o=void 0===i?globalThis.document:i;return y(this,n),t=e.call(this),t._document=o,t}return x(n,[{key:"create",value:function(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");var n=this._document.createElement("canvas"),r=n.getContext("2d");return n.width=t,n.height=e,{canvas:n,context:r}}}]),n}(A);e.DOMCanvasFactory=S;var E=function(){function t(e){var n=e.baseUrl,r=void 0===n?null:n,o=e.isCompressed,a=void 0!==o&&o;y(this,t),this.constructor===t&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=r,this.isCompressed=a}return x(t,[{key:"fetch",value:function(){var t=u(r["default"].mark((function t(e){var n,o,a,s=this;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.name,this.baseUrl){t.next=3;break}throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');case 3:if(n){t.next=5;break}throw new Error("CMap name must be specified.");case 5:return o=this.baseUrl+n+(this.isCompressed?".bcmap":""),a=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE,t.abrupt("return",this._fetchData(o,a)["catch"]((function(t){throw new Error("Unable to load ".concat(s.isCompressed?"binary ":"","CMap at: ").concat(o))})));case 8:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"_fetchData",value:function(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}}]),t}();e.BaseCMapReaderFactory=E;var O=function(t){h(n,t);var e=f(n);function n(){return y(this,n),e.apply(this,arguments)}return x(n,[{key:"_fetchData",value:function(t,e){var n=this;return I()&&R(t,document.baseURI)?fetch(t).then(function(){var t=u(r["default"].mark((function t(o){var a;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(o.ok){t.next=2;break}throw new Error(o.statusText);case 2:if(!n.isCompressed){t.next=10;break}return t.t0=Uint8Array,t.next=6,o.arrayBuffer();case 6:t.t1=t.sent,a=new t.t0(t.t1),t.next=15;break;case 10:return t.t2=i.stringToBytes,t.next=13,o.text();case 13:t.t3=t.sent,a=(0,t.t2)(t.t3);case 15:return t.abrupt("return",{cMapData:a,compressionType:e});case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()):new Promise((function(r,o){var a=new XMLHttpRequest;a.open("GET",t,!0),n.isCompressed&&(a.responseType="arraybuffer"),a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE){var t;if(200===a.status||0===a.status)if(n.isCompressed&&a.response?t=new Uint8Array(a.response):!n.isCompressed&&a.responseText&&(t=(0,i.stringToBytes)(a.responseText)),t)return void r({cMapData:t,compressionType:e});o(new Error(a.statusText))}},a.send(null)}))}}]),n}(E);e.DOMCMapReaderFactory=O;var T=function(){function t(){y(this,t)}return x(t,[{key:"create",value:function(t,e){(0,i.assert)(t>0&&e>0,"Invalid SVG dimensions");var n=document.createElementNS(k,"svg:svg");return n.setAttribute("version","1.1"),n.setAttribute("width",t+"px"),n.setAttribute("height",e+"px"),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox","0 0 "+t+" "+e),n}},{key:"createElement",value:function(t){return(0,i.assert)("string"===typeof t,"Invalid SVG element type"),document.createElementNS(k,t)}}]),t}();e.DOMSVGFactory=T;var _=function(){function t(e){var n=e.viewBox,r=e.scale,i=e.rotation,o=e.offsetX,a=void 0===o?0:o,s=e.offsetY,l=void 0===s?0:s,c=e.dontFlip,u=void 0!==c&&c;y(this,t),this.viewBox=n,this.scale=r,this.rotation=i,this.offsetX=a,this.offsetY=l;var d,h,p,f,g,m,v,b,w=(n[2]+n[0])/2,x=(n[3]+n[1])/2;switch(i%=360,i=i<0?i+360:i,i){case 180:d=-1,h=0,p=0,f=1;break;case 90:d=0,h=1,p=1,f=0;break;case 270:d=0,h=-1,p=-1,f=0;break;case 0:d=1,h=0,p=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}u&&(p=-p,f=-f),0===d?(g=Math.abs(x-n[1])*r+a,m=Math.abs(w-n[0])*r+l,v=Math.abs(n[3]-n[1])*r,b=Math.abs(n[2]-n[0])*r):(g=Math.abs(w-n[0])*r+a,m=Math.abs(x-n[1])*r+l,v=Math.abs(n[2]-n[0])*r,b=Math.abs(n[3]-n[1])*r),this.transform=[d*r,h*r,p*r,f*r,g-d*r*w-p*r*x,m-h*r*w-f*r*x],this.width=v,this.height=b}return x(t,[{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.scale,r=void 0===n?this.scale:n,i=e.rotation,o=void 0===i?this.rotation:i,a=e.offsetX,s=void 0===a?this.offsetX:a,l=e.offsetY,c=void 0===l?this.offsetY:l,u=e.dontFlip,d=void 0!==u&&u;return new t({viewBox:this.viewBox.slice(),scale:r,rotation:o,offsetX:s,offsetY:c,dontFlip:d})}},{key:"convertToViewportPoint",value:function(t,e){return i.Util.applyTransform([t,e],this.transform)}},{key:"convertToViewportRectangle",value:function(t){var e=i.Util.applyTransform([t[0],t[1]],this.transform),n=i.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],n[0],n[1]]}},{key:"convertToPdfPoint",value:function(t,e){return i.Util.applyInverseTransform([t,e],this.transform)}}]),t}();e.PageViewport=_;var M=function(t){h(n,t);var e=f(n);function n(t,r){var i;return y(this,n),i=e.call(this,t),i.type=r,i}return n}(i.BaseException);e.RenderingCancelledException=M;var N={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};function P(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.url,r=e.target,o=e.rel,a=e.enabled,s=void 0===a||a;(0,i.assert)(n&&"string"===typeof n,'addLinkAttributes: A valid "url" parameter must provided.');var l=(0,i.removeNullCharacters)(n);s?t.href=t.title=l:(t.href="",t.title="Disabled: ".concat(l),t.onclick=function(){return!1});var c="";switch(r){case N.NONE:break;case N.SELF:c="_self";break;case N.BLANK:c="_blank";break;case N.PARENT:c="_parent";break;case N.TOP:c="_top";break}t.target=c,t.rel="string"===typeof o?o:C}function L(t){var e=t.indexOf("#"),n=t.indexOf("?"),r=Math.min(e>0?e:t.length,n>0?n:t.length);return t.substring(t.lastIndexOf("/",r)+1,r)}e.LinkTarget=N;var D,j=function(){function t(){y(this,t),this.started=Object.create(null),this.times=[]}return x(t,[{key:"time",value:function(t){t in this.started&&(0,i.warn)("Timer is already running for ".concat(t)),this.started[t]=Date.now()}},{key:"timeEnd",value:function(t){t in this.started||(0,i.warn)("Timer has not been started for ".concat(t)),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}},{key:"toString",value:function(){var t,e=[],n=0,r=a(this.times);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.name;o.length>n&&(n=o.length)}}catch(d){r.e(d)}finally{r.f()}var s,l=a(this.times);try{for(l.s();!(s=l.n()).done;){var c=s.value,u=c.end-c.start;e.push("".concat(c.name.padEnd(n)," ").concat(u,"ms\n"))}}catch(d){l.e(d)}finally{l.f()}return e.join("")}}]),t}();function I(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype&&"undefined"!==typeof ReadableStream}function R(t,e){try{var n=e?new URL(t,e):new URL(t),r=n.protocol;return"http:"===r||"https:"===r}catch(i){return!1}}function F(t){return new Promise((function(e,n){var r=document.createElement("script");r.src=t,r.onload=e,r.onerror=function(){n(new Error("Cannot load script at: ".concat(r.src)))},(document.head||document.documentElement).appendChild(r)}))}function B(t){console.log("Deprecated API usage: "+t)}e.StatTimer=j;var z=function(){function t(){y(this,t)}return x(t,null,[{key:"toDateObject",value:function(t){if(!t||!(0,i.isString)(t))return null;D||(D=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var e=D.exec(t);if(!e)return null;var n=parseInt(e[1],10),r=parseInt(e[2],10);r=r>=1&&r<=12?r-1:0;var o=parseInt(e[3],10);o=o>=1&&o<=31?o:1;var a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;var s=parseInt(e[5],10);s=s>=0&&s<=59?s:0;var l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;var c=e[7]||"Z",u=parseInt(e[8],10);u=u>=0&&u<=23?u:0;var d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===c?(a+=u,s+=d):"+"===c&&(a-=u,s-=d),new Date(Date.UTC(n,r,o,a,s,l))}}]),t}();e.PDFDateString=z},function(t,e,n){"use strict";t.exports=n(3)},function(t,e,n){"use strict";(function(t){function e(t){return e="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var n=function(t){var n,r=Object.prototype,i=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(L){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),a=new M(r||[]);return o._invoke=E(t,n,a),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(L){return{type:"throw",arg:L}}}t.wrap=u;var h="suspendedStart",p="suspendedYield",f="executing",g="completed",m={};function v(){}function b(){}function y(){}var w={};w[a]=function(){return this};var x=Object.getPrototypeOf,C=x&&x(x(N([])));C&&C!==r&&i.call(C,a)&&(w=C);var k=y.prototype=v.prototype=Object.create(w);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,n){function r(o,a,s,l){var c=d(t[o],t,a);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"===e(h)&&i.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,s,l)}),(function(t){r("throw",t,s,l)})):n.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,l)}))}l(c.arg)}var o;function a(t,e){function i(){return new n((function(n,i){r(t,e,n,i)}))}return o=o?o.then(i,i):i()}this._invoke=a}function E(t,e,n){var r=h;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw o;return P()}n.method=i,n.arg=o;while(1){var a=n.delegate;if(a){var s=O(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=d(t,e,n);if("normal"===l.type){if(r=n.done?g:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=g,n.method="throw",n.arg=l.arg)}}}function O(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=n,O(t,e),"throw"===e.method))return m;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=d(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,m):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function N(t){if(t){var e=t[a];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){while(++r<t.length)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:n,done:!0}}return b.prototype=k.constructor=y,y.constructor=b,b.displayName=c(y,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},A(S.prototype),S.prototype[s]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(k),c(k,l,"Generator"),k[a]=function(){return this},k.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){while(e.length){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=N,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,i){return s.type="throw",s.arg=t,e.next=r,i&&(e.method="next",e.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),m}},t}("object"===e(t)?t.exports:{});try{regeneratorRuntime=n}catch(r){Function("r","regeneratorRuntime = r")(n)}}).call(this,n(4)(t))},function(t,e,n){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function o(t){return o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function c(t){var e=h();return function(){var n,r=p(t);if(e){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(t,e){return!e||"object"!==o(e)&&"function"!==typeof e?d(t):e}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.arrayByteLength=rt,e.arraysToBytes=it,e.assert=z,e.bytesToString=et,e.createPromiseCapability=kt,e.escapeString=ft,e.getModificationDate=Ct,e.getVerbosityLevel=I,e.info=R,e.isArrayBuffer=wt,e.isArrayEqual=xt,e.isBool=vt,e.isNum=bt,e.isString=yt,e.isSameOrigin=H,e.createValidAbsoluteUrl=q,e.removeNullCharacters=tt,e.setVerbosityLevel=j,e.shadow=U,e.string32=ot,e.stringToBytes=nt,e.stringToPDFString=pt,e.stringToUTF8String=gt,e.utf8StringToString=mt,e.warn=F,e.unreachable=B,e.IsEvalSupportedCached=e.IsLittleEndianCached=e.createObjectURL=e.FormatError=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.StreamType=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.MissingPDFException=e.InvalidPDFException=e.AbortException=e.CMapCompressionType=e.ImageKind=e.FontType=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationBorderStyleType=e.UNSUPPORTED_FEATURES=e.VerbosityLevel=e.OPS=e.IDENTITY_MATRIX=e.FONT_IDENTITY_MATRIX=e.BaseException=void 0,n(6);var f=[1,0,0,1,0,0];e.IDENTITY_MATRIX=f;var g=[.001,0,0,.001,0,0];e.FONT_IDENTITY_MATRIX=g;var m={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.PermissionFlag=m;var v={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};e.TextRenderingMode=v;var b={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.ImageKind=b;var y={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};e.AnnotationType=y;var w={MARKED:"Marked",REVIEW:"Review"};e.AnnotationStateModelType=w;var x={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationMarkedState=x;var C={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReviewState=C;var k={GROUP:"Group",REPLY:"R"};e.AnnotationReplyType=k;var A={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFlag=A;var S={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationFieldFlag=S;var E={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationBorderStyleType=E;var O={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};e.StreamType=O;var T={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};e.FontType=T;var _={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=_;var M={NONE:0,BINARY:1,STREAM:2};e.CMapCompressionType=M;var N={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.OPS=N;var P={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent"};e.UNSUPPORTED_FEATURES=P;var L={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};e.PasswordResponses=L;var D=_.WARNINGS;function j(t){Number.isInteger(t)&&(D=t)}function I(){return D}function R(t){D>=_.INFOS&&console.log("Info: ".concat(t))}function F(t){D>=_.WARNINGS&&console.log("Warning: ".concat(t))}function B(t){throw new Error(t)}function z(t,e){t||B(e)}function H(t,e){var n;try{if(n=new URL(t),!n.origin||"null"===n.origin)return!1}catch(i){return!1}var r=new URL(e,n);return n.origin===r.origin}function V(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function q(t,e){if(!t)return null;try{var n=e?new URL(t,e):new URL(t);if(V(n))return n}catch(r){}return null}function U(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}var W=function(){function t(e){this.constructor===t&&B("Cannot initialize BaseException."),this.message=e,this.name=this.constructor.name}return t.prototype=new Error,t.constructor=t,t}();e.BaseException=W;var $=function(t){s(n,t);var e=c(n);function n(t,r){var i;return a(this,n),i=e.call(this,t),i.code=r,i}return n}(W);e.PasswordException=$;var G=function(t){s(n,t);var e=c(n);function n(t,r){var i;return a(this,n),i=e.call(this,t),i.details=r,i}return n}(W);e.UnknownErrorException=G;var Y=function(t){s(n,t);var e=c(n);function n(){return a(this,n),e.apply(this,arguments)}return n}(W);e.InvalidPDFException=Y;var X=function(t){s(n,t);var e=c(n);function n(){return a(this,n),e.apply(this,arguments)}return n}(W);e.MissingPDFException=X;var K=function(t){s(n,t);var e=c(n);function n(t,r){var i;return a(this,n),i=e.call(this,t),i.status=r,i}return n}(W);e.UnexpectedResponseException=K;var Z=function(t){s(n,t);var e=c(n);function n(){return a(this,n),e.apply(this,arguments)}return n}(W);e.FormatError=Z;var J=function(t){s(n,t);var e=c(n);function n(){return a(this,n),e.apply(this,arguments)}return n}(W);e.AbortException=J;var Q=/\x00/g;function tt(t){return"string"!==typeof t?(F("The argument for removeNullCharacters must be a string."),t):t.replace(Q,"")}function et(t){z(null!==t&&"object"===o(t)&&void 0!==t.length,"Invalid argument for bytesToString");var e=t.length,n=8192;if(e<n)return String.fromCharCode.apply(null,t);for(var r=[],i=0;i<e;i+=n){var a=Math.min(i+n,e),s=t.subarray(i,a);r.push(String.fromCharCode.apply(null,s))}return r.join("")}function nt(t){z("string"===typeof t,"Invalid argument for stringToBytes");for(var e=t.length,n=new Uint8Array(e),r=0;r<e;++r)n[r]=255&t.charCodeAt(r);return n}function rt(t){return void 0!==t.length?t.length:(z(void 0!==t.byteLength,"arrayByteLength - invalid argument."),t.byteLength)}function it(t){var e=t.length;if(1===e&&t[0]instanceof Uint8Array)return t[0];for(var n=0,r=0;r<e;r++)n+=rt(t[r]);for(var i=0,o=new Uint8Array(n),a=0;a<e;a++){var s=t[a];s instanceof Uint8Array||(s="string"===typeof s?nt(s):new Uint8Array(s));var l=s.byteLength;o.set(s,i),i+=l}return o}function ot(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function at(){var t=new Uint8Array(4);t[0]=1;var e=new Uint32Array(t.buffer,0,1);return 1===e[0]}var st={get value(){return U(this,"value",at())}};function lt(){try{return new Function(""),!0}catch(t){return!1}}e.IsLittleEndianCached=st;var ct={get value(){return U(this,"value",lt())}};e.IsEvalSupportedCached=ct;var ut=["rgb(",0,",",0,",",0,")"],dt=function(){function t(){a(this,t)}return i(t,null,[{key:"makeCssRgb",value:function(t,e,n){return ut[1]=t,ut[3]=e,ut[5]=n,ut.join("")}},{key:"transform",value:function(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}},{key:"applyTransform",value:function(t,e){var n=t[0]*e[0]+t[1]*e[2]+e[4],r=t[0]*e[1]+t[1]*e[3]+e[5];return[n,r]}},{key:"applyInverseTransform",value:function(t,e){var n=e[0]*e[3]-e[1]*e[2],r=(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/n,i=(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/n;return[r,i]}},{key:"getAxialAlignedBoundingBox",value:function(e,n){var r=t.applyTransform(e,n),i=t.applyTransform(e.slice(2,4),n),o=t.applyTransform([e[0],e[3]],n),a=t.applyTransform([e[2],e[1]],n);return[Math.min(r[0],i[0],o[0],a[0]),Math.min(r[1],i[1],o[1],a[1]),Math.max(r[0],i[0],o[0],a[0]),Math.max(r[1],i[1],o[1],a[1])]}},{key:"inverseTransform",value:function(t){var e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}},{key:"apply3dTransform",value:function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]}},{key:"singularValueDecompose2dScale",value:function(t){var e=[t[0],t[2],t[1],t[3]],n=t[0]*e[0]+t[1]*e[2],r=t[0]*e[1]+t[1]*e[3],i=t[2]*e[0]+t[3]*e[2],o=t[2]*e[1]+t[3]*e[3],a=(n+o)/2,s=Math.sqrt((n+o)*(n+o)-4*(n*o-i*r))/2,l=a+s||1,c=a-s||1;return[Math.sqrt(l),Math.sqrt(c)]}},{key:"normalizeRect",value:function(t){var e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}},{key:"intersect",value:function(e,n){function r(t,e){return t-e}var i=[e[0],e[2],n[0],n[2]].sort(r),o=[e[1],e[3],n[1],n[3]].sort(r),a=[];return e=t.normalizeRect(e),n=t.normalizeRect(n),i[0]===e[0]&&i[1]===n[0]||i[0]===n[0]&&i[1]===e[0]?(a[0]=i[1],a[2]=i[2],o[0]===e[1]&&o[1]===n[1]||o[0]===n[1]&&o[1]===e[1]?(a[1]=o[1],a[3]=o[2],a):null):null}}]),t}();e.Util=dt;var ht=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function pt(t){var e=t.length,n=[];if("þ"===t[0]&&"ÿ"===t[1])for(var r=2;r<e;r+=2)n.push(String.fromCharCode(t.charCodeAt(r)<<8|t.charCodeAt(r+1)));else if("ÿ"===t[0]&&"þ"===t[1])for(var i=2;i<e;i+=2)n.push(String.fromCharCode(t.charCodeAt(i+1)<<8|t.charCodeAt(i)));else for(var o=0;o<e;++o){var a=ht[t.charCodeAt(o)];n.push(a?String.fromCharCode(a):t.charAt(o))}return n.join("")}function ft(t){return t.replace(/([\(\)\\])/g,"\\$1")}function gt(t){return decodeURIComponent(escape(t))}function mt(t){return unescape(encodeURIComponent(t))}function vt(t){return"boolean"===typeof t}function bt(t){return"number"===typeof t}function yt(t){return"string"===typeof t}function wt(t){return"object"===o(t)&&null!==t&&void 0!==t.byteLength}function xt(t,e){return t.length===e.length&&t.every((function(t,n){return t===e[n]}))}function Ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date(Date.now()),e=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),(t.getUTCDate()+1).toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return e.join("")}function kt(){var t=Object.create(null),e=!1;return Object.defineProperty(t,"settled",{get:function(){return e}}),t.promise=new Promise((function(n,r){t.resolve=function(t){e=!0,n(t)},t.reject=function(t){e=!0,r(t)}})),t}var At=function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!r&&URL.createObjectURL){var i=new Blob([e],{type:n});return URL.createObjectURL(i)}for(var o="data:".concat(n,";base64,"),a=0,s=e.length;a<s;a+=3){var l=255&e[a],c=255&e[a+1],u=255&e[a+2],d=l>>2,h=(3&l)<<4|c>>4,p=a+1<s?(15&c)<<2|u>>6:64,f=a+2<s?63&u:64;o+=t[d]+t[h]+t[p]+t[f]}return o}}();e.createObjectURL=At},function(t,e,n){"use strict";var r=n(7);function i(t){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}if("undefined"===typeof globalThis||!globalThis._pdfjsCompatibilityChecked){"undefined"!==typeof globalThis&&globalThis.Math===Math||(globalThis=n(8)),globalThis._pdfjsCompatibilityChecked=!0;var o="object"===("undefined"===typeof window?"undefined":i(window))&&"object"===("undefined"===typeof document?"undefined":i(document)),a="undefined"!==typeof navigator&&navigator.userAgent||"",s=/Trident/.test(a);(function(){!globalThis.btoa&&r.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})})(),function(){!globalThis.atob&&r.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}(),function(){o&&"undefined"===typeof Element.prototype.remove&&(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)})}(),function(){if(o&&!r.isNodeJS){var t=document.createElement("div");if(t.classList.add("testOne","testTwo"),!0!==t.classList.contains("testOne")||!0!==t.classList.contains("testTwo")){var e=DOMTokenList.prototype.add,n=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];e.call(this,a)}},DOMTokenList.prototype.remove=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var i=0,o=e;i<o.length;i++){var a=o[i];n.call(this,a)}}}}}(),function(){if(o&&!r.isNodeJS){var t=document.createElement("div");!1!==t.classList.toggle("test",0)&&(DOMTokenList.prototype.toggle=function(t){var e=arguments.length>1?!!arguments[1]:!this.contains(t);return this[e?"add":"remove"](t),e})}}(),function(){if(o&&s){var t=window.history.pushState,e=window.history.replaceState;window.history.pushState=function(e,n,r){var i=void 0===r?[e,n]:[e,n,r];t.apply(this,i)},window.history.replaceState=function(t,n,r){var i=void 0===r?[t,n]:[t,n,r];e.apply(this,i)}}}(),function(){String.prototype.startsWith||n(53)}(),function(){String.prototype.endsWith||n(64)}(),function(){String.prototype.includes||n(66)}(),function(){Array.prototype.includes||n(68)}(),function(){Array.from||n(76)}(),function(){Object.assign||n(98)}(),function(){Object.fromEntries||n(101)}(),function(){Math.log2||(Math.log2=n(105))}(),function(){Number.isNaN||(Number.isNaN=n(107))}(),function(){Number.isInteger||(Number.isInteger=n(109))}(),function(){Uint8Array.prototype.slice||n(112)}(),function(){globalThis.Promise&&globalThis.Promise.allSettled||(globalThis.Promise=n(117))}(),function(){globalThis.URL=n(138)}(),function(){var t=!1;if("undefined"!==typeof ReadableStream)try{new ReadableStream({start:function(t){t.close()}}),t=!0}catch(e){}t||(globalThis.ReadableStream=n(145).ReadableStream)}(),function(){globalThis.Map&&globalThis.Map.prototype.entries||(globalThis.Map=n(146))}(),function(){globalThis.Set&&globalThis.Set.prototype.entries||(globalThis.Set=n(153))}(),function(){globalThis.WeakMap||(globalThis.WeakMap=n(155))}(),function(){globalThis.WeakSet||(globalThis.WeakSet=n(161))}(),function(){String.prototype.codePointAt||n(163)}(),function(){String.fromCodePoint||(String.fromCodePoint=n(165))}(),function(){globalThis.Symbol||n(167)}(),function(){String.prototype.padStart||n(190)}(),function(){String.prototype.padEnd||n(195)}(),function(){Object.values||(Object.values=n(197))}(),function(){Object.entries||(Object.entries=n(200))}()}},function(t,e,n){"use strict";function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeJS=void 0;var i="object"===("undefined"===typeof process?"undefined":r(process))&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=i},function(t,e,n){n(9),t.exports=n(11)},function(t,e,n){var r=n(10),i=n(11);r({global:!0},{globalThis:i})},function(t,e,n){var r=n(11),i=n(12).f,o=n(26),a=n(29),s=n(30),l=n(40),c=n(52);t.exports=function(t,e){var n,u,d,h,p,f,g=t.target,m=t.global,v=t.stat;if(u=m?r:v?r[g]||s(g,{}):(r[g]||{}).prototype,u)for(d in e){if(p=e[d],t.noTargetGet?(f=i(u,d),h=f&&f.value):h=u[d],n=c(m?d:g+(v?".":"#")+d,t.forced),!n&&void 0!==h){if(typeof p===typeof h)continue;l(p,h)}(t.sham||h&&h.sham)&&o(p,"sham",!0),a(u,d,p,t)}}},function(t,e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||Function("return this")()},function(t,e,n){var r=n(13),i=n(15),o=n(16),a=n(17),s=n(21),l=n(23),c=n(24),u=Object.getOwnPropertyDescriptor;e.f=r?u:function(t,e){if(t=a(t),e=s(e,!0),c)try{return u(t,e)}catch(n){}if(l(t,e))return o(!i.f.call(t,e),t[e])}},function(t,e,n){var r=n(14);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(18),i=n(20);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(14),i=n(19),o="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(22);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(13),i=n(14),o=n(25);t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(11),i=n(22),o=r.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},function(t,e,n){var r=n(13),i=n(27),o=n(16);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(13),i=n(24),o=n(28),a=n(21),s=Object.defineProperty;e.f=r?s:function(t,e,n){if(o(t),e=a(e,!0),o(n),i)try{return s(t,e,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(22);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){var r=n(11),i=n(26),o=n(23),a=n(30),s=n(31),l=n(33),c=l.get,u=l.enforce,d=String(String).split("String");(t.exports=function(t,e,n,s){var l=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,h=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||i(n,"name",e),u(n).source=d.join("string"==typeof e?e:"")),t!==r?(l?!h&&t[e]&&(c=!0):delete t[e],c?t[e]=n:i(t,e,n)):c?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},function(t,e,n){var r=n(11),i=n(26);t.exports=function(t,e){try{i(r,t,e)}catch(n){r[t]=e}return e}},function(t,e,n){var r=n(32),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return i.call(t)}),t.exports=r.inspectSource},function(t,e,n){var r=n(11),i=n(30),o="__core-js_shared__",a=r[o]||i(o,{});t.exports=a},function(t,e,n){var r,i,o,a=n(34),s=n(11),l=n(22),c=n(26),u=n(23),d=n(35),h=n(39),p=s.WeakMap,f=function(t){return o(t)?i(t):r(t,{})},g=function(t){return function(e){var n;if(!l(e)||(n=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}};if(a){var m=new p,v=m.get,b=m.has,y=m.set;r=function(t,e){return y.call(m,t,e),e},i=function(t){return v.call(m,t)||{}},o=function(t){return b.call(m,t)}}else{var w=d("state");h[w]=!0,r=function(t,e){return c(t,w,e),e},i=function(t){return u(t,w)?t[w]:{}},o=function(t){return u(t,w)}}t.exports={set:r,get:i,has:o,enforce:f,getterFor:g}},function(t,e,n){var r=n(11),i=n(31),o=r.WeakMap;t.exports="function"===typeof o&&/native code/.test(i(o))},function(t,e,n){var r=n(36),i=n(38),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,e,n){var r=n(37),i=n(32);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports=!1},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},function(t,e){t.exports={}},function(t,e,n){var r=n(23),i=n(41),o=n(12),a=n(27);t.exports=function(t,e){for(var n=i(e),s=a.f,l=o.f,c=0;c<n.length;c++){var u=n[c];r(t,u)||s(t,u,l(e,u))}}},function(t,e,n){var r=n(42),i=n(44),o=n(51),a=n(28);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=o.f;return n?e.concat(n(t)):e}},function(t,e,n){var r=n(43),i=n(11),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t])||o(i[t]):r[t]&&r[t][e]||i[t]&&i[t][e]}},function(t,e,n){var r=n(11);t.exports=r},function(t,e,n){var r=n(45),i=n(50),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){var r=n(23),i=n(17),o=n(46).indexOf,a=n(39);t.exports=function(t,e){var n,s=i(t),l=0,c=[];for(n in s)!r(a,n)&&r(s,n)&&c.push(n);while(e.length>l)r(s,n=e[l++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(17),i=n(47),o=n(49),a=function(t){return function(e,n,a){var s,l=r(e),c=i(l.length),u=o(a,c);if(t&&n!=n){while(c>u)if(s=l[u++],s!=s)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e,n){var r=n(48),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(48),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(14),i=/#|\.prototype\./,o=function(t,e){var n=s[a(t)];return n==c||n!=l&&("function"==typeof e?r(e):!!e)},a=o.normalize=function(t){return String(t).replace(i,".").toLowerCase()},s=o.data={},l=o.NATIVE="N",c=o.POLYFILL="P";t.exports=o},function(t,e,n){n(54);var r=n(61);t.exports=r("String","startsWith")},function(t,e,n){"use strict";var r=n(10),i=n(12).f,o=n(47),a=n(55),s=n(20),l=n(60),c=n(37),u="".startsWith,d=Math.min,h=l("startsWith"),p=!c&&!h&&!!function(){var t=i(String.prototype,"startsWith");return t&&!t.writable}();r({target:"String",proto:!0,forced:!p&&!h},{startsWith:function(t){var e=String(s(this));a(t);var n=o(d(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return u?u.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){var r=n(56);t.exports=function(t){if(r(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,n){var r=n(22),i=n(19),o=n(57),a=o("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==i(t))}},function(t,e,n){var r=n(11),i=n(36),o=n(23),a=n(38),s=n(58),l=n(59),c=i("wks"),u=r.Symbol,d=l?u:u&&u.withoutSetter||a;t.exports=function(t){return o(c,t)||(s&&o(u,t)?c[t]=u[t]:c[t]=d("Symbol."+t)),c[t]}},function(t,e,n){var r=n(14);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(t,e,n){var r=n(58);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var r=n(57),i=r("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[i]=!1,"/./"[t](e)}catch(r){}}return!1}},function(t,e,n){var r=n(11),i=n(62),o=Function.call;t.exports=function(t,e,n){return i(o,r[t].prototype[e],n)}},function(t,e,n){var r=n(63);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){n(65);var r=n(61);t.exports=r("String","endsWith")},function(t,e,n){"use strict";var r=n(10),i=n(12).f,o=n(47),a=n(55),s=n(20),l=n(60),c=n(37),u="".endsWith,d=Math.min,h=l("endsWith"),p=!c&&!h&&!!function(){var t=i(String.prototype,"endsWith");return t&&!t.writable}();r({target:"String",proto:!0,forced:!p&&!h},{endsWith:function(t){var e=String(s(this));a(t);var n=arguments.length>1?arguments[1]:void 0,r=o(e.length),i=void 0===n?r:d(o(n),r),l=String(t);return u?u.call(e,l,i):e.slice(i-l.length,i)===l}})},function(t,e,n){n(67);var r=n(61);t.exports=r("String","includes")},function(t,e,n){"use strict";var r=n(10),i=n(55),o=n(20),a=n(60);r({target:"String",proto:!0,forced:!a("includes")},{includes:function(t){return!!~String(o(this)).indexOf(i(t),arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){n(69);var r=n(61);t.exports=r("Array","includes")},function(t,e,n){"use strict";var r=n(10),i=n(46).includes,o=n(70),a=n(75),s=a("indexOf",{ACCESSORS:!0,1:0});r({target:"Array",proto:!0,forced:!s},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},function(t,e,n){var r=n(57),i=n(71),o=n(27),a=r("unscopables"),s=Array.prototype;void 0==s[a]&&o.f(s,a,{configurable:!0,value:i(null)}),t.exports=function(t){s[a][t]=!0}},function(t,e,n){var r,i=n(28),o=n(72),a=n(50),s=n(39),l=n(74),c=n(25),u=n(35),d=">",h="<",p="prototype",f="script",g=u("IE_PROTO"),m=function(){},v=function(t){return h+f+d+t+h+"/"+f+d},b=function(t){t.write(v("")),t.close();var e=t.parentWindow.Object;return t=null,e},y=function(){var t,e=c("iframe"),n="java"+f+":";return e.style.display="none",l.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(v("document.F=Object")),t.close(),t.F},w=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}w=r?b(r):y();var t=a.length;while(t--)delete w[p][a[t]];return w()};s[g]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(m[p]=i(t),n=new m,m[p]=null,n[g]=t):n=w(),void 0===e?n:o(n,e)}},function(t,e,n){var r=n(13),i=n(27),o=n(28),a=n(73);t.exports=r?Object.defineProperties:function(t,e){o(t);var n,r=a(e),s=r.length,l=0;while(s>l)i.f(t,n=r[l++],e[n]);return t}},function(t,e,n){var r=n(45),i=n(50);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(42);t.exports=r("document","documentElement")},function(t,e,n){var r=n(13),i=n(14),o=n(23),a=Object.defineProperty,s={},l=function(t){throw t};t.exports=function(t,e){if(o(s,t))return s[t];e||(e={});var n=[][t],c=!!o(e,"ACCESSORS")&&e.ACCESSORS,u=o(e,0)?e[0]:l,d=o(e,1)?e[1]:void 0;return s[t]=!!n&&!i((function(){if(c&&!r)return!0;var t={length:-1};c?a(t,1,{enumerable:!0,get:l}):t[1]=1,n.call(t,u,d)}))}},function(t,e,n){n(77),n(89);var r=n(43);t.exports=r.Array.from},function(t,e,n){"use strict";var r=n(78).charAt,i=n(33),o=n(79),a="String Iterator",s=i.set,l=i.getterFor(a);o(String,"String",(function(t){s(this,{type:a,string:String(t),index:0})}),(function(){var t,e=l(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=r(n,i),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){var r=n(48),i=n(20),o=function(t){return function(e,n){var o,a,s=String(i(e)),l=r(n),c=s.length;return l<0||l>=c?t?"":void 0:(o=s.charCodeAt(l),o<55296||o>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):o:t?s.slice(l,l+2):a-56320+(o-55296<<10)+65536)}};t.exports={codeAt:o(!1),charAt:o(!0)}},function(t,e,n){"use strict";var r=n(10),i=n(80),o=n(82),a=n(87),s=n(85),l=n(26),c=n(29),u=n(57),d=n(37),h=n(86),p=n(81),f=p.IteratorPrototype,g=p.BUGGY_SAFARI_ITERATORS,m=u("iterator"),v="keys",b="values",y="entries",w=function(){return this};t.exports=function(t,e,n,u,p,x,C){i(n,e,u);var k,A,S,E=function(t){if(t===p&&N)return N;if(!g&&t in _)return _[t];switch(t){case v:return function(){return new n(this,t)};case b:return function(){return new n(this,t)};case y:return function(){return new n(this,t)}}return function(){return new n(this)}},O=e+" Iterator",T=!1,_=t.prototype,M=_[m]||_["@@iterator"]||p&&_[p],N=!g&&M||E(p),P="Array"==e&&_.entries||M;if(P&&(k=o(P.call(new t)),f!==Object.prototype&&k.next&&(d||o(k)===f||(a?a(k,f):"function"!=typeof k[m]&&l(k,m,w)),s(k,O,!0,!0),d&&(h[O]=w))),p==b&&M&&M.name!==b&&(T=!0,N=function(){return M.call(this)}),d&&!C||_[m]===N||l(_,m,N),h[e]=N,p)if(A={values:E(b),keys:x?N:E(v),entries:E(y)},C)for(S in A)(g||T||!(S in _))&&c(_,S,A[S]);else r({target:e,proto:!0,forced:g||T},A);return A}},function(t,e,n){"use strict";var r=n(81).IteratorPrototype,i=n(71),o=n(16),a=n(85),s=n(86),l=function(){return this};t.exports=function(t,e,n){var c=e+" Iterator";return t.prototype=i(r,{next:o(1,n)}),a(t,c,!1,!0),s[c]=l,t}},function(t,e,n){"use strict";var r,i,o,a=n(82),s=n(26),l=n(23),c=n(57),u=n(37),d=c("iterator"),h=!1,p=function(){return this};[].keys&&(o=[].keys(),"next"in o?(i=a(a(o)),i!==Object.prototype&&(r=i)):h=!0),void 0==r&&(r={}),u||l(r,d)||s(r,d,p),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h}},function(t,e,n){var r=n(23),i=n(83),o=n(35),a=n(84),s=o("IE_PROTO"),l=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=i(t),r(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?l:null}},function(t,e,n){var r=n(20);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(14);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,n){var r=n(27).f,i=n(23),o=n(57),a=o("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,a)&&r(t,a,{configurable:!0,value:e})}},function(t,e){t.exports={}},function(t,e,n){var r=n(28),i=n(88);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(o){}return function(n,o){return r(n),i(o),e?t.call(n,o):n.__proto__=o,n}}():void 0)},function(t,e,n){var r=n(22);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,n){var r=n(10),i=n(90),o=n(97),a=!o((function(t){Array.from(t)}));r({target:"Array",stat:!0,forced:a},{from:i})},function(t,e,n){"use strict";var r=n(62),i=n(83),o=n(91),a=n(92),s=n(47),l=n(93),c=n(94);t.exports=function(t){var e,n,u,d,h,p,f=i(t),g="function"==typeof this?this:Array,m=arguments.length,v=m>1?arguments[1]:void 0,b=void 0!==v,y=c(f),w=0;if(b&&(v=r(v,m>2?arguments[2]:void 0,2)),void 0==y||g==Array&&a(y))for(e=s(f.length),n=new g(e);e>w;w++)p=b?v(f[w],w):f[w],l(n,w,p);else for(d=y.call(f),h=d.next,n=new g;!(u=h.call(d)).done;w++)p=b?o(d,v,[u.value,w],!0):u.value,l(n,w,p);return n.length=w,n}},function(t,e,n){var r=n(28);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(a){var o=t["return"];throw void 0!==o&&r(o.call(t)),a}}},function(t,e,n){var r=n(57),i=n(86),o=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||a[o]===t)}},function(t,e,n){"use strict";var r=n(21),i=n(27),o=n(16);t.exports=function(t,e,n){var a=r(e);a in t?i.f(t,a,o(0,n)):t[a]=n}},function(t,e,n){var r=n(95),i=n(86),o=n(57),a=o("iterator");t.exports=function(t){if(void 0!=t)return t[a]||t["@@iterator"]||i[r(t)]}},function(t,e,n){var r=n(96),i=n(19),o=n(57),a=o("toStringTag"),s="Arguments"==i(function(){return arguments}()),l=function(t,e){try{return t[e]}catch(n){}};t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=l(e=Object(t),a))?n:s?i(e):"Object"==(r=i(e))&&"function"==typeof e.callee?"Arguments":r}},function(t,e,n){var r=n(57),i=r("toStringTag"),o={};o[i]="z",t.exports="[object z]"===String(o)},function(t,e,n){var r=n(57),i=r("iterator"),o=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){o=!0}};s[i]=function(){return this},Array.from(s,(function(){throw 2}))}catch(l){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var r={};r[i]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(l){}return n}},function(t,e,n){n(99);var r=n(43);t.exports=r.Object.assign},function(t,e,n){var r=n(10),i=n(100);r({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},function(t,e,n){"use strict";var r=n(13),i=n(14),o=n(73),a=n(51),s=n(15),l=n(83),c=n(18),u=Object.assign,d=Object.defineProperty;t.exports=!u||i((function(){if(r&&1!==u({b:1},u(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=u({},t)[n]||o(u({},e)).join("")!=i}))?function(t,e){var n=l(t),i=arguments.length,u=1,d=a.f,h=s.f;while(i>u){var p,f=c(arguments[u++]),g=d?o(f).concat(d(f)):o(f),m=g.length,v=0;while(m>v)p=g[v++],r&&!h.call(f,p)||(n[p]=f[p])}return n}:u},function(t,e,n){n(102),n(103);var r=n(43);t.exports=r.Object.fromEntries},function(t,e,n){"use strict";var r=n(17),i=n(70),o=n(86),a=n(33),s=n(79),l="Array Iterator",c=a.set,u=a.getterFor(l);t.exports=s(Array,"Array",(function(t,e){c(this,{type:l,target:r(t),index:0,kind:e})}),(function(){var t=u(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){var r=n(10),i=n(104),o=n(93);r({target:"Object",stat:!0},{fromEntries:function(t){var e={};return i(t,(function(t,n){o(e,t,n)}),void 0,!0),e}})},function(t,e,n){var r=n(28),i=n(92),o=n(47),a=n(62),s=n(94),l=n(91),c=function(t,e){this.stopped=t,this.result=e},u=t.exports=function(t,e,n,u,d){var h,p,f,g,m,v,b,y=a(e,n,u?2:1);if(d)h=t;else{if(p=s(t),"function"!=typeof p)throw TypeError("Target is not iterable");if(i(p)){for(f=0,g=o(t.length);g>f;f++)if(m=u?y(r(b=t[f])[0],b[1]):y(t[f]),m&&m instanceof c)return m;return new c(!1)}h=p.call(t)}v=h.next;while(!(b=v.call(h)).done)if(m=l(h,y,b.value,u),"object"==typeof m&&m&&m instanceof c)return m;return new c(!1)};u.stop=function(t){return new c(!0,t)}},function(t,e,n){n(106);var r=n(43);t.exports=r.Math.log2},function(t,e,n){var r=n(10),i=Math.log,o=Math.LN2;r({target:"Math",stat:!0},{log2:function(t){return i(t)/o}})},function(t,e,n){n(108);var r=n(43);t.exports=r.Number.isNaN},function(t,e,n){var r=n(10);r({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},function(t,e,n){n(110);var r=n(43);t.exports=r.Number.isInteger},function(t,e,n){var r=n(10),i=n(111);r({target:"Number",stat:!0},{isInteger:i})},function(t,e,n){var r=n(22),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},function(t,e,n){n(113)},function(t,e,n){"use strict";var r=n(114),i=n(116),o=n(14),a=r.aTypedArray,s=r.aTypedArrayConstructor,l=r.exportTypedArrayMethod,c=[].slice,u=o((function(){new Int8Array(1).slice()}));l("slice",(function(t,e){var n=c.call(a(this),t,e),r=i(this,this.constructor),o=0,l=n.length,u=new(s(r))(l);while(l>o)u[o]=n[o++];return u}),u)},function(t,e,n){"use strict";var r,i=n(115),o=n(13),a=n(11),s=n(22),l=n(23),c=n(95),u=n(26),d=n(29),h=n(27).f,p=n(82),f=n(87),g=n(57),m=n(38),v=a.Int8Array,b=v&&v.prototype,y=a.Uint8ClampedArray,w=y&&y.prototype,x=v&&p(v),C=b&&p(b),k=Object.prototype,A=k.isPrototypeOf,S=g("toStringTag"),E=m("TYPED_ARRAY_TAG"),O=i&&!!f&&"Opera"!==c(a.opera),T=!1,_={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},M=function(t){var e=c(t);return"DataView"===e||l(_,e)},N=function(t){return s(t)&&l(_,c(t))},P=function(t){if(N(t))return t;throw TypeError("Target is not a typed array")},L=function(t){if(f){if(A.call(x,t))return t}else for(var e in _)if(l(_,r)){var n=a[e];if(n&&(t===n||A.call(n,t)))return t}throw TypeError("Target is not a typed array constructor")},D=function(t,e,n){if(o){if(n)for(var r in _){var i=a[r];i&&l(i.prototype,t)&&delete i.prototype[t]}C[t]&&!n||d(C,t,n?e:O&&b[t]||e)}},j=function(t,e,n){var r,i;if(o){if(f){if(n)for(r in _)i=a[r],i&&l(i,t)&&delete i[t];if(x[t]&&!n)return;try{return d(x,t,n?e:O&&v[t]||e)}catch(s){}}for(r in _)i=a[r],!i||i[t]&&!n||d(i,t,e)}};for(r in _)a[r]||(O=!1);if((!O||"function"!=typeof x||x===Function.prototype)&&(x=function(){throw TypeError("Incorrect invocation")},O))for(r in _)a[r]&&f(a[r],x);if((!O||!C||C===k)&&(C=x.prototype,O))for(r in _)a[r]&&f(a[r].prototype,C);if(O&&p(w)!==C&&f(w,C),o&&!l(C,S))for(r in T=!0,h(C,S,{get:function(){return s(this)?this[E]:void 0}}),_)a[r]&&u(a[r],E,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:O,TYPED_ARRAY_TAG:T&&E,aTypedArray:P,aTypedArrayConstructor:L,exportTypedArrayMethod:D,exportTypedArrayStaticMethod:j,isView:M,isTypedArray:N,TypedArray:x,TypedArrayPrototype:C}},function(t,e){t.exports="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView},function(t,e,n){var r=n(28),i=n(63),o=n(57),a=o("species");t.exports=function(t,e){var n,o=r(t).constructor;return void 0===o||void 0==(n=r(o)[a])?e:i(n)}},function(t,e,n){n(118),n(77),n(120),n(122),n(136),n(137);var r=n(43);t.exports=r.Promise},function(t,e,n){var r=n(96),i=n(29),o=n(119);r||i(Object.prototype,"toString",o,{unsafe:!0})},function(t,e,n){"use strict";var r=n(96),i=n(95);t.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},function(t,e,n){var r=n(11),i=n(121),o=n(102),a=n(26),s=n(57),l=s("iterator"),c=s("toStringTag"),u=o.values;for(var d in i){var h=r[d],p=h&&h.prototype;if(p){if(p[l]!==u)try{a(p,l,u)}catch(g){p[l]=u}if(p[c]||a(p,c,d),i[d])for(var f in o)if(p[f]!==o[f])try{a(p,f,o[f])}catch(g){p[f]=o[f]}}}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){"use strict";var r,i,o,a,s=n(10),l=n(37),c=n(11),u=n(42),d=n(123),h=n(29),p=n(124),f=n(85),g=n(125),m=n(22),v=n(63),b=n(126),y=n(19),w=n(31),x=n(104),C=n(97),k=n(116),A=n(127).set,S=n(130),E=n(131),O=n(133),T=n(132),_=n(134),M=n(33),N=n(52),P=n(57),L=n(135),D=P("species"),j="Promise",I=M.get,R=M.set,F=M.getterFor(j),B=d,z=c.TypeError,H=c.document,V=c.process,q=u("fetch"),U=T.f,W=U,$="process"==y(V),G=!!(H&&H.createEvent&&c.dispatchEvent),Y="unhandledrejection",X="rejectionhandled",K=0,Z=1,J=2,Q=1,tt=2,et=N(j,(function(){var t=w(B)!==String(B);if(!t){if(66===L)return!0;if(!$&&"function"!=typeof PromiseRejectionEvent)return!0}if(l&&!B.prototype["finally"])return!0;if(L>=51&&/native code/.test(B))return!1;var e=B.resolve(1),n=function(t){t((function(){}),(function(){}))},r=e.constructor={};return r[D]=n,!(e.then((function(){}))instanceof n)})),nt=et||!C((function(t){B.all(t)["catch"]((function(){}))})),rt=function(t){var e;return!(!m(t)||"function"!=typeof(e=t.then))&&e},it=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;S((function(){var i=e.value,o=e.state==Z,a=0;while(r.length>a){var s,l,c,u=r[a++],d=o?u.ok:u.fail,h=u.resolve,p=u.reject,f=u.domain;try{d?(o||(e.rejection===tt&&lt(t,e),e.rejection=Q),!0===d?s=i:(f&&f.enter(),s=d(i),f&&(f.exit(),c=!0)),s===u.promise?p(z("Promise-chain cycle")):(l=rt(s))?l.call(s,h,p):h(s)):p(i)}catch(g){f&&!c&&f.exit(),p(g)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&at(t,e)}))}},ot=function(t,e,n){var r,i;G?(r=H.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),c.dispatchEvent(r)):r={promise:e,reason:n},(i=c["on"+t])?i(r):t===Y&&O("Unhandled promise rejection",n)},at=function(t,e){A.call(c,(function(){var n,r=e.value,i=st(e);if(i&&(n=_((function(){$?V.emit("unhandledRejection",r,t):ot(Y,t,r)})),e.rejection=$||st(e)?tt:Q,n.error))throw n.value}))},st=function(t){return t.rejection!==Q&&!t.parent},lt=function(t,e){A.call(c,(function(){$?V.emit("rejectionHandled",t):ot(X,t,e.value)}))},ct=function(t,e,n,r){return function(i){t(e,n,i,r)}},ut=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=J,it(t,e,!0))},dt=function(t,e,n,r){if(!e.done){e.done=!0,r&&(e=r);try{if(t===n)throw z("Promise can't be resolved itself");var i=rt(n);i?S((function(){var r={done:!1};try{i.call(n,ct(dt,t,r,e),ct(ut,t,r,e))}catch(o){ut(t,r,o,e)}})):(e.value=n,e.state=Z,it(t,e,!1))}catch(o){ut(t,{done:!1},o,e)}}};et&&(B=function(t){b(this,B,j),v(t),r.call(this);var e=I(this);try{t(ct(dt,this,e),ct(ut,this,e))}catch(n){ut(this,e,n)}},r=function(t){R(this,{type:j,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:K,value:void 0})},r.prototype=p(B.prototype,{then:function(t,e){var n=F(this),r=U(k(this,B));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=$?V.domain:void 0,n.parent=!0,n.reactions.push(r),n.state!=K&&it(this,n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r,e=I(t);this.promise=t,this.resolve=ct(dt,t,e),this.reject=ct(ut,t,e)},T.f=U=function(t){return t===B||t===o?new i(t):W(t)},l||"function"!=typeof d||(a=d.prototype.then,h(d.prototype,"then",(function(t,e){var n=this;return new B((function(t,e){a.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof q&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return E(B,q.apply(c,arguments))}}))),s({global:!0,wrap:!0,forced:et},{Promise:B}),f(B,j,!1,!0),g(j),o=u(j),s({target:j,stat:!0,forced:et},{reject:function(t){var e=U(this);return e.reject.call(void 0,t),e.promise}}),s({target:j,stat:!0,forced:l||et},{resolve:function(t){return E(l&&this===o?B:this,t)}}),s({target:j,stat:!0,forced:nt},{all:function(t){var e=this,n=U(e),r=n.resolve,i=n.reject,o=_((function(){var n=v(e.resolve),o=[],a=0,s=1;x(t,(function(t){var l=a++,c=!1;o.push(void 0),s++,n.call(e,t).then((function(t){c||(c=!0,o[l]=t,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise},race:function(t){var e=this,n=U(e),r=n.reject,i=_((function(){var i=v(e.resolve);x(t,(function(t){i.call(e,t).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}})},function(t,e,n){var r=n(11);t.exports=r.Promise},function(t,e,n){var r=n(29);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){"use strict";var r=n(42),i=n(27),o=n(57),a=n(13),s=o("species");t.exports=function(t){var e=r(t),n=i.f;a&&e&&!e[s]&&n(e,s,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}},function(t,e,n){var r,i,o,a=n(11),s=n(14),l=n(19),c=n(62),u=n(74),d=n(25),h=n(128),p=a.location,f=a.setImmediate,g=a.clearImmediate,m=a.process,v=a.MessageChannel,b=a.Dispatch,y=0,w={},x="onreadystatechange",C=function(t){if(w.hasOwnProperty(t)){var e=w[t];delete w[t],e()}},k=function(t){return function(){C(t)}},A=function(t){C(t.data)},S=function(t){a.postMessage(t+"",p.protocol+"//"+p.host)};f&&g||(f=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return w[++y]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(y),y},g=function(t){delete w[t]},"process"==l(m)?r=function(t){m.nextTick(k(t))}:b&&b.now?r=function(t){b.now(k(t))}:v&&!h?(i=new v,o=i.port2,i.port1.onmessage=A,r=c(o.postMessage,o,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||s(S)||"file:"===p.protocol?r=x in d("script")?function(t){u.appendChild(d("script"))[x]=function(){u.removeChild(this),C(t)}}:function(t){setTimeout(k(t),0)}:(r=S,a.addEventListener("message",A,!1))),t.exports={set:f,clear:g}},function(t,e,n){var r=n(129);t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},function(t,e,n){var r=n(42);t.exports=r("navigator","userAgent")||""},function(t,e,n){var r,i,o,a,s,l,c,u,d=n(11),h=n(12).f,p=n(19),f=n(127).set,g=n(128),m=d.MutationObserver||d.WebKitMutationObserver,v=d.process,b=d.Promise,y="process"==p(v),w=h(d,"queueMicrotask"),x=w&&w.value;x||(r=function(){var t,e;y&&(t=v.domain)&&t.exit();while(i){e=i.fn,i=i.next;try{e()}catch(n){throw i?a():o=void 0,n}}o=void 0,t&&t.enter()},y?a=function(){v.nextTick(r)}:m&&!g?(s=!0,l=document.createTextNode(""),new m(r).observe(l,{characterData:!0}),a=function(){l.data=s=!s}):b&&b.resolve?(c=b.resolve(void 0),u=c.then,a=function(){u.call(c,r)}):a=function(){f.call(d,r)}),t.exports=x||function(t){var e={fn:t,next:void 0};o&&(o.next=e),i||(i=e,a()),o=e}},function(t,e,n){var r=n(28),i=n(22),o=n(132);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t),a=n.resolve;return a(e),n.promise}},function(t,e,n){"use strict";var r=n(63),i=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new i(t)}},function(t,e,n){var r=n(11);t.exports=function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}},function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},function(t,e,n){var r,i,o=n(11),a=n(129),s=o.process,l=s&&s.versions,c=l&&l.v8;c?(r=c.split("."),i=r[0]+r[1]):a&&(r=a.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/),r&&(i=r[1]))),t.exports=i&&+i},function(t,e,n){"use strict";var r=n(10),i=n(63),o=n(132),a=n(134),s=n(104);r({target:"Promise",stat:!0},{allSettled:function(t){var e=this,n=o.f(e),r=n.resolve,l=n.reject,c=a((function(){var n=i(e.resolve),o=[],a=0,l=1;s(t,(function(t){var i=a++,s=!1;o.push(void 0),l++,n.call(e,t).then((function(t){s||(s=!0,o[i]={status:"fulfilled",value:t},--l||r(o))}),(function(t){s||(s=!0,o[i]={status:"rejected",reason:t},--l||r(o))}))})),--l||r(o)}));return c.error&&l(c.value),n.promise}})},function(t,e,n){"use strict";var r=n(10),i=n(37),o=n(123),a=n(14),s=n(42),l=n(116),c=n(131),u=n(29),d=!!o&&a((function(){o.prototype["finally"].call({then:function(){}},(function(){}))}));r({target:"Promise",proto:!0,real:!0,forced:d},{finally:function(t){var e=l(this,s("Promise")),n="function"==typeof t;return this.then(n?function(n){return c(e,t()).then((function(){return n}))}:t,n?function(n){return c(e,t()).then((function(){throw n}))}:t)}}),i||"function"!=typeof o||o.prototype["finally"]||u(o.prototype,"finally",s("Promise").prototype["finally"])},function(t,e,n){n(139),n(144),n(142);var r=n(43);t.exports=r.URL},function(t,e,n){"use strict";n(77);var r,i=n(10),o=n(13),a=n(140),s=n(11),l=n(72),c=n(29),u=n(126),d=n(23),h=n(100),p=n(90),f=n(78).codeAt,g=n(141),m=n(85),v=n(142),b=n(33),y=s.URL,w=v.URLSearchParams,x=v.getState,C=b.set,k=b.getterFor("URL"),A=Math.floor,S=Math.pow,E="Invalid authority",O="Invalid scheme",T="Invalid host",_="Invalid port",M=/[A-Za-z]/,N=/[\d+-.A-Za-z]/,P=/\d/,L=/^(0x|0X)/,D=/^[0-7]+$/,j=/^\d+$/,I=/^[\dA-Fa-f]+$/,R=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,F=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,B=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,z=/[\u0009\u000A\u000D]/g,H=function(t,e){var n,r,i;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return T;if(n=q(e.slice(1,-1)),!n)return T;t.host=n}else if(J(t)){if(e=g(e),R.test(e))return T;if(n=V(e),null===n)return T;t.host=n}else{if(F.test(e))return T;for(n="",r=p(e),i=0;i<r.length;i++)n+=K(r[i],$);t.host=n}},V=function(t){var e,n,r,i,o,a,s,l=t.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),e=l.length,e>4)return t;for(n=[],r=0;r<e;r++){if(i=l[r],""==i)return t;if(o=10,i.length>1&&"0"==i.charAt(0)&&(o=L.test(i)?16:8,i=i.slice(8==o?1:2)),""===i)a=0;else{if(!(10==o?j:8==o?D:I).test(i))return t;a=parseInt(i,o)}n.push(a)}for(r=0;r<e;r++)if(a=n[r],r==e-1){if(a>=S(256,5-e))return null}else if(a>255)return null;for(s=n.pop(),r=0;r<n.length;r++)s+=n[r]*S(256,3-r);return s},q=function(t){var e,n,r,i,o,a,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,d=0,h=function(){return t.charAt(d)};if(":"==h()){if(":"!=t.charAt(1))return;d+=2,c++,u=c}while(h()){if(8==c)return;if(":"!=h()){e=n=0;while(n<4&&I.test(h()))e=16*e+parseInt(h(),16),d++,n++;if("."==h()){if(0==n)return;if(d-=n,c>6)return;r=0;while(h()){if(i=null,r>0){if(!("."==h()&&r<4))return;d++}if(!P.test(h()))return;while(P.test(h())){if(o=parseInt(h(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;d++}l[c]=256*l[c]+i,r++,2!=r&&4!=r||c++}if(4!=r)return;break}if(":"==h()){if(d++,!h())return}else if(h())return;l[c++]=e}else{if(null!==u)return;d++,c++,u=c}}if(null!==u){a=c-u,c=7;while(0!=c&&a>0)s=l[c],l[c--]=l[u+a-1],l[u+--a]=s}else if(8!=c)return;return l},U=function(t){for(var e=null,n=1,r=null,i=0,o=0;o<8;o++)0!==t[o]?(i>n&&(e=r,n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(e=r,n=i),e},W=function(t){var e,n,r,i;if("number"==typeof t){for(e=[],n=0;n<4;n++)e.unshift(t%256),t=A(t/256);return e.join(".")}if("object"==typeof t){for(e="",r=U(t),n=0;n<8;n++)i&&0===t[n]||(i&&(i=!1),r===n?(e+=n?":":"::",i=!0):(e+=t[n].toString(16),n<7&&(e+=":")));return"["+e+"]"}return t},$={},G=h({},$,{" ":1,'"':1,"<":1,">":1,"`":1}),Y=h({},G,{"#":1,"?":1,"{":1,"}":1}),X=h({},Y,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),K=function(t,e){var n=f(t,0);return n>32&&n<127&&!d(e,t)?t:encodeURIComponent(t)},Z={ftp:21,file:null,http:80,https:443,ws:80,wss:443},J=function(t){return d(Z,t.scheme)},Q=function(t){return""!=t.username||""!=t.password},tt=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},et=function(t,e){var n;return 2==t.length&&M.test(t.charAt(0))&&(":"==(n=t.charAt(1))||!e&&"|"==n)},nt=function(t){var e;return t.length>1&&et(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},rt=function(t){var e=t.path,n=e.length;!n||"file"==t.scheme&&1==n&&et(e[0],!0)||e.pop()},it=function(t){return"."===t||"%2e"===t.toLowerCase()},ot=function(t){return t=t.toLowerCase(),".."===t||"%2e."===t||".%2e"===t||"%2e%2e"===t},at={},st={},lt={},ct={},ut={},dt={},ht={},pt={},ft={},gt={},mt={},vt={},bt={},yt={},wt={},xt={},Ct={},kt={},At={},St={},Et={},Ot=function(t,e,n,i){var o,a,s,l,c=n||at,u=0,h="",f=!1,g=!1,m=!1;n||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace(B,"")),e=e.replace(z,""),o=p(e);while(u<=o.length){switch(a=o[u],c){case at:if(!a||!M.test(a)){if(n)return O;c=lt;continue}h+=a.toLowerCase(),c=st;break;case st:if(a&&(N.test(a)||"+"==a||"-"==a||"."==a))h+=a.toLowerCase();else{if(":"!=a){if(n)return O;h="",c=lt,u=0;continue}if(n&&(J(t)!=d(Z,h)||"file"==h&&(Q(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=h,n)return void(J(t)&&Z[t.scheme]==t.port&&(t.port=null));h="","file"==t.scheme?c=yt:J(t)&&i&&i.scheme==t.scheme?c=ct:J(t)?c=pt:"/"==o[u+1]?(c=ut,u++):(t.cannotBeABaseURL=!0,t.path.push(""),c=At)}break;case lt:if(!i||i.cannotBeABaseURL&&"#"!=a)return O;if(i.cannotBeABaseURL&&"#"==a){t.scheme=i.scheme,t.path=i.path.slice(),t.query=i.query,t.fragment="",t.cannotBeABaseURL=!0,c=Et;break}c="file"==i.scheme?yt:dt;continue;case ct:if("/"!=a||"/"!=o[u+1]){c=dt;continue}c=ft,u++;break;case ut:if("/"==a){c=gt;break}c=kt;continue;case dt:if(t.scheme=i.scheme,a==r)t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,t.path=i.path.slice(),t.query=i.query;else if("/"==a||"\\"==a&&J(t))c=ht;else if("?"==a)t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,t.path=i.path.slice(),t.query="",c=St;else{if("#"!=a){t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,t.path=i.path.slice(),t.path.pop(),c=kt;continue}t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,t.path=i.path.slice(),t.query=i.query,t.fragment="",c=Et}break;case ht:if(!J(t)||"/"!=a&&"\\"!=a){if("/"!=a){t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,c=kt;continue}c=gt}else c=ft;break;case pt:if(c=ft,"/"!=a||"/"!=h.charAt(u+1))continue;u++;break;case ft:if("/"!=a&&"\\"!=a){c=gt;continue}break;case gt:if("@"==a){f&&(h="%40"+h),f=!0,s=p(h);for(var v=0;v<s.length;v++){var b=s[v];if(":"!=b||m){var y=K(b,X);m?t.password+=y:t.username+=y}else m=!0}h=""}else if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&J(t)){if(f&&""==h)return E;u-=p(h).length+1,h="",c=mt}else h+=a;break;case mt:case vt:if(n&&"file"==t.scheme){c=xt;continue}if(":"!=a||g){if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&J(t)){if(J(t)&&""==h)return T;if(n&&""==h&&(Q(t)||null!==t.port))return;if(l=H(t,h),l)return l;if(h="",c=Ct,n)return;continue}"["==a?g=!0:"]"==a&&(g=!1),h+=a}else{if(""==h)return T;if(l=H(t,h),l)return l;if(h="",c=bt,n==vt)return}break;case bt:if(!P.test(a)){if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&J(t)||n){if(""!=h){var w=parseInt(h,10);if(w>65535)return _;t.port=J(t)&&w===Z[t.scheme]?null:w,h=""}if(n)return;c=Ct;continue}return _}h+=a;break;case yt:if(t.scheme="file","/"==a||"\\"==a)c=wt;else{if(!i||"file"!=i.scheme){c=kt;continue}if(a==r)t.host=i.host,t.path=i.path.slice(),t.query=i.query;else if("?"==a)t.host=i.host,t.path=i.path.slice(),t.query="",c=St;else{if("#"!=a){nt(o.slice(u).join(""))||(t.host=i.host,t.path=i.path.slice(),rt(t)),c=kt;continue}t.host=i.host,t.path=i.path.slice(),t.query=i.query,t.fragment="",c=Et}}break;case wt:if("/"==a||"\\"==a){c=xt;break}i&&"file"==i.scheme&&!nt(o.slice(u).join(""))&&(et(i.path[0],!0)?t.path.push(i.path[0]):t.host=i.host),c=kt;continue;case xt:if(a==r||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&et(h))c=kt;else if(""==h){if(t.host="",n)return;c=Ct}else{if(l=H(t,h),l)return l;if("localhost"==t.host&&(t.host=""),n)return;h="",c=Ct}continue}h+=a;break;case Ct:if(J(t)){if(c=kt,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=r&&(c=kt,"/"!=a))continue}else t.fragment="",c=Et;else t.query="",c=St;break;case kt:if(a==r||"/"==a||"\\"==a&&J(t)||!n&&("?"==a||"#"==a)){if(ot(h)?(rt(t),"/"==a||"\\"==a&&J(t)||t.path.push("")):it(h)?"/"==a||"\\"==a&&J(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&et(h)&&(t.host&&(t.host=""),h=h.charAt(0)+":"),t.path.push(h)),h="","file"==t.scheme&&(a==r||"?"==a||"#"==a))while(t.path.length>1&&""===t.path[0])t.path.shift();"?"==a?(t.query="",c=St):"#"==a&&(t.fragment="",c=Et)}else h+=K(a,Y);break;case At:"?"==a?(t.query="",c=St):"#"==a?(t.fragment="",c=Et):a!=r&&(t.path[0]+=K(a,$));break;case St:n||"#"!=a?a!=r&&("'"==a&&J(t)?t.query+="%27":t.query+="#"==a?"%23":K(a,$)):(t.fragment="",c=Et);break;case Et:a!=r&&(t.fragment+=K(a,G));break}u++}},Tt=function(t){var e,n,r=u(this,Tt,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(t),s=C(r,{type:"URL"});if(void 0!==i)if(i instanceof Tt)e=k(i);else if(n=Ot(e={},String(i)),n)throw TypeError(n);if(n=Ot(s,a,null,e),n)throw TypeError(n);var l=s.searchParams=new w,c=x(l);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(l)||null},o||(r.href=Mt.call(r),r.origin=Nt.call(r),r.protocol=Pt.call(r),r.username=Lt.call(r),r.password=Dt.call(r),r.host=jt.call(r),r.hostname=It.call(r),r.port=Rt.call(r),r.pathname=Ft.call(r),r.search=Bt.call(r),r.searchParams=zt.call(r),r.hash=Ht.call(r))},_t=Tt.prototype,Mt=function(){var t=k(this),e=t.scheme,n=t.username,r=t.password,i=t.host,o=t.port,a=t.path,s=t.query,l=t.fragment,c=e+":";return null!==i?(c+="//",Q(t)&&(c+=n+(r?":"+r:"")+"@"),c+=W(i),null!==o&&(c+=":"+o)):"file"==e&&(c+="//"),c+=t.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},Nt=function(){var t=k(this),e=t.scheme,n=t.port;if("blob"==e)try{return new URL(e.path[0]).origin}catch(r){return"null"}return"file"!=e&&J(t)?e+"://"+W(t.host)+(null!==n?":"+n:""):"null"},Pt=function(){return k(this).scheme+":"},Lt=function(){return k(this).username},Dt=function(){return k(this).password},jt=function(){var t=k(this),e=t.host,n=t.port;return null===e?"":null===n?W(e):W(e)+":"+n},It=function(){var t=k(this).host;return null===t?"":W(t)},Rt=function(){var t=k(this).port;return null===t?"":String(t)},Ft=function(){var t=k(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},Bt=function(){var t=k(this).query;return t?"?"+t:""},zt=function(){return k(this).searchParams},Ht=function(){var t=k(this).fragment;return t?"#"+t:""},Vt=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(o&&l(_t,{href:Vt(Mt,(function(t){var e=k(this),n=String(t),r=Ot(e,n);if(r)throw TypeError(r);x(e.searchParams).updateSearchParams(e.query)})),origin:Vt(Nt),protocol:Vt(Pt,(function(t){var e=k(this);Ot(e,String(t)+":",at)})),username:Vt(Lt,(function(t){var e=k(this),n=p(String(t));if(!tt(e)){e.username="";for(var r=0;r<n.length;r++)e.username+=K(n[r],X)}})),password:Vt(Dt,(function(t){var e=k(this),n=p(String(t));if(!tt(e)){e.password="";for(var r=0;r<n.length;r++)e.password+=K(n[r],X)}})),host:Vt(jt,(function(t){var e=k(this);e.cannotBeABaseURL||Ot(e,String(t),mt)})),hostname:Vt(It,(function(t){var e=k(this);e.cannotBeABaseURL||Ot(e,String(t),vt)})),port:Vt(Rt,(function(t){var e=k(this);tt(e)||(t=String(t),""==t?e.port=null:Ot(e,t,bt))})),pathname:Vt(Ft,(function(t){var e=k(this);e.cannotBeABaseURL||(e.path=[],Ot(e,t+"",Ct))})),search:Vt(Bt,(function(t){var e=k(this);t=String(t),""==t?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",Ot(e,t,St)),x(e.searchParams).updateSearchParams(e.query)})),searchParams:Vt(zt),hash:Vt(Ht,(function(t){var e=k(this);t=String(t),""!=t?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",Ot(e,t,Et)):e.fragment=null}))}),c(_t,"toJSON",(function(){return Mt.call(this)}),{enumerable:!0}),c(_t,"toString",(function(){return Mt.call(this)}),{enumerable:!0}),y){var qt=y.createObjectURL,Ut=y.revokeObjectURL;qt&&c(Tt,"createObjectURL",(function(t){return qt.apply(y,arguments)})),Ut&&c(Tt,"revokeObjectURL",(function(t){return Ut.apply(y,arguments)}))}m(Tt,"URL"),i({global:!0,forced:!a,sham:!o},{URL:Tt})},function(t,e,n){var r=n(14),i=n(57),o=n(37),a=i("iterator");t.exports=!r((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n="";return t.pathname="c%20d",e.forEach((function(t,r){e["delete"]("b"),n+=r+t})),o&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},function(t,e,n){"use strict";var r=2147483647,i=36,o=1,a=26,s=38,l=700,c=72,u=128,d="-",h=/[^\0-\u007E]/,p=/[.\u3002\uFF0E\uFF61]/g,f="Overflow: input needs wider integers to process",g=i-o,m=Math.floor,v=String.fromCharCode,b=function(t){var e=[],n=0,r=t.length;while(n<r){var i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=t.charCodeAt(n++);56320==(64512&o)?e.push(((1023&i)<<10)+(1023&o)+65536):(e.push(i),n--)}else e.push(i)}return e},y=function(t){return t+22+75*(t<26)},w=function(t,e,n){var r=0;for(t=n?m(t/l):t>>1,t+=m(t/e);t>g*a>>1;r+=i)t=m(t/g);return m(r+(g+1)*t/(t+s))},x=function(t){var e=[];t=b(t);var n,s,l=t.length,h=u,p=0,g=c;for(n=0;n<t.length;n++)s=t[n],s<128&&e.push(v(s));var x=e.length,C=x;x&&e.push(d);while(C<l){var k=r;for(n=0;n<t.length;n++)s=t[n],s>=h&&s<k&&(k=s);var A=C+1;if(k-h>m((r-p)/A))throw RangeError(f);for(p+=(k-h)*A,h=k,n=0;n<t.length;n++){if(s=t[n],s<h&&++p>r)throw RangeError(f);if(s==h){for(var S=p,E=i;;E+=i){var O=E<=g?o:E>=g+a?a:E-g;if(S<O)break;var T=S-O,_=i-O;e.push(v(y(O+T%_))),S=m(T/_)}e.push(v(y(S))),g=w(p,A,C==x),p=0,++C}}++p,++h}return e.join("")};t.exports=function(t){var e,n,r=[],i=t.toLowerCase().replace(p,".").split(".");for(e=0;e<i.length;e++)n=i[e],r.push(h.test(n)?"xn--"+x(n):n);return r.join(".")}},function(t,e,n){"use strict";n(102);var r=n(10),i=n(42),o=n(140),a=n(29),s=n(124),l=n(85),c=n(80),u=n(33),d=n(126),h=n(23),p=n(62),f=n(95),g=n(28),m=n(22),v=n(71),b=n(16),y=n(143),w=n(94),x=n(57),C=i("fetch"),k=i("Headers"),A=x("iterator"),S="URLSearchParams",E=S+"Iterator",O=u.set,T=u.getterFor(S),_=u.getterFor(E),M=/\+/g,N=Array(4),P=function(t){return N[t-1]||(N[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},L=function(t){try{return decodeURIComponent(t)}catch(e){return t}},D=function(t){var e=t.replace(M," "),n=4;try{return decodeURIComponent(e)}catch(r){while(n)e=e.replace(P(n--),L);return e}},j=/[!'()~]|%20/g,I={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},R=function(t){return I[t]},F=function(t){return encodeURIComponent(t).replace(j,R)},B=function(t,e){if(e){var n,r,i=e.split("&"),o=0;while(o<i.length)n=i[o++],n.length&&(r=n.split("="),t.push({key:D(r.shift()),value:D(r.join("="))}))}},z=function(t){this.entries.length=0,B(this.entries,t)},H=function(t,e){if(t<e)throw TypeError("Not enough arguments")},V=c((function(t,e){O(this,{type:E,iterator:y(T(t).entries),kind:e})}),"Iterator",(function(){var t=_(this),e=t.kind,n=t.iterator.next(),r=n.value;return n.done||(n.value="keys"===e?r.key:"values"===e?r.value:[r.key,r.value]),n})),q=function(){d(this,q,S);var t,e,n,r,i,o,a,s,l,c=arguments.length>0?arguments[0]:void 0,u=this,p=[];if(O(u,{type:S,entries:p,updateURL:function(){},updateSearchParams:z}),void 0!==c)if(m(c))if(t=w(c),"function"===typeof t){e=t.call(c),n=e.next;while(!(r=n.call(e)).done){if(i=y(g(r.value)),o=i.next,(a=o.call(i)).done||(s=o.call(i)).done||!o.call(i).done)throw TypeError("Expected sequence with length 2");p.push({key:a.value+"",value:s.value+""})}}else for(l in c)h(c,l)&&p.push({key:l,value:c[l]+""});else B(p,"string"===typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},U=q.prototype;s(U,{append:function(t,e){H(arguments.length,2);var n=T(this);n.entries.push({key:t+"",value:e+""}),n.updateURL()},delete:function(t){H(arguments.length,1);var e=T(this),n=e.entries,r=t+"",i=0;while(i<n.length)n[i].key===r?n.splice(i,1):i++;e.updateURL()},get:function(t){H(arguments.length,1);for(var e=T(this).entries,n=t+"",r=0;r<e.length;r++)if(e[r].key===n)return e[r].value;return null},getAll:function(t){H(arguments.length,1);for(var e=T(this).entries,n=t+"",r=[],i=0;i<e.length;i++)e[i].key===n&&r.push(e[i].value);return r},has:function(t){H(arguments.length,1);var e=T(this).entries,n=t+"",r=0;while(r<e.length)if(e[r++].key===n)return!0;return!1},set:function(t,e){H(arguments.length,1);for(var n,r=T(this),i=r.entries,o=!1,a=t+"",s=e+"",l=0;l<i.length;l++)n=i[l],n.key===a&&(o?i.splice(l--,1):(o=!0,n.value=s));o||i.push({key:a,value:s}),r.updateURL()},sort:function(){var t,e,n,r=T(this),i=r.entries,o=i.slice();for(i.length=0,n=0;n<o.length;n++){for(t=o[n],e=0;e<n;e++)if(i[e].key>t.key){i.splice(e,0,t);break}e===n&&i.push(t)}r.updateURL()},forEach:function(t){var e,n=T(this).entries,r=p(t,arguments.length>1?arguments[1]:void 0,3),i=0;while(i<n.length)e=n[i++],r(e.value,e.key,this)},keys:function(){return new V(this,"keys")},values:function(){return new V(this,"values")},entries:function(){return new V(this,"entries")}},{enumerable:!0}),a(U,A,U.entries),a(U,"toString",(function(){var t,e=T(this).entries,n=[],r=0;while(r<e.length)t=e[r++],n.push(F(t.key)+"="+F(t.value));return n.join("&")}),{enumerable:!0}),l(q,S),r({global:!0,forced:!o},{URLSearchParams:q}),o||"function"!=typeof C||"function"!=typeof k||r({global:!0,enumerable:!0,forced:!0},{fetch:function(t){var e,n,r,i=[t];return arguments.length>1&&(e=arguments[1],m(e)&&(n=e.body,f(n)===S&&(r=e.headers?new k(e.headers):new k,r.has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),e=v(e,{body:b(0,String(n)),headers:b(0,r)}))),i.push(e)),C.apply(this,i)}}),t.exports={URLSearchParams:q,getState:T}},function(t,e,n){var r=n(28),i=n(94);t.exports=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(String(t)+" is not iterable");return r(e.call(t))}},function(t,e,n){"use strict";var r=n(10);r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},function(t,e,n){(function(t,n){n(e)})(0,(function(t){"use strict";var e="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?Symbol:function(t){return"Symbol("+t+")"};function n(){}var r=Number.isNaN||function(t){return t!==t},i=n;function o(t){return"object"===typeof t&&null!==t||"function"===typeof t}function a(t){return t.slice()}function s(t,e,n,r,i){new Uint8Array(t).set(new Uint8Array(n,r,i),e)}function l(t){return!1!==c(t)&&t!==1/0}function c(t){return"number"===typeof t&&(!r(t)&&!(t<0))}function u(t,e,n){if("function"!==typeof t)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(t,e,n)}function d(t,e,n,r){var i=t[e];if(void 0!==i){if("function"!==typeof i)throw new TypeError(i+" is not a method");switch(n){case 0:return function(){return p(i,t,r)};case 1:return function(e){var n=[e].concat(r);return p(i,t,n)}}}return function(){return k(void 0)}}function h(t,e,n){var r=t[e];if(void 0!==r)return u(r,t,n)}function p(t,e,n){try{return k(u(t,e,n))}catch(r){return A(r)}}function f(t){return t}function g(t){return!1}function m(t){if(t=Number(t),r(t)||t<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return t}function v(t){if(void 0===t)return function(){return 1};if("function"!==typeof t)throw new TypeError("size property of a queuing strategy must be a function");return function(e){return t(e)}}var b=Promise,y=Promise.prototype.then,w=Promise.resolve.bind(b),x=Promise.reject.bind(b);function C(t){return new b(t)}function k(t){return w(t)}function A(t){return x(t)}function S(t,e,n){return y.call(t,e,n)}function E(t,e,n){S(S(t,e,n),void 0,i)}function O(t,e){E(t,e)}function T(t,e){E(t,void 0,e)}function _(t,e,n){return S(t,e,n)}function M(t){S(t,void 0,i)}var N=16384,P=function(){function t(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(t.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),t.prototype.push=function(t){var e=this._back,n=e;e._elements.length===N-1&&(n={_elements:[],_next:void 0}),e._elements.push(t),n!==e&&(this._back=n,e._next=n),++this._size},t.prototype.shift=function(){var t=this._front,e=t,n=this._cursor,r=n+1,i=t._elements,o=i[n];return r===N&&(e=t._next,r=0),--this._size,this._cursor=r,t!==e&&(this._front=e),i[n]=void 0,o},t.prototype.forEach=function(t){var e=this._cursor,n=this._front,r=n._elements;while(e!==r.length||void 0!==n._next){if(e===r.length&&(n=n._next,r=n._elements,e=0,0===r.length))break;t(r[e]),++e}},t.prototype.peek=function(){var t=this._front,e=this._cursor;return t._elements[e]},t}();function L(t,e,n){var r=null;!0===n&&(r=Object.prototype);var i=Object.create(r);return i.value=t,i.done=e,i}function D(t,e){t._forAuthorCode=!0,t._ownerReadableStream=e,e._reader=t,"readable"===e._state?F(t):"closed"===e._state?z(t):B(t,e._storedError)}function j(t,e){var n=t._ownerReadableStream;return Rn(n,e)}function I(t){"readable"===t._ownerReadableStream._state?H(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):V(t,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),t._ownerReadableStream._reader=void 0,t._ownerReadableStream=void 0}function R(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function F(t){t._closedPromise=C((function(e,n){t._closedPromise_resolve=e,t._closedPromise_reject=n}))}function B(t,e){F(t),H(t,e)}function z(t){F(t),q(t)}function H(t,e){M(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0}function V(t,e){B(t,e)}function q(t){t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0}var U=e("[[CancelSteps]]"),W=e("[[PullSteps]]");function $(t,e){void 0===e&&(e=!1);var n=new Q(t);return n._forAuthorCode=e,n}function G(t){var e=C((function(e,n){var r={_resolve:e,_reject:n};t._reader._readRequests.push(r)}));return e}function Y(t,e,n){var r=t._reader,i=r._readRequests.shift();i._resolve(L(e,n,r._forAuthorCode))}function X(t){return t._reader._readRequests.length}function K(t){var e=t._reader;return void 0!==e&&!!tt(e)}var Z,J,Q=function(){function t(t){if(!1===jn(t))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===In(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");D(this,t),this._readRequests=new P}return Object.defineProperty(t.prototype,"closed",{get:function(){return tt(this)?this._closedPromise:A(nt("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return tt(this)?void 0===this._ownerReadableStream?A(R("cancel")):j(this,t):A(nt("cancel"))},t.prototype.read=function(){return tt(this)?void 0===this._ownerReadableStream?A(R("read from")):et(this):A(nt("read"))},t.prototype.releaseLock=function(){if(!tt(this))throw nt("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");I(this)}},t}();function tt(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readRequests")}function et(t){var e=t._ownerReadableStream;return e._disturbed=!0,"closed"===e._state?k(L(void 0,!0,t._forAuthorCode)):"errored"===e._state?A(e._storedError):e._readableStreamController[W]()}function nt(t){return new TypeError("ReadableStreamDefaultReader.prototype."+t+" can only be used on a ReadableStreamDefaultReader")}"symbol"===typeof e.asyncIterator&&(Z={},Z[e.asyncIterator]=function(){return this},J=Z,Object.defineProperty(J,e.asyncIterator,{enumerable:!1}));var rt={next:function(){if(!1===ot(this))return A(at("next"));var t=this._asyncIteratorReader;return void 0===t._ownerReadableStream?A(R("iterate")):_(et(t),(function(e){var n=e.done;n&&I(t);var r=e.value;return L(r,n,!0)}))},return:function(t){if(!1===ot(this))return A(at("next"));var e=this._asyncIteratorReader;if(void 0===e._ownerReadableStream)return A(R("finish iterating"));if(e._readRequests.length>0)return A(new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this._preventCancel){var n=j(e,t);return I(e),_(n,(function(){return L(t,!0,!0)}))}return I(e),k(L(t,!0,!0))}};function it(t,e){void 0===e&&(e=!1);var n=$(t),r=Object.create(rt);return r._asyncIteratorReader=n,r._preventCancel=Boolean(e),r}function ot(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_asyncIteratorReader")}function at(t){return new TypeError("ReadableStreamAsyncIterator."+t+" can only be used on a ReadableSteamAsyncIterator")}function st(t){var e=t._queue.shift();return t._queueTotalSize-=e.size,t._queueTotalSize<0&&(t._queueTotalSize=0),e.value}function lt(t,e,n){if(n=Number(n),!l(n))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t._queue.push({value:e,size:n}),t._queueTotalSize+=n}function ct(t){var e=t._queue.peek();return e.value}function ut(t){t._queue=new P,t._queueTotalSize=0}void 0!==J&&Object.setPrototypeOf(rt,J),Object.defineProperty(rt,"next",{enumerable:!1}),Object.defineProperty(rt,"return",{enumerable:!1});var dt=e("[[AbortSteps]]"),ht=e("[[ErrorSteps]]"),pt=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),mt(this);var n=e.size,r=e.highWaterMark,i=t.type;if(void 0!==i)throw new RangeError("Invalid type is specified");var o=v(n);void 0===r&&(r=1),r=m(r),Yt(this,t,r,o)}return Object.defineProperty(t.prototype,"locked",{get:function(){if(!1===vt(this))throw ae("locked");return bt(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===vt(this)?A(ae("abort")):!0===bt(this)?A(new TypeError("Cannot abort a stream that already has a writer")):yt(this,t)},t.prototype.close=function(){return!1===vt(this)?A(ae("close")):!0===bt(this)?A(new TypeError("Cannot close a stream that already has a writer")):!0===_t(this)?A(new TypeError("Cannot close an already-closing stream")):wt(this)},t.prototype.getWriter=function(){if(!1===vt(this))throw ae("getWriter");return ft(this)},t}();function ft(t){return new jt(t)}function gt(t,e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=function(){return 1});var a=Object.create(pt.prototype);mt(a);var s=Object.create(Wt.prototype);return Gt(a,s,t,e,n,r,i,o),a}function mt(t){t._state="writable",t._storedError=void 0,t._writer=void 0,t._writableStreamController=void 0,t._writeRequests=new P,t._inFlightWriteRequest=void 0,t._closeRequest=void 0,t._inFlightCloseRequest=void 0,t._pendingAbortRequest=void 0,t._backpressure=!1}function vt(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")}function bt(t){return void 0!==t._writer}function yt(t,e){var n=t._state;if("closed"===n||"errored"===n)return k(void 0);if(void 0!==t._pendingAbortRequest)return t._pendingAbortRequest._promise;var r=!1;"erroring"===n&&(r=!0,e=void 0);var i=C((function(n,i){t._pendingAbortRequest={_promise:void 0,_resolve:n,_reject:i,_reason:e,_wasAlreadyErroring:r}}));return t._pendingAbortRequest._promise=i,!1===r&&kt(t,e),i}function wt(t){var e=t._state;if("closed"===e||"errored"===e)return A(new TypeError("The stream (in "+e+" state) is not in the writable state and cannot be closed"));var n=C((function(e,n){var r={_resolve:e,_reject:n};t._closeRequest=r})),r=t._writer;return void 0!==r&&!0===t._backpressure&&"writable"===e&&xe(r),Kt(t._writableStreamController),n}function xt(t){var e=C((function(e,n){var r={_resolve:e,_reject:n};t._writeRequests.push(r)}));return e}function Ct(t,e){var n=t._state;"writable"!==n?At(t):kt(t,e)}function kt(t,e){var n=t._writableStreamController;t._state="erroring",t._storedError=e;var r=t._writer;void 0!==r&&Ht(r,e),!1===Mt(t)&&!0===n._started&&At(t)}function At(t){t._state="errored",t._writableStreamController[ht]();var e=t._storedError;if(t._writeRequests.forEach((function(t){t._reject(e)})),t._writeRequests=new P,void 0!==t._pendingAbortRequest){var n=t._pendingAbortRequest;if(t._pendingAbortRequest=void 0,!0===n._wasAlreadyErroring)return n._reject(e),void Lt(t);var r=t._writableStreamController[dt](n._reason);E(r,(function(){n._resolve(),Lt(t)}),(function(e){n._reject(e),Lt(t)}))}else Lt(t)}function St(t){t._inFlightWriteRequest._resolve(void 0),t._inFlightWriteRequest=void 0}function Et(t,e){t._inFlightWriteRequest._reject(e),t._inFlightWriteRequest=void 0,Ct(t,e)}function Ot(t){t._inFlightCloseRequest._resolve(void 0),t._inFlightCloseRequest=void 0;var e=t._state;"erroring"===e&&(t._storedError=void 0,void 0!==t._pendingAbortRequest&&(t._pendingAbortRequest._resolve(),t._pendingAbortRequest=void 0)),t._state="closed";var n=t._writer;void 0!==n&&fe(n)}function Tt(t,e){t._inFlightCloseRequest._reject(e),t._inFlightCloseRequest=void 0,void 0!==t._pendingAbortRequest&&(t._pendingAbortRequest._reject(e),t._pendingAbortRequest=void 0),Ct(t,e)}function _t(t){return void 0!==t._closeRequest||void 0!==t._inFlightCloseRequest}function Mt(t){return void 0!==t._inFlightWriteRequest||void 0!==t._inFlightCloseRequest}function Nt(t){t._inFlightCloseRequest=t._closeRequest,t._closeRequest=void 0}function Pt(t){t._inFlightWriteRequest=t._writeRequests.shift()}function Lt(t){void 0!==t._closeRequest&&(t._closeRequest._reject(t._storedError),t._closeRequest=void 0);var e=t._writer;void 0!==e&&he(e,t._storedError)}function Dt(t,e){var n=t._writer;void 0!==n&&e!==t._backpressure&&(!0===e?ye(n):xe(n)),t._backpressure=e}var jt=function(){function t(t){if(!1===vt(t))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===bt(t))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=t,t._writer=this;var e=t._state;if("writable"===e)!1===_t(t)&&!0===t._backpressure?ge(this):ve(this),ce(this);else if("erroring"===e)me(this,t._storedError),ce(this);else if("closed"===e)ve(this),de(this);else{var n=t._storedError;me(this,n),ue(this,n)}}return Object.defineProperty(t.prototype,"closed",{get:function(){return!1===It(this)?A(se("closed")):this._closedPromise},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===It(this))throw se("desiredSize");if(void 0===this._ownerWritableStream)throw le("desiredSize");return Vt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){return!1===It(this)?A(se("ready")):this._readyPromise},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===It(this)?A(se("abort")):void 0===this._ownerWritableStream?A(le("abort")):Rt(this,t)},t.prototype.close=function(){if(!1===It(this))return A(se("close"));var t=this._ownerWritableStream;return void 0===t?A(le("close")):!0===_t(t)?A(new TypeError("Cannot close an already-closing stream")):Ft(this)},t.prototype.releaseLock=function(){if(!1===It(this))throw se("releaseLock");var t=this._ownerWritableStream;void 0!==t&&qt(this)},t.prototype.write=function(t){return!1===It(this)?A(se("write")):void 0===this._ownerWritableStream?A(le("write to")):Ut(this,t)},t}();function It(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_ownerWritableStream")}function Rt(t,e){var n=t._ownerWritableStream;return yt(n,e)}function Ft(t){var e=t._ownerWritableStream;return wt(e)}function Bt(t){var e=t._ownerWritableStream,n=e._state;return!0===_t(e)||"closed"===n?k(void 0):"errored"===n?A(e._storedError):Ft(t)}function zt(t,e){"pending"===t._closedPromiseState?he(t,e):pe(t,e)}function Ht(t,e){"pending"===t._readyPromiseState?be(t,e):we(t,e)}function Vt(t){var e=t._ownerWritableStream,n=e._state;return"errored"===n||"erroring"===n?null:"closed"===n?0:Jt(e._writableStreamController)}function qt(t){var e=t._ownerWritableStream,n=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Ht(t,n),zt(t,n),e._writer=void 0,t._ownerWritableStream=void 0}function Ut(t,e){var n=t._ownerWritableStream,r=n._writableStreamController,i=Zt(r,e);if(n!==t._ownerWritableStream)return A(le("write to"));var o=n._state;if("errored"===o)return A(n._storedError);if(!0===_t(n)||"closed"===o)return A(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===o)return A(n._storedError);var a=xt(n);return Qt(r,e,i),a}var Wt=function(){function t(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}return t.prototype.error=function(t){if(!1===$t(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");var e=this._controlledWritableStream._state;"writable"===e&&oe(this,t)},t.prototype[dt]=function(t){var e=this._abortAlgorithm(t);return Xt(this),e},t.prototype[ht]=function(){ut(this)},t}();function $t(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledWritableStream")}function Gt(t,e,n,r,i,o,a,s){e._controlledWritableStream=t,t._writableStreamController=e,e._queue=void 0,e._queueTotalSize=void 0,ut(e),e._started=!1,e._strategySizeAlgorithm=s,e._strategyHWM=a,e._writeAlgorithm=r,e._closeAlgorithm=i,e._abortAlgorithm=o;var l=ie(e);Dt(t,l);var c=n(),u=k(c);E(u,(function(){e._started=!0,te(e)}),(function(n){e._started=!0,Ct(t,n)}))}function Yt(t,e,n,r){var i=Object.create(Wt.prototype);function o(){return h(e,"start",[i])}var a=d(e,"write",1,[i]),s=d(e,"close",0,[]),l=d(e,"abort",1,[]);Gt(t,i,o,a,s,l,n,r)}function Xt(t){t._writeAlgorithm=void 0,t._closeAlgorithm=void 0,t._abortAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function Kt(t){lt(t,"close",0),te(t)}function Zt(t,e){try{return t._strategySizeAlgorithm(e)}catch(n){return ee(t,n),1}}function Jt(t){return t._strategyHWM-t._queueTotalSize}function Qt(t,e,n){var r={chunk:e};try{lt(t,r,n)}catch(a){return void ee(t,a)}var i=t._controlledWritableStream;if(!1===_t(i)&&"writable"===i._state){var o=ie(t);Dt(i,o)}te(t)}function te(t){var e=t._controlledWritableStream;if(!1!==t._started&&void 0===e._inFlightWriteRequest){var n=e._state;if("erroring"!==n){if(0!==t._queue.length){var r=ct(t);"close"===r?ne(t):re(t,r.chunk)}}else At(e)}}function ee(t,e){"writable"===t._controlledWritableStream._state&&oe(t,e)}function ne(t){var e=t._controlledWritableStream;Nt(e),st(t);var n=t._closeAlgorithm();Xt(t),E(n,(function(){Ot(e)}),(function(t){Tt(e,t)}))}function re(t,e){var n=t._controlledWritableStream;Pt(n);var r=t._writeAlgorithm(e);E(r,(function(){St(n);var e=n._state;if(st(t),!1===_t(n)&&"writable"===e){var r=ie(t);Dt(n,r)}te(t)}),(function(e){"writable"===n._state&&Xt(t),Et(n,e)}))}function ie(t){var e=Jt(t);return e<=0}function oe(t,e){var n=t._controlledWritableStream;Xt(t),kt(n,e)}function ae(t){return new TypeError("WritableStream.prototype."+t+" can only be used on a WritableStream")}function se(t){return new TypeError("WritableStreamDefaultWriter.prototype."+t+" can only be used on a WritableStreamDefaultWriter")}function le(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function ce(t){t._closedPromise=C((function(e,n){t._closedPromise_resolve=e,t._closedPromise_reject=n,t._closedPromiseState="pending"}))}function ue(t,e){ce(t),he(t,e)}function de(t){ce(t),fe(t)}function he(t,e){M(t._closedPromise),t._closedPromise_reject(e),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="rejected"}function pe(t,e){ue(t,e)}function fe(t){t._closedPromise_resolve(void 0),t._closedPromise_resolve=void 0,t._closedPromise_reject=void 0,t._closedPromiseState="resolved"}function ge(t){t._readyPromise=C((function(e,n){t._readyPromise_resolve=e,t._readyPromise_reject=n})),t._readyPromiseState="pending"}function me(t,e){ge(t),be(t,e)}function ve(t){ge(t),xe(t)}function be(t,e){M(t._readyPromise),t._readyPromise_reject(e),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="rejected"}function ye(t){ge(t)}function we(t,e){me(t,e)}function xe(t){t._readyPromise_resolve(void 0),t._readyPromise_resolve=void 0,t._readyPromise_reject=void 0,t._readyPromiseState="fulfilled"}function Ce(t){if("object"!==typeof t||null===t)return!1;try{return"boolean"===typeof t.aborted}catch(Z){return!1}}var ke="undefined"!==typeof DOMException?DOMException:void 0;function Ae(t){if("function"!==typeof t&&"object"!==typeof t)return!1;try{return new t,!0}catch(Z){return!1}}function Se(){var t=function(t,e){this.message=t||"",this.name=e||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return t.prototype=Object.create(Error.prototype),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,configurable:!0}),t}var Ee=Ae(ke)?ke:Se();function Oe(t,e,r,i,o,a){var s=$(t),l=ft(e);t._disturbed=!0;var c=!1,u=k(void 0);return C((function(d,h){var p;if(void 0!==a){if(p=function(){var n=new Ee("Aborted","AbortError"),r=[];!1===i&&r.push((function(){return"writable"===e._state?yt(e,n):k(void 0)})),!1===o&&r.push((function(){return"readable"===t._state?Rn(t,n):k(void 0)})),w((function(){return Promise.all(r.map((function(t){return t()})))}),!0,n)},!0===a.aborted)return void p();a.addEventListener("abort",p)}function f(){return C((function(t,e){function n(r){r?t():S(g(),n,e)}n(!1)}))}function g(){return!0===c?k(!0):S(l._readyPromise,(function(){return S(et(s),(function(t){return!0===t.done||(u=S(Ut(l,t.value),void 0,n),!1)}))}))}if(b(t,s._closedPromise,(function(t){!1===i?w((function(){return yt(e,t)}),!0,t):x(!0,t)})),b(e,l._closedPromise,(function(e){!1===o?w((function(){return Rn(t,e)}),!0,e):x(!0,e)})),y(t,s._closedPromise,(function(){!1===r?w((function(){return Bt(l)})):x()})),!0===_t(e)||"closed"===e._state){var m=new TypeError("the destination writable stream closed before all data could be piped to it");!1===o?w((function(){return Rn(t,m)}),!0,m):x(!0,m)}function v(){var t=u;return S(u,(function(){return t!==u?v():void 0}))}function b(t,e,n){"errored"===t._state?n(t._storedError):T(e,n)}function y(t,e,n){"closed"===t._state?n():O(e,n)}function w(t,n,r){function i(){E(t(),(function(){return A(n,r)}),(function(t){return A(!0,t)}))}!0!==c&&(c=!0,"writable"===e._state&&!1===_t(e)?O(v(),i):i())}function x(t,n){!0!==c&&(c=!0,"writable"===e._state&&!1===_t(e)?O(v(),(function(){return A(t,n)})):A(t,n))}function A(t,e){qt(l),I(s),void 0!==a&&a.removeEventListener("abort",p),t?h(e):d(void 0)}M(f())}))}var Te=function(){function t(){throw new TypeError}return Object.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===_e(this))throw He("desiredSize");return Ie(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===_e(this))throw He("close");if(!1===Fe(this))throw new TypeError("The stream is not in a state that permits close");Le(this)},t.prototype.enqueue=function(t){if(!1===_e(this))throw He("enqueue");if(!1===Fe(this))throw new TypeError("The stream is not in a state that permits enqueue");return De(this,t)},t.prototype.error=function(t){if(!1===_e(this))throw He("error");je(this,t)},t.prototype[U]=function(t){ut(this);var e=this._cancelAlgorithm(t);return Pe(this),e},t.prototype[W]=function(){var t=this._controlledReadableStream;if(this._queue.length>0){var e=st(this);return!0===this._closeRequested&&0===this._queue.length?(Pe(this),Fn(t)):Me(this),k(L(e,!1,t._reader._forAuthorCode))}var n=G(t);return Me(this),n},t}();function _e(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")}function Me(t){var e=Ne(t);if(!1!==e)if(!0!==t._pulling){t._pulling=!0;var n=t._pullAlgorithm();E(n,(function(){t._pulling=!1,!0===t._pullAgain&&(t._pullAgain=!1,Me(t))}),(function(e){je(t,e)}))}else t._pullAgain=!0}function Ne(t){var e=t._controlledReadableStream;if(!1===Fe(t))return!1;if(!1===t._started)return!1;if(!0===In(e)&&X(e)>0)return!0;var n=Ie(t);return n>0}function Pe(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0,t._strategySizeAlgorithm=void 0}function Le(t){var e=t._controlledReadableStream;t._closeRequested=!0,0===t._queue.length&&(Pe(t),Fn(e))}function De(t,e){var n=t._controlledReadableStream;if(!0===In(n)&&X(n)>0)Y(n,e,!1);else{var r=void 0;try{r=t._strategySizeAlgorithm(e)}catch(i){throw je(t,i),i}try{lt(t,e,r)}catch(o){throw je(t,o),o}}Me(t)}function je(t,e){var n=t._controlledReadableStream;"readable"===n._state&&(ut(t),Pe(t),Bn(n,e))}function Ie(t){var e=t._controlledReadableStream,n=e._state;return"errored"===n?null:"closed"===n?0:t._strategyHWM-t._queueTotalSize}function Re(t){return!0!==Ne(t)}function Fe(t){var e=t._controlledReadableStream._state;return!1===t._closeRequested&&"readable"===e}function Be(t,e,n,r,i,o,a){e._controlledReadableStream=t,e._queue=void 0,e._queueTotalSize=void 0,ut(e),e._started=!1,e._closeRequested=!1,e._pullAgain=!1,e._pulling=!1,e._strategySizeAlgorithm=a,e._strategyHWM=o,e._pullAlgorithm=r,e._cancelAlgorithm=i,t._readableStreamController=e;var s=n();E(k(s),(function(){e._started=!0,Me(e)}),(function(t){je(e,t)}))}function ze(t,e,n,r){var i=Object.create(Te.prototype);function o(){return h(e,"start",[i])}var a=d(e,"pull",0,[i]),s=d(e,"cancel",1,[]);Be(t,i,o,a,s,n,r)}function He(t){return new TypeError("ReadableStreamDefaultController.prototype."+t+" can only be used on a ReadableStreamDefaultController")}function Ve(t,e){var n,r,i,o,s,l=$(t),c=!1,u=!1,d=!1,h=C((function(t){s=t}));function p(){if(!0===c)return k(void 0);c=!0;var t=_(et(l),(function(t){c=!1;var e=t.done;if(!0===e)return!1===u&&Le(i._readableStreamController),void(!1===d&&Le(o._readableStreamController));var n=t.value,r=n,a=n;!1===u&&De(i._readableStreamController,r),!1===d&&De(o._readableStreamController,a)}));return M(t),k(void 0)}function f(e){if(u=!0,n=e,!0===d){var i=a([n,r]),o=Rn(t,i);s(o)}return h}function g(e){if(d=!0,r=e,!0===u){var i=a([n,r]),o=Rn(t,i);s(o)}return h}function m(){}return i=Ln(m,p,f),o=Ln(m,p,g),T(l._closedPromise,(function(t){je(i._readableStreamController,t),je(o._readableStreamController,t)})),[i,o]}var qe=Number.isInteger||function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t},Ue=function(){function t(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return Object.defineProperty(t.prototype,"view",{get:function(){if(!1===Ge(this))throw xn("view");return this._view},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===Ge(this))throw xn("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");g(this._view.buffer),mn(this._associatedReadableByteStreamController,t)},t.prototype.respondWithNewView=function(t){if(!1===Ge(this))throw xn("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(!ArrayBuffer.isView(t))throw new TypeError("You can only respond with array buffer views");g(t.buffer),vn(this._associatedReadableByteStreamController,t)},t}(),We=function(){function t(){throw new TypeError("ReadableByteStreamController constructor cannot be used directly")}return Object.defineProperty(t.prototype,"byobRequest",{get:function(){if(!1===$e(this))throw Cn("byobRequest");if(void 0===this._byobRequest&&this._pendingPullIntos.length>0){var t=this._pendingPullIntos.peek(),e=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=Object.create(Ue.prototype);wn(n,this,e),this._byobRequest=n}return this._byobRequest},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===$e(this))throw Cn("desiredSize");return gn(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===$e(this))throw Cn("close");if(!0===this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be closed");hn(this)},t.prototype.enqueue=function(t){if(!1===$e(this))throw Cn("enqueue");if(!0===this._closeRequested)throw new TypeError("stream is closed or draining");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError("The stream (in "+e+" state) is not in the readable state and cannot be enqueued to");if(!ArrayBuffer.isView(t))throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController");g(t.buffer),pn(this,t)},t.prototype.error=function(t){if(!1===$e(this))throw Cn("error");fn(this,t)},t.prototype[U]=function(t){if(this._pendingPullIntos.length>0){var e=this._pendingPullIntos.peek();e.bytesFilled=0}ut(this);var n=this._cancelAlgorithm(t);return dn(this),n},t.prototype[W]=function(){var t=this._controlledReadableByteStream;if(this._queueTotalSize>0){var e=this._queue.shift();this._queueTotalSize-=e.byteLength,en(this);var n=void 0;try{n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}catch(s){return A(s)}return k(L(n,!1,t._reader._forAuthorCode))}var r=this._autoAllocateChunkSize;if(void 0!==r){var i=void 0;try{i=new ArrayBuffer(r)}catch(l){return A(l)}var o={buffer:i,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,ctor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}var a=G(t);return Ye(this),a},t}();function $e(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")}function Ge(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")}function Ye(t){var e=un(t);if(!1!==e)if(!0!==t._pulling){t._pulling=!0;var n=t._pullAlgorithm();E(n,(function(){t._pulling=!1,!0===t._pullAgain&&(t._pullAgain=!1,Ye(t))}),(function(e){fn(t,e)}))}else t._pullAgain=!0}function Xe(t){nn(t),t._pendingPullIntos=new P}function Ke(t,e){var n=!1;"closed"===t._state&&(n=!0);var r=Ze(e);"default"===e.readerType?Y(t,r,n):Sn(t,r,n)}function Ze(t){var e=t.bytesFilled,n=t.elementSize;return new t.ctor(t.buffer,t.byteOffset,e/n)}function Je(t,e,n,r){t._queue.push({buffer:e,byteOffset:n,byteLength:r}),t._queueTotalSize+=r}function Qe(t,e){var n=e.elementSize,r=e.bytesFilled-e.bytesFilled%n,i=Math.min(t._queueTotalSize,e.byteLength-e.bytesFilled),o=e.bytesFilled+i,a=o-o%n,l=i,c=!1;a>r&&(l=a-e.bytesFilled,c=!0);var u=t._queue;while(l>0){var d=u.peek(),h=Math.min(l,d.byteLength),p=e.byteOffset+e.bytesFilled;s(e.buffer,p,d.buffer,d.byteOffset,h),d.byteLength===h?u.shift():(d.byteOffset+=h,d.byteLength-=h),t._queueTotalSize-=h,tn(t,h,e),l-=h}return c}function tn(t,e,n){nn(t),n.bytesFilled+=e}function en(t){0===t._queueTotalSize&&!0===t._closeRequested?(dn(t),Fn(t._controlledReadableByteStream)):Ye(t)}function nn(t){void 0!==t._byobRequest&&(t._byobRequest._associatedReadableByteStreamController=void 0,t._byobRequest._view=void 0,t._byobRequest=void 0)}function rn(t){while(t._pendingPullIntos.length>0){if(0===t._queueTotalSize)return;var e=t._pendingPullIntos.peek();!0===Qe(t,e)&&(cn(t),Ke(t._controlledReadableByteStream,e))}}function on(t,e){var n=t._controlledReadableByteStream,r=1;e.constructor!==DataView&&(r=e.constructor.BYTES_PER_ELEMENT);var i=e.constructor,o=f(e.buffer),a={buffer:o,byteOffset:e.byteOffset,byteLength:e.byteLength,bytesFilled:0,elementSize:r,ctor:i,readerType:"byob"};if(t._pendingPullIntos.length>0)return t._pendingPullIntos.push(a),An(n);if("closed"===n._state){var s=new i(a.buffer,a.byteOffset,0);return k(L(s,!0,n._reader._forAuthorCode))}if(t._queueTotalSize>0){if(!0===Qe(t,a)){var l=Ze(a);return en(t),k(L(l,!1,n._reader._forAuthorCode))}if(!0===t._closeRequested){var c=new TypeError("Insufficient bytes to fill elements in the given buffer");return fn(t,c),A(c)}}t._pendingPullIntos.push(a);var u=An(n);return Ye(t),u}function an(t,e){e.buffer=f(e.buffer);var n=t._controlledReadableByteStream;if(!0===On(n))while(En(n)>0){var r=cn(t);Ke(n,r)}}function sn(t,e,n){if(n.bytesFilled+e>n.byteLength)throw new RangeError("bytesWritten out of range");if(tn(t,e,n),!(n.bytesFilled<n.elementSize)){cn(t);var r=n.bytesFilled%n.elementSize;if(r>0){var i=n.byteOffset+n.bytesFilled,o=n.buffer.slice(i-r,i);Je(t,o,0,o.byteLength)}n.buffer=f(n.buffer),n.bytesFilled-=r,Ke(t._controlledReadableByteStream,n),rn(t)}}function ln(t,e){var n=t._pendingPullIntos.peek(),r=t._controlledReadableByteStream;if("closed"===r._state){if(0!==e)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");an(t,n)}else sn(t,e,n);Ye(t)}function cn(t){var e=t._pendingPullIntos.shift();return nn(t),e}function un(t){var e=t._controlledReadableByteStream;if("readable"!==e._state)return!1;if(!0===t._closeRequested)return!1;if(!1===t._started)return!1;if(!0===K(e)&&X(e)>0)return!0;if(!0===On(e)&&En(e)>0)return!0;var n=gn(t);return n>0}function dn(t){t._pullAlgorithm=void 0,t._cancelAlgorithm=void 0}function hn(t){var e=t._controlledReadableByteStream;if(t._queueTotalSize>0)t._closeRequested=!0;else{if(t._pendingPullIntos.length>0){var n=t._pendingPullIntos.peek();if(n.bytesFilled>0){var r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw fn(t,r),r}}dn(t),Fn(e)}}function pn(t,e){var n=t._controlledReadableByteStream,r=e.buffer,i=e.byteOffset,o=e.byteLength,a=f(r);if(!0===K(n))if(0===X(n))Je(t,a,i,o);else{var s=new Uint8Array(a,i,o);Y(n,s,!1)}else!0===On(n)?(Je(t,a,i,o),rn(t)):Je(t,a,i,o);Ye(t)}function fn(t,e){var n=t._controlledReadableByteStream;"readable"===n._state&&(Xe(t),ut(t),dn(t),Bn(n,e))}function gn(t){var e=t._controlledReadableByteStream,n=e._state;return"errored"===n?null:"closed"===n?0:t._strategyHWM-t._queueTotalSize}function mn(t,e){if(e=Number(e),!1===l(e))throw new RangeError("bytesWritten must be a finite");ln(t,e)}function vn(t,e){var n=t._pendingPullIntos.peek();if(n.byteOffset+n.bytesFilled!==e.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(n.byteLength!==e.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");n.buffer=e.buffer,ln(t,e.byteLength)}function bn(t,e,n,r,i,o,a){e._controlledReadableByteStream=t,e._pullAgain=!1,e._pulling=!1,e._byobRequest=void 0,e._queue=e._queueTotalSize=void 0,ut(e),e._closeRequested=!1,e._started=!1,e._strategyHWM=m(o),e._pullAlgorithm=r,e._cancelAlgorithm=i,e._autoAllocateChunkSize=a,e._pendingPullIntos=new P,t._readableStreamController=e;var s=n();E(k(s),(function(){e._started=!0,Ye(e)}),(function(t){fn(e,t)}))}function yn(t,e,n){var r=Object.create(We.prototype);function i(){return h(e,"start",[r])}var o=d(e,"pull",0,[r]),a=d(e,"cancel",1,[]),s=e.autoAllocateChunkSize;if(void 0!==s&&(s=Number(s),!1===qe(s)||s<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");bn(t,r,i,o,a,n,s)}function wn(t,e,n){t._associatedReadableByteStreamController=e,t._view=n}function xn(t){return new TypeError("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Cn(t){return new TypeError("ReadableByteStreamController.prototype."+t+" can only be used on a ReadableByteStreamController")}function kn(t,e){void 0===e&&(e=!1);var n=new Tn(t);return n._forAuthorCode=e,n}function An(t){var e=C((function(e,n){var r={_resolve:e,_reject:n};t._reader._readIntoRequests.push(r)}));return e}function Sn(t,e,n){var r=t._reader,i=r._readIntoRequests.shift();i._resolve(L(e,n,r._forAuthorCode))}function En(t){return t._reader._readIntoRequests.length}function On(t){var e=t._reader;return void 0!==e&&!!_n(e)}var Tn=function(){function t(t){if(!jn(t))throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===$e(t._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(In(t))throw new TypeError("This stream has already been locked for exclusive reading by another reader");D(this,t),this._readIntoRequests=new P}return Object.defineProperty(t.prototype,"closed",{get:function(){return _n(this)?this._closedPromise:A(Nn("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return _n(this)?void 0===this._ownerReadableStream?A(R("cancel")):j(this,t):A(Nn("cancel"))},t.prototype.read=function(t){return _n(this)?void 0===this._ownerReadableStream?A(R("read from")):ArrayBuffer.isView(t)?(g(t.buffer),0===t.byteLength?A(new TypeError("view must have non-zero byteLength")):Mn(this,t)):A(new TypeError("view must be an array buffer view")):A(Nn("read"))},t.prototype.releaseLock=function(){if(!_n(this))throw Nn("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");I(this)}},t}();function _n(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")}function Mn(t,e){var n=t._ownerReadableStream;return n._disturbed=!0,"errored"===n._state?A(n._storedError):on(n._readableStreamController,e)}function Nn(t){return new TypeError("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var Pn=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),Dn(this);var n=e.size,r=e.highWaterMark,i=t.type,o=String(i);if("bytes"===o){if(void 0!==n)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===r&&(r=0),r=m(r),yn(this,t,r)}else{if(void 0!==i)throw new RangeError("Invalid type is specified");var a=v(n);void 0===r&&(r=1),r=m(r),ze(this,t,r,a)}}return Object.defineProperty(t.prototype,"locked",{get:function(){if(!1===jn(this))throw zn("locked");return In(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===jn(this)?A(zn("cancel")):!0===In(this)?A(new TypeError("Cannot cancel a stream that already has a reader")):Rn(this,t)},t.prototype.getReader=function(t){var e=(void 0===t?{}:t).mode;if(!1===jn(this))throw zn("getReader");if(void 0===e)return $(this,!0);if(e=String(e),"byob"===e)return kn(this,!0);throw new RangeError("Invalid mode is specified")},t.prototype.pipeThrough=function(t,e){var n=t.writable,r=t.readable,i=void 0===e?{}:e,o=i.preventClose,a=i.preventAbort,s=i.preventCancel,l=i.signal;if(!1===jn(this))throw zn("pipeThrough");if(!1===vt(n))throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(!1===jn(r))throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(o=Boolean(o),a=Boolean(a),s=Boolean(s),void 0!==l&&!Ce(l))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===In(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===bt(n))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");var c=Oe(this,n,o,a,s,l);return M(c),r},t.prototype.pipeTo=function(t,e){var n=void 0===e?{}:e,r=n.preventClose,i=n.preventAbort,o=n.preventCancel,a=n.signal;return!1===jn(this)?A(zn("pipeTo")):!1===vt(t)?A(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(r=Boolean(r),i=Boolean(i),o=Boolean(o),void 0===a||Ce(a)?!0===In(this)?A(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===bt(t)?A(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Oe(this,t,r,i,o,a):A(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},t.prototype.tee=function(){if(!1===jn(this))throw zn("tee");var t=Ve(this);return a(t)},t.prototype.getIterator=function(t){var e=(void 0===t?{}:t).preventCancel,n=void 0!==e&&e;if(!1===jn(this))throw zn("getIterator");return it(this,n)},t}();function Ln(t,e,n,r,i){void 0===r&&(r=1),void 0===i&&(i=function(){return 1});var o=Object.create(Pn.prototype);Dn(o);var a=Object.create(Te.prototype);return Be(o,a,t,e,n,r,i),o}function Dn(t){t._state="readable",t._reader=void 0,t._storedError=void 0,t._disturbed=!1}function jn(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")}function In(t){return void 0!==t._reader}function Rn(t,e){if(t._disturbed=!0,"closed"===t._state)return k(void 0);if("errored"===t._state)return A(t._storedError);Fn(t);var r=t._readableStreamController[U](e);return _(r,n)}function Fn(t){t._state="closed";var e=t._reader;void 0!==e&&(tt(e)&&(e._readRequests.forEach((function(t){t._resolve(L(void 0,!0,e._forAuthorCode))})),e._readRequests=new P),q(e))}function Bn(t,e){t._state="errored",t._storedError=e;var n=t._reader;void 0!==n&&(tt(n)?(n._readRequests.forEach((function(t){t._reject(e)})),n._readRequests=new P):(n._readIntoRequests.forEach((function(t){t._reject(e)})),n._readIntoRequests=new P),H(n,e))}function zn(t){return new TypeError("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"===typeof e.asyncIterator&&Object.defineProperty(Pn.prototype,e.asyncIterator,{value:Pn.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});var Hn=function(){function t(t){var e=t.highWaterMark;this.highWaterMark=e}return t.prototype.size=function(t){return t.byteLength},t}(),Vn=function(){function t(t){var e=t.highWaterMark;this.highWaterMark=e}return t.prototype.size=function(){return 1},t}(),qn=function(){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var r=e.size,i=e.highWaterMark,o=n.size,a=n.highWaterMark,s=t.writableType;if(void 0!==s)throw new RangeError("Invalid writable type specified");var l=v(r);void 0===i&&(i=1),i=m(i);var c=t.readableType;if(void 0!==c)throw new RangeError("Invalid readable type specified");var u,d=v(o);void 0===a&&(a=0),a=m(a);var p=C((function(t){u=t}));Un(this,p,i,l,a,d),Jn(this,t);var f=h(t,"start",[this._transformStreamController]);u(f)}return Object.defineProperty(t.prototype,"readable",{get:function(){if(!1===Wn(this))throw cr("readable");return this._readable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"writable",{get:function(){if(!1===Wn(this))throw cr("writable");return this._writable},enumerable:!0,configurable:!0}),t}();function Un(t,e,n,r,i,o){function a(){return e}function s(e){return ir(t,e)}function l(e){return or(t,e)}function c(){return ar(t)}function u(){return sr(t)}function d(e){return Gn(t,e),k(void 0)}t._writable=gt(a,s,c,l,n,r),t._readable=Ln(a,u,d,i,o),t._backpressure=void 0,t._backpressureChangePromise=void 0,t._backpressureChangePromise_resolve=void 0,Yn(t,!0),t._transformStreamController=void 0}function Wn(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_transformStreamController")}function $n(t,e){je(t._readable._readableStreamController,e),Gn(t,e)}function Gn(t,e){Qn(t._transformStreamController),ee(t._writable._writableStreamController,e),!0===t._backpressure&&Yn(t,!1)}function Yn(t,e){void 0!==t._backpressureChangePromise&&t._backpressureChangePromise_resolve(),t._backpressureChangePromise=C((function(e){t._backpressureChangePromise_resolve=e})),t._backpressure=e}var Xn=function(){function t(){throw new TypeError("TransformStreamDefaultController instances cannot be created directly")}return Object.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===Kn(this))throw lr("desiredSize");var t=this._controlledTransformStream._readable._readableStreamController;return Ie(t)},enumerable:!0,configurable:!0}),t.prototype.enqueue=function(t){if(!1===Kn(this))throw lr("enqueue");tr(this,t)},t.prototype.error=function(t){if(!1===Kn(this))throw lr("error");er(this,t)},t.prototype.terminate=function(){if(!1===Kn(this))throw lr("terminate");rr(this)},t}();function Kn(t){return!!o(t)&&!!Object.prototype.hasOwnProperty.call(t,"_controlledTransformStream")}function Zn(t,e,n,r){e._controlledTransformStream=t,t._transformStreamController=e,e._transformAlgorithm=n,e._flushAlgorithm=r}function Jn(t,e){var n=Object.create(Xn.prototype),r=function(t){try{return tr(n,t),k(void 0)}catch(e){return A(e)}},i=e.transform;if(void 0!==i){if("function"!==typeof i)throw new TypeError("transform is not a method");r=function(t){return p(i,e,[t,n])}}var o=d(e,"flush",0,[n]);Zn(t,n,r,o)}function Qn(t){t._transformAlgorithm=void 0,t._flushAlgorithm=void 0}function tr(t,e){var n=t._controlledTransformStream,r=n._readable._readableStreamController;if(!1===Fe(r))throw new TypeError("Readable side is not in a state that permits enqueue");try{De(r,e)}catch(o){throw Gn(n,o),n._readable._storedError}var i=Re(r);i!==n._backpressure&&Yn(n,!0)}function er(t,e){$n(t._controlledTransformStream,e)}function nr(t,e){var n=t._transformAlgorithm(e);return _(n,void 0,(function(e){throw $n(t._controlledTransformStream,e),e}))}function rr(t){var e=t._controlledTransformStream,n=e._readable._readableStreamController;!0===Fe(n)&&Le(n);var r=new TypeError("TransformStream terminated");Gn(e,r)}function ir(t,e){var n=t._transformStreamController;if(!0===t._backpressure){var r=t._backpressureChangePromise;return _(r,(function(){var r=t._writable,i=r._state;if("erroring"===i)throw r._storedError;return nr(n,e)}))}return nr(n,e)}function or(t,e){return $n(t,e),k(void 0)}function ar(t){var e=t._readable,n=t._transformStreamController,r=n._flushAlgorithm();return Qn(n),_(r,(function(){if("errored"===e._state)throw e._storedError;var t=e._readableStreamController;!0===Fe(t)&&Le(t)}),(function(n){throw $n(t,n),e._storedError}))}function sr(t){return Yn(t,!1),t._backpressureChangePromise}function lr(t){return new TypeError("TransformStreamDefaultController.prototype."+t+" can only be used on a TransformStreamDefaultController")}function cr(t){return new TypeError("TransformStream.prototype."+t+" can only be used on a TransformStream")}t.ByteLengthQueuingStrategy=Hn,t.CountQueuingStrategy=Vn,t.ReadableStream=Pn,t.TransformStream=qn,t.WritableStream=pt,Object.defineProperty(t,"__esModule",{value:!0})}))},function(t,e,n){n(147),n(118),n(77),n(120);var r=n(43);t.exports=r.Map},function(t,e,n){"use strict";var r=n(148),i=n(152);t.exports=r("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),i)},function(t,e,n){"use strict";var r=n(10),i=n(11),o=n(52),a=n(29),s=n(149),l=n(104),c=n(126),u=n(22),d=n(14),h=n(97),p=n(85),f=n(151);t.exports=function(t,e,n){var g=-1!==t.indexOf("Map"),m=-1!==t.indexOf("Weak"),v=g?"set":"add",b=i[t],y=b&&b.prototype,w=b,x={},C=function(t){var e=y[t];a(y,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(m&&!u(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return m&&!u(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(m&&!u(t))&&e.call(this,0===t?0:t)}:function(t,n){return e.call(this,0===t?0:t,n),this})};if(o(t,"function"!=typeof b||!(m||y.forEach&&!d((function(){(new b).entries().next()})))))w=n.getConstructor(e,t,g,v),s.REQUIRED=!0;else if(o(t,!0)){var k=new w,A=k[v](m?{}:-0,1)!=k,S=d((function(){k.has(1)})),E=h((function(t){new b(t)})),O=!m&&d((function(){var t=new b,e=5;while(e--)t[v](e,e);return!t.has(-0)}));E||(w=e((function(e,n){c(e,w,t);var r=f(new b,e,w);return void 0!=n&&l(n,r[v],r,g),r})),w.prototype=y,y.constructor=w),(S||O)&&(C("delete"),C("has"),g&&C("get")),(O||A)&&C(v),m&&y.clear&&delete y.clear}return x[t]=w,r({global:!0,forced:w!=b},x),p(w,t),m||n.setStrong(w,t,g),w}},function(t,e,n){var r=n(39),i=n(22),o=n(23),a=n(27).f,s=n(38),l=n(150),c=s("meta"),u=0,d=Object.isExtensible||function(){return!0},h=function(t){a(t,c,{value:{objectID:"O"+ ++u,weakData:{}}})},p=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,c)){if(!d(t))return"F";if(!e)return"E";h(t)}return t[c].objectID},f=function(t,e){if(!o(t,c)){if(!d(t))return!0;if(!e)return!1;h(t)}return t[c].weakData},g=function(t){return l&&m.REQUIRED&&d(t)&&!o(t,c)&&h(t),t},m=t.exports={REQUIRED:!1,fastKey:p,getWeakData:f,onFreeze:g};r[c]=!0},function(t,e,n){var r=n(14);t.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(t,e,n){var r=n(22),i=n(87);t.exports=function(t,e,n){var o,a;return i&&"function"==typeof(o=e.constructor)&&o!==n&&r(a=o.prototype)&&a!==n.prototype&&i(t,a),t}},function(t,e,n){"use strict";var r=n(27).f,i=n(71),o=n(124),a=n(62),s=n(126),l=n(104),c=n(79),u=n(125),d=n(13),h=n(149).fastKey,p=n(33),f=p.set,g=p.getterFor;t.exports={getConstructor:function(t,e,n,c){var u=t((function(t,r){s(t,u,e),f(t,{type:e,index:i(null),first:void 0,last:void 0,size:0}),d||(t.size=0),void 0!=r&&l(r,t[c],t,n)})),p=g(e),m=function(t,e,n){var r,i,o=p(t),a=v(t,e);return a?a.value=n:(o.last=a={index:i=h(e,!0),key:e,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=a),r&&(r.next=a),d?o.size++:t.size++,"F"!==i&&(o.index[i]=a)),t},v=function(t,e){var n,r=p(t),i=h(e);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==e)return n};return o(u.prototype,{clear:function(){var t=this,e=p(t),n=e.index,r=e.first;while(r)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete n[r.index],r=r.next;e.first=e.last=void 0,d?e.size=0:t.size=0},delete:function(t){var e=this,n=p(e),r=v(e,t);if(r){var i=r.next,o=r.previous;delete n.index[r.index],r.removed=!0,o&&(o.next=i),i&&(i.previous=o),n.first==r&&(n.first=i),n.last==r&&(n.last=o),d?n.size--:e.size--}return!!r},forEach:function(t){var e,n=p(this),r=a(t,arguments.length>1?arguments[1]:void 0,3);while(e=e?e.next:n.first){r(e.value,e.key,this);while(e&&e.removed)e=e.previous}},has:function(t){return!!v(this,t)}}),o(u.prototype,n?{get:function(t){var e=v(this,t);return e&&e.value},set:function(t,e){return m(this,0===t?0:t,e)}}:{add:function(t){return m(this,t=0===t?0:t,t)}}),d&&r(u.prototype,"size",{get:function(){return p(this).size}}),u},setStrong:function(t,e,n){var r=e+" Iterator",i=g(e),o=g(r);c(t,e,(function(t,e){f(this,{type:r,target:t,state:i(t),kind:e,last:void 0})}),(function(){var t=o(this),e=t.kind,n=t.last;while(n&&n.removed)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),u(e)}}},function(t,e,n){n(154),n(118),n(77),n(120);var r=n(43);t.exports=r.Set},function(t,e,n){"use strict";var r=n(148),i=n(152);t.exports=r("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),i)},function(t,e,n){n(118),n(156),n(120);var r=n(43);t.exports=r.WeakMap},function(t,e,n){"use strict";var r,i=n(11),o=n(124),a=n(149),s=n(148),l=n(157),c=n(22),u=n(33).enforce,d=n(34),h=!i.ActiveXObject&&"ActiveXObject"in i,p=Object.isExtensible,f=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},g=t.exports=s("WeakMap",f,l);if(d&&h){r=l.getConstructor(f,"WeakMap",!0),a.REQUIRED=!0;var m=g.prototype,v=m["delete"],b=m.has,y=m.get,w=m.set;o(m,{delete:function(t){if(c(t)&&!p(t)){var e=u(this);return e.frozen||(e.frozen=new r),v.call(this,t)||e.frozen["delete"](t)}return v.call(this,t)},has:function(t){if(c(t)&&!p(t)){var e=u(this);return e.frozen||(e.frozen=new r),b.call(this,t)||e.frozen.has(t)}return b.call(this,t)},get:function(t){if(c(t)&&!p(t)){var e=u(this);return e.frozen||(e.frozen=new r),b.call(this,t)?y.call(this,t):e.frozen.get(t)}return y.call(this,t)},set:function(t,e){if(c(t)&&!p(t)){var n=u(this);n.frozen||(n.frozen=new r),b.call(this,t)?w.call(this,t,e):n.frozen.set(t,e)}else w.call(this,t,e);return this}})}},function(t,e,n){"use strict";var r=n(124),i=n(149).getWeakData,o=n(28),a=n(22),s=n(126),l=n(104),c=n(158),u=n(23),d=n(33),h=d.set,p=d.getterFor,f=c.find,g=c.findIndex,m=0,v=function(t){return t.frozen||(t.frozen=new b)},b=function(){this.entries=[]},y=function(t,e){return f(t.entries,(function(t){return t[0]===e}))};b.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var n=y(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=g(this.entries,(function(e){return e[0]===t}));return~e&&this.entries.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,c){var d=t((function(t,r){s(t,d,e),h(t,{type:e,id:m++,frozen:void 0}),void 0!=r&&l(r,t[c],t,n)})),f=p(e),g=function(t,e,n){var r=f(t),a=i(o(e),!0);return!0===a?v(r).set(e,n):a[r.id]=n,t};return r(d.prototype,{delete:function(t){var e=f(this);if(!a(t))return!1;var n=i(t);return!0===n?v(e)["delete"](t):n&&u(n,e.id)&&delete n[e.id]},has:function(t){var e=f(this);if(!a(t))return!1;var n=i(t);return!0===n?v(e).has(t):n&&u(n,e.id)}}),r(d.prototype,n?{get:function(t){var e=f(this);if(a(t)){var n=i(t);return!0===n?v(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return g(this,t,e)}}:{add:function(t){return g(this,t,!0)}}),d}}},function(t,e,n){var r=n(62),i=n(18),o=n(83),a=n(47),s=n(159),l=[].push,c=function(t){var e=1==t,n=2==t,c=3==t,u=4==t,d=6==t,h=5==t||d;return function(p,f,g,m){for(var v,b,y=o(p),w=i(y),x=r(f,g,3),C=a(w.length),k=0,A=m||s,S=e?A(p,C):n?A(p,0):void 0;C>k;k++)if((h||k in w)&&(v=w[k],b=x(v,k,y),t))if(e)S[k]=b;else if(b)switch(t){case 3:return!0;case 5:return v;case 6:return k;case 2:l.call(S,v)}else if(u)return!1;return d?-1:c||u?u:S}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},function(t,e,n){var r=n(22),i=n(160),o=n(57),a=o("species");t.exports=function(t,e){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)?r(n)&&(n=n[a],null===n&&(n=void 0)):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},function(t,e,n){var r=n(19);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){n(118),n(162),n(120);var r=n(43);t.exports=r.WeakSet},function(t,e,n){"use strict";var r=n(148),i=n(157);r("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),i)},function(t,e,n){n(164);var r=n(61);t.exports=r("String","codePointAt")},function(t,e,n){"use strict";var r=n(10),i=n(78).codeAt;r({target:"String",proto:!0},{codePointAt:function(t){return i(this,t)}})},function(t,e,n){n(166);var r=n(43);t.exports=r.String.fromCodePoint},function(t,e,n){var r=n(10),i=n(49),o=String.fromCharCode,a=String.fromCodePoint,s=!!a&&1!=a.length;r({target:"String",stat:!0,forced:s},{fromCodePoint:function(t){var e,n=[],r=arguments.length,a=0;while(r>a){if(e=+arguments[a++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){n(168),n(118),n(170),n(174),n(175),n(176),n(177),n(178),n(179),n(180),n(181),n(182),n(183),n(184),n(185),n(186),n(187),n(188),n(189);var r=n(43);t.exports=r.Symbol},function(t,e,n){"use strict";var r=n(10),i=n(14),o=n(160),a=n(22),s=n(83),l=n(47),c=n(93),u=n(159),d=n(169),h=n(57),p=n(135),f=h("isConcatSpreadable"),g=9007199254740991,m="Maximum allowed index exceeded",v=p>=51||!i((function(){var t=[];return t[f]=!1,t.concat()[0]!==t})),b=d("concat"),y=function(t){if(!a(t))return!1;var e=t[f];return void 0!==e?!!e:o(t)},w=!v||!b;r({target:"Array",proto:!0,forced:w},{concat:function(t){var e,n,r,i,o,a=s(this),d=u(a,0),h=0;for(e=-1,r=arguments.length;e<r;e++)if(o=-1===e?a:arguments[e],y(o)){if(i=l(o.length),h+i>g)throw TypeError(m);for(n=0;n<i;n++,h++)n in o&&c(d,h,o[n])}else{if(h>=g)throw TypeError(m);c(d,h++,o)}return d.length=h,d}})},function(t,e,n){var r=n(14),i=n(57),o=n(135),a=i("species");t.exports=function(t){return o>=51||!r((function(){var e=[],n=e.constructor={};return n[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},function(t,e,n){"use strict";var r=n(10),i=n(11),o=n(42),a=n(37),s=n(13),l=n(58),c=n(59),u=n(14),d=n(23),h=n(160),p=n(22),f=n(28),g=n(83),m=n(17),v=n(21),b=n(16),y=n(71),w=n(73),x=n(44),C=n(171),k=n(51),A=n(12),S=n(27),E=n(15),O=n(26),T=n(29),_=n(36),M=n(35),N=n(39),P=n(38),L=n(57),D=n(172),j=n(173),I=n(85),R=n(33),F=n(158).forEach,B=M("hidden"),z="Symbol",H="prototype",V=L("toPrimitive"),q=R.set,U=R.getterFor(z),W=Object[H],$=i.Symbol,G=o("JSON","stringify"),Y=A.f,X=S.f,K=C.f,Z=E.f,J=_("symbols"),Q=_("op-symbols"),tt=_("string-to-symbol-registry"),et=_("symbol-to-string-registry"),nt=_("wks"),rt=i.QObject,it=!rt||!rt[H]||!rt[H].findChild,ot=s&&u((function(){return 7!=y(X({},"a",{get:function(){return X(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=Y(W,e);r&&delete W[e],X(t,e,n),r&&t!==W&&X(W,e,r)}:X,at=function(t,e){var n=J[t]=y($[H]);return q(n,{type:z,tag:t,description:e}),s||(n.description=e),n},st=c?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof $},lt=function(t,e,n){t===W&&lt(Q,e,n),f(t);var r=v(e,!0);return f(n),d(J,r)?(n.enumerable?(d(t,B)&&t[B][r]&&(t[B][r]=!1),n=y(n,{enumerable:b(0,!1)})):(d(t,B)||X(t,B,b(1,{})),t[B][r]=!0),ot(t,r,n)):X(t,r,n)},ct=function(t,e){f(t);var n=m(e),r=w(n).concat(ft(n));return F(r,(function(e){s&&!dt.call(n,e)||lt(t,e,n[e])})),t},ut=function(t,e){return void 0===e?y(t):ct(y(t),e)},dt=function(t){var e=v(t,!0),n=Z.call(this,e);return!(this===W&&d(J,e)&&!d(Q,e))&&(!(n||!d(this,e)||!d(J,e)||d(this,B)&&this[B][e])||n)},ht=function(t,e){var n=m(t),r=v(e,!0);if(n!==W||!d(J,r)||d(Q,r)){var i=Y(n,r);return!i||!d(J,r)||d(n,B)&&n[B][r]||(i.enumerable=!0),i}},pt=function(t){var e=K(m(t)),n=[];return F(e,(function(t){d(J,t)||d(N,t)||n.push(t)})),n},ft=function(t){var e=t===W,n=K(e?Q:m(t)),r=[];return F(n,(function(t){!d(J,t)||e&&!d(W,t)||r.push(J[t])})),r};if(l||($=function(){if(this instanceof $)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=P(t),n=function(t){this===W&&n.call(Q,t),d(this,B)&&d(this[B],e)&&(this[B][e]=!1),ot(this,e,b(1,t))};return s&&it&&ot(W,e,{configurable:!0,set:n}),at(e,t)},T($[H],"toString",(function(){return U(this).tag})),T($,"withoutSetter",(function(t){return at(P(t),t)})),E.f=dt,S.f=lt,A.f=ht,x.f=C.f=pt,k.f=ft,D.f=function(t){return at(L(t),t)},s&&(X($[H],"description",{configurable:!0,get:function(){return U(this).description}}),a||T(W,"propertyIsEnumerable",dt,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:$}),F(w(nt),(function(t){j(t)})),r({target:z,stat:!0,forced:!l},{for:function(t){var e=String(t);if(d(tt,e))return tt[e];var n=$(e);return tt[e]=n,et[n]=e,n},keyFor:function(t){if(!st(t))throw TypeError(t+" is not a symbol");if(d(et,t))return et[t]},useSetter:function(){it=!0},useSimple:function(){it=!1}}),r({target:"Object",stat:!0,forced:!l,sham:!s},{create:ut,defineProperty:lt,defineProperties:ct,getOwnPropertyDescriptor:ht}),r({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:pt,getOwnPropertySymbols:ft}),r({target:"Object",stat:!0,forced:u((function(){k.f(1)}))},{getOwnPropertySymbols:function(t){return k.f(g(t))}}),G){var gt=!l||u((function(){var t=$();return"[null]"!=G([t])||"{}"!=G({a:t})||"{}"!=G(Object(t))}));r({target:"JSON",stat:!0,forced:gt},{stringify:function(t,e,n){var r,i=[t],o=1;while(arguments.length>o)i.push(arguments[o++]);if(r=e,(p(e)||void 0!==t)&&!st(t))return h(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!st(e))return e}),i[1]=e,G.apply(null,i)}})}$[H][V]||O($[H],V,$[H].valueOf),I($,z),N[B]=!0},function(t,e,n){var r=n(17),i=n(44).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return i(t)}catch(e){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?s(t):i(r(t))}},function(t,e,n){var r=n(57);e.f=r},function(t,e,n){var r=n(43),i=n(23),o=n(172),a=n(27).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||a(e,t,{value:o.f(t)})}},function(t,e,n){var r=n(173);r("asyncIterator")},function(t,e,n){"use strict";var r=n(10),i=n(13),o=n(11),a=n(23),s=n(22),l=n(27).f,c=n(40),u=o.Symbol;if(i&&"function"==typeof u&&(!("description"in u.prototype)||void 0!==u().description)){var d={},h=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof h?new u(t):void 0===t?u():u(t);return""===t&&(d[e]=!0),e};c(h,u);var p=h.prototype=u.prototype;p.constructor=h;var f=p.toString,g="Symbol(test)"==String(u("test")),m=/^Symbol\((.*)\)[^)]+$/;l(p,"description",{configurable:!0,get:function(){var t=s(this)?this.valueOf():this,e=f.call(t);if(a(d,t))return"";var n=g?e.slice(7,-1):e.replace(m,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:h})}},function(t,e,n){var r=n(173);r("hasInstance")},function(t,e,n){var r=n(173);r("isConcatSpreadable")},function(t,e,n){var r=n(173);r("iterator")},function(t,e,n){var r=n(173);r("match")},function(t,e,n){var r=n(173);r("matchAll")},function(t,e,n){var r=n(173);r("replace")},function(t,e,n){var r=n(173);r("search")},function(t,e,n){var r=n(173);r("species")},function(t,e,n){var r=n(173);r("split")},function(t,e,n){var r=n(173);r("toPrimitive")},function(t,e,n){var r=n(173);r("toStringTag")},function(t,e,n){var r=n(173);r("unscopables")},function(t,e,n){var r=n(85);r(Math,"Math",!0)},function(t,e,n){var r=n(11),i=n(85);i(r.JSON,"JSON",!0)},function(t,e,n){n(191);var r=n(61);t.exports=r("String","padStart")},function(t,e,n){"use strict";var r=n(10),i=n(192).start,o=n(194);r({target:"String",proto:!0,forced:o},{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(47),i=n(193),o=n(20),a=Math.ceil,s=function(t){return function(e,n,s){var l,c,u=String(o(e)),d=u.length,h=void 0===s?" ":String(s),p=r(n);return p<=d||""==h?u:(l=p-d,c=i.call(h,a(l/h.length)),c.length>l&&(c=c.slice(0,l)),t?u+c:c+u)}};t.exports={start:s(!1),end:s(!0)}},function(t,e,n){"use strict";var r=n(48),i=n(20);t.exports="".repeat||function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e,n){var r=n(129);t.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(r)},function(t,e,n){n(196);var r=n(61);t.exports=r("String","padEnd")},function(t,e,n){"use strict";var r=n(10),i=n(192).end,o=n(194);r({target:"String",proto:!0,forced:o},{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){n(198);var r=n(43);t.exports=r.Object.values},function(t,e,n){var r=n(10),i=n(199).values;r({target:"Object",stat:!0},{values:function(t){return i(t)}})},function(t,e,n){var r=n(13),i=n(73),o=n(17),a=n(15).f,s=function(t){return function(e){var n,s=o(e),l=i(s),c=l.length,u=0,d=[];while(c>u)n=l[u++],r&&!a.call(s,n)||d.push(t?[n,s[n]]:s[n]);return d}};t.exports={entries:s(!0),values:s(!1)}},function(t,e,n){n(201);var r=n(43);t.exports=r.Object.entries},function(t,e,n){var r=n(10),i=n(199).entries;r({target:"Object",stat:!0},{entries:function(t){return i(t)}})},function(module,exports,__w_pdfjs_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.build=exports.version=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFWorker=exports.PDFDataRangeTransport=exports.LoopbackPort=void 0;var _regenerator=_interopRequireDefault(__w_pdfjs_require__(2)),_util=__w_pdfjs_require__(5),_display_utils=__w_pdfjs_require__(1),_font_loader=__w_pdfjs_require__(203),_node_utils=__w_pdfjs_require__(204),_annotation_storage=__w_pdfjs_require__(205),_api_compatibility=__w_pdfjs_require__(206),_canvas=__w_pdfjs_require__(207),_worker_options=__w_pdfjs_require__(209),_is_node=__w_pdfjs_require__(7),_message_handler=__w_pdfjs_require__(210),_metadata=__w_pdfjs_require__(211),_optional_content_config=__w_pdfjs_require__(213),_transport_stream=__w_pdfjs_require__(214),_webgl=__w_pdfjs_require__(215);function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function asyncGeneratorStep(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function _asyncToGenerator(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){asyncGeneratorStep(o,r,i,a,s,"next",t)}function s(t){asyncGeneratorStep(o,r,i,a,s,"throw",t)}a(void 0)}))}}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _createForOfIteratorHelper(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=_unsupportedIterableToArray(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),t}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"===typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _iterableToArrayLimit(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(l){i=!0,o=l}finally{try{r||null==s["return"]||s["return"]()}finally{if(i)throw o}}return n}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _typeof(t){return _typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DefaultCanvasFactory=_is_node.isNodeJS?_node_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory,DefaultCMapReaderFactory=_is_node.isNodeJS?_node_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory,createPDFNetworkStream;function setPDFNetworkStreamFactory(t){createPDFNetworkStream=t}function getDocument(t){var e,n=new PDFDocumentLoadingTask;if("string"===typeof t)e={url:t};else if((0,_util.isArrayBuffer)(t))e={data:t};else if(t instanceof PDFDataRangeTransport)e={range:t};else{if("object"!==_typeof(t))throw new Error("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");e=t}var r=Object.create(null),i=null,o=null;for(var a in e)if("url"!==a||"undefined"===typeof window)if("range"!==a)if("worker"!==a)if("data"!==a||e[a]instanceof Uint8Array)r[a]=e[a];else{var s=e[a];if("string"===typeof s)r[a]=(0,_util.stringToBytes)(s);else if("object"!==_typeof(s)||null===s||isNaN(s.length)){if(!(0,_util.isArrayBuffer)(s))throw new Error("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property.");r[a]=new Uint8Array(s)}else r[a]=new Uint8Array(s)}else o=e[a];else i=e[a];else r[a]=new URL(e[a],window.location).href;if(r.rangeChunkSize=r.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE,r.CMapReaderFactory=r.CMapReaderFactory||DefaultCMapReaderFactory,r.ignoreErrors=!0!==r.stopAtErrors,r.fontExtraProperties=!0===r.fontExtraProperties,r.pdfBug=!0===r.pdfBug,Number.isInteger(r.maxImageSize)||(r.maxImageSize=-1),"boolean"!==typeof r.isEvalSupported&&(r.isEvalSupported=!0),"boolean"!==typeof r.disableFontFace&&(r.disableFontFace=_api_compatibility.apiCompatibilityParams.disableFontFace||!1),"undefined"===typeof r.ownerDocument&&(r.ownerDocument=globalThis.document),"boolean"!==typeof r.disableRange&&(r.disableRange=!1),"boolean"!==typeof r.disableStream&&(r.disableStream=!1),"boolean"!==typeof r.disableAutoFetch&&(r.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(r.verbosity),!o){var l={verbosity:r.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};o=l.port?PDFWorker.fromPort(l):new PDFWorker(l),n._worker=o}var c=n.docId;return o.promise.then((function(){if(n.destroyed)throw new Error("Loading aborted");var t=_fetchDocument(o,r,i,c),e=new Promise((function(t){var e;i?e=new _transport_stream.PDFDataTransportStream({length:r.length,initialData:r.initialData,progressiveDone:r.progressiveDone,disableRange:r.disableRange,disableStream:r.disableStream},i):r.data||(e=createPDFNetworkStream({url:r.url,length:r.length,httpHeaders:r.httpHeaders,withCredentials:r.withCredentials,rangeChunkSize:r.rangeChunkSize,disableRange:r.disableRange,disableStream:r.disableStream})),t(e)}));return Promise.all([t,e]).then((function(t){var e=_slicedToArray(t,2),i=e[0],a=e[1];if(n.destroyed)throw new Error("Loading aborted");var s=new _message_handler.MessageHandler(c,i,o.port);s.postMessageTransfers=o.postMessageTransfers;var l=new WorkerTransport(s,n,a,r);n._transport=l,s.send("Ready",null)}))}))["catch"](n._capability.reject),n}function _fetchDocument(t,e,n,r){return t.destroyed?Promise.reject(new Error("Worker was destroyed")):(n&&(e.length=n.length,e.initialData=n.initialData,e.progressiveDone=n.progressiveDone),t.messageHandler.sendWithPromise("GetDocRequest",{docId:r,apiVersion:"2.6.347",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,postMessageTransfers:t.postMessageTransfers,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties}).then((function(e){if(t.destroyed)throw new Error("Worker was destroyed");return e})))}var PDFDocumentLoadingTask=function(){var t=0,e=function(){function e(){_classCallCheck(this,e),this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+t++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}return _createClass(e,[{key:"destroy",value:function(){var t=this;this.destroyed=!0;var e=this._transport?this._transport.destroy():Promise.resolve();return e.then((function(){t._transport=null,t._worker&&(t._worker.destroy(),t._worker=null)}))}},{key:"promise",get:function(){return this._capability.promise}}]),e}();return e}(),PDFDataRangeTransport=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];_classCallCheck(this,t),this.length=e,this.initialData=n,this.progressiveDone=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}return _createClass(t,[{key:"addRangeListener",value:function(t){this._rangeListeners.push(t)}},{key:"addProgressListener",value:function(t){this._progressListeners.push(t)}},{key:"addProgressiveReadListener",value:function(t){this._progressiveReadListeners.push(t)}},{key:"addProgressiveDoneListener",value:function(t){this._progressiveDoneListeners.push(t)}},{key:"onDataRange",value:function(t,e){var n,r=_createForOfIteratorHelper(this._rangeListeners);try{for(r.s();!(n=r.n()).done;){var i=n.value;i(t,e)}}catch(o){r.e(o)}finally{r.f()}}},{key:"onDataProgress",value:function(t,e){var n=this;this._readyCapability.promise.then((function(){var r,i=_createForOfIteratorHelper(n._progressListeners);try{for(i.s();!(r=i.n()).done;){var o=r.value;o(t,e)}}catch(a){i.e(a)}finally{i.f()}}))}},{key:"onDataProgressiveRead",value:function(t){var e=this;this._readyCapability.promise.then((function(){var n,r=_createForOfIteratorHelper(e._progressiveReadListeners);try{for(r.s();!(n=r.n()).done;){var i=n.value;i(t)}}catch(o){r.e(o)}finally{r.f()}}))}},{key:"onDataProgressiveDone",value:function(){var t=this;this._readyCapability.promise.then((function(){var e,n=_createForOfIteratorHelper(t._progressiveDoneListeners);try{for(n.s();!(e=n.n()).done;){var r=e.value;r()}}catch(i){n.e(i)}finally{n.f()}}))}},{key:"transportReady",value:function(){this._readyCapability.resolve()}},{key:"requestDataRange",value:function(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}},{key:"abort",value:function(){}}]),t}();exports.PDFDataRangeTransport=PDFDataRangeTransport;var PDFDocumentProxy=function(){function t(e,n){_classCallCheck(this,t),this._pdfInfo=e,this._transport=n}return _createClass(t,[{key:"getPage",value:function(t){return this._transport.getPage(t)}},{key:"getPageIndex",value:function(t){return this._transport.getPageIndex(t)}},{key:"getDestinations",value:function(){return this._transport.getDestinations()}},{key:"getDestination",value:function(t){return this._transport.getDestination(t)}},{key:"getPageLabels",value:function(){return this._transport.getPageLabels()}},{key:"getPageLayout",value:function(){return this._transport.getPageLayout()}},{key:"getPageMode",value:function(){return this._transport.getPageMode()}},{key:"getViewerPreferences",value:function(){return this._transport.getViewerPreferences()}},{key:"getOpenAction",value:function(){return this._transport.getOpenAction()}},{key:"getAttachments",value:function(){return this._transport.getAttachments()}},{key:"getJavaScript",value:function(){return this._transport.getJavaScript()}},{key:"getOutline",value:function(){return this._transport.getOutline()}},{key:"getOptionalContentConfig",value:function(){return this._transport.getOptionalContentConfig()}},{key:"getPermissions",value:function(){return this._transport.getPermissions()}},{key:"getMetadata",value:function(){return this._transport.getMetadata()}},{key:"getData",value:function(){return this._transport.getData()}},{key:"getDownloadInfo",value:function(){return this._transport.downloadInfoCapability.promise}},{key:"getStats",value:function(){return this._transport.getStats()}},{key:"cleanup",value:function(){return this._transport.startCleanup()}},{key:"destroy",value:function(){return this.loadingTask.destroy()}},{key:"saveDocument",value:function(t){return this._transport.saveDocument(t)}},{key:"annotationStorage",get:function(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}},{key:"numPages",get:function(){return this._pdfInfo.numPages}},{key:"fingerprint",get:function(){return this._pdfInfo.fingerprint}},{key:"loadingParams",get:function(){return this._transport.loadingParams}},{key:"loadingTask",get:function(){return this._transport.loadingTask}}]),t}();exports.PDFDocumentProxy=PDFDocumentProxy;var PDFPageProxy=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];_classCallCheck(this,t),this._pageIndex=e,this._pageInfo=n,this._ownerDocument=i,this._transport=r,this._stats=o?new _display_utils.StatTimer:null,this._pdfBug=o,this.commonObjs=r.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this.destroyed=!1}return _createClass(t,[{key:"getViewport",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.scale,n=t.rotation,r=void 0===n?this.rotate:n,i=t.offsetX,o=void 0===i?0:i,a=t.offsetY,s=void 0===a?0:a,l=t.dontFlip,c=void 0!==l&&l;return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:r,offsetX:o,offsetY:s,dontFlip:c})}},{key:"getAnnotations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.intent,n=void 0===e?null:e;return this.annotationsPromise&&this.annotationsIntent===n||(this.annotationsPromise=this._transport.getAnnotations(this._pageIndex,n),this.annotationsIntent=n),this.annotationsPromise}},{key:"render",value:function(t){var e=this,n=t.canvasContext,r=t.viewport,i=t.intent,o=void 0===i?"display":i,a=t.enableWebGL,s=void 0!==a&&a,l=t.renderInteractiveForms,c=void 0!==l&&l,u=t.transform,d=void 0===u?null:u,h=t.imageLayer,p=void 0===h?null:h,f=t.canvasFactory,g=void 0===f?null:f,m=t.background,v=void 0===m?null:m,b=t.annotationStorage,y=void 0===b?null:b,w=t.optionalContentConfigPromise,x=void 0===w?null:w;this._stats&&this._stats.time("Overall");var C="print"===o?"print":"display";this.pendingCleanup=!1,x||(x=this._transport.getOptionalContentConfig());var k=this._intentStates.get(C);k||(k=Object.create(null),this._intentStates.set(C,k)),k.streamReaderCancelTimeout&&(clearTimeout(k.streamReaderCancelTimeout),k.streamReaderCancelTimeout=null);var A=g||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),S=new _webgl.WebGLContext({enable:s});k.displayReadyCapability||(k.displayReadyCapability=(0,_util.createPromiseCapability)(),k.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:C,renderInteractiveForms:!0===c,annotationStorage:y&&y.getAll()||null}));var E=function(t){var n=k.renderTasks.indexOf(O);n>=0&&k.renderTasks.splice(n,1),(e.cleanupAfterRender||"print"===C)&&(e.pendingCleanup=!0),e._tryCleanup(),t?(O.capability.reject(t),e._abortOperatorList({intentState:k,reason:t})):O.capability.resolve(),e._stats&&(e._stats.timeEnd("Rendering"),e._stats.timeEnd("Overall"))},O=new InternalRenderTask({callback:E,params:{canvasContext:n,viewport:r,transform:d,imageLayer:p,background:v},objs:this.objs,commonObjs:this.commonObjs,operatorList:k.operatorList,pageIndex:this._pageIndex,canvasFactory:A,webGLContext:S,useRequestAnimationFrame:"print"!==C,pdfBug:this._pdfBug});k.renderTasks||(k.renderTasks=[]),k.renderTasks.push(O);var T=O.task;return Promise.all([k.displayReadyCapability.promise,x]).then((function(t){var n=_slicedToArray(t,2),r=n[0],i=n[1];e.pendingCleanup?E():(e._stats&&e._stats.time("Rendering"),O.initializeGraphics({transparency:r,optionalContentConfig:i}),O.operatorListChanged())}))["catch"](E),T}},{key:"getOperatorList",value:function(){function t(){if(r.operatorList.lastChunk){r.opListReadCapability.resolve(r.operatorList);var t=r.renderTasks.indexOf(e);t>=0&&r.renderTasks.splice(t,1)}}var e,n="oplist",r=this._intentStates.get(n);return r||(r=Object.create(null),this._intentStates.set(n,r)),r.opListReadCapability||(e=Object.create(null),e.operatorListChanged=t,r.opListReadCapability=(0,_util.createPromiseCapability)(),r.renderTasks=[],r.renderTasks.push(e),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:n})),r.opListReadCapability.promise}},{key:"streamTextContent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.normalizeWhitespace,n=void 0!==e&&e,r=t.disableCombineTextItems,i=void 0!==r&&r,o=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:!0===n,combineTextItems:!0!==i},{highWaterMark:o,size:function(t){return t.items.length}})}},{key:"getTextContent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.streamTextContent(t);return new Promise((function(t,n){function r(){i.read().then((function(e){var n,i=e.value,a=e.done;a?t(o):(Object.assign(o.styles,i.styles),(n=o.items).push.apply(n,_toConsumableArray(i.items)),r())}),n)}var i=e.getReader(),o={items:[],styles:Object.create(null)};r()}))}},{key:"_destroy",value:function(){this.destroyed=!0,this._transport.pageCache[this._pageIndex]=null;var t,e=[],n=_createForOfIteratorHelper(this._intentStates);try{for(n.s();!(t=n.n()).done;){var r=_slicedToArray(t.value,2),i=r[0],o=r[1];if(this._abortOperatorList({intentState:o,reason:new Error("Page was destroyed."),force:!0}),"oplist"!==i){var a,s=_createForOfIteratorHelper(o.renderTasks);try{for(s.s();!(a=s.n()).done;){var l=a.value;e.push(l.completed),l.cancel()}}catch(c){s.e(c)}finally{s.f()}}}}catch(c){n.e(c)}finally{n.f()}return this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)}},{key:"cleanup",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.pendingCleanup=!0,this._tryCleanup(t)}},{key:"_tryCleanup",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.pendingCleanup)return!1;var e,n=_createForOfIteratorHelper(this._intentStates.values());try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.renderTasks,o=r.operatorList;if(0!==i.length||!o.lastChunk)return!1}}catch(a){n.e(a)}finally{n.f()}return this._intentStates.clear(),this.objs.clear(),this.annotationsPromise=null,t&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0}},{key:"_startRenderPage",value:function(t,e){var n=this._intentStates.get(e);n&&(this._stats&&this._stats.timeEnd("Page Request"),n.displayReadyCapability&&n.displayReadyCapability.resolve(t))}},{key:"_renderPageChunk",value:function(t,e){for(var n=0,r=t.length;n<r;n++)e.operatorList.fnArray.push(t.fnArray[n]),e.operatorList.argsArray.push(t.argsArray[n]);e.operatorList.lastChunk=t.lastChunk;for(var i=0;i<e.renderTasks.length;i++)e.renderTasks[i].operatorListChanged();t.lastChunk&&this._tryCleanup()}},{key:"_pumpOperatorList",value:function(t){var e=this;(0,_util.assert)(t.intent,'PDFPageProxy._pumpOperatorList: Expected "intent" argument.');var n=this._transport.messageHandler.sendWithStream("GetOperatorList",t),r=n.getReader(),i=this._intentStates.get(t.intent);i.streamReader=r;var o=function t(){r.read().then((function(n){var r=n.value,o=n.done;o?i.streamReader=null:e._transport.destroyed||(e._renderPageChunk(r,i),t())}),(function(t){if(i.streamReader=null,!e._transport.destroyed){if(i.operatorList){i.operatorList.lastChunk=!0;for(var n=0;n<i.renderTasks.length;n++)i.renderTasks[n].operatorListChanged();e._tryCleanup()}if(i.displayReadyCapability)i.displayReadyCapability.reject(t);else{if(!i.opListReadCapability)throw t;i.opListReadCapability.reject(t)}}}))};o()}},{key:"_abortOperatorList",value:function(t){var e=this,n=t.intentState,r=t.reason,i=t.force,o=void 0!==i&&i;if((0,_util.assert)(r instanceof Error||"object"===_typeof(r)&&null!==r,'PDFPageProxy._abortOperatorList: Expected "reason" argument.'),n.streamReader){if(!o){if(0!==n.renderTasks.length)return;if(r instanceof _display_utils.RenderingCancelledException)return void(n.streamReaderCancelTimeout=setTimeout((function(){e._abortOperatorList({intentState:n,reason:r,force:!0}),n.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT))}if(n.streamReader.cancel(new _util.AbortException(r&&r.message)),n.streamReader=null,!this._transport.destroyed){var a,s=_createForOfIteratorHelper(this._intentStates);try{for(s.s();!(a=s.n()).done;){var l=_slicedToArray(a.value,2),c=l[0],u=l[1];if(u===n){this._intentStates["delete"](c);break}}}catch(d){s.e(d)}finally{s.f()}this.cleanup()}}}},{key:"pageNumber",get:function(){return this._pageIndex+1}},{key:"rotate",get:function(){return this._pageInfo.rotate}},{key:"ref",get:function(){return this._pageInfo.ref}},{key:"userUnit",get:function(){return this._pageInfo.userUnit}},{key:"view",get:function(){return this._pageInfo.view}},{key:"stats",get:function(){return this._stats}}]),t}();exports.PDFPageProxy=PDFPageProxy;var LoopbackPort=function(){function t(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];_classCallCheck(this,t),this._listeners=[],this._defer=e,this._deferred=Promise.resolve(void 0)}return _createClass(t,[{key:"postMessage",value:function(t,e){var n=this;function r(t){if("object"!==_typeof(t)||null===t)return t;if(i.has(t))return i.get(t);var n,o;if((n=t.buffer)&&(0,_util.isArrayBuffer)(n)){var a=e&&e.includes(n);return o=a?new t.constructor(n,t.byteOffset,t.byteLength):new t.constructor(t),i.set(t,o),o}for(var s in o=Array.isArray(t)?[]:{},i.set(t,o),t){var l=void 0,c=t;while(!(l=Object.getOwnPropertyDescriptor(c,s)))c=Object.getPrototypeOf(c);if("undefined"!==typeof l.value)if("function"!==typeof l.value)o[s]=r(l.value);else if(t.hasOwnProperty&&t.hasOwnProperty(s))throw new Error("LoopbackPort.postMessage - cannot clone: ".concat(t[s]))}return o}if(this._defer){var i=new WeakMap,o={data:r(t)};this._deferred.then((function(){n._listeners.forEach((function(t){t.call(n,o)}))}))}else this._listeners.forEach((function(e){e.call(n,{data:t})}))}},{key:"addEventListener",value:function(t,e){this._listeners.push(e)}},{key:"removeEventListener",value:function(t,e){var n=this._listeners.indexOf(e);this._listeners.splice(n,1)}},{key:"terminate",value:function(){this._listeners.length=0}}]),t}();exports.LoopbackPort=LoopbackPort;var PDFWorker=function PDFWorkerClosure(){var pdfWorkerPorts=new WeakMap,isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node.isNodeJS)isWorkerDisabled=!0,fallbackWorkerSrc="./pdf.worker.js";else if("object"===("undefined"===typeof document?"undefined":_typeof(document))&&"currentScript"in document){var pdfjsFilePath=document.currentScript&&document.currentScript.src;pdfjsFilePath&&(fallbackWorkerSrc=pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function _getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if("undefined"!==typeof fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){var t;try{t=globalThis.pdfjsWorker&&globalThis.pdfjsWorker.WorkerMessageHandler}catch(e){}return t||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util.createPromiseCapability)();var loader=function(){var _ref12=_asyncToGenerator(_regenerator["default"].mark((function _callee(){var mainWorkerMessageHandler,worker;return _regenerator["default"].wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(mainWorkerMessageHandler=getMainThreadWorkerMessageHandler(),!mainWorkerMessageHandler){_context.next=3;break}return _context.abrupt("return",mainWorkerMessageHandler);case 3:if(!_is_node.isNodeJS){_context.next=6;break}return worker=eval("require")(_getWorkerSrc()),_context.abrupt("return",worker.WorkerMessageHandler);case 6:return _context.next=8,(0,_display_utils.loadScript)(_getWorkerSrc());case 8:return _context.abrupt("return",window.pdfjsWorker.WorkerMessageHandler);case 9:case"end":return _context.stop()}}),_callee)})));return function(){return _ref12.apply(this,arguments)}}();return loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject),fakeWorkerCapability.promise}function createCDNWrapper(t){var e="importScripts('"+t+"');";return URL.createObjectURL(new Blob([e]))}var PDFWorker=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.name,r=void 0===n?null:n,i=e.port,o=void 0===i?null:i,a=e.verbosity,s=void 0===a?(0,_util.getVerbosityLevel)():a;if(_classCallCheck(this,t),o&&pdfWorkerPorts.has(o))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=r,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=s,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,o)return pdfWorkerPorts.set(o,this),void this._initializeFromPort(o);this._initialize()}return _createClass(t,[{key:"_initializeFromPort",value:function(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve()}},{key:"_initialize",value:function(){var t=this;if("undefined"!==typeof Worker&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){var e=_getWorkerSrc();try{(0,_util.isSameOrigin)(window.location.href,e)||(e=createCDNWrapper(new URL(e,window.location).href));var n=new Worker(e),r=new _message_handler.MessageHandler("main","worker",n),i=function(){n.removeEventListener("error",o),r.destroy(),n.terminate(),t.destroyed?t._readyCapability.reject(new Error("Worker was destroyed")):t._setupFakeWorker()},o=function(){t._webWorker||i()};n.addEventListener("error",o),r.on("test",(function(e){n.removeEventListener("error",o),t.destroyed?i():e?(t._messageHandler=r,t._port=n,t._webWorker=n,e.supportTransfers||(t.postMessageTransfers=!1),t._readyCapability.resolve(),r.send("configure",{verbosity:t.verbosity})):(t._setupFakeWorker(),r.destroy(),n.terminate())})),r.on("ready",(function(e){if(n.removeEventListener("error",o),t.destroyed)i();else try{a()}catch(r){t._setupFakeWorker()}}));var a=function(){var e=new Uint8Array([t.postMessageTransfers?255:0]);try{r.send("test",e,[e.buffer])}catch(n){(0,_util.warn)("Cannot use postMessage transfers."),e[0]=0,r.send("test",e)}};return void a()}catch(s){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}},{key:"_setupFakeWorker",value:function(){var t=this;isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),isWorkerDisabled=!0),setupFakeWorkerGlobal().then((function(e){if(t.destroyed)t._readyCapability.reject(new Error("Worker was destroyed"));else{var n=new LoopbackPort;t._port=n;var r="fake"+nextFakeWorkerId++,i=new _message_handler.MessageHandler(r+"_worker",r,n);e.setup(i,n);var o=new _message_handler.MessageHandler(r,r+"_worker",n);t._messageHandler=o,t._readyCapability.resolve(),o.send("configure",{verbosity:t.verbosity})}}))["catch"]((function(e){t._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(e.message,'".')))}))}},{key:"destroy",value:function(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pdfWorkerPorts["delete"](this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}},{key:"promise",get:function(){return this._readyCapability.promise}},{key:"port",get:function(){return this._port}},{key:"messageHandler",get:function(){return this._messageHandler}}],[{key:"fromPort",value:function(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(e.port)?pdfWorkerPorts.get(e.port):new t(e)}},{key:"getWorkerSrc",value:function(){return _getWorkerSrc()}}]),t}();return PDFWorker}();exports.PDFWorker=PDFWorker;var WorkerTransport=function(){function t(e,n,r,i){_classCallCheck(this,t),this.messageHandler=e,this.loadingTask=n,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:n.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:i.ownerDocument}),this._params=i,this.CMapReaderFactory=new i.CMapReaderFactory({baseUrl:i.cMapUrl,isCompressed:i.cMapPacked}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}return _createClass(t,[{key:"destroy",value:function(){var t=this;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));var e=[];this.pageCache.forEach((function(t){t&&e.push(t._destroy())})),this.pageCache.length=0,this.pagePromises.length=0;var n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then((function(){t.fontLoader.clear(),t._networkStream&&t._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),t.messageHandler&&(t.messageHandler.destroy(),t.messageHandler=null),t.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}},{key:"setupMessageHandler",value:function(){var t=this,e=this.messageHandler,n=this.loadingTask;e.on("GetReader",(function(e,n){(0,_util.assert)(t._networkStream,"GetReader - no `IPDFStream` instance available."),t._fullReader=t._networkStream.getFullReader(),t._fullReader.onProgress=function(e){t._lastProgress={loaded:e.loaded,total:e.total}},n.onPull=function(){t._fullReader.read().then((function(t){var e=t.value,r=t.done;r?n.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(e),1,[e]))}))["catch"]((function(t){n.error(t)}))},n.onCancel=function(e){t._fullReader.cancel(e),n.ready["catch"]((function(e){if(!t.destroyed)throw e}))}})),e.on("ReaderHeadersReady",(function(e){var r=(0,_util.createPromiseCapability)(),i=t._fullReader;return i.headersReady.then((function(){i.isStreamingSupported&&i.isRangeSupported||(t._lastProgress&&n.onProgress&&n.onProgress(t._lastProgress),i.onProgress=function(t){n.onProgress&&n.onProgress({loaded:t.loaded,total:t.total})}),r.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),r.reject),r.promise})),e.on("GetRangeReader",(function(e,n){(0,_util.assert)(t._networkStream,"GetRangeReader - no `IPDFStream` instance available.");var r=t._networkStream.getRangeReader(e.begin,e.end);r?(n.onPull=function(){r.read().then((function(t){var e=t.value,r=t.done;r?n.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetRangeReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(e),1,[e]))}))["catch"]((function(t){n.error(t)}))},n.onCancel=function(e){r.cancel(e),n.ready["catch"]((function(e){if(!t.destroyed)throw e}))}):n.close()})),e.on("GetDoc",(function(e){var r=e.pdfInfo;t._numPages=r.numPages,n._capability.resolve(new PDFDocumentProxy(r,t))})),e.on("DocException",(function(t){var e;switch(t.name){case"PasswordException":e=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":e=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":e=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":e=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":e=new _util.UnknownErrorException(t.message,t.details);break}if(!(e instanceof Error)){var r="DocException - expected a valid Error.";(0,_util.warn)(r)}n._capability.reject(e)})),e.on("PasswordRequest",(function(e){if(t._passwordCapability=(0,_util.createPromiseCapability)(),n.onPassword){var r=function(e){t._passwordCapability.resolve({password:e})};try{n.onPassword(r,e.code)}catch(i){t._passwordCapability.reject(i)}}else t._passwordCapability.reject(new _util.PasswordException(e.message,e.code));return t._passwordCapability.promise})),e.on("DataLoaded",(function(e){n.onProgress&&n.onProgress({loaded:e.length,total:e.length}),t.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(function(e){if(!t.destroyed){var n=t.pageCache[e.pageIndex];n._startRenderPage(e.transparency,e.intent)}})),e.on("commonobj",(function(n){if(!t.destroyed){var r=_slicedToArray(n,3),i=r[0],o=r[1],a=r[2];if(!t.commonObjs.has(i))switch(o){case"Font":var s=t._params;if("error"in a){var l=a.error;(0,_util.warn)("Error during font loading: ".concat(l)),t.commonObjs.resolve(i,l);break}var c=null;s.pdfBug&&globalThis.FontInspector&&globalThis.FontInspector.enabled&&(c={registerFont:function(t,e){globalThis.FontInspector.fontAdded(t,e)}});var u=new _font_loader.FontFaceObject(a,{isEvalSupported:s.isEvalSupported,disableFontFace:s.disableFontFace,ignoreErrors:s.ignoreErrors,onUnsupportedFeature:t._onUnsupportedFeature.bind(t),fontRegistry:c});t.fontLoader.bind(u)["catch"]((function(t){return e.sendWithPromise("FontFallback",{id:i})}))["finally"]((function(){!s.fontExtraProperties&&u.data&&(u.data=null),t.commonObjs.resolve(i,u)}));break;case"FontPath":case"Image":t.commonObjs.resolve(i,a);break;default:throw new Error("Got unknown common object type ".concat(o))}}})),e.on("obj",(function(e){if(!t.destroyed){var n=_slicedToArray(e,4),r=n[0],i=n[1],o=n[2],a=n[3],s=t.pageCache[i];if(!s.objs.has(r))switch(o){case"Image":s.objs.resolve(r,a);var l=8e6;a&&"data"in a&&a.data.length>l&&(s.cleanupAfterRender=!0);break;default:throw new Error("Got unknown object type ".concat(o))}}})),e.on("DocProgress",(function(e){t.destroyed||n.onProgress&&n.onProgress({loaded:e.loaded,total:e.total})})),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",(function(e,n){if(t.destroyed)n.error(new Error("Worker was destroyed"));else{var r=!1;n.onPull=function(){r?n.close():(r=!0,t.CMapReaderFactory.fetch(e).then((function(t){n.enqueue(t,1,[t.cMapData.buffer])}))["catch"]((function(t){n.error(t)})))}}}))}},{key:"_onUnsupportedFeature",value:function(t){var e=t.featureId;this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(e)}},{key:"getData",value:function(){return this.messageHandler.sendWithPromise("GetData",null)}},{key:"getPage",value:function(t){var e=this;if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request"));var n=t-1;if(n in this.pagePromises)return this.pagePromises[n];var r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then((function(t){if(e.destroyed)throw new Error("Transport destroyed");var r=new PDFPageProxy(n,t,e,e._params.ownerDocument,e._params.pdfBug);return e.pageCache[n]=r,r}));return this.pagePromises[n]=r,r}},{key:"getPageIndex",value:function(t){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:t})["catch"]((function(t){return Promise.reject(new Error(t))}))}},{key:"getAnnotations",value:function(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}},{key:"saveDocument",value:function(t){return this.messageHandler.sendWithPromise("SaveDocument",{numPages:this._numPages,annotationStorage:t&&t.getAll()||null,filename:this._fullReader?this._fullReader.filename:null})["finally"]((function(){t&&t.resetModified()}))}},{key:"getDestinations",value:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)}},{key:"getDestination",value:function(t){return"string"!==typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}},{key:"getPageLabels",value:function(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}},{key:"getPageLayout",value:function(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}},{key:"getPageMode",value:function(){return this.messageHandler.sendWithPromise("GetPageMode",null)}},{key:"getViewerPreferences",value:function(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}},{key:"getOpenAction",value:function(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}},{key:"getAttachments",value:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)}},{key:"getJavaScript",value:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}},{key:"getOutline",value:function(){return this.messageHandler.sendWithPromise("GetOutline",null)}},{key:"getOptionalContentConfig",value:function(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((function(t){return new _optional_content_config.OptionalContentConfig(t)}))}},{key:"getPermissions",value:function(){return this.messageHandler.sendWithPromise("GetPermissions",null)}},{key:"getMetadata",value:function(){var t=this;return this.messageHandler.sendWithPromise("GetMetadata",null).then((function(e){return{info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:t._fullReader?t._fullReader.filename:null}}))}},{key:"getStats",value:function(){return this.messageHandler.sendWithPromise("GetStats",null)}},{key:"startCleanup",value:function(){var t=this;return this.messageHandler.sendWithPromise("Cleanup",null).then((function(){for(var e=0,n=t.pageCache.length;e<n;e++){var r=t.pageCache[e];if(r){var i=r.cleanup();if(!i)throw new Error("startCleanup: Page ".concat(e+1," is currently rendering."))}}t.commonObjs.clear(),t.fontLoader.clear()}))}},{key:"loadingParams",get:function(){var t=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,disableFontFace:t.disableFontFace})}}]),t}(),PDFObjects=function(){function t(){_classCallCheck(this,t),this._objs=Object.create(null)}return _createClass(t,[{key:"_ensureObj",value:function(t){return this._objs[t]?this._objs[t]:this._objs[t]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:!1}}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e)return this._ensureObj(t).capability.promise.then(e),null;var n=this._objs[t];if(!n||!n.resolved)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return n.data}},{key:"has",value:function(t){var e=this._objs[t];return!!e&&e.resolved}},{key:"resolve",value:function(t,e){var n=this._ensureObj(t);n.resolved=!0,n.data=e,n.capability.resolve(e)}},{key:"clear",value:function(){this._objs=Object.create(null)}}]),t}(),RenderTask=function(){function t(e){_classCallCheck(this,t),this._internalRenderTask=e,this.onContinue=null}return _createClass(t,[{key:"cancel",value:function(){this._internalRenderTask.cancel()}},{key:"promise",get:function(){return this._internalRenderTask.capability.promise}}]),t}(),InternalRenderTask=function(){var t=new WeakSet,e=function(){function e(t){var n=t.callback,r=t.params,i=t.objs,o=t.commonObjs,a=t.operatorList,s=t.pageIndex,l=t.canvasFactory,c=t.webGLContext,u=t.useRequestAnimationFrame,d=void 0!==u&&u,h=t.pdfBug,p=void 0!==h&&h;_classCallCheck(this,e),this.callback=n,this.params=r,this.objs=i,this.commonObjs=o,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=s,this.canvasFactory=l,this.webGLContext=c,this._pdfBug=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===d&&"undefined"!==typeof window,this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=r.canvasContext.canvas}return _createClass(e,[{key:"initializeGraphics",value:function(e){var n=e.transparency,r=void 0!==n&&n,i=e.optionalContentConfig;if(!this.cancelled){if(this._canvas){if(t.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager&&globalThis.StepperManager.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var o=this.params,a=o.canvasContext,s=o.viewport,l=o.transform,c=o.imageLayer,u=o.background;this.gfx=new _canvas.CanvasGraphics(a,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext,c,i),this.gfx.beginDrawing({transform:l,viewport:s,transparency:r,background:u}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}}},{key:"cancel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&t["delete"](this._canvas),this.callback(e||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),"canvas"))}},{key:"operatorListChanged",value:function(){this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}},{key:"_continue",value:function(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}},{key:"_scheduleNext",value:function(){var t=this;this._useRequestAnimationFrame?window.requestAnimationFrame((function(){t._nextBound()["catch"](t.cancel.bind(t))})):Promise.resolve().then(this._nextBound)["catch"](this.cancel.bind(this))}},{key:"_next",value:function(){var e=_asyncToGenerator(_regenerator["default"].mark((function e(){return _regenerator["default"].wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!this.cancelled){e.next=2;break}return e.abrupt("return");case 2:this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&t["delete"](this._canvas),this.callback()));case 4:case"end":return e.stop()}}),e,this)})));function n(){return e.apply(this,arguments)}return n}()},{key:"completed",get:function(){return this.capability.promise["catch"]((function(){}))}}]),e}();return e}(),version="2.6.347";exports.version=version;var build="3be9c65f";exports.build=build},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var r=o(n(2)),i=n(5);function o(t){return t&&t.__esModule?t:{default:t}}function a(t){return a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function c(t){var e=h();return function(){var n,r=p(t);if(e){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(t,e){return!e||"object"!==a(e)&&"function"!==typeof e?d(t):e}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function f(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function g(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){f(o,r,i,a,s,"next",t)}function s(t){f(o,r,i,a,s,"throw",t)}a(void 0)}))}}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function b(t,e,n){return e&&v(t.prototype,e),n&&v(t,n),t}var y,w=function(){function t(e){var n=e.docId,r=e.onUnsupportedFeature,o=e.ownerDocument,a=void 0===o?globalThis.document:o;m(this,t),this.constructor===t&&(0,i.unreachable)("Cannot initialize BaseFontLoader."),this.docId=n,this._onUnsupportedFeature=r,this._document=a,this.nativeFontFaces=[],this.styleElement=null}return b(t,[{key:"addNativeFontFace",value:function(t){this.nativeFontFaces.push(t),this._document.fonts.add(t)}},{key:"insertRule",value:function(t){var e=this.styleElement;e||(e=this.styleElement=this._document.createElement("style"),e.id="PDFJS_FONT_STYLE_TAG_".concat(this.docId),this._document.documentElement.getElementsByTagName("head")[0].appendChild(e));var n=e.sheet;n.insertRule(t,n.cssRules.length)}},{key:"clear",value:function(){var t=this;this.nativeFontFaces.forEach((function(e){t._document.fonts["delete"](e)})),this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}},{key:"bind",value:function(){var t=g(r["default"].mark((function t(e){var n,o,a=this;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.attached&&!e.missingFile){t.next=2;break}return t.abrupt("return");case 2:if(e.attached=!0,!this.isFontLoadingAPISupported){t.next=19;break}if(n=e.createNativeFontFace(),!n){t.next=18;break}return this.addNativeFontFace(n),t.prev=7,t.next=10,n.loaded;case 10:t.next=18;break;case 12:throw t.prev=12,t.t0=t["catch"](7),this._onUnsupportedFeature({featureId:i.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,i.warn)("Failed to load font '".concat(n.family,"': '").concat(t.t0,"'.")),e.disableFontFace=!0,t.t0;case 18:return t.abrupt("return");case 19:if(o=e.createFontFaceRule(),!o){t.next=26;break}if(this.insertRule(o),!this.isSyncFontLoadingSupported){t.next=24;break}return t.abrupt("return");case 24:return t.next=26,new Promise((function(t){var n=a._queueLoadingCallback(t);a._prepareFontLoadEvent([o],[e],n)}));case 26:case"end":return t.stop()}}),t,this,[[7,12]])})));function e(e){return t.apply(this,arguments)}return e}()},{key:"_queueLoadingCallback",value:function(t){(0,i.unreachable)("Abstract method `_queueLoadingCallback`.")}},{key:"_prepareFontLoadEvent",value:function(t,e,n){(0,i.unreachable)("Abstract method `_prepareFontLoadEvent`.")}},{key:"isFontLoadingAPISupported",get:function(){var t="undefined"!==typeof this._document&&!!this._document.fonts;return(0,i.shadow)(this,"isFontLoadingAPISupported",t)}},{key:"isSyncFontLoadingSupported",get:function(){(0,i.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}},{key:"_loadTestFont",get:function(){(0,i.unreachable)("Abstract method `_loadTestFont`.")}}]),t}();e.FontLoader=y,e.FontLoader=y=function(t){s(n,t);var e=c(n);function n(t){var r;return m(this,n),r=e.call(this,t),r.loadingContext={requests:[],nextRequestId:0},r.loadTestFontId=0,r}return b(n,[{key:"_queueLoadingCallback",value:function(t){function e(){(0,i.assert)(!r.done,"completeRequest() cannot be called twice."),r.done=!0;while(n.requests.length>0&&n.requests[0].done){var t=n.requests.shift();setTimeout(t.callback,0)}}var n=this.loadingContext,r={id:"pdfjs-font-loading-".concat(n.nextRequestId++),done:!1,complete:e,callback:t};return n.requests.push(r),r}},{key:"_prepareFontLoadEvent",value:function(t,e,n){var r,o,a=this;function s(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function l(t,e,n,r){var i=t.substring(0,e),o=t.substring(e+n);return i+r+o}var c=this._document.createElement("canvas");c.width=1,c.height=1;var u=c.getContext("2d"),d=0;function h(t,e){if(d++,d>30)return(0,i.warn)("Load test font never loaded."),void e();u.font="30px "+t,u.fillText(".",0,20);var n=u.getImageData(0,0,1,1);n.data[3]>0?e():setTimeout(h.bind(null,t,e))}var p="lt".concat(Date.now()).concat(this.loadTestFontId++),f=this._loadTestFont,g=976;f=l(f,g,p.length,p);var m=16,v=1482184792,b=s(f,m);for(r=0,o=p.length-3;r<o;r+=4)b=b-v+s(p,r)|0;r<p.length&&(b=b-v+s(p+"XXX",r)|0),f=l(f,m,4,(0,i.string32)(b));var y="url(data:font/opentype;base64,".concat(btoa(f),");"),w='@font-face {font-family:"'.concat(p,'";src:').concat(y,"}");this.insertRule(w);var x=[];for(r=0,o=e.length;r<o;r++)x.push(e[r].loadedName);x.push(p);var C=this._document.createElement("div");for(C.style.visibility="hidden",C.style.width=C.style.height="10px",C.style.position="absolute",C.style.top=C.style.left="0px",r=0,o=x.length;r<o;++r){var k=this._document.createElement("span");k.textContent="Hi",k.style.fontFamily=x[r],C.appendChild(k)}this._document.body.appendChild(C),h(p,(function(){a._document.body.removeChild(C),n.complete()}))}},{key:"isSyncFontLoadingSupported",get:function(){var t=!1;if("undefined"===typeof navigator)t=!0;else{var e=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);e&&e[1]>=14&&(t=!0)}return(0,i.shadow)(this,"isSyncFontLoadingSupported",t)}},{key:"_loadTestFont",get:function(){var t=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,i.shadow)(this,"_loadTestFont",t())}}]),n}(w);var x=function(){function t(e,n){var r=n.isEvalSupported,i=void 0===r||r,o=n.disableFontFace,a=void 0!==o&&o,s=n.ignoreErrors,l=void 0!==s&&s,c=n.onUnsupportedFeature,u=void 0===c?null:c,d=n.fontRegistry,h=void 0===d?null:d;for(var p in m(this,t),this.compiledGlyphs=Object.create(null),e)this[p]=e[p];this.isEvalSupported=!1!==i,this.disableFontFace=!0===a,this.ignoreErrors=!0===l,this._onUnsupportedFeature=u,this.fontRegistry=h}return b(t,[{key:"createNativeFontFace",value:function(){if(!this.data||this.disableFontFace)return null;var t=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),t}},{key:"createFontFaceRule",value:function(){if(!this.data||this.disableFontFace)return null;var t=(0,i.bytesToString)(new Uint8Array(this.data)),e="url(data:".concat(this.mimetype,";base64,").concat(btoa(t),");"),n='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(e,"}");return this.fontRegistry&&this.fontRegistry.registerFont(this,e),n}},{key:"getPathGenerator",value:function(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];var n,r;try{n=t.get(this.loadedName+"_path_"+e)}catch(c){if(!this.ignoreErrors)throw c;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:i.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,i.warn)('getPathGenerator - ignoring character: "'.concat(c,'".')),this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&i.IsEvalSupportedCached.value){for(var o,a="",s=0,l=n.length;s<l;s++)r=n[s],o=void 0!==r.args?r.args.join(","):"",a+="c."+r.cmd+"("+o+");\n";return this.compiledGlyphs[e]=new Function("c","size",a)}return this.compiledGlyphs[e]=function(t,e){for(var i=0,o=n.length;i<o;i++)r=n[i],"scale"===r.cmd&&(r.args=[e,-e]),t[r.cmd].apply(t,r.args)}}}]),t}();e.FontFaceObject=x},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeCMapReaderFactory=e.NodeCanvasFactory=void 0;var r=n(1),i=n(7),o=n(5);function a(t){return a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function c(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}function u(t,e){return u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},u(t,e)}function d(t){var e=f();return function(){var n,r=g(t);if(e){var i=g(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function h(t,e){return!e||"object"!==a(e)&&"function"!==typeof e?p(t):e}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var v=function t(){m(this,t),(0,o.unreachable)("Not implemented: NodeCanvasFactory")};e.NodeCanvasFactory=v;var b=function t(){m(this,t),(0,o.unreachable)("Not implemented: NodeCMapReaderFactory")};e.NodeCMapReaderFactory=b,i.isNodeJS&&(e.NodeCanvasFactory=v=function(t){c(n,t);var e=d(n);function n(){return m(this,n),e.apply(this,arguments)}return l(n,[{key:"create",value:function(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");var n=__webpack_require__(2),r=n.createCanvas(t,e);return{canvas:r,context:r.getContext("2d")}}}]),n}(r.BaseCanvasFactory),e.NodeCMapReaderFactory=b=function(t){c(n,t);var e=d(n);function n(){return m(this,n),e.apply(this,arguments)}return l(n,[{key:"_fetchData",value:function(t,e){return new Promise((function(n,r){var i=__webpack_require__(1);i.readFile(t,(function(t,i){!t&&i?n({cMapData:new Uint8Array(i),compressionType:e}):r(new Error(t))}))}))}}]),n}(r.BaseCMapReaderFactory))},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationStorage=void 0;var a=function(){function t(){r(this,t),this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null}return o(t,[{key:"getOrCreateValue",value:function(t,e){return this._storage.has(t)?this._storage.get(t):(this._storage.set(t,e),e)}},{key:"setValue",value:function(t,e){this._storage.get(t)!==e&&this._setModified(),this._storage.set(t,e)}},{key:"getAll",value:function(){return 0===this._storage.size?null:Object.fromEntries(this._storage)}},{key:"_setModified",value:function(){this._modified||(this._modified=!0,"function"===typeof this.onSetModified&&this.onSetModified())}},{key:"resetModified",value:function(){this._modified&&(this._modified=!1,"function"===typeof this.onResetModified&&this.onResetModified())}},{key:"size",get:function(){return this._storage.size}}]),t}();e.AnnotationStorage=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.apiCompatibilityParams=void 0;var r=n(7),i=Object.create(null);(function(){r.isNodeJS&&(i.disableFontFace=!0)})();var o=Object.freeze(i);e.apiCompatibilityParams=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var r=n(5),i=n(208);function o(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,o=t},f:function(){try{s||null==n["return"]||n["return"]()}finally{if(l)throw o}}}}function a(t,e){if(t){if("string"===typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var l=16,c=100,u=4096,d=.65,h=!0,p=1e3,f=16;function g(t){t.mozCurrentTransform||(t._originalSave=t.save,t._originalRestore=t.restore,t._originalRotate=t.rotate,t._originalScale=t.scale,t._originalTranslate=t.translate,t._originalTransform=t.transform,t._originalSetTransform=t.setTransform,t._transformMatrix=t._transformMatrix||[1,0,0,1,0,0],t._transformStack=[],Object.defineProperty(t,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(t,"mozCurrentTransformInverse",{get:function(){var t=this._transformMatrix,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=e*i-n*r,l=n*r-e*i;return[i/s,n/l,r/l,e/s,(i*o-r*a)/l,(n*o-e*a)/s]}}),t.save=function(){var t=this._transformMatrix;this._transformStack.push(t),this._transformMatrix=t.slice(0,6),this._originalSave()},t.restore=function(){var t=this._transformStack.pop();t&&(this._transformMatrix=t,this._originalRestore())},t.translate=function(t,e){var n=this._transformMatrix;n[4]=n[0]*t+n[2]*e+n[4],n[5]=n[1]*t+n[3]*e+n[5],this._originalTranslate(t,e)},t.scale=function(t,e){var n=this._transformMatrix;n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*e,n[3]=n[3]*e,this._originalScale(t,e)},t.transform=function(e,n,r,i,o,a){var s=this._transformMatrix;this._transformMatrix=[s[0]*e+s[2]*n,s[1]*e+s[3]*n,s[0]*r+s[2]*i,s[1]*r+s[3]*i,s[0]*o+s[2]*a+s[4],s[1]*o+s[3]*a+s[5]],t._originalTransform(e,n,r,i,o,a)},t.setTransform=function(e,n,r,i,o,a){this._transformMatrix=[e,n,r,i,o,a],t._originalSetTransform(e,n,r,i,o,a)},t.rotate=function(t){var e=Math.cos(t),n=Math.sin(t),r=this._transformMatrix;this._transformMatrix=[r[0]*e+r[2]*n,r[1]*e+r[3]*n,r[0]*-n+r[2]*e,r[1]*-n+r[3]*e,r[4],r[5]],this._originalRotate(t)})}var m=function(){function t(t){this.canvasFactory=t,this.cache=Object.create(null)}return t.prototype={getCanvas:function(t,e,n,r){var i;return void 0!==this.cache[t]?(i=this.cache[t],this.canvasFactory.reset(i,e,n),i.context.setTransform(1,0,0,1,0,0)):(i=this.canvasFactory.create(e,n),this.cache[t]=i),r&&g(i.context),i},clear:function(){for(var t in this.cache){var e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}},t}();function v(t){var e,n,r,i,o=1e3,a=t.width,s=t.height,l=a+1,c=new Uint8Array(l*(s+1)),u=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),d=a+7&-8,h=t.data,p=new Uint8Array(d*s),f=0;for(e=0,i=h.length;e<i;e++){var g=128,m=h[e];while(g>0)p[f++]=m&g?0:255,g>>=1}var v=0;for(f=0,0!==p[f]&&(c[0]=1,++v),n=1;n<a;n++)p[f]!==p[f+1]&&(c[n]=p[f]?2:1,++v),f++;for(0!==p[f]&&(c[n]=2,++v),e=1;e<s;e++){f=e*d,r=e*l,p[f-d]!==p[f]&&(c[r]=p[f]?1:8,++v);var b=(p[f]?4:0)+(p[f-d]?8:0);for(n=1;n<a;n++)b=(b>>2)+(p[f+1]?4:0)+(p[f-d+1]?8:0),u[b]&&(c[r+n]=u[b],++v),f++;if(p[f-d]!==p[f]&&(c[r+n]=p[f]?2:4,++v),v>o)return null}for(f=d*(s-1),r=e*l,0!==p[f]&&(c[r]=8,++v),n=1;n<a;n++)p[f]!==p[f+1]&&(c[r+n]=p[f]?4:8,++v),f++;if(0!==p[f]&&(c[r+n]=4,++v),v>o)return null;var y=new Int32Array([0,l,-1,0,-l,0,0,0,1]),w=[];for(e=0;v&&e<=s;e++){var x=e*l,C=x+a;while(x<C&&!c[x])x++;if(x!==C){var k,A=[x%l,e],S=c[x],E=x;do{var O=y[S];do{x+=O}while(!c[x]);k=c[x],5!==k&&10!==k?(S=k,c[x]=0):(S=k&51*S>>4,c[x]&=S>>2|S<<2),A.push(x%l),A.push(x/l|0),c[x]||--v}while(E!==x);w.push(A),--e}}var T=function(t){t.save(),t.scale(1/a,-1/s),t.translate(0,-s),t.beginPath();for(var e=0,n=w.length;e<n;e++){var r=w[e];t.moveTo(r[0],r[1]);for(var i=2,o=r.length;i<o;i+=2)t.lineTo(r[i],r[i+1])}t.fill(),t.beginPath(),t.restore()};return T}var b=function(){function t(){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=r.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.resumeSMaskCtx=null,this.transferMaps=null}return t.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(t,e){this.x=t,this.y=e}},t}(),y=function(){var t=15,e=10;function n(t,e,n,r,i,o,a){this.ctx=t,this.current=new b,this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=n,this.canvasFactory=r,this.webGLContext=i,this.imageLayer=o,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.contentVisible=!0,this.markedContentStack=[],this.optionalContentConfig=a,this.cachedCanvases=new m(this.canvasFactory),t&&g(t),this._cachedGetSinglePixelWidth=null}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!==typeof ImageData&&e instanceof ImageData)t.putImageData(e,0,0);else{var i,o,a,s,l,c,u,d,h,p=e.height,g=e.width,m=p%f,v=(p-m)/f,b=0===m?v:v+1,y=t.createImageData(g,f),w=0,x=e.data,C=y.data;if(n)switch(n.length){case 1:c=n[0],u=n[0],d=n[0],h=n[0];break;case 4:c=n[0],u=n[1],d=n[2],h=n[3];break}if(e.kind===r.ImageKind.GRAYSCALE_1BPP){var k=x.byteLength,A=new Uint32Array(C.buffer,0,C.byteLength>>2),S=A.length,E=g+7>>3,O=4294967295,T=r.IsLittleEndianCached.value?4278190080:255;if(h&&255===h[0]&&0===h[255]){var _=[T,O];O=_[0],T=_[1]}for(o=0;o<b;o++){for(s=o<v?f:m,i=0,a=0;a<s;a++){for(var M=k-w,N=0,P=M>E?g:8*M-7,L=-8&P,D=0,j=0;N<L;N+=8)j=x[w++],A[i++]=128&j?O:T,A[i++]=64&j?O:T,A[i++]=32&j?O:T,A[i++]=16&j?O:T,A[i++]=8&j?O:T,A[i++]=4&j?O:T,A[i++]=2&j?O:T,A[i++]=1&j?O:T;for(;N<P;N++)0===D&&(j=x[w++],D=128),A[i++]=j&D?O:T,D>>=1}while(i<S)A[i++]=0;t.putImageData(y,0,o*f)}}else if(e.kind===r.ImageKind.RGBA_32BPP){var I=!!(c||u||d);for(a=0,l=g*f*4,o=0;o<v;o++){if(C.set(x.subarray(w,w+l)),w+=l,I)for(var R=0;R<l;R+=4)c&&(C[R+0]=c[C[R+0]]),u&&(C[R+1]=u[C[R+1]]),d&&(C[R+2]=d[C[R+2]]);t.putImageData(y,0,a),a+=f}if(o<b){if(l=g*m*4,C.set(x.subarray(w,w+l)),I)for(var F=0;F<l;F+=4)c&&(C[F+0]=c[C[F+0]]),u&&(C[F+1]=u[C[F+1]]),d&&(C[F+2]=d[C[F+2]]);t.putImageData(y,0,a)}}else{if(e.kind!==r.ImageKind.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));var B=!!(c||u||d);for(s=f,l=g*s,o=0;o<b;o++){for(o>=v&&(s=m,l=g*s),i=0,a=l;a--;)C[i++]=x[w++],C[i++]=x[w++],C[i++]=x[w++],C[i++]=255;if(B)for(var z=0;z<i;z+=4)c&&(C[z+0]=c[C[z+0]]),u&&(C[z+1]=u[C[z+1]]),d&&(C[z+2]=d[C[z+2]]);t.putImageData(y,0,o*f)}}}}function s(t,e){for(var n=e.height,r=e.width,i=n%f,o=(n-i)/f,a=0===i?o:o+1,s=t.createImageData(r,f),l=0,c=e.data,u=s.data,d=0;d<a;d++){for(var h=d<o?f:i,p=3,g=0;g<h;g++)for(var m=0,v=0;v<r;v++){if(!m){var b=c[l++];m=128}u[p]=b&m?0:255,p+=4,m>>=1}t.putImageData(s,0,d*f)}}function y(t,e){for(var n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],r=0,i=n.length;r<i;r++){var o=n[r];void 0!==t[o]&&(e[o]=t[o])}void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function w(t){t.strokeStyle="#000000",t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0)}function x(t,e,n,r){for(var i=t.length,o=3;o<i;o+=4){var a=t[o];if(0===a)t[o-3]=e,t[o-2]=n,t[o-1]=r;else if(a<255){var s=255-a;t[o-3]=t[o-3]*a+e*s>>8,t[o-2]=t[o-2]*a+n*s>>8,t[o-1]=t[o-1]*a+r*s>>8}}}function C(t,e,n){for(var r=t.length,i=1/255,o=3;o<r;o+=4){var a=n?n[t[o]]:t[o];e[o]=e[o]*a*i|0}}function k(t,e,n){for(var r=t.length,i=3;i<r;i+=4){var o=77*t[i-3]+152*t[i-2]+28*t[i-1];e[i]=n?e[i]*n[o>>8]>>8:e[i]*o>>16}}function A(t,e,n,r,i,o,a){var s,l=!!o,c=l?o[0]:0,u=l?o[1]:0,d=l?o[2]:0;s="Luminosity"===i?k:C;for(var h=1048576,p=Math.min(r,Math.ceil(h/n)),f=0;f<r;f+=p){var g=Math.min(p,r-f),m=t.getImageData(0,f,n,g),v=e.getImageData(0,f,n,g);l&&x(m.data,c,u,d),s(m.data,v.data,a),t.putImageData(v,0,f)}}function S(t,e,n,r){var i=e.canvas,o=e.context;t.setTransform(e.scaleX,0,0,e.scaleY,e.offsetX,e.offsetY);var a=e.backdrop||null;if(!e.transferMap&&r.isEnabled){var s=r.composeSMask({layer:n.canvas,mask:i,properties:{subtype:e.subtype,backdrop:a}});return t.setTransform(1,0,0,1,0,0),void t.drawImage(s,e.offsetX,e.offsetY)}A(o,n,i.width,i.height,e.subtype,a,e.transferMap),t.drawImage(i,0,0)}var E=["butt","round","square"],O=["miter","round","bevel"],T={},_={};for(var M in n.prototype={beginDrawing:function(t){var e=t.transform,n=t.viewport,r=t.transparency,i=void 0!==r&&r,o=t.background,a=void 0===o?null:o,s=this.ctx.canvas.width,l=this.ctx.canvas.height;if(this.ctx.save(),this.ctx.fillStyle=a||"rgb(255, 255, 255)",this.ctx.fillRect(0,0,s,l),this.ctx.restore(),i){var c=this.cachedCanvases.getCanvas("transparent",s,l,!0);this.compositeCtx=this.ctx,this.transparentCanvas=c.canvas,this.ctx=c.context,this.ctx.save(),this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save(),w(this.ctx),e&&this.ctx.transform.apply(this.ctx,e),this.ctx.transform.apply(this.ctx,n.transform),this.baseTransform=this.ctx.mozCurrentTransform.slice(),this.imageLayer&&this.imageLayer.beginLayout()},executeOperatorList:function(n,i,a,s){var l=n.argsArray,c=n.fnArray,u=i||0,d=l.length;if(d===u)return u;var h,p=d-u>e&&"function"===typeof a,f=p?Date.now()+t:0,g=0,m=this.commonObjs,v=this.objs;while(1){if(void 0!==s&&u===s.nextBreakPoint)return s.breakIt(u,a),u;if(h=c[u],h!==r.OPS.dependency)this[h].apply(this,l[u]);else{var b,y=o(l[u]);try{for(y.s();!(b=y.n()).done;){var w=b.value,x=w.startsWith("g_")?m:v;if(!x.has(w))return x.get(w,a),u}}catch(C){y.e(C)}finally{y.f()}}if(u++,u===d)return u;if(p&&++g>e){if(Date.now()>f)return a(),u;g=0}}},endDrawing:function(){null!==this.current.activeSMask&&this.endSMaskGroup(),this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null),this.cachedCanvases.clear(),this.webGLContext.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(t){this.current.lineWidth=t,this.ctx.lineWidth=t},setLineCap:function(t){this.ctx.lineCap=E[t]},setLineJoin:function(t){this.ctx.lineJoin=O[t]},setMiterLimit:function(t){this.ctx.miterLimit=t},setDash:function(t,e){var n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(t),n.lineDashOffset=e)},setRenderingIntent:function(t){},setFlatness:function(t){},setGState:function(t){for(var e=0,n=t.length;e<n;e++){var r=t[e],i=r[0],o=r[1];switch(i){case"LW":this.setLineWidth(o);break;case"LC":this.setLineCap(o);break;case"LJ":this.setLineJoin(o);break;case"ML":this.setMiterLimit(o);break;case"D":this.setDash(o[0],o[1]);break;case"RI":this.setRenderingIntent(o);break;case"FL":this.setFlatness(o);break;case"Font":this.setFont(o[0],o[1]);break;case"CA":this.current.strokeAlpha=r[1];break;case"ca":this.current.fillAlpha=r[1],this.ctx.globalAlpha=r[1];break;case"BM":this.ctx.globalCompositeOperation=o;break;case"SMask":this.current.activeSMask&&(this.stateStack.length>0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=o?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null;break;case"TR":this.current.transferMaps=o}}},beginSMaskGroup:function(){var t=this.current.activeSMask,e=t.canvas.width,n=t.canvas.height,r="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(r,e,n,!0),o=this.ctx,a=o.mozCurrentTransform;this.ctx.save();var s=i.context;s.scale(1/t.scaleX,1/t.scaleY),s.translate(-t.offsetX,-t.offsetY),s.transform.apply(s,a),t.startTransformInverse=s.mozCurrentTransformInverse,y(o,s),this.ctx=s,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(o),this.groupLevel++},suspendSMaskGroup:function(){var t=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),S(this.ctx,this.current.activeSMask,t,this.webGLContext),this.ctx.restore(),this.ctx.save(),y(t,this.ctx),this.current.resumeSMaskCtx=t;var e=r.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,e),t.save(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,t.canvas.width,t.canvas.height),t.restore()},resumeSMaskGroup:function(){var t=this.current.resumeSMaskCtx,e=this.ctx;this.ctx=t,this.groupStack.push(e),this.groupLevel++},endSMaskGroup:function(){var t=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),S(this.ctx,this.current.activeSMask,t,this.webGLContext),this.ctx.restore(),y(t,this.ctx);var e=r.Util.transform(this.current.activeSMask.startTransformInverse,t.mozCurrentTransform);this.ctx.transform.apply(this.ctx,e)},save:function(){this.ctx.save();var t=this.current;this.stateStack.push(t),this.current=t.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),null===this.current.activeSMask||0!==this.stateStack.length&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask||this.endSMaskGroup(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)},transform:function(t,e,n,r,i,o){this.ctx.transform(t,e,n,r,i,o),this._cachedGetSinglePixelWidth=null},constructPath:function(t,e){for(var n=this.ctx,i=this.current,o=i.x,a=i.y,s=0,l=0,c=t.length;s<c;s++)switch(0|t[s]){case r.OPS.rectangle:o=e[l++],a=e[l++];var u=e[l++],d=e[l++];0===u&&n.lineWidth<this.getSinglePixelWidth()&&(u=this.getSinglePixelWidth()),0===d&&n.lineWidth<this.getSinglePixelWidth()&&(d=this.getSinglePixelWidth());var h=o+u,p=a+d;n.moveTo(o,a),n.lineTo(h,a),n.lineTo(h,p),n.lineTo(o,p),n.lineTo(o,a),n.closePath();break;case r.OPS.moveTo:o=e[l++],a=e[l++],n.moveTo(o,a);break;case r.OPS.lineTo:o=e[l++],a=e[l++],n.lineTo(o,a);break;case r.OPS.curveTo:o=e[l+4],a=e[l+5],n.bezierCurveTo(e[l],e[l+1],e[l+2],e[l+3],o,a),l+=6;break;case r.OPS.curveTo2:n.bezierCurveTo(o,a,e[l],e[l+1],e[l+2],e[l+3]),o=e[l+2],a=e[l+3],l+=4;break;case r.OPS.curveTo3:o=e[l+2],a=e[l+3],n.bezierCurveTo(e[l],e[l+1],o,a,o,a),l+=4;break;case r.OPS.closePath:n.closePath();break}i.setCurrentPoint(o,a)},closePath:function(){this.ctx.closePath()},stroke:function(t){t="undefined"===typeof t||t;var e=this.ctx,n=this.current.strokeColor;if(e.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(n&&n.hasOwnProperty("type")&&"Pattern"===n.type){e.save();var i=e.mozCurrentTransform,o=r.Util.singularValueDecompose2dScale(i)[0];e.strokeStyle=n.getPattern(e,this),e.lineWidth=Math.max(this.getSinglePixelWidth()*d,this.current.lineWidth*o),e.stroke(),e.restore()}else e.lineWidth=Math.max(this.getSinglePixelWidth()*d,this.current.lineWidth),e.stroke();t&&this.consumePath(),e.globalAlpha=this.current.fillAlpha},closeStroke:function(){this.closePath(),this.stroke()},fill:function(t){t="undefined"===typeof t||t;var e=this.ctx,n=this.current.fillColor,r=this.current.patternFill,i=!1;r&&(e.save(),this.baseTransform&&e.setTransform.apply(e,this.baseTransform),e.fillStyle=n.getPattern(e,this),i=!0),this.contentVisible&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),i&&e.restore(),t&&this.consumePath()},eoFill:function(){this.pendingEOFill=!0,this.fill()},fillStroke:function(){this.fill(!1),this.stroke(!1),this.consumePath()},eoFillStroke:function(){this.pendingEOFill=!0,this.fillStroke()},closeFillStroke:function(){this.closePath(),this.fillStroke()},closeEOFillStroke:function(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()},endPath:function(){this.consumePath()},clip:function(){this.pendingClip=T},eoClip:function(){this.pendingClip=_},beginText:function(){this.current.textMatrix=r.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},endText:function(){var t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(var n=0;n<t.length;n++){var r=t[n];e.setTransform.apply(e,r.transform),e.translate(r.x,r.y),r.addToPath(e,r.fontSize)}e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()},setCharSpacing:function(t){this.current.charSpacing=t},setWordSpacing:function(t){this.current.wordSpacing=t},setHScale:function(t){this.current.textHScale=t/100},setLeading:function(t){this.current.leading=-t},setFont:function(t,e){var n=this.commonObjs.get(t),i=this.current;if(!n)throw new Error("Can't find font for ".concat(t));if(i.fontMatrix=n.fontMatrix?n.fontMatrix:r.FONT_IDENTITY_MATRIX,0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,r.warn)("Invalid font matrix for font "+t),e<0?(e=-e,i.fontDirection=-1):i.fontDirection=1,this.current.font=n,this.current.fontSize=e,!n.isType3Font){var o=n.loadedName||"sans-serif",a="normal";n.black?a="900":n.bold&&(a="bold");var s=n.italic?"italic":"normal",u='"'.concat(o,'", ').concat(n.fallbackName),d=e;e<l?d=l:e>c&&(d=c),this.current.fontSizeScale=e/d,this.ctx.font="".concat(s," ").concat(a," ").concat(d,"px ").concat(u)}},setTextRenderingMode:function(t){this.current.textRenderingMode=t},setTextRise:function(t){this.current.textRise=t},moveText:function(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e},setLeadingMoveText:function(t,e){this.setLeading(-e),this.moveText(t,e)},setTextMatrix:function(t,e,n,r,i,o){this.current.textMatrix=[t,e,n,r,i,o],this.current.textMatrixScale=Math.sqrt(t*t+e*e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar:function(t,e,n,i){var o,a=this.ctx,s=this.current,l=s.font,c=s.textRenderingMode,u=s.fontSize/s.fontSizeScale,d=c&r.TextRenderingMode.FILL_STROKE_MASK,h=!!(c&r.TextRenderingMode.ADD_TO_PATH_FLAG),p=s.patternFill&&!l.missingFile;if((l.disableFontFace||h||p)&&(o=l.getPathGenerator(this.commonObjs,t)),l.disableFontFace||p?(a.save(),a.translate(e,n),a.beginPath(),o(a,u),i&&a.setTransform.apply(a,i),d!==r.TextRenderingMode.FILL&&d!==r.TextRenderingMode.FILL_STROKE||a.fill(),d!==r.TextRenderingMode.STROKE&&d!==r.TextRenderingMode.FILL_STROKE||a.stroke(),a.restore()):(d!==r.TextRenderingMode.FILL&&d!==r.TextRenderingMode.FILL_STROKE||a.fillText(t,e,n),d!==r.TextRenderingMode.STROKE&&d!==r.TextRenderingMode.FILL_STROKE||a.strokeText(t,e,n)),h){var f=this.pendingTextPaths||(this.pendingTextPaths=[]);f.push({transform:a.mozCurrentTransform,x:e,y:n,fontSize:u,addToPath:o})}},get isFontSubpixelAAEnabled(){var t=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10),e=t.context;e.scale(1.5,1),e.fillText("I",0,10);for(var n=e.getImageData(0,0,10,10).data,i=!1,o=3;o<n.length;o+=4)if(n[o]>0&&n[o]<255){i=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",i)},showText:function(t){var e=this.current,n=e.font;if(n.isType3Font)return this.showType3Text(t);var i=e.fontSize;if(0!==i){var o,a=this.ctx,s=e.fontSizeScale,l=e.charSpacing,c=e.wordSpacing,u=e.fontDirection,h=e.textHScale*u,p=t.length,f=n.vertical,g=f?1:-1,m=n.defaultVMetrics,v=i*e.fontMatrix[0],b=e.textRenderingMode===r.TextRenderingMode.FILL&&!n.disableFontFace&&!e.patternFill;if(a.save(),e.patternFill){a.save();var y=e.fillColor.getPattern(a,this);o=a.mozCurrentTransform,a.restore(),a.fillStyle=y}a.transform.apply(a,e.textMatrix),a.translate(e.x,e.y+e.textRise),u>0?a.scale(h,-1):a.scale(h,1);var w=e.lineWidth,x=e.textMatrixScale;if(0===x||0===w){var C=e.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;C!==r.TextRenderingMode.STROKE&&C!==r.TextRenderingMode.FILL_STROKE||(this._cachedGetSinglePixelWidth=null,w=this.getSinglePixelWidth()*d)}else w/=x;1!==s&&(a.scale(s,s),w/=s),a.lineWidth=w;var k,A=0;for(k=0;k<p;++k){var S=t[k];if((0,r.isNum)(S))A+=g*S*i/1e3;else{var E,O,T,_,M,N,P,L,D=!1,j=(S.isSpace?c:0)+l,I=S.fontChar,R=S.accent,F=S.width;if(f)M=S.vmetric||m,N=S.vmetric?M[1]:.5*F,N=-N*v,P=M[2]*v,F=M?-M[0]:F,E=N/s,O=(A+P)/s;else E=A/s,O=0;if(n.remeasure&&F>0){var B=1e3*a.measureText(I).width/i*s;if(F<B&&this.isFontSubpixelAAEnabled){var z=F/B;D=!0,a.save(),a.scale(z,1),E/=z}else F!==B&&(E+=(F-B)/2e3*i/s)}this.contentVisible&&(S.isInFont||n.missingFile)&&(b&&!R?a.fillText(I,E,O):(this.paintChar(I,E,O,o),R&&(T=E+i*R.offset.x/s,_=O-i*R.offset.y/s,this.paintChar(R.fontChar,T,_,o)))),L=f?F*v-j*u:F*v+j*u,A+=L,D&&a.restore()}}f?e.y-=A:e.x+=A*h,a.restore()}},showType3Text:function(t){var e,n,i,o,a=this.ctx,s=this.current,l=s.font,c=s.fontSize,u=s.fontDirection,d=l.vertical?1:-1,h=s.charSpacing,p=s.wordSpacing,f=s.textHScale*u,g=s.fontMatrix||r.FONT_IDENTITY_MATRIX,m=t.length,v=s.textRenderingMode===r.TextRenderingMode.INVISIBLE;if(!v&&0!==c){for(this._cachedGetSinglePixelWidth=null,a.save(),a.transform.apply(a,s.textMatrix),a.translate(s.x,s.y),a.scale(f,u),e=0;e<m;++e)if(n=t[e],(0,r.isNum)(n))o=d*n*c/1e3,this.ctx.translate(o,0),s.x+=o*f;else{var b=(n.isSpace?p:0)+h,y=l.charProcOperatorList[n.operatorListId];if(y){this.contentVisible&&(this.processingType3=n,this.save(),a.scale(c,c),a.transform.apply(a,g),this.executeOperatorList(y),this.restore());var w=r.Util.applyTransform([n.width,0],g);i=w[0]*c+b,a.translate(i,0),s.x+=i*f}else(0,r.warn)('Type3 character "'.concat(n.operatorListId,'" is not available.'))}a.restore(),this.processingType3=null}},setCharWidth:function(t,e){},setCharWidthAndBounds:function(t,e,n,r,i,o){this.ctx.rect(n,r,i-n,o-r),this.clip(),this.endPath()},getColorN_Pattern:function(t){var e,r=this;if("TilingPattern"===t[0]){var o=t[1],a=this.baseTransform||this.ctx.mozCurrentTransform.slice(),s={createCanvasGraphics:function(t){return new n(t,r.commonObjs,r.objs,r.canvasFactory,r.webGLContext)}};e=new i.TilingPattern(t,o,this.ctx,s,a)}else e=(0,i.getShadingPatternFromIR)(t);return e},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0},setStrokeRGBColor:function(t,e,n){var i=r.Util.makeCssRgb(t,e,n);this.ctx.strokeStyle=i,this.current.strokeColor=i},setFillRGBColor:function(t,e,n){var i=r.Util.makeCssRgb(t,e,n);this.ctx.fillStyle=i,this.current.fillColor=i,this.current.patternFill=!1},shadingFill:function(t){if(this.contentVisible){var e=this.ctx;this.save();var n=(0,i.getShadingPatternFromIR)(t);e.fillStyle=n.getPattern(e,this,!0);var o=e.mozCurrentTransformInverse;if(o){var a=e.canvas,s=a.width,l=a.height,c=r.Util.applyTransform([0,0],o),u=r.Util.applyTransform([0,l],o),d=r.Util.applyTransform([s,0],o),h=r.Util.applyTransform([s,l],o),p=Math.min(c[0],u[0],d[0],h[0]),f=Math.min(c[1],u[1],d[1],h[1]),g=Math.max(c[0],u[0],d[0],h[0]),m=Math.max(c[1],u[1],d[1],h[1]);this.ctx.fillRect(p,f,g-p,m-f)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()}},beginInlineImage:function(){(0,r.unreachable)("Should not call beginInlineImage")},beginImageData:function(){(0,r.unreachable)("Should not call beginImageData")},paintFormXObjectBegin:function(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform.apply(this,t),this.baseTransform=this.ctx.mozCurrentTransform,e)){var n=e[2]-e[0],r=e[3]-e[1];this.ctx.rect(e[0],e[1],n,r),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())},beginGroup:function(t){if(this.contentVisible){this.save();var e=this.ctx;t.isolated||(0,r.info)("TODO: Support non-isolated groups."),t.knockout&&(0,r.warn)("Knockout groups not supported.");var n=e.mozCurrentTransform;if(t.matrix&&e.transform.apply(e,t.matrix),!t.bbox)throw new Error("Bounding box is required.");var i=r.Util.getAxialAlignedBoundingBox(t.bbox,e.mozCurrentTransform),o=[0,0,e.canvas.width,e.canvas.height];i=r.Util.intersect(i,o)||[0,0,0,0];var a=Math.floor(i[0]),s=Math.floor(i[1]),l=Math.max(Math.ceil(i[2])-a,1),c=Math.max(Math.ceil(i[3])-s,1),d=1,h=1;l>u&&(d=l/u,l=u),c>u&&(h=c/u,c=u);var p="groupAt"+this.groupLevel;t.smask&&(p+="_smask_"+this.smaskCounter++%2);var f=this.cachedCanvases.getCanvas(p,l,c,!0),g=f.context;g.scale(1/d,1/h),g.translate(-a,-s),g.transform.apply(g,n),t.smask?this.smaskStack.push({canvas:f.canvas,context:g,offsetX:a,offsetY:s,scaleX:d,scaleY:h,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(a,s),e.scale(d,h)),y(e,g),this.ctx=g,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++,this.current.activeSMask=null}},endGroup:function(t){if(this.contentVisible){this.groupLevel--;var e=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,t.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(e.canvas,0,0),this.restore()}},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(t,e,n){if(this.save(),w(this.ctx),this.current=new b,Array.isArray(t)&&4===t.length){var r=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],r,i),this.clip(),this.endPath()}this.transform.apply(this,e),this.transform.apply(this,n)},endAnnotation:function(){this.restore()},paintImageMaskXObject:function(t){if(this.contentVisible){var e=this.ctx,n=t.width,r=t.height,i=this.current.fillColor,o=this.current.patternFill,a=this.processingType3;if(h&&a&&void 0===a.compiled&&(a.compiled=n<=p&&r<=p?v({data:t.data,width:n,height:r}):null),a&&a.compiled)a.compiled(e);else{var l=this.cachedCanvases.getCanvas("maskCanvas",n,r),c=l.context;c.save(),s(c,t),c.globalCompositeOperation="source-in",c.fillStyle=o?i.getPattern(c,this):i,c.fillRect(0,0,n,r),c.restore(),this.paintInlineImageXObject(l.canvas)}}},paintImageMaskXObjectRepeat:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(this.contentVisible){var a=t.width,l=t.height,c=this.current.fillColor,u=this.current.patternFill,d=this.cachedCanvases.getCanvas("maskCanvas",a,l),h=d.context;h.save(),s(h,t),h.globalCompositeOperation="source-in",h.fillStyle=u?c.getPattern(h,this):c,h.fillRect(0,0,a,l),h.restore();for(var p=this.ctx,f=0,g=o.length;f<g;f+=2)p.save(),p.transform(e,n,r,i,o[f],o[f+1]),p.scale(1,-1),p.drawImage(d.canvas,0,0,a,l,0,-1,1,1),p.restore()}},paintImageMaskXObjectGroup:function(t){if(this.contentVisible)for(var e=this.ctx,n=this.current.fillColor,r=this.current.patternFill,i=0,o=t.length;i<o;i++){var a=t[i],l=a.width,c=a.height,u=this.cachedCanvases.getCanvas("maskCanvas",l,c),d=u.context;d.save(),s(d,a),d.globalCompositeOperation="source-in",d.fillStyle=r?n.getPattern(d,this):n,d.fillRect(0,0,l,c),d.restore(),e.save(),e.transform.apply(e,a.transform),e.scale(1,-1),e.drawImage(u.canvas,0,0,l,c,0,-1,1,1),e.restore()}},paintImageXObject:function(t){if(this.contentVisible){var e=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);e?this.paintInlineImageXObject(e):(0,r.warn)("Dependent image isn't ready yet")}},paintImageXObjectRepeat:function(t,e,n,i){if(this.contentVisible){var o=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);if(o){for(var a=o.width,s=o.height,l=[],c=0,u=i.length;c<u;c+=2)l.push({transform:[e,0,0,n,i[c],i[c+1]],x:0,y:0,w:a,h:s});this.paintInlineImageXObjectGroup(o,l)}else(0,r.warn)("Dependent image isn't ready yet")}},paintInlineImageXObject:function(t){if(this.contentVisible){var e=t.width,n=t.height,r=this.ctx;this.save(),r.scale(1/e,-1/n);var i,o,s=r.mozCurrentTransformInverse,l=s[0],c=s[1],u=Math.max(Math.sqrt(l*l+c*c),1),d=s[2],h=s[3],p=Math.max(Math.sqrt(d*d+h*h),1);if("function"===typeof HTMLElement&&t instanceof HTMLElement||!t.data)i=t;else{o=this.cachedCanvases.getCanvas("inlineImage",e,n);var f=o.context;a(f,t,this.current.transferMaps),i=o.canvas}var g=e,m=n,v="prescale1";while(u>2&&g>1||p>2&&m>1){var b=g,y=m;u>2&&g>1&&(b=Math.ceil(g/2),u/=g/b),p>2&&m>1&&(y=Math.ceil(m/2),p/=m/y),o=this.cachedCanvases.getCanvas(v,b,y),f=o.context,f.clearRect(0,0,b,y),f.drawImage(i,0,0,g,m,0,0,b,y),i=o.canvas,g=b,m=y,v="prescale1"===v?"prescale2":"prescale1"}if(r.drawImage(i,0,0,g,m,0,-n,e,n),this.imageLayer){var w=this.getCanvasPosition(0,-n);this.imageLayer.appendImage({imgData:t,left:w[0],top:w[1],width:e/s[0],height:n/s[3]})}this.restore()}},paintInlineImageXObjectGroup:function(t,e){if(this.contentVisible){var n=this.ctx,r=t.width,i=t.height,o=this.cachedCanvases.getCanvas("inlineImage",r,i),s=o.context;a(s,t,this.current.transferMaps);for(var l=0,c=e.length;l<c;l++){var u=e[l];if(n.save(),n.transform.apply(n,u.transform),n.scale(1,-1),n.drawImage(o.canvas,u.x,u.y,u.w,u.h,0,-1,1,1),this.imageLayer){var d=this.getCanvasPosition(u.x,u.y);this.imageLayer.appendImage({imgData:t,left:d[0],top:d[1],width:r,height:i})}n.restore()}}},paintSolidColorImageMask:function(){this.contentVisible&&this.ctx.fillRect(0,0,1,1)},markPoint:function(t){},markPointProps:function(t,e){},beginMarkedContent:function(t){this.markedContentStack.push({visible:!0})},beginMarkedContentProps:function(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()},endMarkedContent:function(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()},beginCompat:function(){},endCompat:function(){},consumePath:function(){var t=this.ctx;this.pendingClip&&(this.pendingClip===_?t.clip("evenodd"):t.clip(),this.pendingClip=null),t.beginPath()},getSinglePixelWidth:function(t){if(null===this._cachedGetSinglePixelWidth){var e=this.ctx.mozCurrentTransformInverse;this._cachedGetSinglePixelWidth=Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1],e[2]*e[2]+e[3]*e[3]))}return this._cachedGetSinglePixelWidth},getCanvasPosition:function(t,e){var n=this.ctx.mozCurrentTransform;return[n[0]*t+n[2]*e+n[4],n[1]*t+n[3]*e+n[5]]},isContentVisible:function(){for(var t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}},r.OPS)n.prototype[r.OPS[M]]=n.prototype[M];return n}();e.CanvasGraphics=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getShadingPatternFromIR=s,e.TilingPattern=void 0;var r=n(5),i={};function o(t,e){if(e&&"undefined"!==typeof Path2D){var n=e[2]-e[0],r=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],n,r),t.clip(i)}}i.RadialAxial={fromIR:function(t){var e=t[1],n=t[2],r=t[3],i=t[4],a=t[5],s=t[6],l=t[7];return{type:"Pattern",getPattern:function(t){var c;o(t,n),"axial"===e?c=t.createLinearGradient(i[0],i[1],a[0],a[1]):"radial"===e&&(c=t.createRadialGradient(i[0],i[1],s,a[0],a[1],l));for(var u=0,d=r.length;u<d;++u){var h=r[u];c.addColorStop(h[0],h[1])}return c}}}};var a=function(){function t(t,e,n,r,i,o,a,s){var l,c=e.coords,u=e.colors,d=t.data,h=4*t.width;c[n+1]>c[r+1]&&(l=n,n=r,r=l,l=o,o=a,a=l),c[r+1]>c[i+1]&&(l=r,r=i,i=l,l=a,a=s,s=l),c[n+1]>c[r+1]&&(l=n,n=r,r=l,l=o,o=a,a=l);var p=(c[n]+e.offsetX)*e.scaleX,f=(c[n+1]+e.offsetY)*e.scaleY,g=(c[r]+e.offsetX)*e.scaleX,m=(c[r+1]+e.offsetY)*e.scaleY,v=(c[i]+e.offsetX)*e.scaleX,b=(c[i+1]+e.offsetY)*e.scaleY;if(!(f>=b))for(var y,w,x,C,k,A,S,E,O=u[o],T=u[o+1],_=u[o+2],M=u[a],N=u[a+1],P=u[a+2],L=u[s],D=u[s+1],j=u[s+2],I=Math.round(f),R=Math.round(b),F=I;F<=R;F++){if(F<m){var B=void 0;B=F<f?0:f===m?1:(f-F)/(f-m),y=p-(p-g)*B,w=O-(O-M)*B,x=T-(T-N)*B,C=_-(_-P)*B}else{var z=void 0;z=F>b?1:m===b?0:(m-F)/(m-b),y=g-(g-v)*z,w=M-(M-L)*z,x=N-(N-D)*z,C=P-(P-j)*z}var H=void 0;H=F<f?0:F>b?1:(f-F)/(f-b),k=p-(p-v)*H,A=O-(O-L)*H,S=T-(T-D)*H,E=_-(_-j)*H;for(var V=Math.round(Math.min(y,k)),q=Math.round(Math.max(y,k)),U=h*F+4*V,W=V;W<=q;W++)H=(y-W)/(y-k),H<0?H=0:H>1&&(H=1),d[U++]=w-(w-A)*H|0,d[U++]=x-(x-S)*H|0,d[U++]=C-(C-E)*H|0,d[U++]=255}}function e(e,n,r){var i,o,a=n.coords,s=n.colors;switch(n.type){case"lattice":var l=n.verticesPerRow,c=Math.floor(a.length/l)-1,u=l-1;for(i=0;i<c;i++)for(var d=i*l,h=0;h<u;h++,d++)t(e,r,a[d],a[d+1],a[d+l],s[d],s[d+1],s[d+l]),t(e,r,a[d+l+1],a[d+1],a[d+l],s[d+l+1],s[d+1],s[d+l]);break;case"triangles":for(i=0,o=a.length;i<o;i+=3)t(e,r,a[i],a[i+1],a[i+2],s[i],s[i+1],s[i+2]);break;default:throw new Error("illegal figure")}}function n(t,n,r,i,o,a,s,l){var c,u,d,h,p=1.1,f=3e3,g=2,m=Math.floor(t[0]),v=Math.floor(t[1]),b=Math.ceil(t[2])-m,y=Math.ceil(t[3])-v,w=Math.min(Math.ceil(Math.abs(b*n[0]*p)),f),x=Math.min(Math.ceil(Math.abs(y*n[1]*p)),f),C=b/w,k=y/x,A={coords:r,colors:i,offsetX:-m,offsetY:-v,scaleX:1/C,scaleY:1/k},S=w+2*g,E=x+2*g;if(l.isEnabled)c=l.drawFigures({width:w,height:x,backgroundColor:a,figures:o,context:A}),u=s.getCanvas("mesh",S,E,!1),u.context.drawImage(c,g,g),c=u.canvas;else{u=s.getCanvas("mesh",S,E,!1);var O=u.context,T=O.createImageData(w,x);if(a){var _=T.data;for(d=0,h=_.length;d<h;d+=4)_[d]=a[0],_[d+1]=a[1],_[d+2]=a[2],_[d+3]=255}for(d=0;d<o.length;d++)e(T,o[d],A);O.putImageData(T,g,g),c=u.canvas}return{canvas:c,offsetX:m-g*C,offsetY:v-g*k,scaleX:C,scaleY:k}}return n}();function s(t){var e=i[t[0]];if(!e)throw new Error("Unknown IR type: ".concat(t[0]));return e.fromIR(t)}i.Mesh={fromIR:function(t){var e=t[2],n=t[3],i=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return{type:"Pattern",getPattern:function(t,d,h){var p;if(o(t,c),h)p=r.Util.singularValueDecompose2dScale(t.mozCurrentTransform);else if(p=r.Util.singularValueDecompose2dScale(d.baseTransform),l){var f=r.Util.singularValueDecompose2dScale(l);p=[p[0]*f[0],p[1]*f[1]]}var g=a(s,p,e,n,i,h?null:u,d.cachedCanvases,d.webGLContext);return h||(t.setTransform.apply(t,d.baseTransform),l&&t.transform.apply(t,l)),t.translate(g.offsetX,g.offsetY),t.scale(g.scaleX,g.scaleY),t.createPattern(g.canvas,"no-repeat")}}}},i.Dummy={fromIR:function(){return{type:"Pattern",getPattern:function(){return"hotpink"}}}};var l=function(){var t={COLORED:1,UNCOLORED:2},e=3e3;function n(t,e,n,r,i){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.canvasGraphicsFactory=r,this.baseTransform=i,this.type="Pattern",this.ctx=n}return n.prototype={createPatternCanvas:function(t){var e=this.operatorList,n=this.bbox,i=this.xstep,o=this.ystep,a=this.paintType,s=this.tilingType,l=this.color,c=this.canvasGraphicsFactory;(0,r.info)("TilingType: "+s);var u=n[0],d=n[1],h=n[2],p=n[3],f=r.Util.singularValueDecompose2dScale(this.matrix),g=r.Util.singularValueDecompose2dScale(this.baseTransform),m=[f[0]*g[0],f[1]*g[1]],v=this.getSizeAndScale(i,this.ctx.canvas.width,m[0]),b=this.getSizeAndScale(o,this.ctx.canvas.height,m[1]),y=t.cachedCanvases.getCanvas("pattern",v.size,b.size,!0),w=y.context,x=c.createCanvasGraphics(w);return x.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(x,a,l),x.transform(v.scale,0,0,b.scale,0,0),x.transform(1,0,0,1,-u,-d),this.clipBbox(x,n,u,d,h,p),x.executeOperatorList(e),this.ctx.transform(1,0,0,1,u,d),this.ctx.scale(1/v.scale,1/b.scale),y.canvas},getSizeAndScale:function(t,n,r){t=Math.abs(t);var i=Math.max(e,n),o=Math.ceil(t*r);return o>=i?o=i:r=o/t,{scale:r,size:o}},clipBbox:function(t,e,n,r,i,o){if(Array.isArray(e)&&4===e.length){var a=i-n,s=o-r;t.ctx.rect(n,r,a,s),t.clip(),t.endPath()}},setFillAndStrokeStyleToContext:function(e,n,i){var o=e.ctx,a=e.current;switch(n){case t.COLORED:var s=this.ctx;o.fillStyle=s.fillStyle,o.strokeStyle=s.strokeStyle,a.fillColor=s.fillStyle,a.strokeColor=s.strokeStyle;break;case t.UNCOLORED:var l=r.Util.makeCssRgb(i[0],i[1],i[2]);o.fillStyle=l,o.strokeStyle=l,a.fillColor=l,a.strokeColor=l;break;default:throw new r.FormatError("Unsupported paint type: ".concat(n))}},getPattern:function(t,e){t=this.ctx,t.setTransform.apply(t,this.baseTransform),t.transform.apply(t,this.matrix);var n=this.createPatternCanvas(e);return t.createPattern(n,"repeat")}},n}();e.TilingPattern=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;var r=Object.create(null);e.GlobalWorkerOptions=r,r.workerPort=void 0===r.workerPort?null:r.workerPort,r.workerSrc=void 0===r.workerSrc?"":r.workerSrc},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var r=o(n(2)),i=n(5);function o(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){a(o,r,i,s,l,"next",t)}function l(t){a(o,r,i,s,l,"throw",t)}s(void 0)}))}}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),t}function d(t){return d="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}var h={UNKNOWN:0,DATA:1,ERROR:2},p={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function f(t){if("object"!==d(t)||null===t)return t;switch(t.name){case"AbortException":return new i.AbortException(t.message);case"MissingPDFException":return new i.MissingPDFException(t.message);case"UnexpectedResponseException":return new i.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new i.UnknownErrorException(t.message,t.details);default:return new i.UnknownErrorException(t.message,t.toString())}}var g=function(){function t(e,n,r){var i=this;l(this,t),this.sourceName=e,this.targetName=n,this.comObj=r,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=function(t){var e=t.data;if(e.targetName===i.sourceName)if(e.stream)i._processStreamMessage(e);else if(e.callback){var n=e.callbackId,o=i.callbackCapabilities[n];if(!o)throw new Error("Cannot resolve callback ".concat(n));if(delete i.callbackCapabilities[n],e.callback===h.DATA)o.resolve(e.data);else{if(e.callback!==h.ERROR)throw new Error("Unexpected callback case");o.reject(f(e.reason))}}else{var a=i.actionHandler[e.action];if(!a)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){var s=i.sourceName,l=e.sourceName;new Promise((function(t){t(a(e.data))})).then((function(t){r.postMessage({sourceName:s,targetName:l,callback:h.DATA,callbackId:e.callbackId,data:t})}),(function(t){r.postMessage({sourceName:s,targetName:l,callback:h.ERROR,callbackId:e.callbackId,reason:f(t)})}))}else e.streamId?i._createStreamSink(e):a(e.data)}},r.addEventListener("message",this._onComObjOnMessage)}return u(t,[{key:"on",value:function(t,e){var n=this.actionHandler;if(n[t])throw new Error('There is already an actionName called "'.concat(t,'"'));n[t]=e}},{key:"send",value:function(t,e,n){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},n)}},{key:"sendWithPromise",value:function(t,e,n){var r=this.callbackId++,o=(0,i.createPromiseCapability)();this.callbackCapabilities[r]=o;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},n)}catch(a){o.reject(a)}return o.promise}},{key:"sendWithStream",value:function(t,e,n,r){var o=this,a=this.streamId++,s=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:function(n){var c=(0,i.createPromiseCapability)();return o.streamControllers[a]={controller:n,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},o._postMessage({sourceName:s,targetName:l,action:t,streamId:a,data:e,desiredSize:n.desiredSize},r),c.promise},pull:function(t){var e=(0,i.createPromiseCapability)();return o.streamControllers[a].pullCall=e,c.postMessage({sourceName:s,targetName:l,stream:p.PULL,streamId:a,desiredSize:t.desiredSize}),e.promise},cancel:function(t){(0,i.assert)(t instanceof Error,"cancel must have a valid reason");var e=(0,i.createPromiseCapability)();return o.streamControllers[a].cancelCall=e,o.streamControllers[a].isClosed=!0,c.postMessage({sourceName:s,targetName:l,stream:p.CANCEL,streamId:a,reason:f(t)}),e.promise}},n)}},{key:"_createStreamSink",value:function(t){var e=this,n=this.actionHandler[t.action],r=t.streamId,o=this.sourceName,a=t.sourceName,s=this.comObj,l={enqueue:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var l=this.desiredSize;this.desiredSize-=n,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,i.createPromiseCapability)(),this.ready=this.sinkCapability.promise),e._postMessage({sourceName:o,targetName:a,stream:p.ENQUEUE,streamId:r,chunk:t},s)}},close:function(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:o,targetName:a,stream:p.CLOSE,streamId:r}),delete e.streamSinks[r])},error:function(t){(0,i.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:o,targetName:a,stream:p.ERROR,streamId:r,reason:f(t)}))},sinkCapability:(0,i.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[r]=l,new Promise((function(e){e(n(t.data,l))})).then((function(){s.postMessage({sourceName:o,targetName:a,stream:p.START_COMPLETE,streamId:r,success:!0})}),(function(t){s.postMessage({sourceName:o,targetName:a,stream:p.START_COMPLETE,streamId:r,reason:f(t)})}))}},{key:"_processStreamMessage",value:function(t){var e=t.streamId,n=this.sourceName,r=t.sourceName,o=this.comObj;switch(t.stream){case p.START_COMPLETE:t.success?this.streamControllers[e].startCall.resolve():this.streamControllers[e].startCall.reject(f(t.reason));break;case p.PULL_COMPLETE:t.success?this.streamControllers[e].pullCall.resolve():this.streamControllers[e].pullCall.reject(f(t.reason));break;case p.PULL:if(!this.streamSinks[e]){o.postMessage({sourceName:n,targetName:r,stream:p.PULL_COMPLETE,streamId:e,success:!0});break}this.streamSinks[e].desiredSize<=0&&t.desiredSize>0&&this.streamSinks[e].sinkCapability.resolve(),this.streamSinks[e].desiredSize=t.desiredSize;var a=this.streamSinks[t.streamId].onPull;new Promise((function(t){t(a&&a())})).then((function(){o.postMessage({sourceName:n,targetName:r,stream:p.PULL_COMPLETE,streamId:e,success:!0})}),(function(t){o.postMessage({sourceName:n,targetName:r,stream:p.PULL_COMPLETE,streamId:e,reason:f(t)})}));break;case p.ENQUEUE:if((0,i.assert)(this.streamControllers[e],"enqueue should have stream controller"),this.streamControllers[e].isClosed)break;this.streamControllers[e].controller.enqueue(t.chunk);break;case p.CLOSE:if((0,i.assert)(this.streamControllers[e],"close should have stream controller"),this.streamControllers[e].isClosed)break;this.streamControllers[e].isClosed=!0,this.streamControllers[e].controller.close(),this._deleteStreamController(e);break;case p.ERROR:(0,i.assert)(this.streamControllers[e],"error should have stream controller"),this.streamControllers[e].controller.error(f(t.reason)),this._deleteStreamController(e);break;case p.CANCEL_COMPLETE:t.success?this.streamControllers[e].cancelCall.resolve():this.streamControllers[e].cancelCall.reject(f(t.reason)),this._deleteStreamController(e);break;case p.CANCEL:if(!this.streamSinks[e])break;var s=this.streamSinks[t.streamId].onCancel;new Promise((function(e){e(s&&s(f(t.reason)))})).then((function(){o.postMessage({sourceName:n,targetName:r,stream:p.CANCEL_COMPLETE,streamId:e,success:!0})}),(function(t){o.postMessage({sourceName:n,targetName:r,stream:p.CANCEL_COMPLETE,streamId:e,reason:f(t)})})),this.streamSinks[e].sinkCapability.reject(f(t.reason)),this.streamSinks[e].isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}},{key:"_deleteStreamController",value:function(){var t=s(r["default"].mark((function t(e){return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Promise.allSettled([this.streamControllers[e].startCall,this.streamControllers[e].pullCall,this.streamControllers[e].cancelCall].map((function(t){return t&&t.promise})));case 2:delete this.streamControllers[e];case 3:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"_postMessage",value:function(t,e){e&&this.postMessageTransfers?this.comObj.postMessage(t,e):this.comObj.postMessage(t)}},{key:"destroy",value:function(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}]),t}();e.MessageHandler=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=n(5),i=n(212);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}var l=function(){function t(e){o(this,t),(0,r.assert)("string"===typeof e,"Metadata: input is not a string"),e=this._repair(e);var n=new i.SimpleXMLParser,a=n.parseFromString(e);this._metadataMap=new Map,a&&this._parse(a)}return s(t,[{key:"_repair",value:function(t){return t.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,(function(t,e){for(var n=e.replace(/\\([0-3])([0-7])([0-7])/g,(function(t,e,n,r){return String.fromCharCode(64*e+8*n+1*r)})).replace(/&(amp|apos|gt|lt|quot);/g,(function(t,e){switch(e){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error("_repair: ".concat(e," isn't defined."))})),r="",i=0,o=n.length;i<o;i+=2){var a=256*n.charCodeAt(i)+n.charCodeAt(i+1);r+=a>=32&&a<127&&60!==a&&62!==a&&38!==a?String.fromCharCode(a):"&#x"+(65536+a).toString(16).substring(1)+";"}return">"+r}))}},{key:"_parse",value:function(t){var e=t.documentElement;if("rdf:rdf"!==e.nodeName.toLowerCase()){e=e.firstChild;while(e&&"rdf:rdf"!==e.nodeName.toLowerCase())e=e.nextSibling}var n=e?e.nodeName.toLowerCase():null;if(e&&"rdf:rdf"===n&&e.hasChildNodes())for(var r=e.childNodes,i=0,o=r.length;i<o;i++){var a=r[i];if("rdf:description"===a.nodeName.toLowerCase())for(var s=0,l=a.childNodes.length;s<l;s++)if("#text"!==a.childNodes[s].nodeName.toLowerCase()){var c=a.childNodes[s],u=c.nodeName.toLowerCase();this._metadataMap.set(u,c.textContent.trim())}}}},{key:"get",value:function(t){return this._metadataMap.has(t)?this._metadataMap.get(t):null}},{key:"getAll",value:function(){return Object.fromEntries(this._metadataMap)}},{key:"has",value:function(t){return this._metadataMap.has(t)}}]),t}();e.Metadata=l},function(t,e,n){"use strict";function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){return c(t)||l(t,e)||a(t,e)||o()}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){if(t){if("string"===typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(l){i=!0,o=l}finally{try{r||null==s["return"]||s["return"]()}finally{if(i)throw o}}return n}}function c(t){if(Array.isArray(t))return t}function u(t,e,n){return u="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=d(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},u(t,e,n||t)}function d(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=b(t),null===t)break;return t}function h(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}function p(t,e){return p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},p(t,e)}function f(t){var e=v();return function(){var n,r=b(t);if(e){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function g(t,e){return!e||"object"!==r(e)&&"function"!==typeof e?m(t):e}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},b(t)}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e,n){return e&&w(t.prototype,e),n&&w(t,n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleXMLParser=void 0;var C={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};function k(t,e){var n=t[e];return" "===n||"\n"===n||"\r"===n||"\t"===n}function A(t){for(var e=0,n=t.length;e<n;e++)if(!k(t,e))return!1;return!0}var S=function(){function t(){y(this,t)}return x(t,[{key:"_resolveEntities",value:function(t){var e=this;return t.replace(/&([^;]+);/g,(function(t,n){if("#x"===n.substring(0,2))return String.fromCharCode(parseInt(n.substring(2),16));if("#"===n.substring(0,1))return String.fromCharCode(parseInt(n.substring(1),10));switch(n){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"'}return e.onResolveEntity(n)}))}},{key:"_parseContent",value:function(t,e){var n=[],r=e;function i(){while(r<t.length&&k(t,r))++r}while(r<t.length&&!k(t,r)&&">"!==t[r]&&"/"!==t[r])++r;var o=t.substring(e,r);i();while(r<t.length&&">"!==t[r]&&"/"!==t[r]&&"?"!==t[r]){i();var a="",s="";while(r<t.length&&!k(t,r)&&"="!==t[r])a+=t[r],++r;if(i(),"="!==t[r])return null;++r,i();var l=t[r];if('"'!==l&&"'"!==l)return null;var c=t.indexOf(l,++r);if(c<0)return null;s=t.substring(r,c),n.push({name:a,value:this._resolveEntities(s)}),r=c+1,i()}return{name:o,attributes:n,parsed:r-e}}},{key:"_parseProcessingInstruction",value:function(t,e){var n=e;function r(){while(n<t.length&&k(t,n))++n}while(n<t.length&&!k(t,n)&&">"!==t[n]&&"/"!==t[n])++n;var i=t.substring(e,n);r();var o=n;while(n<t.length&&("?"!==t[n]||">"!==t[n+1]))++n;var a=t.substring(o,n);return{name:i,value:a,parsed:n-e}}},{key:"parseXml",value:function(t){var e=0;while(e<t.length){var n=t[e],r=e;if("<"===n){++r;var i=t[r],o=void 0;switch(i){case"/":if(++r,o=t.indexOf(">",r),o<0)return void this.onError(C.UnterminatedElement);this.onEndElement(t.substring(r,o)),r=o+1;break;case"?":++r;var a=this._parseProcessingInstruction(t,r);if("?>"!==t.substring(r+a.parsed,r+a.parsed+2))return void this.onError(C.UnterminatedXmlDeclaration);this.onPi(a.name,a.value),r+=a.parsed+2;break;case"!":if("--"===t.substring(r+1,r+3)){if(o=t.indexOf("--\x3e",r+3),o<0)return void this.onError(C.UnterminatedComment);this.onComment(t.substring(r+3,o)),r=o+3}else if("[CDATA["===t.substring(r+1,r+8)){if(o=t.indexOf("]]>",r+8),o<0)return void this.onError(C.UnterminatedCdat);this.onCdata(t.substring(r+8,o)),r=o+3}else{if("DOCTYPE"!==t.substring(r+1,r+8))return void this.onError(C.MalformedElement);var s=t.indexOf("[",r+8),l=!1;if(o=t.indexOf(">",r+8),o<0)return void this.onError(C.UnterminatedDoctypeDeclaration);if(s>0&&o>s){if(o=t.indexOf("]>",r+8),o<0)return void this.onError(C.UnterminatedDoctypeDeclaration);l=!0}var c=t.substring(r+8,o+(l?1:0));this.onDoctype(c),r=o+(l?2:1)}break;default:var u=this._parseContent(t,r);if(null===u)return void this.onError(C.MalformedElement);var d=!1;if("/>"===t.substring(r+u.parsed,r+u.parsed+2))d=!0;else if(">"!==t.substring(r+u.parsed,r+u.parsed+1))return void this.onError(C.UnterminatedElement);this.onBeginElement(u.name,u.attributes,d),r+=u.parsed+(d?2:1);break}}else{while(r<t.length&&"<"!==t[r])r++;var h=t.substring(e,r);this.onText(this._resolveEntities(h))}e=r}}},{key:"onResolveEntity",value:function(t){return"&".concat(t,";")}},{key:"onPi",value:function(t,e){}},{key:"onComment",value:function(t){}},{key:"onCdata",value:function(t){}},{key:"onDoctype",value:function(t){}},{key:"onText",value:function(t){}},{key:"onBeginElement",value:function(t,e,n){}},{key:"onEndElement",value:function(t){}},{key:"onError",value:function(t){}}]),t}(),E=function(){function t(e,n){y(this,t),this.nodeName=e,this.nodeValue=n,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}return x(t,[{key:"hasChildNodes",value:function(){return this.childNodes&&this.childNodes.length>0}},{key:"firstChild",get:function(){return this.childNodes&&this.childNodes[0]}},{key:"nextSibling",get:function(){var t=this.parentNode.childNodes;if(t){var e=t.indexOf(this);if(-1!==e)return t[e+1]}}},{key:"textContent",get:function(){return this.childNodes?this.childNodes.map((function(t){return t.textContent})).join(""):this.nodeValue||""}}]),t}(),O=function(t){h(n,t);var e=f(n);function n(){var t;return y(this,n),t=e.call(this),t._currentFragment=null,t._stack=null,t._errorCode=C.NoError,t}return x(n,[{key:"parseFromString",value:function(t){if(this._currentFragment=[],this._stack=[],this._errorCode=C.NoError,this.parseXml(t),this._errorCode===C.NoError){var e=i(this._currentFragment,1),n=e[0];if(n)return{documentElement:n}}}},{key:"onResolveEntity",value:function(t){switch(t){case"apos":return"'"}return u(b(n.prototype),"onResolveEntity",this).call(this,t)}},{key:"onText",value:function(t){if(!A(t)){var e=new E("#text",t);this._currentFragment.push(e)}}},{key:"onCdata",value:function(t){var e=new E("#text",t);this._currentFragment.push(e)}},{key:"onBeginElement",value:function(t,e,n){var r=new E(t);r.childNodes=[],this._currentFragment.push(r),n||(this._stack.push(this._currentFragment),this._currentFragment=r.childNodes)}},{key:"onEndElement",value:function(t){this._currentFragment=this._stack.pop()||[];var e=this._currentFragment[this._currentFragment.length-1];if(e)for(var n=0,r=e.childNodes.length;n<r;n++)e.childNodes[n].parentNode=e}},{key:"onError",value:function(t){this._errorCode=t}}]),n}(S);e.SimpleXMLParser=O},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var r=n(5);function i(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,a=t},f:function(){try{s||null==n["return"]||n["return"]()}finally{if(l)throw a}}}}function o(t,e){if(t){if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var u=function t(e,n){c(this,t),this.visible=!0,this.name=e,this.intent=n},d=function(){function t(e){if(c(this,t),this.name=null,this.creator=null,this._order=null,this._groups=new Map,null!==e){this.name=e.name,this.creator=e.creator,this._order=e.order;var n,r=i(e.groups);try{for(r.s();!(n=r.n()).done;){var o=n.value;this._groups.set(o.id,new u(o.name,o.intent))}}catch(v){r.e(v)}finally{r.f()}if("OFF"===e.baseState){var a,s=i(this._groups);try{for(s.s();!(a=s.n()).done;){var l=a.value;l.visible=!1}}catch(v){s.e(v)}finally{s.f()}}var d,h=i(e.on);try{for(h.s();!(d=h.n()).done;){var p=d.value;this._groups.get(p).visible=!0}}catch(v){h.e(v)}finally{h.f()}var f,g=i(e.off);try{for(g.s();!(f=g.n()).done;){var m=f.value;this._groups.get(m).visible=!1}}catch(v){g.e(v)}finally{g.f()}}}return l(t,[{key:"isVisible",value:function(t){if("OCG"===t.type)return this._groups.has(t.id)?this._groups.get(t.id).visible:((0,r.warn)("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression&&(0,r.warn)("Visibility expression not supported yet."),!t.policy||"AnyOn"===t.policy){var e,n=i(t.ids);try{for(n.s();!(e=n.n()).done;){var o=e.value;if(!this._groups.has(o))return(0,r.warn)("Optional content group not found: ".concat(o)),!0;if(this._groups.get(o).visible)return!0}}catch(g){n.e(g)}finally{n.f()}return!1}if("AllOn"===t.policy){var a,s=i(t.ids);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(!this._groups.has(l))return(0,r.warn)("Optional content group not found: ".concat(l)),!0;if(!this._groups.get(l).visible)return!1}}catch(g){s.e(g)}finally{s.f()}return!0}if("AnyOff"===t.policy){var c,u=i(t.ids);try{for(u.s();!(c=u.n()).done;){var d=c.value;if(!this._groups.has(d))return(0,r.warn)("Optional content group not found: ".concat(d)),!0;if(!this._groups.get(d).visible)return!0}}catch(g){u.e(g)}finally{u.f()}return!1}if("AllOff"===t.policy){var h,p=i(t.ids);try{for(p.s();!(h=p.n()).done;){var f=h.value;if(!this._groups.has(f))return(0,r.warn)("Optional content group not found: ".concat(f)),!0;if(this._groups.get(f).visible)return!1}}catch(g){p.e(g)}finally{p.f()}return!0}return(0,r.warn)("Unknown optional content policy ".concat(t.policy,".")),!0}return(0,r.warn)("Unknown group type ".concat(t.type,".")),!0}},{key:"setVisibility",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._groups.has(t)?this._groups.get(t).visible=!!e:(0,r.warn)("Optional content group not found: ".concat(t))}},{key:"getOrder",value:function(){return this._groups.size?this._order?this._order.slice():Array.from(this._groups.keys()):null}},{key:"getGroups",value:function(){return this._groups.size?Object.fromEntries(this._groups):null}},{key:"getGroup",value:function(t){return this._groups.get(t)||null}}]),t}();e.OptionalContentConfig=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var r=o(n(2)),i=n(5);function o(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){a(o,r,i,s,l,"next",t)}function l(t){a(o,r,i,s,l,"throw",t)}s(void 0)}))}}function l(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}}}function c(t,e){if(t){if("string"===typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),t}var f=function(){function t(e,n){var r=this;d(this,t),(0,i.assert)(n,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=e.progressiveDone||!1;var o=e.initialData;if(o&&o.length>0){var a=new Uint8Array(o).buffer;this._queuedChunks.push(a)}this._pdfDataRangeTransport=n,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._contentLength=e.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((function(t,e){r._onReceiveData({begin:t,chunk:e})})),this._pdfDataRangeTransport.addProgressListener((function(t,e){r._onProgress({loaded:t,total:e})})),this._pdfDataRangeTransport.addProgressiveReadListener((function(t){r._onReceiveData({chunk:t})})),this._pdfDataRangeTransport.addProgressiveDoneListener((function(){r._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}return p(t,[{key:"_onReceiveData",value:function(t){var e=new Uint8Array(t.chunk).buffer;if(void 0===t.begin)this._fullRequestReader?this._fullRequestReader._enqueue(e):this._queuedChunks.push(e);else{var n=this._rangeReaders.some((function(n){return n._begin===t.begin&&(n._enqueue(e),!0)}));(0,i.assert)(n,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}},{key:"_onProgress",value:function(t){if(void 0===t.total){var e=this._rangeReaders[0];e&&e.onProgress&&e.onProgress({loaded:t.loaded})}else{var n=this._fullRequestReader;n&&n.onProgress&&n.onProgress({loaded:t.loaded,total:t.total})}}},{key:"_onProgressiveDone",value:function(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}},{key:"_removeRangeReader",value:function(t){var e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}},{key:"getFullReader",value:function(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var t=this._queuedChunks;return this._queuedChunks=null,new g(this,t,this._progressiveDone)}},{key:"getRangeReader",value:function(t,e){if(e<=this._progressiveDataLength)return null;var n=new m(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(n),n}},{key:"cancelAllRequests",value:function(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);var e=this._rangeReaders.slice(0);e.forEach((function(e){e.cancel(t)})),this._pdfDataRangeTransport.abort()}},{key:"_progressiveDataLength",get:function(){return this._fullRequestReader?this._fullRequestReader._loaded:0}}]),t}();e.PDFDataTransportStream=f;var g=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];d(this,t),this._stream=e,this._done=r||!1,this._filename=null,this._queuedChunks=n||[],this._loaded=0;var i,o=l(this._queuedChunks);try{for(o.s();!(i=o.n()).done;){var a=i.value;this._loaded+=a.byteLength}}catch(s){o.e(s)}finally{o.f()}this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}return p(t,[{key:"_enqueue",value:function(t){if(!this._done){if(this._requests.length>0){var e=this._requests.shift();e.resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}},{key:"read",value:function(){var t=s(r["default"].mark((function t(){var e,n;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(this._queuedChunks.length>0)){t.next=3;break}return e=this._queuedChunks.shift(),t.abrupt("return",{value:e,done:!1});case 3:if(!this._done){t.next=5;break}return t.abrupt("return",{value:void 0,done:!0});case 5:return n=(0,i.createPromiseCapability)(),this._requests.push(n),t.abrupt("return",n.promise);case 8:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"cancel",value:function(t){this._done=!0,this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})})),this._requests=[]}},{key:"progressiveDone",value:function(){this._done||(this._done=!0)}},{key:"headersReady",get:function(){return this._headersReady}},{key:"filename",get:function(){return this._filename}},{key:"isRangeSupported",get:function(){return this._stream._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._stream._isStreamingSupported}},{key:"contentLength",get:function(){return this._stream._contentLength}}]),t}(),m=function(){function t(e,n,r){d(this,t),this._stream=e,this._begin=n,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}return p(t,[{key:"_enqueue",value:function(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{var e=this._requests.shift();e.resolve({value:t,done:!1}),this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})})),this._requests=[]}this._done=!0,this._stream._removeRangeReader(this)}}},{key:"read",value:function(){var t=s(r["default"].mark((function t(){var e,n;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!this._queuedChunk){t.next=4;break}return e=this._queuedChunk,this._queuedChunk=null,t.abrupt("return",{value:e,done:!1});case 4:if(!this._done){t.next=6;break}return t.abrupt("return",{value:void 0,done:!0});case 6:return n=(0,i.createPromiseCapability)(),this._requests.push(n),t.abrupt("return",n.promise);case 9:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"cancel",value:function(t){this._done=!0,this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})})),this._requests=[],this._stream._removeRangeReader(this)}},{key:"isStreamingSupported",get:function(){return!1}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLContext=void 0;var r=n(5);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}var s=function(){function t(e){var n=e.enable,r=void 0!==n&&n;i(this,t),this._enabled=!0===r}return a(t,[{key:"composeSMask",value:function(t){var e=t.layer,n=t.mask,r=t.properties;return l.composeSMask(e,n,r)}},{key:"drawFigures",value:function(t){var e=t.width,n=t.height,r=t.backgroundColor,i=t.figures,o=t.context;return l.drawFigures(e,n,r,i,o)}},{key:"clear",value:function(){l.cleanup()}},{key:"isEnabled",get:function(){var t=this._enabled;return t&&(t=l.tryInitGL()),(0,r.shadow)(this,"isEnabled",t)}}]),t}();e.WebGLContext=s;var l=function(){function t(t,e,n){var r=t.createShader(n);t.shaderSource(r,e),t.compileShader(r);var i=t.getShaderParameter(r,t.COMPILE_STATUS);if(!i){var o=t.getShaderInfoLog(r);throw new Error("Error during shader compilation: "+o)}return r}function e(e,n){return t(e,n,e.VERTEX_SHADER)}function n(e,n){return t(e,n,e.FRAGMENT_SHADER)}function r(t,e){for(var n=t.createProgram(),r=0,i=e.length;r<i;++r)t.attachShader(n,e[r]);t.linkProgram(n);var o=t.getProgramParameter(n,t.LINK_STATUS);if(!o){var a=t.getProgramInfoLog(n);throw new Error("Error during program linking: "+a)}return n}function i(t,e,n){t.activeTexture(n);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),r}var o,a;function s(){o||(a=document.createElement("canvas"),o=a.getContext("webgl",{premultipliedalpha:!1}))}var l=" attribute vec2 a_position; attribute vec2 a_texCoord; uniform vec2 u_resolution; varying vec2 v_texCoord; void main() { vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_texCoord = a_texCoord; } ",c=" precision mediump float; uniform vec4 u_backdrop; uniform int u_subtype; uniform sampler2D u_image; uniform sampler2D u_mask; varying vec2 v_texCoord; void main() { vec4 imageColor = texture2D(u_image, v_texCoord); vec4 maskColor = texture2D(u_mask, v_texCoord); if (u_backdrop.a > 0.0) { maskColor.rgb = maskColor.rgb * maskColor.a + u_backdrop.rgb * (1.0 - maskColor.a); } float lum; if (u_subtype == 0) { lum = maskColor.a; } else { lum = maskColor.r * 0.3 + maskColor.g * 0.59 + maskColor.b * 0.11; } imageColor.a *= lum; imageColor.rgb *= imageColor.a; gl_FragColor = imageColor; } ",u=null;function d(){var t,i;s(),t=a,a=null,i=o,o=null;var d=e(i,l),h=n(i,c),p=r(i,[d,h]);i.useProgram(p);var f={};f.gl=i,f.canvas=t,f.resolutionLocation=i.getUniformLocation(p,"u_resolution"),f.positionLocation=i.getAttribLocation(p,"a_position"),f.backdropLocation=i.getUniformLocation(p,"u_backdrop"),f.subtypeLocation=i.getUniformLocation(p,"u_subtype");var g=i.getAttribLocation(p,"a_texCoord"),m=i.getUniformLocation(p,"u_image"),v=i.getUniformLocation(p,"u_mask"),b=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,b),i.bufferData(i.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),i.STATIC_DRAW),i.enableVertexAttribArray(g),i.vertexAttribPointer(g,2,i.FLOAT,!1,0,0),i.uniform1i(m,0),i.uniform1i(v,1),u=f}function h(t,e,n){var r=t.width,o=t.height;u||d();var a=u,s=a.canvas,l=a.gl;s.width=r,s.height=o,l.viewport(0,0,l.drawingBufferWidth,l.drawingBufferHeight),l.uniform2f(a.resolutionLocation,r,o),n.backdrop?l.uniform4f(a.resolutionLocation,n.backdrop[0],n.backdrop[1],n.backdrop[2],1):l.uniform4f(a.resolutionLocation,0,0,0,0),l.uniform1i(a.subtypeLocation,"Luminosity"===n.subtype?1:0);var c=i(l,t,l.TEXTURE0),h=i(l,e,l.TEXTURE1),p=l.createBuffer();return l.bindBuffer(l.ARRAY_BUFFER,p),l.bufferData(l.ARRAY_BUFFER,new Float32Array([0,0,r,0,0,o,0,o,r,0,r,o]),l.STATIC_DRAW),l.enableVertexAttribArray(a.positionLocation),l.vertexAttribPointer(a.positionLocation,2,l.FLOAT,!1,0,0),l.clearColor(0,0,0,0),l.enable(l.BLEND),l.blendFunc(l.ONE,l.ONE_MINUS_SRC_ALPHA),l.clear(l.COLOR_BUFFER_BIT),l.drawArrays(l.TRIANGLES,0,6),l.flush(),l.deleteTexture(c),l.deleteTexture(h),l.deleteBuffer(p),s}var p=" attribute vec2 a_position; attribute vec3 a_color; uniform vec2 u_resolution; uniform vec2 u_scale; uniform vec2 u_offset; varying vec4 v_color; void main() { vec2 position = (a_position + u_offset) * u_scale; vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_color = vec4(a_color / 255.0, 1.0); } ",f=" precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ",g=null;function m(){var t,i;s(),t=a,a=null,i=o,o=null;var l=e(i,p),c=n(i,f),u=r(i,[l,c]);i.useProgram(u);var d={};d.gl=i,d.canvas=t,d.resolutionLocation=i.getUniformLocation(u,"u_resolution"),d.scaleLocation=i.getUniformLocation(u,"u_scale"),d.offsetLocation=i.getUniformLocation(u,"u_offset"),d.positionLocation=i.getAttribLocation(u,"a_position"),d.colorLocation=i.getAttribLocation(u,"a_color"),g=d}function v(t,e,n,r,i){g||m();var o=g,a=o.canvas,s=o.gl;a.width=t,a.height=e,s.viewport(0,0,s.drawingBufferWidth,s.drawingBufferHeight),s.uniform2f(o.resolutionLocation,t,e);var l,c,u,d=0;for(l=0,c=r.length;l<c;l++)switch(r[l].type){case"lattice":u=r[l].coords.length/r[l].verticesPerRow|0,d+=(u-1)*(r[l].verticesPerRow-1)*6;break;case"triangles":d+=r[l].coords.length;break}var h=new Float32Array(2*d),p=new Uint8Array(3*d),f=i.coords,v=i.colors,b=0,y=0;for(l=0,c=r.length;l<c;l++){var w=r[l],x=w.coords,C=w.colors;switch(w.type){case"lattice":var k=w.verticesPerRow;u=x.length/k|0;for(var A=1;A<u;A++)for(var S=A*k+1,E=1;E<k;E++,S++)h[b]=f[x[S-k-1]],h[b+1]=f[x[S-k-1]+1],h[b+2]=f[x[S-k]],h[b+3]=f[x[S-k]+1],h[b+4]=f[x[S-1]],h[b+5]=f[x[S-1]+1],p[y]=v[C[S-k-1]],p[y+1]=v[C[S-k-1]+1],p[y+2]=v[C[S-k-1]+2],p[y+3]=v[C[S-k]],p[y+4]=v[C[S-k]+1],p[y+5]=v[C[S-k]+2],p[y+6]=v[C[S-1]],p[y+7]=v[C[S-1]+1],p[y+8]=v[C[S-1]+2],h[b+6]=h[b+2],h[b+7]=h[b+3],h[b+8]=h[b+4],h[b+9]=h[b+5],h[b+10]=f[x[S]],h[b+11]=f[x[S]+1],p[y+9]=p[y+3],p[y+10]=p[y+4],p[y+11]=p[y+5],p[y+12]=p[y+6],p[y+13]=p[y+7],p[y+14]=p[y+8],p[y+15]=v[C[S]],p[y+16]=v[C[S]+1],p[y+17]=v[C[S]+2],b+=12,y+=18;break;case"triangles":for(var O=0,T=x.length;O<T;O++)h[b]=f[x[O]],h[b+1]=f[x[O]+1],p[y]=v[C[O]],p[y+1]=v[C[O]+1],p[y+2]=v[C[O]+2],b+=2,y+=3;break}}n?s.clearColor(n[0]/255,n[1]/255,n[2]/255,1):s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT);var _=s.createBuffer();s.bindBuffer(s.ARRAY_BUFFER,_),s.bufferData(s.ARRAY_BUFFER,h,s.STATIC_DRAW),s.enableVertexAttribArray(o.positionLocation),s.vertexAttribPointer(o.positionLocation,2,s.FLOAT,!1,0,0);var M=s.createBuffer();return s.bindBuffer(s.ARRAY_BUFFER,M),s.bufferData(s.ARRAY_BUFFER,p,s.STATIC_DRAW),s.enableVertexAttribArray(o.colorLocation),s.vertexAttribPointer(o.colorLocation,3,s.UNSIGNED_BYTE,!1,0,0),s.uniform2f(o.scaleLocation,i.scaleX,i.scaleY),s.uniform2f(o.offsetLocation,i.offsetX,i.offsetY),s.drawArrays(s.TRIANGLES,0,d),s.flush(),s.deleteBuffer(_),s.deleteBuffer(M),a}return{tryInitGL:function(){try{return s(),!!o}catch(t){}return!1},composeSMask:h,drawFigures:v,cleanup:function(){u&&u.canvas&&(u.canvas.width=0,u.canvas.height=0),g&&g.canvas&&(g.canvas.width=0,g.canvas.height=0),u=null,g=null}}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationLayer=void 0;var r=n(1),i=n(5),o=n(205);function a(t,e,n){return a="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=s(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},a(t,e,n||t)}function s(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=b(t),null===t)break;return t}function l(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}}}function c(t,e){if(t){if("string"===typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function d(t){return d="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}function p(t,e){return p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},p(t,e)}function f(t){var e=v();return function(){var n,r=b(t);if(e){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function g(t,e){return!e||"object"!==d(e)&&"function"!==typeof e?m(t):e}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},b(t)}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e,n){return e&&w(t.prototype,e),n&&w(t,n),t}var C=function(){function t(){y(this,t)}return x(t,null,[{key:"create",value:function(t){var e=t.data.annotationType;switch(e){case i.AnnotationType.LINK:return new A(t);case i.AnnotationType.TEXT:return new S(t);case i.AnnotationType.WIDGET:var n=t.data.fieldType;switch(n){case"Tx":return new O(t);case"Btn":return t.data.radioButton?new _(t):t.data.checkBox?new T(t):new M(t);case"Ch":return new N(t)}return new E(t);case i.AnnotationType.POPUP:return new P(t);case i.AnnotationType.FREETEXT:return new D(t);case i.AnnotationType.LINE:return new j(t);case i.AnnotationType.SQUARE:return new I(t);case i.AnnotationType.CIRCLE:return new R(t);case i.AnnotationType.POLYLINE:return new F(t);case i.AnnotationType.CARET:return new z(t);case i.AnnotationType.INK:return new H(t);case i.AnnotationType.POLYGON:return new B(t);case i.AnnotationType.HIGHLIGHT:return new V(t);case i.AnnotationType.UNDERLINE:return new q(t);case i.AnnotationType.SQUIGGLY:return new U(t);case i.AnnotationType.STRIKEOUT:return new W(t);case i.AnnotationType.STAMP:return new $(t);case i.AnnotationType.FILEATTACHMENT:return new G(t);default:return new k(t)}}}]),t}(),k=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];y(this,t),this.isRenderable=n,this.data=e.data,this.layer=e.layer,this.page=e.page,this.viewport=e.viewport,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderInteractiveForms=e.renderInteractiveForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,n&&(this.container=this._createContainer(r))}return x(t,[{key:"_createContainer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.data,n=this.page,r=this.viewport,o=document.createElement("section"),a=e.rect[2]-e.rect[0],s=e.rect[3]-e.rect[1];o.setAttribute("data-annotation-id",e.id);var l=i.Util.normalizeRect([e.rect[0],n.view[3]-e.rect[1]+n.view[1],e.rect[2],n.view[3]-e.rect[3]+n.view[1]]);if(o.style.transform="matrix(".concat(r.transform.join(","),")"),o.style.transformOrigin="-".concat(l[0],"px -").concat(l[1],"px"),!t&&e.borderStyle.width>0){o.style.borderWidth="".concat(e.borderStyle.width,"px"),e.borderStyle.style!==i.AnnotationBorderStyleType.UNDERLINE&&(a-=2*e.borderStyle.width,s-=2*e.borderStyle.width);var c=e.borderStyle.horizontalCornerRadius,u=e.borderStyle.verticalCornerRadius;if(c>0||u>0){var d="".concat(c,"px / ").concat(u,"px");o.style.borderRadius=d}switch(e.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:o.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:o.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:o.style.borderBottomStyle="solid";break;default:break}e.color?o.style.borderColor=i.Util.makeCssRgb(0|e.color[0],0|e.color[1],0|e.color[2]):o.style.borderWidth=0}return o.style.left="".concat(l[0],"px"),o.style.top="".concat(l[1],"px"),o.style.width="".concat(a,"px"),o.style.height="".concat(s,"px"),o}},{key:"_createPopup",value:function(t,e,n){e||(e=document.createElement("div"),e.style.height=t.style.height,e.style.width=t.style.width,t.appendChild(e));var r=new L({container:t,trigger:e,color:n.color,title:n.title,modificationDate:n.modificationDate,contents:n.contents,hideWrapper:!0}),i=r.render();i.style.left=t.style.width,t.appendChild(i)}},{key:"render",value:function(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}}]),t}(),A=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.url||t.data.dest||t.data.action);return e.call(this,t,r)}return x(n,[{key:"render",value:function(){this.container.className="linkAnnotation";var t=this.data,e=this.linkService,n=document.createElement("a");return t.url?(0,r.addLinkAttributes)(n,{url:t.url,target:t.newWindow?r.LinkTarget.BLANK:e.externalLinkTarget,rel:e.externalLinkRel,enabled:e.externalLinkEnabled}):t.action?this._bindNamedAction(n,t.action):this._bindLink(n,t.dest),this.container.appendChild(n),this.container}},{key:"_bindLink",value:function(t,e){var n=this;t.href=this.linkService.getDestinationHash(e),t.onclick=function(){return e&&n.linkService.navigateTo(e),!1},e&&(t.className="internalLink")}},{key:"_bindNamedAction",value:function(t,e){var n=this;t.href=this.linkService.getAnchorUrl(""),t.onclick=function(){return n.linkService.executeNamedAction(e),!1},t.className="internalLink"}}]),n}(k),S=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r)}return x(n,[{key:"render",value:function(){this.container.className="textAnnotation";var t=document.createElement("img");return t.style.height=this.container.style.height,t.style.width=this.container.style.width,t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,t,this.data),this.container.appendChild(t),this.container}}]),n}(k),E=function(t){h(n,t);var e=f(n);function n(){return y(this,n),e.apply(this,arguments)}return x(n,[{key:"render",value:function(){return this.container}}]),n}(k),O=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=t.renderInteractiveForms||!t.data.hasAppearance&&!!t.data.fieldValue;return e.call(this,t,r)}return x(n,[{key:"render",value:function(){var t=["left","center","right"],e=this.annotationStorage,n=this.data.id;this.container.className="textWidgetAnnotation";var r=null;if(this.renderInteractiveForms){var i=e.getOrCreateValue(n,this.data.fieldValue);if(this.data.multiLine?(r=document.createElement("textarea"),r.textContent=i):(r=document.createElement("input"),r.type="text",r.setAttribute("value",i)),r.addEventListener("input",(function(t){e.setValue(n,t.target.value)})),r.disabled=this.data.readOnly,r.name=this.data.fieldName,null!==this.data.maxLen&&(r.maxLength=this.data.maxLen),this.data.comb){var o=this.data.rect[2]-this.data.rect[0],a=o/this.data.maxLen;r.classList.add("comb"),r.style.letterSpacing="calc(".concat(a,"px - 1ch)")}}else{r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell";var s=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&(s=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(r,s)}return null!==this.data.textAlignment&&(r.style.textAlign=t[this.data.textAlignment]),this.container.appendChild(r),this.container}},{key:"_setTextStyle",value:function(t,e){var n=t.style;if(n.fontSize="".concat(this.data.fontSize,"px"),n.direction=this.data.fontDirection<0?"rtl":"ltr",e){var r="normal";e.black?r="900":e.bold&&(r="bold"),n.fontWeight=r,n.fontStyle=e.italic?"italic":"normal";var i=e.loadedName?'"'.concat(e.loadedName,'", '):"",o=e.fallbackName||"Helvetica, sans-serif";n.fontFamily=i+o}}}]),n}(E),T=function(t){h(n,t);var e=f(n);function n(t){return y(this,n),e.call(this,t,t.renderInteractiveForms)}return x(n,[{key:"render",value:function(){var t=this.annotationStorage,e=this.data,n=e.id,r=t.getOrCreateValue(n,e.fieldValue&&"Off"!==e.fieldValue);this.container.className="buttonWidgetAnnotation checkBox";var i=document.createElement("input");return i.disabled=e.readOnly,i.type="checkbox",i.name=this.data.fieldName,r&&i.setAttribute("checked",!0),i.addEventListener("change",(function(e){t.setValue(n,e.target.checked)})),this.container.appendChild(i),this.container}}]),n}(E),_=function(t){h(n,t);var e=f(n);function n(t){return y(this,n),e.call(this,t,t.renderInteractiveForms)}return x(n,[{key:"render",value:function(){this.container.className="buttonWidgetAnnotation radioButton";var t=this.annotationStorage,e=this.data,n=e.id,r=t.getOrCreateValue(n,e.fieldValue===e.buttonValue),i=document.createElement("input");return i.disabled=e.readOnly,i.type="radio",i.name=e.fieldName,r&&i.setAttribute("checked",!0),i.addEventListener("change",(function(e){var r,i=e.target.name,o=l(document.getElementsByName(i));try{for(o.s();!(r=o.n()).done;){var a=r.value;a!==e.target&&t.setValue(a.parentNode.getAttribute("data-annotation-id"),!1)}}catch(s){o.e(s)}finally{o.f()}t.setValue(n,e.target.checked)})),this.container.appendChild(i),this.container}}]),n}(E),M=function(t){h(n,t);var e=f(n);function n(){return y(this,n),e.apply(this,arguments)}return x(n,[{key:"render",value:function(){var t=a(b(n.prototype),"render",this).call(this);return t.className="buttonWidgetAnnotation pushButton",t}}]),n}(A),N=function(t){h(n,t);var e=f(n);function n(t){return y(this,n),e.call(this,t,t.renderInteractiveForms)}return x(n,[{key:"render",value:function(){this.container.className="choiceWidgetAnnotation";var t=this.annotationStorage,e=this.data.id;t.getOrCreateValue(e,this.data.fieldValue.length>0?this.data.fieldValue[0]:null);var n=document.createElement("select");n.disabled=this.data.readOnly,n.name=this.data.fieldName,this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0));var r,i=l(this.data.options);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=document.createElement("option");a.textContent=o.displayValue,a.value=o.exportValue,this.data.fieldValue.includes(o.exportValue)&&a.setAttribute("selected",!0),n.appendChild(a)}}catch(s){i.e(s)}finally{i.f()}return n.addEventListener("input",(function(n){var r=n.target.options,i=r[r.selectedIndex].value;t.setValue(e,i)})),this.container.appendChild(n),this.container}}]),n}(E),P=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!(!t.data.title&&!t.data.contents);return e.call(this,t,r)}return x(n,[{key:"render",value:function(){var t=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",t.includes(this.data.parentType))return this.container;var e='[data-annotation-id="'.concat(this.data.parentId,'"]'),n=this.layer.querySelector(e);if(!n)return this.container;var r=new L({container:this.container,trigger:n,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),i=parseFloat(n.style.left),o=parseFloat(n.style.width);return this.container.style.transformOrigin="-".concat(i+o,"px -").concat(n.style.top),this.container.style.left="".concat(i+o,"px"),this.container.appendChild(r.render()),this.container}}]),n}(k),L=function(){function t(e){y(this,t),this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.title=e.title,this.modificationDate=e.modificationDate,this.contents=e.contents,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}return x(t,[{key:"render",value:function(){var t=.7,e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.setAttribute("hidden",!0);var n=document.createElement("div");n.className="popup";var o=this.color;if(o){var a=t*(255-o[0])+o[0],s=t*(255-o[1])+o[1],l=t*(255-o[2])+o[2];n.style.backgroundColor=i.Util.makeCssRgb(0|a,0|s,0|l)}var c=document.createElement("h1");c.textContent=this.title,n.appendChild(c);var u=r.PDFDateString.toDateObject(this.modificationDate);if(u){var d=document.createElement("span");d.textContent="{{date}}, {{time}}",d.dataset.l10nId="annotation_date_string",d.dataset.l10nArgs=JSON.stringify({date:u.toLocaleDateString(),time:u.toLocaleTimeString()}),n.appendChild(d)}var h=this._formatContents(this.contents);return n.appendChild(h),this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),n.addEventListener("click",this._hide.bind(this,!0)),e.appendChild(n),e}},{key:"_formatContents",value:function(t){for(var e=document.createElement("p"),n=t.split(/(?:\r\n?|\n)/),r=0,i=n.length;r<i;++r){var o=n[r];e.appendChild(document.createTextNode(o)),r<i-1&&e.appendChild(document.createElement("br"))}return e}},{key:"_toggle",value:function(){this.pinned?this._hide(!0):this._show(!0)}},{key:"_show",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&(this.pinned=!0),this.hideElement.hasAttribute("hidden")&&(this.hideElement.removeAttribute("hidden"),this.container.style.zIndex+=1)}},{key:"_hide",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&(this.pinned=!1),this.hideElement.hasAttribute("hidden")||this.pinned||(this.hideElement.setAttribute("hidden",!0),this.container.style.zIndex-=1)}}]),t}(),D=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),n}(k),j=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){this.container.className="lineAnnotation";var t=this.data,e=t.rect[2]-t.rect[0],n=t.rect[3]-t.rect[1],r=this.svgFactory.create(e,n),i=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),i.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),i.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),i.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),i.setAttribute("stroke-width",t.borderStyle.width||1),i.setAttribute("stroke","transparent"),r.appendChild(i),this.container.append(r),this._createPopup(this.container,i,t),this.container}}]),n}(k),I=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){this.container.className="squareAnnotation";var t=this.data,e=t.rect[2]-t.rect[0],n=t.rect[3]-t.rect[1],r=this.svgFactory.create(e,n),i=t.borderStyle.width,o=this.svgFactory.createElement("svg:rect");return o.setAttribute("x",i/2),o.setAttribute("y",i/2),o.setAttribute("width",e-i),o.setAttribute("height",n-i),o.setAttribute("stroke-width",i||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","none"),r.appendChild(o),this.container.append(r),this._createPopup(this.container,o,t),this.container}}]),n}(k),R=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){this.container.className="circleAnnotation";var t=this.data,e=t.rect[2]-t.rect[0],n=t.rect[3]-t.rect[1],r=this.svgFactory.create(e,n),i=t.borderStyle.width,o=this.svgFactory.createElement("svg:ellipse");return o.setAttribute("cx",e/2),o.setAttribute("cy",n/2),o.setAttribute("rx",e/2-i/2),o.setAttribute("ry",n/2-i/2),o.setAttribute("stroke-width",i||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","none"),r.appendChild(o),this.container.append(r),this._createPopup(this.container,o,t),this.container}}]),n}(k),F=function(t){h(n,t);var e=f(n);function n(t){var r;y(this,n);var i=!!(t.data.hasPopup||t.data.title||t.data.contents);return r=e.call(this,t,i,!0),r.containerClassName="polylineAnnotation",r.svgElementName="svg:polyline",r}return x(n,[{key:"render",value:function(){this.container.className=this.containerClassName;var t,e=this.data,n=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],i=this.svgFactory.create(n,r),o=[],a=l(e.vertices);try{for(a.s();!(t=a.n()).done;){var s=t.value,c=s.x-e.rect[0],u=e.rect[3]-s.y;o.push(c+","+u)}}catch(h){a.e(h)}finally{a.f()}o=o.join(" ");var d=this.svgFactory.createElement(this.svgElementName);return d.setAttribute("points",o),d.setAttribute("stroke-width",e.borderStyle.width||1),d.setAttribute("stroke","transparent"),d.setAttribute("fill","none"),i.appendChild(d),this.container.append(i),this._createPopup(this.container,d,e),this.container}}]),n}(k),B=function(t){h(n,t);var e=f(n);function n(t){var r;return y(this,n),r=e.call(this,t),r.containerClassName="polygonAnnotation",r.svgElementName="svg:polygon",r}return n}(F),z=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),n}(k),H=function(t){h(n,t);var e=f(n);function n(t){var r;y(this,n);var i=!!(t.data.hasPopup||t.data.title||t.data.contents);return r=e.call(this,t,i,!0),r.containerClassName="inkAnnotation",r.svgElementName="svg:polyline",r}return x(n,[{key:"render",value:function(){this.container.className=this.containerClassName;var t,e=this.data,n=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],i=this.svgFactory.create(n,r),o=l(e.inkLists);try{for(o.s();!(t=o.n()).done;){var a,s=t.value,c=[],u=l(s);try{for(u.s();!(a=u.n()).done;){var d=a.value,h=d.x-e.rect[0],p=e.rect[3]-d.y;c.push("".concat(h,",").concat(p))}}catch(g){u.e(g)}finally{u.f()}c=c.join(" ");var f=this.svgFactory.createElement(this.svgElementName);f.setAttribute("points",c),f.setAttribute("stroke-width",e.borderStyle.width||1),f.setAttribute("stroke","transparent"),f.setAttribute("fill","none"),this._createPopup(this.container,f,e),i.appendChild(f)}}catch(g){o.e(g)}finally{o.f()}return this.container.append(i),this.container}}]),n}(k),V=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){return this.container.className="highlightAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),n}(k),q=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){return this.container.className="underlineAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),n}(k),U=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){return this.container.className="squigglyAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),n}(k),W=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){return this.container.className="strikeoutAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),n}(k),$=function(t){h(n,t);var e=f(n);function n(t){y(this,n);var r=!!(t.data.hasPopup||t.data.title||t.data.contents);return e.call(this,t,r,!0)}return x(n,[{key:"render",value:function(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),n}(k),G=function(t){h(n,t);var e=f(n);function n(t){var o;y(this,n),o=e.call(this,t,!0);var a=o.data.file,s=a.filename,l=a.content;return o.filename=(0,r.getFilenameFromUrl)(s),o.content=l,o.linkService.eventBus&&o.linkService.eventBus.dispatch("fileattachmentannotation",{source:m(o),id:(0,i.stringToPDFString)(s),filename:s,content:l}),o}return x(n,[{key:"render",value:function(){this.container.className="fileAttachmentAnnotation";var t=document.createElement("div");return t.style.height=this.container.style.height,t.style.width=this.container.style.width,t.addEventListener("dblclick",this._download.bind(this)),this.data.hasPopup||!this.data.title&&!this.data.contents||this._createPopup(this.container,t,this.data),this.container.appendChild(t),this.container}},{key:"_download",value:function(){this.downloadManager?this.downloadManager.downloadData(this.content,this.filename,""):(0,i.warn)("Download cannot be started due to unavailable download manager")}}]),n}(k),Y=function(){function t(){y(this,t)}return x(t,null,[{key:"render",value:function(t){var e,n=[],a=[],s=l(t.annotations);try{for(s.s();!(e=s.n()).done;){var c=e.value;c&&(c.annotationType!==i.AnnotationType.POPUP?n.push(c):a.push(c))}}catch(f){s.e(f)}finally{s.f()}a.length&&n.push.apply(n,a);for(var u=0,d=n;u<d.length;u++){var h=d[u],p=C.create({data:h,layer:t.div,page:t.page,viewport:t.viewport,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderInteractiveForms:"boolean"!==typeof t.renderInteractiveForms||t.renderInteractiveForms,svgFactory:new r.DOMSVGFactory,annotationStorage:t.annotationStorage||new o.AnnotationStorage});p.isRenderable&&t.div.appendChild(p.render())}}},{key:"update",value:function(t){var e,n=l(t.annotations);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=t.div.querySelector('[data-annotation-id="'.concat(r.id,'"]'));i&&(i.style.transform="matrix(".concat(t.viewport.transform.join(","),")"))}}catch(o){n.e(o)}finally{n.f()}t.div.removeAttribute("hidden")}}]),t}();e.AnnotationLayer=Y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.renderTextLayer=void 0;var r=n(5),i=function(){var t=1e5,e=/\S/;function n(t){return!e.test(t)}function i(t,e,i){var o=document.createElement("span"),a={angle:0,canvasWidth:0,isWhitespace:!1,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1};if(t._textDivs.push(o),n(e.str))return a.isWhitespace=!0,void t._textDivProperties.set(o,a);var s=r.Util.transform(t._viewport.transform,e.transform),l=Math.atan2(s[1],s[0]),c=i[e.fontName];c.vertical&&(l+=Math.PI/2);var u,d,h=Math.sqrt(s[2]*s[2]+s[3]*s[3]),p=h;c.ascent?p=c.ascent*p:c.descent&&(p=(1+c.descent)*p),0===l?(u=s[4],d=s[5]-p):(u=s[4]+p*Math.sin(l),d=s[5]-p*Math.cos(l)),o.style.left="".concat(u,"px"),o.style.top="".concat(d,"px"),o.style.fontSize="".concat(h,"px"),o.style.fontFamily=c.fontFamily,o.textContent=e.str,t._fontInspectorEnabled&&(o.dataset.fontName=e.fontName),0!==l&&(a.angle=l*(180/Math.PI));var f=!1;if(e.str.length>1)f=!0;else if(e.transform[0]!==e.transform[3]){var g=Math.abs(e.transform[0]),m=Math.abs(e.transform[3]);g!==m&&Math.max(g,m)/Math.min(g,m)>1.5&&(f=!0)}if(f&&(c.vertical?a.canvasWidth=e.height*t._viewport.scale:a.canvasWidth=e.width*t._viewport.scale),t._textDivProperties.set(o,a),t._textContentStream&&t._layoutText(o),t._enhanceTextSelection){var v=1,b=0;0!==l&&(v=Math.cos(l),b=Math.sin(l));var y,w,x=(c.vertical?e.height:e.width)*t._viewport.scale,C=h;0!==l?(y=[v,b,-b,v,u,d],w=r.Util.getAxialAlignedBoundingBox([0,0,x,C],y)):w=[u,d,u+x,d+C],t._bounds.push({left:w[0],top:w[1],right:w[2],bottom:w[3],div:o,size:[x,C],m:y})}}function o(e){if(!e._canceled){var n=e._textDivs,r=e._capability,i=n.length;if(i>t)return e._renderingDone=!0,void r.resolve();if(!e._textContentStream)for(var o=0;o<i;o++)e._layoutText(n[o]);e._renderingDone=!0,r.resolve()}}function a(t,e,n){for(var r=0,i=0;i<n;i++){var o=t[e++];o>0&&(r=r?Math.min(o,r):o)}return r}function s(t){for(var e=t._bounds,n=t._viewport,i=l(n.width,n.height,e),o=0;o<i.length;o++){var s=e[o].div,c=t._textDivProperties.get(s);if(0!==c.angle){var u=i[o],d=e[o],h=d.m,p=h[0],f=h[1],g=[[0,0],[0,d.size[1]],[d.size[0],0],d.size],m=new Float64Array(64);g.forEach((function(t,e){var n=r.Util.applyTransform(t,h);m[e+0]=p&&(u.left-n[0])/p,m[e+4]=f&&(u.top-n[1])/f,m[e+8]=p&&(u.right-n[0])/p,m[e+12]=f&&(u.bottom-n[1])/f,m[e+16]=f&&(u.left-n[0])/-f,m[e+20]=p&&(u.top-n[1])/p,m[e+24]=f&&(u.right-n[0])/-f,m[e+28]=p&&(u.bottom-n[1])/p,m[e+32]=p&&(u.left-n[0])/-p,m[e+36]=f&&(u.top-n[1])/-f,m[e+40]=p&&(u.right-n[0])/-p,m[e+44]=f&&(u.bottom-n[1])/-f,m[e+48]=f&&(u.left-n[0])/f,m[e+52]=p&&(u.top-n[1])/-p,m[e+56]=f&&(u.right-n[0])/f,m[e+60]=p&&(u.bottom-n[1])/-p}));var v=1+Math.min(Math.abs(p),Math.abs(f));c.paddingLeft=a(m,32,16)/v,c.paddingTop=a(m,48,16)/v,c.paddingRight=a(m,0,16)/v,c.paddingBottom=a(m,16,16)/v,t._textDivProperties.set(s,c)}else c.paddingLeft=e[o].left-i[o].left,c.paddingTop=e[o].top-i[o].top,c.paddingRight=i[o].right-e[o].right,c.paddingBottom=i[o].bottom-e[o].bottom,t._textDivProperties.set(s,c)}}function l(t,e,n){var r=n.map((function(t,e){return{x1:t.left,y1:t.top,x2:t.right,y2:t.bottom,index:e,x1New:void 0,x2New:void 0}}));c(t,r);var i=new Array(n.length);return r.forEach((function(t){var e=t.index;i[e]={left:t.x1New,top:0,right:t.x2New,bottom:0}})),n.map((function(e,n){var o=i[n],a=r[n];a.x1=e.top,a.y1=t-o.right,a.x2=e.bottom,a.y2=t-o.left,a.index=n,a.x1New=void 0,a.x2New=void 0})),c(e,r),r.forEach((function(t){var e=t.index;i[e].top=t.x1New,i[e].bottom=t.x2New})),i}function c(t,e){e.sort((function(t,e){return t.x1-e.x1||t.index-e.index}));var n={x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0},r=[{start:-1/0,end:1/0,boundary:n}];e.forEach((function(t){var e=0;while(e<r.length&&r[e].end<=t.y1)e++;var n,i,o=r.length-1;while(o>=0&&r[o].start>=t.y2)o--;var a,s,l=-1/0;for(a=e;a<=o;a++){var c;n=r[a],i=n.boundary,c=i.x2>t.x1?i.index>t.index?i.x1New:t.x1:void 0===i.x2New?(i.x2+t.x1)/2:i.x2New,c>l&&(l=c)}for(t.x1New=l,a=e;a<=o;a++)n=r[a],i=n.boundary,void 0===i.x2New?i.x2>t.x1?i.index>t.index&&(i.x2New=i.x2):i.x2New=l:i.x2New>l&&(i.x2New=Math.max(l,i.x2));var u=[],d=null;for(a=e;a<=o;a++){n=r[a],i=n.boundary;var h=i.x2>t.x2?i:t;d===h?u[u.length-1].end=n.end:(u.push({start:n.start,end:n.end,boundary:h}),d=h)}for(r[e].start<t.y1&&(u[0].start=t.y1,u.unshift({start:r[e].start,end:t.y1,boundary:r[e].boundary})),t.y2<r[o].end&&(u[u.length-1].end=t.y2,u.push({start:t.y2,end:r[o].end,boundary:r[o].boundary})),a=e;a<=o;a++)if(n=r[a],i=n.boundary,void 0===i.x2New){var p=!1;for(s=e-1;!p&&s>=0&&r[s].start>=i.y1;s--)p=r[s].boundary===i;for(s=o+1;!p&&s<r.length&&r[s].end<=i.y2;s++)p=r[s].boundary===i;for(s=0;!p&&s<u.length;s++)p=u[s].boundary===i;p||(i.x2New=l)}Array.prototype.splice.apply(r,[e,o-e+1].concat(u))})),r.forEach((function(e){var n=e.boundary;void 0===n.x2New&&(n.x2New=Math.max(t,n.x2))}))}function u(t){var e=this,n=t.textContent,i=t.textContentStream,o=t.container,a=t.viewport,s=t.textDivs,l=t.textContentItemsStr,c=t.enhanceTextSelection;this._textContent=n,this._textContentStream=i,this._container=o,this._document=o.ownerDocument,this._viewport=a,this._textDivs=s||[],this._textContentItemsStr=l||[],this._enhanceTextSelection=!!c,this._fontInspectorEnabled=!(!globalThis.FontInspector||!globalThis.FontInspector.enabled),this._reader=null,this._layoutTextLastFontSize=null,this._layoutTextLastFontFamily=null,this._layoutTextCtx=null,this._textDivProperties=new WeakMap,this._renderingDone=!1,this._canceled=!1,this._capability=(0,r.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._capability.promise["finally"]((function(){e._layoutTextCtx&&(e._layoutTextCtx.canvas.width=0,e._layoutTextCtx.canvas.height=0,e._layoutTextCtx=null)}))["catch"]((function(){}))}function d(t){var e=new u({textContent:t.textContent,textContentStream:t.textContentStream,container:t.container,viewport:t.viewport,textDivs:t.textDivs,textContentItemsStr:t.textContentItemsStr,enhanceTextSelection:t.enhanceTextSelection});return e._render(t.timeout),e}return u.prototype={get promise(){return this._capability.promise},cancel:function(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))},_processItems:function(t,e){for(var n=0,r=t.length;n<r;n++)this._textContentItemsStr.push(t[n].str),i(this,t[n],e)},_layoutText:function(t){var e=this._textDivProperties.get(t);if(!e.isWhitespace){var n="";if(0!==e.canvasWidth){var r=t.style,i=r.fontSize,o=r.fontFamily;i===this._layoutTextLastFontSize&&o===this._layoutTextLastFontFamily||(this._layoutTextCtx.font="".concat(i," ").concat(o),this._layoutTextLastFontSize=i,this._layoutTextLastFontFamily=o);var a=this._layoutTextCtx.measureText(t.textContent),s=a.width;s>0&&(e.scale=e.canvasWidth/s,n="scaleX(".concat(e.scale,")"))}0!==e.angle&&(n="rotate(".concat(e.angle,"deg) ").concat(n)),n.length>0&&(this._enhanceTextSelection&&(e.originalTransform=n),t.style.transform=n),this._textDivProperties.set(t,e),this._container.appendChild(t)}},_render:function(t){var e=this,n=(0,r.createPromiseCapability)(),i=Object.create(null),a=this._document.createElement("canvas");if(a.mozOpaque=!0,this._layoutTextCtx=a.getContext("2d",{alpha:!1}),this._textContent){var s=this._textContent.items,l=this._textContent.styles;this._processItems(s,l),n.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');var c=function t(){e._reader.read().then((function(r){var o=r.value,a=r.done;a?n.resolve():(Object.assign(i,o.styles),e._processItems(o.items,i),t())}),n.reject)};this._reader=this._textContentStream.getReader(),c()}n.promise.then((function(){i=null,t?e._renderTimer=setTimeout((function(){o(e),e._renderTimer=null}),t):o(e)}),this._capability.reject)},expandTextDivs:function(t){if(this._enhanceTextSelection&&this._renderingDone){null!==this._bounds&&(s(this),this._bounds=null);for(var e=[],n=[],r=0,i=this._textDivs.length;r<i;r++){var o=this._textDivs[r],a=this._textDivProperties.get(o);a.isWhitespace||(t?(e.length=0,n.length=0,a.originalTransform&&e.push(a.originalTransform),a.paddingTop>0?(n.push("".concat(a.paddingTop,"px")),e.push("translateY(".concat(-a.paddingTop,"px)"))):n.push(0),a.paddingRight>0?n.push("".concat(a.paddingRight/a.scale,"px")):n.push(0),a.paddingBottom>0?n.push("".concat(a.paddingBottom,"px")):n.push(0),a.paddingLeft>0?(n.push("".concat(a.paddingLeft/a.scale,"px")),e.push("translateX(".concat(-a.paddingLeft/a.scale,"px)"))):n.push(0),o.style.padding=n.join(" "),e.length&&(o.style.transform=e.join(" "))):(o.style.padding=null,o.style.transform=a.originalTransform))}}}},d}();e.renderTextLayer=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var r=n(5),i=n(1),o=n(7);function a(t){return c(t)||l(t)||g(t)||s()}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function c(t){if(Array.isArray(t))return m(t)}function u(t,e){return p(t)||h(t,e)||g(t,e)||d()}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(l){i=!0,o=l}finally{try{r||null==s["return"]||s["return"]()}finally{if(i)throw o}}return n}}function p(t){if(Array.isArray(t))return t}function f(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=g(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}}}function g(t,e){if(t){if("string"===typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function y(t,e,n){return e&&b(t.prototype,e),n&&b(t,n),t}var w=function(){throw new Error("Not implemented: SVGGraphics")};e.SVGGraphics=w;var x=function(t){var e,n=[],r=[],i=f(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;"save"!==o.fn?"restore"===o.fn?n=r.pop():n.push(o):(n.push({fnId:92,fn:"group",items:[]}),r.push(n),n=n[n.length-1].items)}}catch(a){i.e(a)}finally{i.f()}return n},C=function(t){if(Number.isInteger(t))return t.toString();var e=t.toFixed(10),n=e.length-1;if("0"!==e[n])return e;do{n--}while("0"===e[n]);return e.substring(0,"."===e[n]?n:n+1)},k=function(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":"scale(".concat(C(t[0])," ").concat(C(t[3]),")");if(t[0]===t[3]&&t[1]===-t[2]){var e=180*Math.acos(t[0])/Math.PI;return"rotate(".concat(C(e),")")}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return"translate(".concat(C(t[4])," ").concat(C(t[5]),")");return"matrix(".concat(C(t[0])," ").concat(C(t[1])," ").concat(C(t[2])," ").concat(C(t[3])," ").concat(C(t[4])," ")+"".concat(C(t[5]),")")},A={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},S="http://www.w3.org/XML/1998/namespace",E="http://www.w3.org/1999/xlink",O=["butt","round","square"],T=["miter","round","bevel"],_=function(){for(var t=new Uint8Array([137,80,78,71,13,10,26,10]),e=12,n=new Int32Array(256),i=0;i<256;i++){for(var a=i,s=0;s<8;s++)a=1&a?3988292384^a>>1&2147483647:a>>1&2147483647;n[i]=a}function l(t,e,r){for(var i=-1,o=e;o<r;o++){var a=255&(i^t[o]),s=n[a];i=i>>>8^s}return-1^i}function c(t,e,n,r){var i=r,o=e.length;n[i]=o>>24&255,n[i+1]=o>>16&255,n[i+2]=o>>8&255,n[i+3]=255&o,i+=4,n[i]=255&t.charCodeAt(0),n[i+1]=255&t.charCodeAt(1),n[i+2]=255&t.charCodeAt(2),n[i+3]=255&t.charCodeAt(3),i+=4,n.set(e,i),i+=e.length;var a=l(n,r+4,i);n[i]=a>>24&255,n[i+1]=a>>16&255,n[i+2]=a>>8&255,n[i+3]=255&a}function u(t,e,n){for(var r=1,i=0,o=e;o<n;++o)r=(r+(255&t[o]))%65521,i=(i+r)%65521;return i<<16|r}function d(t){if(!o.isNodeJS)return h(t);try{var e;e=parseInt(process.versions.node)>=8?t:Buffer.from(t);var n=__webpack_require__(3).deflateSync(e,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(i){(0,r.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+i)}return h(t)}function h(t){var e=t.length,n=65535,r=Math.ceil(e/n),i=new Uint8Array(2+e+5*r+4),o=0;i[o++]=120,i[o++]=156;var a=0;while(e>n)i[o++]=0,i[o++]=255,i[o++]=255,i[o++]=0,i[o++]=0,i.set(t.subarray(a,a+n),o),o+=n,a+=n,e-=n;i[o++]=1,i[o++]=255&e,i[o++]=e>>8&255,i[o++]=255&~e,i[o++]=(65535&~e)>>8&255,i.set(t.subarray(a),o),o+=t.length-a;var s=u(t,0,t.length);return i[o++]=s>>24&255,i[o++]=s>>16&255,i[o++]=s>>8&255,i[o++]=255&s,i}function p(n,i,o,a){var s,l,u,h=n.width,p=n.height,f=n.data;switch(i){case r.ImageKind.GRAYSCALE_1BPP:l=0,s=1,u=h+7>>3;break;case r.ImageKind.RGB_24BPP:l=2,s=8,u=3*h;break;case r.ImageKind.RGBA_32BPP:l=6,s=8,u=4*h;break;default:throw new Error("invalid format")}for(var g=new Uint8Array((1+u)*p),m=0,v=0,b=0;b<p;++b)g[m++]=0,g.set(f.subarray(v,v+u),m),v+=u,m+=u;if(i===r.ImageKind.GRAYSCALE_1BPP&&a){m=0;for(var y=0;y<p;y++){m++;for(var w=0;w<u;w++)g[m++]^=255}}var x=new Uint8Array([h>>24&255,h>>16&255,h>>8&255,255&h,p>>24&255,p>>16&255,p>>8&255,255&p,s,l,0,0,0]),C=d(g),k=t.length+3*e+x.length+C.length,A=new Uint8Array(k),S=0;return A.set(t,S),S+=t.length,c("IHDR",x,A,S),S+=e+x.length,c("IDATA",C,A,S),S+=e+C.length,c("IEND",new Uint8Array(0),A,S),(0,r.createObjectURL)(A,"image/png",o)}return function(t,e,n){var i=void 0===t.kind?r.ImageKind.GRAYSCALE_1BPP:t.kind;return p(t,i,e,n)}}(),M=function(){function t(){v(this,t),this.fontSizeScale=1,this.fontWeight=A.fontWeight,this.fontSize=0,this.textMatrix=r.IDENTITY_MATRIX,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=r.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=A.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}return y(t,[{key:"clone",value:function(){return Object.create(this)}},{key:"setCurrentPoint",value:function(t,e){this.x=t,this.y=e}}]),t}(),N=0,P=0,L=0;e.SVGGraphics=w=function(){function t(e,n){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var a in v(this,t),this.svgFactory=new i.DOMSVGFactory,this.current=new M,this.transformMatrix=r.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=n,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!o,this._operatorIdMapping=[],r.OPS)this._operatorIdMapping[r.OPS[a]]=a}return y(t,[{key:"save",value:function(){this.transformStack.push(this.transformMatrix);var t=this.current;this.extraStack.push(t),this.current=t.clone()}},{key:"restore",value:function(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}},{key:"group",value:function(t){this.save(),this.executeOpTree(t),this.restore()}},{key:"loadDependencies",value:function(t){for(var e=this,n=t.fnArray,i=t.argsArray,o=0,a=n.length;o<a;o++)if(n[o]===r.OPS.dependency){var s,l=f(i[o]);try{var c=function(){var t=s.value,n=t.startsWith("g_")?e.commonObjs:e.objs,r=new Promise((function(e){n.get(t,e)}));e.current.dependencies.push(r)};for(l.s();!(s=l.n()).done;)c()}catch(u){l.e(u)}finally{l.f()}}return Promise.all(this.current.dependencies)}},{key:"transform",value:function(t,e,n,i,o,a){var s=[t,e,n,i,o,a];this.transformMatrix=r.Util.transform(this.transformMatrix,s),this.tgrp=null}},{key:"getSVG",value:function(t,e){var n=this;this.viewport=e;var i=this._initialize(e);return this.loadDependencies(t).then((function(){return n.transformMatrix=r.IDENTITY_MATRIX,n.executeOpTree(n.convertOpList(t)),i}))}},{key:"convertOpList",value:function(t){for(var e=this._operatorIdMapping,n=t.argsArray,r=t.fnArray,i=[],o=0,a=r.length;o<a;o++){var s=r[o];i.push({fnId:s,fn:e[s],args:n[o]})}return x(i)}},{key:"executeOpTree",value:function(t){var e,n=f(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,o=i.fn,a=i.fnId,s=i.args;switch(0|a){case r.OPS.beginText:this.beginText();break;case r.OPS.dependency:break;case r.OPS.setLeading:this.setLeading(s);break;case r.OPS.setLeadingMoveText:this.setLeadingMoveText(s[0],s[1]);break;case r.OPS.setFont:this.setFont(s);break;case r.OPS.showText:this.showText(s[0]);break;case r.OPS.showSpacedText:this.showText(s[0]);break;case r.OPS.endText:this.endText();break;case r.OPS.moveText:this.moveText(s[0],s[1]);break;case r.OPS.setCharSpacing:this.setCharSpacing(s[0]);break;case r.OPS.setWordSpacing:this.setWordSpacing(s[0]);break;case r.OPS.setHScale:this.setHScale(s[0]);break;case r.OPS.setTextMatrix:this.setTextMatrix(s[0],s[1],s[2],s[3],s[4],s[5]);break;case r.OPS.setTextRise:this.setTextRise(s[0]);break;case r.OPS.setTextRenderingMode:this.setTextRenderingMode(s[0]);break;case r.OPS.setLineWidth:this.setLineWidth(s[0]);break;case r.OPS.setLineJoin:this.setLineJoin(s[0]);break;case r.OPS.setLineCap:this.setLineCap(s[0]);break;case r.OPS.setMiterLimit:this.setMiterLimit(s[0]);break;case r.OPS.setFillRGBColor:this.setFillRGBColor(s[0],s[1],s[2]);break;case r.OPS.setStrokeRGBColor:this.setStrokeRGBColor(s[0],s[1],s[2]);break;case r.OPS.setStrokeColorN:this.setStrokeColorN(s);break;case r.OPS.setFillColorN:this.setFillColorN(s);break;case r.OPS.shadingFill:this.shadingFill(s[0]);break;case r.OPS.setDash:this.setDash(s[0],s[1]);break;case r.OPS.setRenderingIntent:this.setRenderingIntent(s[0]);break;case r.OPS.setFlatness:this.setFlatness(s[0]);break;case r.OPS.setGState:this.setGState(s[0]);break;case r.OPS.fill:this.fill();break;case r.OPS.eoFill:this.eoFill();break;case r.OPS.stroke:this.stroke();break;case r.OPS.fillStroke:this.fillStroke();break;case r.OPS.eoFillStroke:this.eoFillStroke();break;case r.OPS.clip:this.clip("nonzero");break;case r.OPS.eoClip:this.clip("evenodd");break;case r.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case r.OPS.paintImageXObject:this.paintImageXObject(s[0]);break;case r.OPS.paintInlineImageXObject:this.paintInlineImageXObject(s[0]);break;case r.OPS.paintImageMaskXObject:this.paintImageMaskXObject(s[0]);break;case r.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(s[0],s[1]);break;case r.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case r.OPS.closePath:this.closePath();break;case r.OPS.closeStroke:this.closeStroke();break;case r.OPS.closeFillStroke:this.closeFillStroke();break;case r.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case r.OPS.nextLine:this.nextLine();break;case r.OPS.transform:this.transform(s[0],s[1],s[2],s[3],s[4],s[5]);break;case r.OPS.constructPath:this.constructPath(s[0],s[1]);break;case r.OPS.endPath:this.endPath();break;case 92:this.group(i.items);break;default:(0,r.warn)("Unimplemented operator ".concat(o));break}}}catch(l){n.e(l)}finally{n.f()}}},{key:"setWordSpacing",value:function(t){this.current.wordSpacing=t}},{key:"setCharSpacing",value:function(t){this.current.charSpacing=t}},{key:"nextLine",value:function(){this.moveText(0,this.current.leading)}},{key:"setTextMatrix",value:function(t,e,n,r,i,o){var a=this.current;a.textMatrix=a.lineMatrix=[t,e,n,r,i,o],a.textMatrixScale=Math.sqrt(t*t+e*e),a.x=a.lineX=0,a.y=a.lineY=0,a.xcoords=[],a.ycoords=[],a.tspan=this.svgFactory.createElement("svg:tspan"),a.tspan.setAttributeNS(null,"font-family",a.fontFamily),a.tspan.setAttributeNS(null,"font-size","".concat(C(a.fontSize),"px")),a.tspan.setAttributeNS(null,"y",C(-a.y)),a.txtElement=this.svgFactory.createElement("svg:text"),a.txtElement.appendChild(a.tspan)}},{key:"beginText",value:function(){var t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=r.IDENTITY_MATRIX,t.lineMatrix=r.IDENTITY_MATRIX,t.textMatrixScale=1,t.tspan=this.svgFactory.createElement("svg:tspan"),t.txtElement=this.svgFactory.createElement("svg:text"),t.txtgrp=this.svgFactory.createElement("svg:g"),t.xcoords=[],t.ycoords=[]}},{key:"moveText",value:function(t,e){var n=this.current;n.x=n.lineX+=t,n.y=n.lineY+=e,n.xcoords=[],n.ycoords=[],n.tspan=this.svgFactory.createElement("svg:tspan"),n.tspan.setAttributeNS(null,"font-family",n.fontFamily),n.tspan.setAttributeNS(null,"font-size","".concat(C(n.fontSize),"px")),n.tspan.setAttributeNS(null,"y",C(-n.y))}},{key:"showText",value:function(t){var e=this.current,n=e.font,i=e.fontSize;if(0!==i){var o,a=e.fontSizeScale,s=e.charSpacing,l=e.wordSpacing,c=e.fontDirection,u=e.textHScale*c,d=n.vertical,h=d?1:-1,p=n.defaultVMetrics,g=i*e.fontMatrix[0],m=0,v=f(t);try{for(v.s();!(o=v.n()).done;){var b=o.value;if(null!==b)if((0,r.isNum)(b))m+=h*b*i/1e3;else{var y=(b.isSpace?l:0)+s,w=b.fontChar,x=void 0,E=void 0,O=b.width;if(d){var T=void 0,_=b.vmetric||p;T=b.vmetric?_[1]:.5*O,T=-T*g;var M=_[2]*g;O=_?-_[0]:O,x=T/a,E=(m+M)/a}else x=m/a,E=0;(b.isInFont||n.missingFile)&&(e.xcoords.push(e.x+x),d&&e.ycoords.push(-e.y+E),e.tspan.textContent+=w);var N=void 0;N=d?O*g-y*c:O*g+y*c,m+=N}else m+=c*l}}catch(j){v.e(j)}finally{v.f()}e.tspan.setAttributeNS(null,"x",e.xcoords.map(C).join(" ")),d?e.tspan.setAttributeNS(null,"y",e.ycoords.map(C).join(" ")):e.tspan.setAttributeNS(null,"y",C(-e.y)),d?e.y-=m:e.x+=m*u,e.tspan.setAttributeNS(null,"font-family",e.fontFamily),e.tspan.setAttributeNS(null,"font-size","".concat(C(e.fontSize),"px")),e.fontStyle!==A.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle),e.fontWeight!==A.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);var P=e.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;if(P===r.TextRenderingMode.FILL||P===r.TextRenderingMode.FILL_STROKE?(e.fillColor!==A.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor),e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)):e.textRenderingMode===r.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none"),P===r.TextRenderingMode.STROKE||P===r.TextRenderingMode.FILL_STROKE){var L=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,L)}var D=e.textMatrix;0!==e.textRise&&(D=D.slice(),D[5]+=e.textRise),e.txtElement.setAttributeNS(null,"transform","".concat(k(D)," scale(").concat(C(u),", -1)")),e.txtElement.setAttributeNS(S,"xml:space","preserve"),e.txtElement.appendChild(e.tspan),e.txtgrp.appendChild(e.txtElement),this._ensureTransformGroup().appendChild(e.txtElement)}}},{key:"setLeadingMoveText",value:function(t,e){this.setLeading(-e),this.moveText(t,e)}},{key:"addFontStyle",value:function(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.appendChild(this.cssStyle));var e=(0,r.createObjectURL)(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(t.loadedName,'";')+" src: url(".concat(e,"); }\n")}},{key:"setFont",value:function(t){var e=this.current,n=this.commonObjs.get(t[0]),i=t[1];e.font=n,!this.embedFonts||n.missingFile||this.embeddedFonts[n.loadedName]||(this.addFontStyle(n),this.embeddedFonts[n.loadedName]=n),e.fontMatrix=n.fontMatrix?n.fontMatrix:r.FONT_IDENTITY_MATRIX;var o="normal";n.black?o="900":n.bold&&(o="bold");var a=n.italic?"italic":"normal";i<0?(i=-i,e.fontDirection=-1):e.fontDirection=1,e.fontSize=i,e.fontFamily=n.loadedName,e.fontWeight=o,e.fontStyle=a,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",C(-e.y)),e.xcoords=[],e.ycoords=[]}},{key:"endText",value:function(){var t=this.current;t.textRenderingMode&r.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement&&t.txtElement.hasChildNodes()&&(t.element=t.txtElement,this.clip("nonzero"),this.endPath())}},{key:"setLineWidth",value:function(t){t>0&&(this.current.lineWidth=t)}},{key:"setLineCap",value:function(t){this.current.lineCap=O[t]}},{key:"setLineJoin",value:function(t){this.current.lineJoin=T[t]}},{key:"setMiterLimit",value:function(t){this.current.miterLimit=t}},{key:"setStrokeAlpha",value:function(t){this.current.strokeAlpha=t}},{key:"setStrokeRGBColor",value:function(t,e,n){this.current.strokeColor=r.Util.makeCssRgb(t,e,n)}},{key:"setFillAlpha",value:function(t){this.current.fillAlpha=t}},{key:"setFillRGBColor",value:function(t,e,n){this.current.fillColor=r.Util.makeCssRgb(t,e,n),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}},{key:"setStrokeColorN",value:function(t){this.current.strokeColor=this._makeColorN_Pattern(t)}},{key:"setFillColorN",value:function(t){this.current.fillColor=this._makeColorN_Pattern(t)}},{key:"shadingFill",value:function(t){var e=this.viewport.width,n=this.viewport.height,i=r.Util.inverseTransform(this.transformMatrix),o=r.Util.applyTransform([0,0],i),a=r.Util.applyTransform([0,n],i),s=r.Util.applyTransform([e,0],i),l=r.Util.applyTransform([e,n],i),c=Math.min(o[0],a[0],s[0],l[0]),u=Math.min(o[1],a[1],s[1],l[1]),d=Math.max(o[0],a[0],s[0],l[0]),h=Math.max(o[1],a[1],s[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c),p.setAttributeNS(null,"y",u),p.setAttributeNS(null,"width",d-c),p.setAttributeNS(null,"height",h-u),p.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(p)}},{key:"_makeColorN_Pattern",value:function(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}},{key:"_makeTilingPattern",value:function(t){var e=t[1],n=t[2],i=t[3]||r.IDENTITY_MATRIX,o=u(t[4],4),s=o[0],l=o[1],c=o[2],d=o[3],h=t[5],p=t[6],f=t[7],g="shading".concat(L++),m=r.Util.applyTransform([s,l],i),v=u(m,2),b=v[0],y=v[1],w=r.Util.applyTransform([c,d],i),x=u(w,2),C=x[0],k=x[1],A=r.Util.singularValueDecompose2dScale(i),S=u(A,2),E=S[0],O=S[1],T=h*E,_=p*O,M=this.svgFactory.createElement("svg:pattern");M.setAttributeNS(null,"id",g),M.setAttributeNS(null,"patternUnits","userSpaceOnUse"),M.setAttributeNS(null,"width",T),M.setAttributeNS(null,"height",_),M.setAttributeNS(null,"x","".concat(b)),M.setAttributeNS(null,"y","".concat(y));var N=this.svg,P=this.transformMatrix,D=this.current.fillColor,j=this.current.strokeColor,I=this.svgFactory.create(C-b,k-y);if(this.svg=I,this.transformMatrix=i,2===f){var R=r.Util.makeCssRgb.apply(r.Util,a(e));this.current.fillColor=R,this.current.strokeColor=R}return this.executeOpTree(this.convertOpList(n)),this.svg=N,this.transformMatrix=P,this.current.fillColor=D,this.current.strokeColor=j,M.appendChild(I.childNodes[0]),this.defs.appendChild(M),"url(#".concat(g,")")}},{key:"_makeShadingPattern",value:function(t){switch(t[0]){case"RadialAxial":var e,n="shading".concat(L++),i=t[3];switch(t[1]){case"axial":var o=t[4],a=t[5];e=this.svgFactory.createElement("svg:linearGradient"),e.setAttributeNS(null,"id",n),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"x1",o[0]),e.setAttributeNS(null,"y1",o[1]),e.setAttributeNS(null,"x2",a[0]),e.setAttributeNS(null,"y2",a[1]);break;case"radial":var s=t[4],l=t[5],c=t[6],u=t[7];e=this.svgFactory.createElement("svg:radialGradient"),e.setAttributeNS(null,"id",n),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"cx",l[0]),e.setAttributeNS(null,"cy",l[1]),e.setAttributeNS(null,"r",u),e.setAttributeNS(null,"fx",s[0]),e.setAttributeNS(null,"fy",s[1]),e.setAttributeNS(null,"fr",c);break;default:throw new Error("Unknown RadialAxial type: ".concat(t[1]))}var d,h=f(i);try{for(h.s();!(d=h.n()).done;){var p=d.value,g=this.svgFactory.createElement("svg:stop");g.setAttributeNS(null,"offset",p[0]),g.setAttributeNS(null,"stop-color",p[1]),e.appendChild(g)}}catch(m){h.e(m)}finally{h.f()}return this.defs.appendChild(e),"url(#".concat(n,")");case"Mesh":return(0,r.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(t[0]))}}},{key:"setDash",value:function(t,e){this.current.dashArray=t,this.current.dashPhase=e}},{key:"constructPath",value:function(t,e){var n,i=this.current,o=i.x,a=i.y,s=[],l=0,c=f(t);try{for(c.s();!(n=c.n()).done;){var u=n.value;switch(0|u){case r.OPS.rectangle:o=e[l++],a=e[l++];var d=e[l++],h=e[l++],p=o+d,g=a+h;s.push("M",C(o),C(a),"L",C(p),C(a),"L",C(p),C(g),"L",C(o),C(g),"Z");break;case r.OPS.moveTo:o=e[l++],a=e[l++],s.push("M",C(o),C(a));break;case r.OPS.lineTo:o=e[l++],a=e[l++],s.push("L",C(o),C(a));break;case r.OPS.curveTo:o=e[l+4],a=e[l+5],s.push("C",C(e[l]),C(e[l+1]),C(e[l+2]),C(e[l+3]),C(o),C(a)),l+=6;break;case r.OPS.curveTo2:s.push("C",C(o),C(a),C(e[l]),C(e[l+1]),C(e[l+2]),C(e[l+3])),o=e[l+2],a=e[l+3],l+=4;break;case r.OPS.curveTo3:o=e[l+2],a=e[l+3],s.push("C",C(e[l]),C(e[l+1]),C(o),C(a),C(o),C(a)),l+=4;break;case r.OPS.closePath:s.push("Z");break}}}catch(m){c.e(m)}finally{c.f()}s=s.join(" "),i.path&&t.length>0&&t[0]!==r.OPS.rectangle&&t[0]!==r.OPS.moveTo?s=i.path.getAttributeNS(null,"d")+s:(i.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(i.path)),i.path.setAttributeNS(null,"d",s),i.path.setAttributeNS(null,"fill","none"),i.element=i.path,i.setCurrentPoint(o,a)}},{key:"endPath",value:function(){var t=this.current;if(t.path=null,this.pendingClip)if(t.element){var e="clippath".concat(N++),n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",e),n.setAttributeNS(null,"transform",k(this.transformMatrix));var r=t.element.cloneNode(!0);"evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.appendChild(r),this.defs.appendChild(n),t.activeClipUrl&&(t.clipGroup=null,this.extraStack.forEach((function(t){t.clipGroup=null})),n.setAttributeNS(null,"clip-path",t.activeClipUrl)),t.activeClipUrl="url(#".concat(e,")"),this.tgrp=null}else this.pendingClip=null}},{key:"clip",value:function(t){this.pendingClip=t}},{key:"closePath",value:function(){var t=this.current;if(t.path){var e="".concat(t.path.getAttributeNS(null,"d"),"Z");t.path.setAttributeNS(null,"d",e)}}},{key:"setLeading",value:function(t){this.current.leading=-t}},{key:"setTextRise",value:function(t){this.current.textRise=t}},{key:"setTextRenderingMode",value:function(t){this.current.textRenderingMode=t}},{key:"setHScale",value:function(t){this.current.textHScale=t/100}},{key:"setRenderingIntent",value:function(t){}},{key:"setFlatness",value:function(t){}},{key:"setGState",value:function(t){var e,n=f(t);try{for(n.s();!(e=n.n()).done;){var i=u(e.value,2),o=i[0],a=i[1];switch(o){case"LW":this.setLineWidth(a);break;case"LC":this.setLineCap(a);break;case"LJ":this.setLineJoin(a);break;case"ML":this.setMiterLimit(a);break;case"D":this.setDash(a[0],a[1]);break;case"RI":this.setRenderingIntent(a);break;case"FL":this.setFlatness(a);break;case"Font":this.setFont(a);break;case"CA":this.setStrokeAlpha(a);break;case"ca":this.setFillAlpha(a);break;default:(0,r.warn)("Unimplemented graphic state operator ".concat(o));break}}}catch(s){n.e(s)}finally{n.f()}}},{key:"fill",value:function(){var t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}},{key:"stroke",value:function(){var t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}},{key:"_setStrokeAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.current,r=n.dashArray;1!==e&&r.length>0&&(r=r.map((function(t){return e*t}))),t.setAttributeNS(null,"stroke",n.strokeColor),t.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",C(n.miterLimit)),t.setAttributeNS(null,"stroke-linecap",n.lineCap),t.setAttributeNS(null,"stroke-linejoin",n.lineJoin),t.setAttributeNS(null,"stroke-width",C(e*n.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",r.map(C).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",C(e*n.dashPhase)+"px")}},{key:"eoFill",value:function(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}},{key:"fillStroke",value:function(){this.stroke(),this.fill()}},{key:"eoFillStroke",value:function(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}},{key:"closeStroke",value:function(){this.closePath(),this.stroke()}},{key:"closeFillStroke",value:function(){this.closePath(),this.fillStroke()}},{key:"closeEOFillStroke",value:function(){this.closePath(),this.eoFillStroke()}},{key:"paintSolidColorImageMask",value:function(){var t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0"),t.setAttributeNS(null,"y","0"),t.setAttributeNS(null,"width","1px"),t.setAttributeNS(null,"height","1px"),t.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(t)}},{key:"paintImageXObject",value:function(t){var e=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);e?this.paintInlineImageXObject(e):(0,r.warn)("Dependent image with object ID ".concat(t," is not ready yet"))}},{key:"paintInlineImageXObject",value:function(t,e){var n=t.width,r=t.height,i=_(t,this.forceDataSchema,!!e),o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",C(n)),o.setAttributeNS(null,"height",C(r)),this.current.element=o,this.clip("nonzero");var a=this.svgFactory.createElement("svg:image");a.setAttributeNS(E,"xlink:href",i),a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y",C(-r)),a.setAttributeNS(null,"width",C(n)+"px"),a.setAttributeNS(null,"height",C(r)+"px"),a.setAttributeNS(null,"transform","scale(".concat(C(1/n)," ").concat(C(-1/r),")")),e?e.appendChild(a):this._ensureTransformGroup().appendChild(a)}},{key:"paintImageMaskXObject",value:function(t){var e=this.current,n=t.width,r=t.height,i=e.fillColor;e.maskId="mask".concat(P++);var o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",e.maskId);var a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",C(n)),a.setAttributeNS(null,"height",C(r)),a.setAttributeNS(null,"fill",i),a.setAttributeNS(null,"mask","url(#".concat(e.maskId,")")),this.defs.appendChild(o),this._ensureTransformGroup().appendChild(a),this.paintInlineImageXObject(t,o)}},{key:"paintFormXObjectBegin",value:function(t,e){if(Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e){var n=e[2]-e[0],r=e[3]-e[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",e[0]),i.setAttributeNS(null,"y",e[1]),i.setAttributeNS(null,"width",C(n)),i.setAttributeNS(null,"height",C(r)),this.current.element=i,this.clip("nonzero"),this.endPath()}}},{key:"paintFormXObjectEnd",value:function(){}},{key:"_initialize",value:function(t){var e=this.svgFactory.create(t.width,t.height),n=this.svgFactory.createElement("svg:defs");e.appendChild(n),this.defs=n;var r=this.svgFactory.createElement("svg:g");return r.setAttributeNS(null,"transform",k(t.transform)),e.appendChild(r),this.svg=r,e}},{key:"_ensureClipGroup",value:function(){if(!this.current.clipGroup){var t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(t),this.current.clipGroup=t}return this.current.clipGroup}},{key:"_ensureTransformGroup",value:function(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",k(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var r=a(n(2)),i=n(5),o=n(220);function a(t){return t&&t.__esModule?t:{default:t}}function s(t){return s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function l(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function u(t){var e=p();return function(){var n,r=f(t);if(e){var i=f(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function d(t,e){return!e||"object"!==s(e)&&"function"!==typeof e?h(t):e}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function g(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function m(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){g(o,r,i,a,s,"next",t)}function s(t){g(o,r,i,a,s,"throw",t)}a(void 0)}))}}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function y(t,e,n){return e&&b(t.prototype,e),n&&b(t,n),t}var w=__webpack_require__(1),x=__webpack_require__(4),C=__webpack_require__(5),k=__webpack_require__(6),A=/^file:\/\/\/[a-zA-Z]:\//;function S(t){var e=k.parse(t);return"file:"===e.protocol||e.host?e:/^[a-z]:[/\\]/i.test(t)?k.parse("file:///".concat(t)):(e.host||(e.protocol="file:"),e)}var E=function(){function t(e){v(this,t),this.source=e,this.url=S(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}return y(t,[{key:"getFullReader",value:function(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new P(this):new M(this),this._fullRequestReader}},{key:"getRangeReader",value:function(t,e){if(e<=this._progressiveDataLength)return null;var n=this.isFsUrl?new L(this,t,e):new N(this,t,e);return this._rangeRequestReaders.push(n),n}},{key:"cancelAllRequests",value:function(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);var e=this._rangeRequestReaders.slice(0);e.forEach((function(e){e.cancel(t)}))}},{key:"_progressiveDataLength",get:function(){return this._fullRequestReader?this._fullRequestReader._loaded:0}}]),t}();e.PDFNodeStream=E;var O=function(){function t(e){v(this,t),this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;var n=e.source;this._contentLength=n.length,this._loaded=0,this._filename=null,this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)(),this._headersCapability=(0,i.createPromiseCapability)()}return y(t,[{key:"read",value:function(){var t=m(r["default"].mark((function t(){var e,n;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this._readCapability.promise;case 2:if(!this._done){t.next=4;break}return t.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){t.next=6;break}throw this._storedError;case 6:if(e=this._readableStream.read(),null!==e){t.next=10;break}return this._readCapability=(0,i.createPromiseCapability)(),t.abrupt("return",this.read());case 10:return this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),n=new Uint8Array(e).buffer,t.abrupt("return",{value:n,done:!1});case 14:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"cancel",value:function(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function(t){this._storedError=t,this._readCapability.resolve()}},{key:"_setReadableStream",value:function(t){var e=this;this._readableStream=t,t.on("readable",(function(){e._readCapability.resolve()})),t.on("end",(function(){t.destroy(),e._done=!0,e._readCapability.resolve()})),t.on("error",(function(t){e._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}},{key:"headersReady",get:function(){return this._headersCapability.promise}},{key:"filename",get:function(){return this._filename}},{key:"contentLength",get:function(){return this._contentLength}},{key:"isRangeSupported",get:function(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}}]),t}(),T=function(){function t(e){v(this,t),this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)();var n=e.source;this._isStreamingSupported=!n.disableStream}return y(t,[{key:"read",value:function(){var t=m(r["default"].mark((function t(){var e,n;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this._readCapability.promise;case 2:if(!this._done){t.next=4;break}return t.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){t.next=6;break}throw this._storedError;case 6:if(e=this._readableStream.read(),null!==e){t.next=10;break}return this._readCapability=(0,i.createPromiseCapability)(),t.abrupt("return",this.read());case 10:return this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded}),n=new Uint8Array(e).buffer,t.abrupt("return",{value:n,done:!1});case 14:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"cancel",value:function(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function(t){this._storedError=t,this._readCapability.resolve()}},{key:"_setReadableStream",value:function(t){var e=this;this._readableStream=t,t.on("readable",(function(){e._readCapability.resolve()})),t.on("end",(function(){t.destroy(),e._done=!0,e._readCapability.resolve()})),t.on("error",(function(t){e._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}}]),t}();function _(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}var M=function(t){l(n,t);var e=u(n);function n(t){var r;v(this,n),r=e.call(this,t);var a=function(e){if(404===e.statusCode){var n=new i.MissingPDFException('Missing PDF "'.concat(r._url,'".'));return r._storedError=n,void r._headersCapability.reject(n)}r._headersCapability.resolve(),r._setReadableStream(e);var a=function(t){return r._readableStream.headers[t.toLowerCase()]},s=(0,o.validateRangeRequestCapabilities)({getResponseHeader:a,isHttp:t.isHttp,rangeChunkSize:r._rangeChunkSize,disableRange:r._disableRange}),l=s.allowRangeRequests,c=s.suggestedLength;r._isRangeSupported=l,r._contentLength=c||r._contentLength,r._filename=(0,o.extractFilenameFromHeader)(a)};return r._request=null,"http:"===r._url.protocol?r._request=x.request(_(r._url,t.httpHeaders),a):r._request=C.request(_(r._url,t.httpHeaders),a),r._request.on("error",(function(t){r._storedError=t,r._headersCapability.reject(t)})),r._request.end(),r}return n}(O),N=function(t){l(n,t);var e=u(n);function n(t,r,o){var a;for(var s in v(this,n),a=e.call(this,t),a._httpHeaders={},t.httpHeaders){var l=t.httpHeaders[s];"undefined"!==typeof l&&(a._httpHeaders[s]=l)}a._httpHeaders.Range="bytes=".concat(r,"-").concat(o-1);var c=function(t){if(404!==t.statusCode)a._setReadableStream(t);else{var e=new i.MissingPDFException('Missing PDF "'.concat(a._url,'".'));a._storedError=e}};return a._request=null,"http:"===a._url.protocol?a._request=x.request(_(a._url,a._httpHeaders),c):a._request=C.request(_(a._url,a._httpHeaders),c),a._request.on("error",(function(t){a._storedError=t})),a._request.end(),a}return n}(T),P=function(t){l(n,t);var e=u(n);function n(t){var r;v(this,n),r=e.call(this,t);var o=decodeURIComponent(r._url.path);return A.test(r._url.href)&&(o=o.replace(/^\//,"")),w.lstat(o,(function(t,e){if(t)return"ENOENT"===t.code&&(t=new i.MissingPDFException('Missing PDF "'.concat(o,'".'))),r._storedError=t,void r._headersCapability.reject(t);r._contentLength=e.size,r._setReadableStream(w.createReadStream(o)),r._headersCapability.resolve()})),r}return n}(O),L=function(t){l(n,t);var e=u(n);function n(t,r,i){var o;v(this,n),o=e.call(this,t);var a=decodeURIComponent(o._url.path);return A.test(o._url.href)&&(a=a.replace(/^\//,"")),o._setReadableStream(w.createReadStream(a,{start:r,end:i-1})),o}return n}(T)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=s,e.extractFilenameFromHeader=a,e.validateRangeRequestCapabilities=o,e.validateResponseStatus=l;var r=n(5),i=n(221);function o(t){var e=t.getResponseHeader,n=t.isHttp,i=t.rangeChunkSize,o=t.disableRange;(0,r.assert)(i>0,"Range chunk size must be larger than zero");var a={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(e("Content-Length"),10);if(!Number.isInteger(s))return a;if(a.suggestedLength=s,s<=2*i)return a;if(o||!n)return a;if("bytes"!==e("Accept-Ranges"))return a;var l=e("Content-Encoding")||"identity";return"identity"!==l||(a.allowRangeRequests=!0),a}function a(t){var e=t("Content-Disposition");if(e){var n=(0,i.getFilenameFromContentDispositionHeader)(e);if(n.includes("%"))try{n=decodeURIComponent(n)}catch(r){}if(/\.pdf$/i.test(n))return n}return null}function s(t,e){return 404===t||0===t&&e.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+e+'".'):new r.UnexpectedResponseException("Unexpected server response ("+t+') while retrieving PDF "'+e+'".',t)}function l(t){return 200===t||206===t}},function(t,e,n){"use strict";function r(t,e){return l(t)||s(t,e)||o(t,e)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,e){if(t){if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(l){i=!0,o=l}finally{try{r||null==s["return"]||s["return"]()}finally{if(i)throw o}}return n}}function l(t){if(Array.isArray(t))return t}function c(t){var e=!0,n=s("filename\\*","i").exec(t);if(n){n=n[1];var i=d(n);return i=unescape(i),i=h(i),i=p(i),c(i)}if(n=u(t),n){var o=p(n);return c(o)}if(n=s("filename","i").exec(t),n){n=n[1];var a=d(n);return a=p(a),c(a)}function s(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function l(t,n){if(t){if(!/^[\x00-\xFF]+$/.test(n))return n;try{var r=new TextDecoder(t,{fatal:!0}),i=Array.from(n,(function(t){return 255&t.charCodeAt(0)}));n=r.decode(new Uint8Array(i)),e=!1}catch(o){if(/^utf-?8$/i.test(t))try{n=decodeURIComponent(escape(n)),e=!1}catch(a){}}}return n}function c(t){return e&&/[\x80-\xff]/.test(t)&&(t=l("utf-8",t),e&&(t=l("iso-8859-1",t))),t}function u(t){var e,n=[],i=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");while(null!==(e=i.exec(t))){var o=e,a=r(o,4),l=a[1],c=a[2],u=a[3];if(l=parseInt(l,10),l in n){if(0===l)break}else n[l]=[c,u]}for(var p=[],f=0;f<n.length;++f){if(!(f in n))break;var g=r(n[f],2),m=g[0],v=g[1];v=d(v),m&&(v=unescape(v),0===f&&(v=h(v))),p.push(v)}return p.join("")}function d(t){if(t.startsWith('"')){for(var e=t.slice(1).split('\\"'),n=0;n<e.length;++n){var r=e[n].indexOf('"');-1!==r&&(e[n]=e[n].slice(0,r),e.length=n+1),e[n]=e[n].replace(/\\(.)/g,"$1")}t=e.join('"')}return t}function h(t){var e=t.indexOf("'");if(-1===e)return t;var n=t.slice(0,e),r=t.slice(e+1),i=r.replace(/^[^']*'/,"");return l(n,i)}function p(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,n,r){if("q"===n||"Q"===n)return r=r.replace(/_/g," "),r=r.replace(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})),l(e,r);try{r=atob(r)}catch(i){}return l(e,r)}))}return""}Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var r=a(n(2)),i=n(5),o=n(220);function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){s(o,r,i,a,l,"next",t)}function l(t){s(o,r,i,a,l,"throw",t)}a(void 0)}))}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),t}var h=200,p=206;function f(t){var e=t.response;if("string"!==typeof e)return e;var n=(0,i.stringToBytes)(e);return n.buffer}var g=function(){function t(e,n){c(this,t),this.url=e,n=n||{},this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&n.httpHeaders||{},this.withCredentials=n.withCredentials||!1,this.getXhr=n.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}return d(t,[{key:"requestRange",value:function(t,e,n){var r={begin:t,end:e};for(var i in n)r[i]=n[i];return this.request(r)}},{key:"requestFull",value:function(t){return this.request(t)}},{key:"request",value:function(t){var e=this.getXhr(),n=this.currXhrId++,r=this.pendingRequests[n]={xhr:e};for(var i in e.open("GET",this.url),e.withCredentials=this.withCredentials,this.httpHeaders){var o=this.httpHeaders[i];"undefined"!==typeof o&&e.setRequestHeader(i,o)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),r.expectedStatus=p):r.expectedStatus=h,e.responseType="arraybuffer",t.onError&&(e.onerror=function(n){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,n),e.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=t.onHeadersReceived,r.onDone=t.onDone,r.onError=t.onError,r.onProgress=t.onProgress,e.send(null),n}},{key:"onProgress",value:function(t,e){var n=this.pendingRequests[t];n&&n.onProgress&&n.onProgress(e)}},{key:"onStateChange",value:function(t,e){var n=this.pendingRequests[t];if(n){var r=n.xhr;if(r.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4===r.readyState&&t in this.pendingRequests)if(delete this.pendingRequests[t],0===r.status&&this.isHttp)n.onError&&n.onError(r.status);else{var i=r.status||h,o=i===h&&n.expectedStatus===p;if(o||i===n.expectedStatus){var a=f(r);if(i===p){var s=r.getResponseHeader("Content-Range"),l=/bytes (\d+)-(\d+)\/(\d+)/.exec(s);n.onDone({begin:parseInt(l[1],10),chunk:a})}else a?n.onDone({begin:0,chunk:a}):n.onError&&n.onError(r.status)}else n.onError&&n.onError(r.status)}}}},{key:"getRequestXhr",value:function(t){return this.pendingRequests[t].xhr}},{key:"isPendingRequest",value:function(t){return t in this.pendingRequests}},{key:"abortRequest",value:function(t){var e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}]),t}(),m=function(){function t(e){c(this,t),this._source=e,this._manager=new g(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}return d(t,[{key:"_onRangeRequestReaderClosed",value:function(t){var e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}},{key:"getFullReader",value:function(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new v(this._manager,this._source),this._fullRequestReader}},{key:"getRangeReader",value:function(t,e){var n=new b(this._manager,t,e);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}},{key:"cancelAllRequests",value:function(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);var e=this._rangeRequestReaders.slice(0);e.forEach((function(e){e.cancel(t)}))}}]),t}();e.PDFNetworkStream=m;var v=function(){function t(e,n){c(this,t),this._manager=e;var r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=n.url,this._fullRequestId=e.requestFull(r),this._headersReceivedCapability=(0,i.createPromiseCapability)(),this._disableRange=n.disableRange||!1,this._contentLength=n.length,this._rangeChunkSize=n.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}return d(t,[{key:"_onHeadersReceived",value:function(){var t=this._fullRequestId,e=this._manager.getRequestXhr(t),n=function(t){return e.getResponseHeader(t)},r=(0,o.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),i=r.allowRangeRequests,a=r.suggestedLength;i&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=(0,o.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}},{key:"_onDone",value:function(t){if(t)if(this._requests.length>0){var e=this._requests.shift();e.resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0,this._cachedChunks.length>0||(this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})})),this._requests=[])}},{key:"_onError",value:function(t){var e=this._url,n=(0,o.createResponseStatusError)(t,e);this._storedError=n,this._headersReceivedCapability.reject(n),this._requests.forEach((function(t){t.reject(n)})),this._requests=[],this._cachedChunks=[]}},{key:"_onProgress",value:function(t){this.onProgress&&this.onProgress({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}},{key:"read",value:function(){var t=l(r["default"].mark((function t(){var e,n;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!this._storedError){t.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){t.next=5;break}return e=this._cachedChunks.shift(),t.abrupt("return",{value:e,done:!1});case 5:if(!this._done){t.next=7;break}return t.abrupt("return",{value:void 0,done:!0});case 7:return n=(0,i.createPromiseCapability)(),this._requests.push(n),t.abrupt("return",n.promise);case 10:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"cancel",value:function(t){this._done=!0,this._headersReceivedCapability.reject(t),this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})})),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},{key:"filename",get:function(){return this._filename}},{key:"isRangeSupported",get:function(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}},{key:"contentLength",get:function(){return this._contentLength}},{key:"headersReady",get:function(){return this._headersReceivedCapability.promise}}]),t}(),b=function(){function t(e,n,r){c(this,t),this._manager=e;var i={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=e.requestRange(n,r,i),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}return d(t,[{key:"_close",value:function(){this.onClosed&&this.onClosed(this)}},{key:"_onDone",value:function(t){var e=t.chunk;if(this._requests.length>0){var n=this._requests.shift();n.resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0,this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})})),this._requests=[],this._close()}},{key:"_onProgress",value:function(t){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:t.loaded})}},{key:"read",value:function(){var t=l(r["default"].mark((function t(){var e,n;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(null===this._queuedChunk){t.next=4;break}return e=this._queuedChunk,this._queuedChunk=null,t.abrupt("return",{value:e,done:!1});case 4:if(!this._done){t.next=6;break}return t.abrupt("return",{value:void 0,done:!0});case 6:return n=(0,i.createPromiseCapability)(),this._requests.push(n),t.abrupt("return",n.promise);case 9:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"cancel",value:function(t){this._done=!0,this._requests.forEach((function(t){t.resolve({value:void 0,done:!0})})),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},{key:"isStreamingSupported",get:function(){return!1}}]),t}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var r=a(n(2)),i=n(5),o=n(220);function a(t){return t&&t.__esModule?t:{default:t}}function s(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){s(o,r,i,a,l,"next",t)}function l(t){s(o,r,i,a,l,"throw",t)}a(void 0)}))}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),t}function h(t,e,n){return{method:"GET",headers:t,signal:n&&n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function p(t){var e=new Headers;for(var n in t){var r=t[n];"undefined"!==typeof r&&e.append(n,r)}return e}var f=function(){function t(e){c(this,t),this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}return d(t,[{key:"getFullReader",value:function(){return(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new g(this),this._fullRequestReader}},{key:"getRangeReader",value:function(t,e){if(e<=this._progressiveDataLength)return null;var n=new m(this,t,e);return this._rangeRequestReaders.push(n),n}},{key:"cancelAllRequests",value:function(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);var e=this._rangeRequestReaders.slice(0);e.forEach((function(e){e.cancel(t)}))}},{key:"_progressiveDataLength",get:function(){return this._fullRequestReader?this._fullRequestReader._loaded:0}}]),t}();e.PDFFetchStream=f;var g=function(){function t(e){var n=this;c(this,t),this._stream=e,this._reader=null,this._loaded=0,this._filename=null;var r=e.source;this._withCredentials=r.withCredentials||!1,this._contentLength=r.length,this._headersCapability=(0,i.createPromiseCapability)(),this._disableRange=r.disableRange||!1,this._rangeChunkSize=r.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),"undefined"!==typeof AbortController&&(this._abortController=new AbortController),this._isStreamingSupported=!r.disableStream,this._isRangeSupported=!r.disableRange,this._headers=p(this._stream.httpHeaders);var a=r.url;fetch(a,h(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!(0,o.validateResponseStatus)(t.status))throw(0,o.createResponseStatusError)(t.status,a);n._reader=t.body.getReader(),n._headersCapability.resolve();var e=function(e){return t.headers.get(e)},r=(0,o.validateRangeRequestCapabilities)({getResponseHeader:e,isHttp:n._stream.isHttp,rangeChunkSize:n._rangeChunkSize,disableRange:n._disableRange}),s=r.allowRangeRequests,l=r.suggestedLength;n._isRangeSupported=s,n._contentLength=l||n._contentLength,n._filename=(0,o.extractFilenameFromHeader)(e),!n._isStreamingSupported&&n._isRangeSupported&&n.cancel(new i.AbortException("Streaming is disabled."))}))["catch"](this._headersCapability.reject),this.onProgress=null}return d(t,[{key:"read",value:function(){var t=l(r["default"].mark((function t(){var e,n,i,o;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this._headersCapability.promise;case 2:return t.next=4,this._reader.read();case 4:if(e=t.sent,n=e.value,i=e.done,!i){t.next=9;break}return t.abrupt("return",{value:n,done:i});case 9:return this._loaded+=n.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),o=new Uint8Array(n).buffer,t.abrupt("return",{value:o,done:!1});case 13:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"cancel",value:function(t){this._reader&&this._reader.cancel(t),this._abortController&&this._abortController.abort()}},{key:"headersReady",get:function(){return this._headersCapability.promise}},{key:"filename",get:function(){return this._filename}},{key:"contentLength",get:function(){return this._contentLength}},{key:"isRangeSupported",get:function(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}}]),t}(),m=function(){function t(e,n,r){var a=this;c(this,t),this._stream=e,this._reader=null,this._loaded=0;var s=e.source;this._withCredentials=s.withCredentials||!1,this._readCapability=(0,i.createPromiseCapability)(),this._isStreamingSupported=!s.disableStream,"undefined"!==typeof AbortController&&(this._abortController=new AbortController),this._headers=p(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(n,"-").concat(r-1));var l=s.url;fetch(l,h(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!(0,o.validateResponseStatus)(t.status))throw(0,o.createResponseStatusError)(t.status,l);a._readCapability.resolve(),a._reader=t.body.getReader()}))["catch"]((function(t){if(!t||"AbortError"!==t.name)throw t})),this.onProgress=null}return d(t,[{key:"read",value:function(){var t=l(r["default"].mark((function t(){var e,n,i,o;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this._readCapability.promise;case 2:return t.next=4,this._reader.read();case 4:if(e=t.sent,n=e.value,i=e.done,!i){t.next=9;break}return t.abrupt("return",{value:n,done:i});case 9:return this._loaded+=n.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),o=new Uint8Array(n).buffer,t.abrupt("return",{value:o,done:!1});case 13:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"cancel",value:function(t){this._reader&&this._reader.cancel(t),this._abortController&&this._abortController.abort()}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}}]),t}()}])}))}).call(this,__webpack_require__("b639").Buffer,__webpack_require__("4362"),__webpack_require__("c8ba"))},"43e0":function(t,e,n){"use strict";t.exports=function(t){var e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}},"459e":function(t,e,n){"use strict";n("4e4c")},"45eb":function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n("d3b7"),n("f8c9"),n("5d41"),n("e439");var r=n("7e84");function i(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=Object(r["a"])(t),null===t)break;return t}function o(){return o="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=i(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},o.apply(this,arguments)}},"466d":function(t,e,n){"use strict";var r=n("c65b"),i=n("d784"),o=n("825a"),a=n("7234"),s=n("50c4"),l=n("577e"),c=n("1d80"),u=n("dc4a"),d=n("8aa5"),h=n("14c3");i("match",(function(t,e,n){return[function(e){var n=c(this),i=a(e)?void 0:u(e,t);return i?r(i,e,n):new RegExp(e)[t](l(n))},function(t){var r=o(this),i=l(t),a=n(e,r,i);if(a.done)return a.value;if(!r.global)return h(r,i);var c=r.unicode;r.lastIndex=0;var u,p=[],f=0;while(null!==(u=h(r,i))){var g=l(u[0]);p[f]=g,""===g&&(r.lastIndex=d(i,s(r.lastIndex),c)),f++}return 0===f?null:p}]}))},"479d":function(t,e,n){"use strict";var r=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,i=/\((c|tm|r)\)/i,o=/\((c|tm|r)\)/gi,a={c:"©",r:"®",tm:"™"};function s(t,e){return a[e.toLowerCase()]}function l(t){var e,n,r=0;for(e=t.length-1;e>=0;e--)n=t[e],"text"!==n.type||r||(n.content=n.content.replace(o,s)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function c(t){var e,n,i=0;for(e=t.length-1;e>=0;e--)n=t[e],"text"!==n.type||i||r.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1")),"link_open"===n.type&&"auto"===n.info&&i--,"link_close"===n.type&&"auto"===n.info&&i++}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(i.test(t.tokens[e].content)&&l(t.tokens[e].children),r.test(t.tokens[e].content)&&c(t.tokens[e].children))}},4895:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";function e(e,r,o,a){if(o&&o.call){var s=o;o=null}else s=i(e,o,"rangeFinder");"number"==typeof r&&(r=t.Pos(r,0));var l=i(e,o,"minFoldSize");function c(t){var n=s(e,r);if(!n||n.to.line-n.from.line<l)return null;if("fold"===a)return n;for(var i=e.findMarksAt(n.from),o=0;o<i.length;++o)if(i[o].__isFold){if(!t)return null;n.cleared=!0,i[o].clear()}return n}var u=c(!0);if(i(e,o,"scanUp"))while(!u&&r.line>e.firstLine())r=t.Pos(r.line-1,0),u=c(!1);if(u&&!u.cleared&&"unfold"!==a){var d=n(e,o,u);t.on(d,"mousedown",(function(e){h.clear(),t.e_preventDefault(e)}));var h=e.markText(u.from,u.to,{replacedWith:d,clearOnEnter:i(e,o,"clearOnEnter"),__isFold:!0});h.on("clear",(function(n,r){t.signal(e,"unfold",e,n,r)})),t.signal(e,"fold",e,u.from,u.to)}}function n(t,e,n){var r=i(t,e,"widget");if("function"==typeof r&&(r=r(n.from,n.to)),"string"==typeof r){var o=document.createTextNode(r);r=document.createElement("span"),r.appendChild(o),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}t.newFoldFunction=function(t,n){return function(r,i){e(r,i,{rangeFinder:t,widget:n})}},t.defineExtension("foldCode",(function(t,n,r){e(this,t,n,r)})),t.defineExtension("isFolded",(function(t){for(var e=this.findMarksAt(t),n=0;n<e.length;++n)if(e[n].__isFold)return!0})),t.commands.toggleFold=function(t){t.foldCode(t.getCursor())},t.commands.fold=function(t){t.foldCode(t.getCursor(),null,"fold")},t.commands.unfold=function(t){t.foldCode(t.getCursor(),{scanUp:!1},"unfold")},t.commands.foldAll=function(e){e.operation((function(){for(var n=e.firstLine(),r=e.lastLine();n<=r;n++)e.foldCode(t.Pos(n,0),{scanUp:!1},"fold")}))},t.commands.unfoldAll=function(e){e.operation((function(){for(var n=e.firstLine(),r=e.lastLine();n<=r;n++)e.foldCode(t.Pos(n,0),{scanUp:!1},"unfold")}))},t.registerHelper("fold","combine",(function(){var t=Array.prototype.slice.call(arguments,0);return function(e,n){for(var r=0;r<t.length;++r){var i=t[r](e,n);if(i)return i}}})),t.registerHelper("fold","auto",(function(t,e){for(var n=t.getHelpers(e,"fold"),r=0;r<n.length;r++){var i=n[r](t,e);if(i)return i}}));var r={rangeFinder:t.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function i(t,e,n){if(e&&void 0!==e[n])return e[n];var i=t.options.foldOptions;return i&&void 0!==i[n]?i[n]:r[n]}t.defineOption("foldOptions",null),t.defineExtension("foldOption",(function(t,e){return i(this,t,e)}))}))},"489c":function(t,e,n){"use strict";var r=/^([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])?)*)$/,i=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;t.exports=function(t,e){var n,o,a,s,l,c,u=t.pos;if(60!==t.src.charCodeAt(u))return!1;for(l=t.pos,c=t.posMax;;){if(++u>=c)return!1;if(s=t.src.charCodeAt(u),60===s)return!1;if(62===s)break}return n=t.src.slice(l+1,u),i.test(n)?(o=t.md.normalizeLink(n),!!t.md.validateLink(o)&&(e||(a=t.push("link_open","a",1),a.attrs=[["href",o]],a.markup="autolink",a.info="auto",a=t.push("text","",0),a.content=t.md.normalizeLinkText(n),a=t.push("link_close","a",-1),a.markup="autolink",a.info="auto"),t.pos+=n.length+2,!0)):!!r.test(n)&&(o=t.md.normalizeLink("mailto:"+n),!!t.md.validateLink(o)&&(e||(a=t.push("link_open","a",1),a.attrs=[["href",o]],a.markup="autolink",a.info="auto",a=t.push("text","",0),a.content=t.md.normalizeLinkText(n),a=t.push("link_close","a",-1),a.markup="autolink",a.info="auto"),t.pos+=n.length+2,!0))}},"4ae1":function(t,e,n){var r=n("23e7"),i=n("d066"),o=n("2ba4"),a=n("0538"),s=n("5087"),l=n("825a"),c=n("861d"),u=n("7c73"),d=n("d039"),h=i("Reflect","construct"),p=Object.prototype,f=[].push,g=d((function(){function t(){}return!(h((function(){}),[],t)instanceof t)})),m=!d((function(){h((function(){}))})),v=g||m;r({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,e){s(t),l(e);var n=arguments.length<3?t:s(arguments[2]);if(m&&!g)return h(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return o(f,r,e),new(o(a,t,r))}var i=n.prototype,d=u(c(i)?i:p),v=o(t,d,e);return c(v)?v:d}})},"4b11":function(t,e){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},"4ba6":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";function e(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.info=r,this.align=i,this.prev=o}function n(t,n,r,i){var o=t.indented;return t.context&&"statement"==t.context.type&&"statement"!=r&&(o=t.context.indented),t.context=new e(o,n,r,i,null,t.context)}function r(t){var e=t.context.type;return")"!=e&&"]"!=e&&"}"!=e||(t.indented=t.context.indented),t.context=t.context.prev}function i(t,e,n){return"variable"==e.prevToken||"type"==e.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(t.string.slice(0,n))||(!(!e.typeAtEndOfLine||t.column()!=t.indentation())||void 0))}function o(t){for(;;){if(!t||"top"==t.type)return!0;if("}"==t.type&&"namespace"!=t.prev.info)return!1;t=t.prev}}function a(t){for(var e={},n=t.split(" "),r=0;r<n.length;++r)e[n[r]]=!0;return e}function s(t,e){return"function"===typeof t?t(e):t.propertyIsEnumerable(e)}t.defineMode("clike",(function(a,l){var c,u,d=a.indentUnit,h=l.statementIndentUnit||d,p=l.dontAlignCalls,f=l.keywords||{},g=l.types||{},m=l.builtin||{},v=l.blockKeywords||{},b=l.defKeywords||{},y=l.atoms||{},w=l.hooks||{},x=l.multiLineStrings,C=!1!==l.indentStatements,k=!1!==l.indentSwitch,A=l.namespaceSeparator,S=l.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,E=l.numberStart||/[\d\.]/,O=l.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,T=l.isOperatorChar||/[+\-*&%=<>!?|\/]/,_=l.isIdentifierChar||/[\w\$_\xa1-\uffff]/,M=l.isReservedIdentifier||!1;function N(t,e){var n=t.next();if(w[n]){var r=w[n](t,e);if(!1!==r)return r}if('"'==n||"'"==n)return e.tokenize=P(n),e.tokenize(t,e);if(E.test(n)){if(t.backUp(1),t.match(O))return"number";t.next()}if(S.test(n))return c=n,null;if("/"==n){if(t.eat("*"))return e.tokenize=L,L(t,e);if(t.eat("/"))return t.skipToEnd(),"comment"}if(T.test(n)){while(!t.match(/^\/[\/*]/,!1)&&t.eat(T));return"operator"}if(t.eatWhile(_),A)while(t.match(A))t.eatWhile(_);var i=t.current();return s(f,i)?(s(v,i)&&(c="newstatement"),s(b,i)&&(u=!0),"keyword"):s(g,i)?"type":s(m,i)||M&&M(i)?(s(v,i)&&(c="newstatement"),"builtin"):s(y,i)?"atom":"variable"}function P(t){return function(e,n){var r,i=!1,o=!1;while(null!=(r=e.next())){if(r==t&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!x)&&(n.tokenize=null),"string"}}function L(t,e){var n,r=!1;while(n=t.next()){if("/"==n&&r){e.tokenize=null;break}r="*"==n}return"comment"}function D(t,e){l.typeFirstDefinitions&&t.eol()&&o(e.context)&&(e.typeAtEndOfLine=i(t,e,t.pos))}return{startState:function(t){return{tokenize:null,context:new e((t||0)-d,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(t,e){var a=e.context;if(t.sol()&&(null==a.align&&(a.align=!1),e.indented=t.indentation(),e.startOfLine=!0),t.eatSpace())return D(t,e),null;c=u=null;var s=(e.tokenize||N)(t,e);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),";"==c||":"==c||","==c&&t.match(/^\s*(?:\/\/.*)?$/,!1))while("statement"==e.context.type)r(e);else if("{"==c)n(e,t.column(),"}");else if("["==c)n(e,t.column(),"]");else if("("==c)n(e,t.column(),")");else if("}"==c){while("statement"==a.type)a=r(e);"}"==a.type&&(a=r(e));while("statement"==a.type)a=r(e)}else c==a.type?r(e):C&&(("}"==a.type||"top"==a.type)&&";"!=c||"statement"==a.type&&"newstatement"==c)&&n(e,t.column(),"statement",t.current());if("variable"==s&&("def"==e.prevToken||l.typeFirstDefinitions&&i(t,e,t.start)&&o(e.context)&&t.match(/^\s*\(/,!1))&&(s="def"),w.token){var d=w.token(t,e,s);void 0!==d&&(s=d)}return"def"==s&&!1===l.styleDefs&&(s="variable"),e.startOfLine=!1,e.prevToken=u?"def":s||c,D(t,e),s},indent:function(e,n){if(e.tokenize!=N&&null!=e.tokenize||e.typeAtEndOfLine)return t.Pass;var r=e.context,i=n&&n.charAt(0),o=i==r.type;if("statement"==r.type&&"}"==i&&(r=r.prev),l.dontIndentStatements)while("statement"==r.type&&l.dontIndentStatements.test(r.info))r=r.prev;if(w.indent){var a=w.indent(e,r,n,d);if("number"==typeof a)return a}var s=r.prev&&"switch"==r.prev.info;if(l.allmanIndentation&&/[{(]/.test(i)){while("top"!=r.type&&"}"!=r.type)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:h):!r.align||p&&")"==r.type?")"!=r.type||o?r.indented+(o?0:d)+(o||!s||/^(?:case|default)\b/.test(n)?0:d):r.indented+h:r.column+(o?0:1)},electricInput:k?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}));var l="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",c="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",u="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",d="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",h=a("int long char short double float unsigned signed void bool"),p=a("SEL instancetype id Class Protocol BOOL");function f(t){return s(h,t)||/.+_t$/.test(t)}function g(t){return f(t)||s(p,t)}var m="case do else for if switch while struct enum union",v="struct enum union";function b(t,e){if(!e.startOfLine)return!1;for(var n,r=null;n=t.peek();){if("\\"==n&&t.match(/^.$/)){r=b;break}if("/"==n&&t.match(/^\/[\/\*]/,!1))break;t.next()}return e.tokenize=r,"meta"}function y(t,e){return"type"==e.prevToken&&"type"}function w(t){return!(!t||t.length<2)&&("_"==t[0]&&("_"==t[1]||t[1]!==t[1].toLowerCase()))}function x(t){return t.eatWhile(/[\w\.']/),"number"}function C(t,e){if(t.backUp(1),t.match(/^(?:R|u8R|uR|UR|LR)/)){var n=t.match(/^"([^\s\\()]{0,16})\(/);return!!n&&(e.cpp11RawStringDelim=n[1],e.tokenize=S,S(t,e))}return t.match(/^(?:u8|u|U|L)/)?!!t.match(/^["']/,!1)&&"string":(t.next(),!1)}function k(t){var e=/(\w+)::~?(\w+)$/.exec(t);return e&&e[1]==e[2]}function A(t,e){var n;while(null!=(n=t.next()))if('"'==n&&!t.eat('"')){e.tokenize=null;break}return"string"}function S(t,e){var n=e.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),r=t.match(new RegExp(".*?\\)"+n+'"'));return r?e.tokenize=null:t.skipToEnd(),"string"}function E(e,n){"string"==typeof e&&(e=[e]);var r=[];function i(t){if(t)for(var e in t)t.hasOwnProperty(e)&&r.push(e)}i(n.keywords),i(n.types),i(n.builtin),i(n.atoms),r.length&&(n.helperType=e[0],t.registerHelper("hintWords",e[0],r));for(var o=0;o<e.length;++o)t.defineMIME(e[o],n)}function O(t,e){var n=!1;while(!t.eol()){if(!n&&t.match('"""')){e.tokenize=null;break}n="\\"==t.next()&&!n}return"string"}function T(t){return function(e,n){var r;while(r=e.next()){if("*"==r&&e.eat("/")){if(1==t){n.tokenize=null;break}return n.tokenize=T(t-1),n.tokenize(e,n)}if("/"==r&&e.eat("*"))return n.tokenize=T(t+1),n.tokenize(e,n)}return"comment"}}function _(t){return function(e,n){var r,i=!1,o=!1;while(!e.eol()){if(!t&&!i&&e.match('"')){o=!0;break}if(t&&e.match('"""')){o=!0;break}r=e.next(),!i&&"$"==r&&e.match("{")&&e.skipTo("}"),i=!i&&"\\"==r&&!t}return!o&&t||(n.tokenize=null),"string"}}E(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(l),types:f,blockKeywords:a(m),defKeywords:a(v),typeFirstDefinitions:!0,atoms:a("NULL true false"),isReservedIdentifier:w,hooks:{"#":b,"*":y},modeProps:{fold:["brace","include"]}}),E(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(l+" "+c),types:f,blockKeywords:a(m+" class try catch"),defKeywords:a(v+" class namespace"),typeFirstDefinitions:!0,atoms:a("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:w,hooks:{"#":b,"*":y,u:C,U:C,L:C,R:C,0:x,1:x,2:x,3:x,4:x,5:x,6:x,7:x,8:x,9:x,token:function(t,e,n){if("variable"==n&&"("==t.peek()&&(";"==e.prevToken||null==e.prevToken||"}"==e.prevToken)&&k(t.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),E("text/x-java",{name:"clike",keywords:a("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:a("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:a("catch class do else finally for if switch try while"),defKeywords:a("class interface enum @interface"),typeFirstDefinitions:!0,atoms:a("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(t){return!t.match("interface",!1)&&(t.eatWhile(/[\w\$_]/),"meta")},'"':function(t,e){return!!t.match(/""$/)&&(e.tokenize=O,e.tokenize(t,e))}},modeProps:{fold:["brace","import"]}}),E("text/x-csharp",{name:"clike",keywords:a("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:a("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),defKeywords:a("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"@":function(t,e){return t.eat('"')?(e.tokenize=A,A(t,e)):(t.eatWhile(/[\w\$_]/),"meta")}}}),E("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:a("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:a("catch class enum do else finally for forSome if match switch try while"),defKeywords:a("class enum def object package trait type val var"),atoms:a("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(t){return t.eatWhile(/[\w\$_]/),"meta"},'"':function(t,e){return!!t.match('""')&&(e.tokenize=O,e.tokenize(t,e))},"'":function(t){return t.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(t,n){var r=n.context;return!("}"!=r.type||!r.align||!t.eat(">"))&&(n.context=new e(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(t,e){return!!t.eat("*")&&(e.tokenize=T(1),e.tokenize(t,e))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),E("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object interface fun"),atoms:a("true false null this"),hooks:{"@":function(t){return t.eatWhile(/[\w\$_]/),"meta"},"*":function(t,e){return"."==e.prevToken?"variable":"operator"},'"':function(t,e){return e.tokenize=_(t.match('""')),e.tokenize(t,e)},"/":function(t,e){return!!t.eat("*")&&(e.tokenize=T(1),e.tokenize(t,e))},indent:function(t,e,n,r){var i=n&&n.charAt(0);return"}"!=t.prevToken&&")"!=t.prevToken||""!=n?"operator"==t.prevToken&&"}"!=n&&"}"!=t.context.type||"variable"==t.prevToken&&"."==i||("}"==t.prevToken||")"==t.prevToken)&&"."==i?2*r+e.indented:e.align&&"}"==e.type?e.indented+(t.context.type==(n||"").charAt(0)?0:r):void 0:t.indented}},modeProps:{closeBrackets:{triples:'"'}}}),E(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":b},modeProps:{fold:["brace","include"]}}),E("text/x-nesc",{name:"clike",keywords:a(l+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:f,blockKeywords:a(m),atoms:a("null true false"),hooks:{"#":b},modeProps:{fold:["brace","include"]}}),E("text/x-objectivec",{name:"clike",keywords:a(l+" "+u),types:g,builtin:a(d),blockKeywords:a(m+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:a(v+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:w,hooks:{"#":b,"*":y},modeProps:{fold:["brace","include"]}}),E("text/x-objectivec++",{name:"clike",keywords:a(l+" "+u+" "+c),types:g,builtin:a(d),blockKeywords:a(m+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:a(v+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:w,hooks:{"#":b,"*":y,u:C,U:C,L:C,R:C,0:x,1:x,2:x,3:x,4:x,5:x,6:x,7:x,8:x,9:x,token:function(t,e,n){if("variable"==n&&"("==t.peek()&&(";"==e.prevToken||null==e.prevToken||"}"==e.prevToken)&&k(t.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),E("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:f,blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":b},modeProps:{fold:["brace","include"]}});var M=null;function N(t){return function(e,n){var r,i=!1,o=!1;while(!e.eol()){if(!i&&e.match('"')&&("single"==t||e.match('""'))){o=!0;break}if(!i&&e.match("``")){M=N(t),o=!0;break}r=e.next(),i="single"==t&&!i&&"\\"==r}return o&&(n.tokenize=null),"string"}}E("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(t){var e=t.charAt(0);return e===e.toUpperCase()&&e!==e.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(t){return t.eatWhile(/[\w\$_]/),"meta"},'"':function(t,e){return e.tokenize=N(t.match('""')?"triple":"single"),e.tokenize(t,e)},"`":function(t,e){return!(!M||!t.match("`"))&&(e.tokenize=M,M=null,e.tokenize(t,e))},"'":function(t){return t.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(t,e,n){if(("variable"==n||"type"==n)&&"."==e.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}))},"4c53":function(t,e,n){"use strict";var r=n("23e7"),i=n("857a"),o=n("af03");r({target:"String",proto:!0,forced:o("sub")},{sub:function(){return i(this,"sub","","")}})},"4d7f":function(t,e,n){(function(e){var n,r={},i={16:!1,18:!1,17:!1,91:!1},o="all",a={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},s={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},l=function(t){return s[t]||t.toUpperCase().charCodeAt(0)},c=[];for(n=1;n<20;n++)s["f"+n]=111+n;function u(t,e){var n=t.length;while(n--)if(t[n]===e)return n;return-1}function d(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var h={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};function p(t){for(n in i)i[n]=t[h[n]]}function f(t){var e,n,o,s,l,d;if(e=t.keyCode,-1==u(c,e)&&c.push(e),93!=e&&224!=e||(e=91),e in i)for(o in i[e]=!0,a)a[o]==e&&(v[o]=!0);else if(p(t),v.filter.call(this,t)&&e in r)for(d=k(),s=0;s<r[e].length;s++)if(n=r[e][s],n.scope==d||"all"==n.scope){for(o in l=n.mods.length>0,i)(!i[o]&&u(n.mods,+o)>-1||i[o]&&-1==u(n.mods,+o))&&(l=!1);(0!=n.mods.length||i[16]||i[18]||i[17]||i[91])&&!l||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function g(t){var e,n=t.keyCode,r=u(c,n);if(r>=0&&c.splice(r,1),93!=n&&224!=n||(n=91),n in i)for(e in i[n]=!1,a)a[e]==n&&(v[e]=!1)}function m(){for(n in i)i[n]=!1;for(n in a)v[n]=!1}function v(t,e,n){var i,o;i=S(t),void 0===n&&(n=e,e="all");for(var a=0;a<i.length;a++)o=[],t=i[a].split("+"),t.length>1&&(o=E(t),t=[t[t.length-1]]),t=t[0],t=l(t),t in r||(r[t]=[]),r[t].push({shortcut:i[a],scope:e,method:n,key:i[a],mods:o})}function b(t,e){var n,i,o,a,s,c=[];for(n=S(t),a=0;a<n.length;a++){if(i=n[a].split("+"),i.length>1&&(c=E(i),t=i[i.length-1]),t=l(t),void 0===e&&(e=k()),!r[t])return;for(o=0;o<r[t].length;o++)s=r[t][o],s.scope===e&&d(s.mods,c)&&(r[t][o]={})}}function y(t){return"string"==typeof t&&(t=l(t)),-1!=u(c,t)}function w(){return c.slice(0)}function x(t){var e=(t.target||t.srcElement).tagName;return!("INPUT"==e||"SELECT"==e||"TEXTAREA"==e)}for(n in a)v[n]=!1;function C(t){o=t||"all"}function k(){return o||"all"}function A(t){var e,n,i;for(e in r)for(n=r[e],i=0;i<n.length;)n[i].scope===t?n.splice(i,1):i++}function S(t){var e;return t=t.replace(/\s/g,""),e=t.split(","),""==e[e.length-1]&&(e[e.length-2]+=","),e}function E(t){for(var e=t.slice(0,t.length-1),n=0;n<e.length;n++)e[n]=a[e[n]];return e}function O(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,(function(){n(window.event)}))}O(document,"keydown",(function(t){f(t)})),O(document,"keyup",g),O(window,"focus",m);var T=e.key;function _(){var t=e.key;return e.key=T,t}e.key=v,e.key.setScope=C,e.key.getScope=k,e.key.deleteScope=A,e.key.filter=x,e.key.isPressed=y,e.key.getPressedKeyCodes=w,e.key.noConflict=_,e.key.unbind=b,t.exports=v})(this)},"4e4c":function(t,e,n){},"4f1c":function(t,e,n){},"4fc2":function(t,e){t.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},5:function(t,e){},5122:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n("d9e2");function r(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}},5136:function(t,e,n){"use strict";n.r(e);n("b2a3"),n("8f3c")},"515a":function(t,e,n){"use strict";t.exports=function(t,e){var n,r,i,o,a,s,l,c,u=t.pos,d=t.src.charCodeAt(u);if(96!==d)return!1;n=u,u++,r=t.posMax;while(u<r&&96===t.src.charCodeAt(u))u++;if(i=t.src.slice(n,u),l=i.length,t.backticksScanned&&(t.backticks[l]||0)<=n)return e||(t.pending+=i),t.pos+=l,!0;a=s=u;while(-1!==(a=t.src.indexOf("`",s))){s=a+1;while(s<r&&96===t.src.charCodeAt(s))s++;if(c=s-a,c===l)return e||(o=t.push("code_inline","code",0),o.markup=i,o.content=t.src.slice(u,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),t.pos=s,!0;t.backticks[c]=a}return t.backticksScanned=!0,e||(t.pending+=i),t.pos+=l,!0}},"51ac":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});for(var r="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),i={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},o={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:r?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},a={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},s=1;s<20;s++)a["f"+s]=111+s;function l(t,e,n){e&&!("byKey"in e)&&(n=e,e=null),Array.isArray(t)||(t=[t]);var r=t.map((function(t){return d(t,e)})),i=function(t){return r.some((function(e){return h(e,t)}))},o=null==n?i:i(n);return o}function c(t,e){return l(t,e)}function u(t,e){return l(t,{byKey:!0},e)}function d(t,e){var n=e&&e.byKey,r={};t=t.replace("++","+add");var s=t.split("+"),l=s.length;for(var c in i)r[i[c]]=!1;var u=!0,d=!1,h=void 0;try{for(var g,m=s[Symbol.iterator]();!(u=(g=m.next()).done);u=!0){var v=g.value,b=v.endsWith("?")&&v.length>1;b&&(v=v.slice(0,-1));var y=f(v),w=i[y];if(v.length>1&&!w&&!o[v]&&!a[y])throw new TypeError('Unknown modifier: "'+v+'"');1!==l&&w||(n?r.key=y:r.which=p(v)),w&&(r[w]=!b||null)}}catch(x){d=!0,h=x}finally{try{!u&&m.return&&m.return()}finally{if(d)throw h}}return r}function h(t,e){for(var n in t){var r=t[n],i=void 0;if(null!=r&&(i="key"===n&&null!=e.key?e.key.toLowerCase():"which"===n?91===r&&93===e.which?91:e.which:e[n],(null!=i||!1!==r)&&i!==r))return!1}return!0}function p(t){t=f(t);var e=a[t]||t.toUpperCase().charCodeAt(0);return e}function f(t){return t=t.toLowerCase(),t=o[t]||t,t}e.default=l,e.isHotkey=l,e.isCodeHotkey=c,e.isKeyHotkey=u,e.parseHotkey=d,e.compareHotkey=h,e.toKeyCode=p,e.toKeyName=f},"546b":function(t,e,n){},"54f6":function(t,e,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function i(t,e){var n,i,o,a=t.posMax,s=t.pos;if(126!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=a)return!1;t.pos=s+1;while(t.pos<a){if(126===t.src.charCodeAt(t.pos)){n=!0;break}t.md.inline.skipToken(t)}return n&&s+1!==t.pos?(i=t.src.slice(s+1,t.pos),i.match(/(^|[^\\])(\\\\)*\s/)?(t.pos=s,!1):(t.posMax=t.pos,t.pos=s+1,o=t.push("sub_open","sub",1),o.markup="~",o=t.push("text","",0),o.content=i.replace(r,"$1"),o=t.push("sub_close","sub",-1),o.markup="~",t.pos=t.posMax+1,t.posMax=a,!0)):(t.pos=s,!1)}t.exports=function(t){t.inline.ruler.after("emphasis","sub",i)}},"55be":function(t,e,n){"use strict";function r(t){return Object.prototype.toString.call(t)}function i(t){return"[object String]"===r(t)}var o=Object.prototype.hasOwnProperty;function a(t,e){return o.call(t,e)}function s(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach((function(e){if(e){if("object"!==typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach((function(n){t[n]=e[n]}))}})),t}function l(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function c(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!==(65535&t)&&65534!==(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function u(t){if(t>65535){t-=65536;var e=55296+(t>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}var d=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,h=/&([a-z#][a-z0-9]{1,31});/gi,p=new RegExp(d.source+"|"+h.source,"gi"),f=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,g=n("b4c9");function m(t,e){var n=0;return a(g,e)?g[e]:35===e.charCodeAt(0)&&f.test(e)&&(n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10),c(n))?u(n):t}function v(t){return t.indexOf("\\")<0?t:t.replace(d,"$1")}function b(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(p,(function(t,e,n){return e||m(t,n)}))}var y=/[&<>"]/,w=/[&<>"]/g,x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function C(t){return x[t]}function k(t){return y.test(t)?t.replace(w,C):t}var A=/[.?*+^$[\]\\(){}|-]/g;function S(t){return t.replace(A,"\\$&")}function E(t){switch(t){case 9:case 32:return!0}return!1}function O(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}var T=n("7ca0");function _(t){return T.test(t)}function M(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function N(t){return t=t.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}e.lib={},e.lib.mdurl=n("d8a6"),e.lib.ucmicro=n("d5d1"),e.assign=s,e.isString=i,e.has=a,e.unescapeMd=v,e.unescapeAll=b,e.isValidEntityCode=c,e.fromCodePoint=u,e.escapeHtml=k,e.arrayReplaceAt=l,e.isSpace=E,e.isWhiteSpace=O,e.isMdAsciiPunct=M,e.isPunctChar=_,e.escapeRE=S,e.normalizeReference=N},"56b3":function(t,e,n){(function(e,n){t.exports=n()})(0,(function(){"use strict";var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(t),c=l&&/Qt\/\d+\.\d+/.test(t),u=!o&&/Chrome\/(\d+)/.exec(t),d=u&&+u[1],h=/Opera\//.test(t),p=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),g=/PhantomJS/.test(t),m=p&&(/Mobile\/\w+/.test(t)||navigator.maxTouchPoints>2),v=/Android/.test(t),b=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=m||/Mac/.test(e),w=/\bCrOS\b/.test(t),x=/win/i.test(e),C=h&&t.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(h=!1,l=!0);var k=y&&(c||h&&(null==C||C<12.11)),A=n||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var E,O=function(t,e){var n=t.className,r=S(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function _(t,e){return T(t).appendChild(e)}function M(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o<e.length;++o)i.appendChild(e[o]);return i}function N(t,e,n,r){var i=M(t,e,n,r);return i.setAttribute("role","presentation"),i}function P(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 L(t){var e;try{e=t.activeElement}catch(n){e=t.body||null}while(e&&e.shadowRoot&&e.shadowRoot.activeElement)e=e.shadowRoot.activeElement;return e}function D(t,e){var n=t.className;S(e).test(n)||(t.className+=(n?" ":"")+e)}function j(t,e){for(var n=t.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(e)&&(e+=" "+n[r]);return e}E=document.createRange?function(t,e,n,r){var i=document.createRange();return i.setEnd(r||t,n),i.setStart(t,e),i}:function(t,e,n){var r=document.body.createTextRange();try{r.moveToElementText(t.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",e),r};var I=function(t){t.select()};function R(t){return t.display.wrapper.ownerDocument}function F(t){return R(t).defaultView}function B(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e)}}function z(t,e,n){for(var r in e||(e={}),t)!t.hasOwnProperty(r)||!1===n&&e.hasOwnProperty(r)||(e[r]=t[r]);return e}function H(t,e,n,r,i){null==e&&(e=t.search(/[^\s\u00a0]/),-1==e&&(e=t.length));for(var o=r||0,a=i||0;;){var s=t.indexOf("\t",o);if(s<0||s>=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}m?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(e){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};function q(t,e){for(var n=0;n<t.length;++n)if(t[n]==e)return n;return-1}V.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},V.prototype.set=function(t,e){this.f=e;var n=+new Date+t;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=n)};var U=50,W={toString:function(){return"CodeMirror.Pass"}},$={scroll:!1},G={origin:"*mouse"},Y={origin:"+move"};function X(t,e,n){for(var r=0,i=0;;){var o=t.indexOf("\t",r);-1==o&&(o=t.length);var a=o-r;if(o==t.length||i+a>=e)return r+Math.min(a,e-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=e)return r}}var K=[""];function Z(t){while(K.length<=t)K.push(J(K)+" ");return K[t]}function J(t){return t[t.length-1]}function Q(t,e){for(var n=[],r=0;r<t.length;r++)n[r]=e(t[r],r);return n}function tt(t,e,n){var r=0,i=n(e);while(r<t.length&&n(t[r])<=i)r++;t.splice(r,0,e)}function et(){}function nt(t,e){var n;return Object.create?n=Object.create(t):(et.prototype=t,n=new et),e&&z(e,n),n}var rt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function it(t){return/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||rt.test(t))}function ot(t,e){return e?!!(e.source.indexOf("\\w")>-1&&it(t))||e.test(t):it(t)}function at(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var st=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function lt(t){return t.charCodeAt(0)>=768&&st.test(t)}function ct(t,e,n){while((n<0?e>0:e<t.length)&&lt(t.charAt(e)))e+=n;return e}function ut(t,e,n){for(var r=e>n?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}function dt(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;o<t.length;++o){var a=t[o];(a.from<n&&a.to>e||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}var ht=null;function pt(t,e,n){var r;ht=null;for(var i=0;i<t.length;++i){var o=t[i];if(o.from<e&&o.to>e)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:ht=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:ht=i)}return null!=r?r:ht}var ft=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var c="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!r.test(t))return!1;for(var u=t.length,d=[],h=0;h<u;++h)d.push(n(t.charCodeAt(h)));for(var p=0,f=c;p<u;++p){var g=d[p];"m"==g?d[p]=f:f=g}for(var m=0,v=c;m<u;++m){var b=d[m];"1"==b&&"r"==v?d[m]="n":o.test(b)&&(v=b,"r"==b&&(d[m]="R"))}for(var y=1,w=d[0];y<u-1;++y){var x=d[y];"+"==x&&"1"==w&&"1"==d[y+1]?d[y]="1":","!=x||w!=d[y+1]||"1"!=w&&"n"!=w||(d[y]=w),w=x}for(var C=0;C<u;++C){var k=d[C];if(","==k)d[C]="N";else if("%"==k){var A=void 0;for(A=C+1;A<u&&"%"==d[A];++A);for(var S=C&&"!"==d[C-1]||A<u&&"1"==d[A]?"1":"N",E=C;E<A;++E)d[E]=S;C=A-1}}for(var O=0,T=c;O<u;++O){var _=d[O];"L"==T&&"1"==_?d[O]="L":o.test(_)&&(T=_)}for(var M=0;M<u;++M)if(i.test(d[M])){var N=void 0;for(N=M+1;N<u&&i.test(d[N]);++N);for(var P="L"==(M?d[M-1]:c),L="L"==(N<u?d[N]:c),D=P==L?P?"L":"R":c,j=M;j<N;++j)d[j]=D;M=N-1}for(var I,R=[],F=0;F<u;)if(a.test(d[F])){var B=F;for(++F;F<u&&a.test(d[F]);++F);R.push(new l(0,B,F))}else{var z=F,H=R.length,V="rtl"==e?1:0;for(++F;F<u&&"L"!=d[F];++F);for(var q=z;q<F;)if(s.test(d[q])){z<q&&(R.splice(H,0,new l(1,z,q)),H+=V);var U=q;for(++q;q<F&&s.test(d[q]);++q);R.splice(H,0,new l(2,U,q)),H+=V,z=q}else++q;z<F&&R.splice(H,0,new l(1,z,F))}return"ltr"==e&&(1==R[0].level&&(I=t.match(/^\s+/))&&(R[0].from=I[0].length,R.unshift(new l(0,0,I[0].length))),1==J(R).level&&(I=t.match(/\s+$/))&&(J(R).to-=I[0].length,R.push(new l(0,u-I[0].length,u)))),"rtl"==e?R.reverse():R}}();function gt(t,e){var n=t.order;return null==n&&(n=t.order=ft(t.text,e)),n}var mt=[],vt=function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent)t.attachEvent("on"+e,n);else{var r=t._handlers||(t._handlers={});r[e]=(r[e]||mt).concat(n)}};function bt(t,e){return t._handlers&&t._handlers[e]||mt}function yt(t,e,n){if(t.removeEventListener)t.removeEventListener(e,n,!1);else if(t.detachEvent)t.detachEvent("on"+e,n);else{var r=t._handlers,i=r&&r[e];if(i){var o=q(i,n);o>-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function wt(t,e){var n=bt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function xt(t,e,n){return"string"==typeof e&&(e={type:e,preventDefault:function(){this.defaultPrevented=!0}}),wt(t,n||e.type,t,e),Ot(e)||e.codemirrorIgnore}function Ct(t){var e=t._handlers&&t._handlers.cursorActivity;if(e)for(var n=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),r=0;r<e.length;++r)-1==q(n,e[r])&&n.push(e[r])}function kt(t,e){return bt(t,e).length>0}function At(t){t.prototype.on=function(t,e){vt(this,t,e)},t.prototype.off=function(t,e){yt(this,t,e)}}function St(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Et(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Ot(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Tt(t){St(t),Et(t)}function _t(t){return t.target||t.srcElement}function Mt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Nt,Pt,Lt=function(){if(a&&s<9)return!1;var t=M("div");return"draggable"in t||"dragDrop"in t}();function Dt(t){if(null==Nt){var e=M("span","");_(t,M("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Nt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Nt?M("span",""):M("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function jt(t){if(null!=Pt)return Pt;var e=_(t,document.createTextNode("AخA")),n=E(e,0,1).getBoundingClientRect(),r=E(e,1,2).getBoundingClientRect();return T(t),!(!n||n.left==n.right)&&(Pt=r.right-n.right<3)}var It=3!="\n\nb".split(/\n/).length?function(t){var e=0,n=[],r=t.length;while(e<=r){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Rt=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)},Ft=function(){var t=M("div");return"oncopy"in t||(t.setAttribute("oncopy","return;"),"function"==typeof t.oncopy)}(),Bt=null;function zt(t){if(null!=Bt)return Bt;var e=_(t,M("span","x")),n=e.getBoundingClientRect(),r=E(e,0,1).getBoundingClientRect();return Bt=Math.abs(n.left-r.left)>1}var Ht={},Vt={};function qt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Ht[t]=e}function Ut(t,e){Vt[t]=e}function Wt(t){if("string"==typeof t&&Vt.hasOwnProperty(t))t=Vt[t];else if(t&&"string"==typeof t.name&&Vt.hasOwnProperty(t.name)){var e=Vt[t.name];"string"==typeof e&&(e={name:e}),t=nt(e,t),t.name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Wt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Wt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function $t(t,e){e=Wt(e);var n=Ht[e.name];if(!n)return $t(t,"text/plain");var r=n(t,e);if(Gt.hasOwnProperty(e.name)){var i=Gt[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}var Gt={};function Yt(t,e){var n=Gt.hasOwnProperty(t)?Gt[t]:Gt[t]={};z(e,n)}function Xt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Kt(t,e){var n;while(t.innerMode){if(n=t.innerMode(e),!n||n.mode==t)break;e=n.state,t=n.mode}return n||{mode:t,state:e}}function Zt(t,e,n){return!t.startState||t.startState(e,n)}var Jt=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};function Qt(t,e){if(e-=t.first,e<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");var n=t;while(!n.lines)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e<o){n=i;break}e-=o}return n.lines[e]}function te(t,e,n){var r=[],i=e.line;return t.iter(e.line,n.line+1,(function(t){var o=t.text;i==n.line&&(o=o.slice(0,n.ch)),i==e.line&&(o=o.slice(e.ch)),r.push(o),++i})),r}function ee(t,e,n){var r=[];return t.iter(e,n,(function(t){r.push(t.text)})),r}function ne(t,e){var n=e-t.height;if(n)for(var r=t;r;r=r.parent)r.height+=n}function re(t){if(null==t.parent)return null;for(var e=t.parent,n=q(e.lines,t),r=e.parent;r;e=r,r=r.parent)for(var i=0;;++i){if(r.children[i]==e)break;n+=r.children[i].chunkSize()}return n+e.first}function ie(t,e){var n=t.first;t:do{for(var r=0;r<t.children.length;++r){var i=t.children[r],o=i.height;if(e<o){t=i;continue t}e-=o,n+=i.chunkSize()}return n}while(!t.lines);for(var a=0;a<t.lines.length;++a){var s=t.lines[a],l=s.height;if(e<l)break;e-=l}return n+a}function oe(t,e){return e>=t.first&&e<t.first+t.size}function ae(t,e){return String(t.lineNumberFormatter(e+t.firstLineNumber))}function se(t,e,n){if(void 0===n&&(n=null),!(this instanceof se))return new se(t,e,n);this.line=t,this.ch=e,this.sticky=n}function le(t,e){return t.line-e.line||t.ch-e.ch}function ce(t,e){return t.sticky==e.sticky&&0==le(t,e)}function ue(t){return se(t.line,t.ch)}function de(t,e){return le(t,e)<0?e:t}function he(t,e){return le(t,e)<0?t:e}function pe(t,e){return Math.max(t.first,Math.min(e,t.first+t.size-1))}function fe(t,e){if(e.line<t.first)return se(t.first,0);var n=t.first+t.size-1;return e.line>n?se(n,Qt(t,n).text.length):ge(e,Qt(t,e.line).text.length)}function ge(t,e){var n=t.ch;return null==n||n>e?se(t.line,e):n<0?se(t.line,0):t}function me(t,e){for(var n=[],r=0;r<e.length;r++)n[r]=fe(t,e[r]);return n}Jt.prototype.eol=function(){return this.pos>=this.string.length},Jt.prototype.sol=function(){return this.pos==this.lineStart},Jt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Jt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Jt.prototype.eat=function(t){var e,n=this.string.charAt(this.pos);if(e="string"==typeof t?n==t:n&&(t.test?t.test(n):t(n)),e)return++this.pos,n},Jt.prototype.eatWhile=function(t){var e=this.pos;while(this.eat(t));return this.pos>e},Jt.prototype.eatSpace=function(){var t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>t},Jt.prototype.skipToEnd=function(){this.pos=this.string.length},Jt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Jt.prototype.backUp=function(t){this.pos-=t},Jt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Jt.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},Jt.prototype.match=function(t,e,n){if("string"!=typeof t){var r=this.string.slice(this.pos).match(t);return r&&r.index>0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(i(o)==i(t))return!1!==e&&(this.pos+=t.length),!0},Jt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Jt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Jt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Jt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ve=function(t,e){this.state=t,this.lookAhead=e},be=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ye(t,e,n,r){var i=[t.state.modeGen],o={};Te(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=t.state.overlays[r],l=1,c=0;n.state=!0,Te(t,e.text,s.mode,n,(function(t,e){var n=l;while(c<t){var r=i[l];r>t&&i.splice(l,1,t,i[l+1],r),l+=2,c=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+e}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<t.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function we(t,e,n){if(!e.styles||e.styles[0]!=t.state.modeGen){var r=xe(t,re(e)),i=e.text.length>t.options.maxHighlightLength&&Xt(t.doc.mode,r.state),o=ye(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),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 xe(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new be(r,!0,e);var o=_e(t,e,n),a=o>r.first&&Qt(r,o-1).stateAfter,s=a?be.fromSaved(r,a,o):new be(r,Zt(r.mode),o);return r.iter(o,e,(function(n){Ce(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function Ce(t,e,n,r){var i=t.doc.mode,o=new Jt(e,t.options.tabSize,n);o.start=o.pos=r||0,""==e&&ke(i,n.state);while(!o.eol())Ae(i,o,n.state),o.start=o.pos}function ke(t,e){if(t.blankLine)return t.blankLine(e);if(t.innerMode){var n=Kt(t,e);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Ae(t,e,n,r){for(var i=0;i<10;i++){r&&(r[0]=Kt(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.")}be.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},be.prototype.baseToken=function(t){if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=t)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},be.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},be.fromSaved=function(t,e,n){return e instanceof ve?new be(t,Xt(t.mode,e.state),n,e.lookAhead):new be(t,Xt(t.mode,e),n)},be.prototype.save=function(t){var e=!1!==t?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ve(e,this.maxLookAhead):e};var Se=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Ee(t,e,n,r){var i,o=t.doc,a=o.mode;e=fe(o,e);var s,l=Qt(o,e.line),c=xe(t,e.line,n),u=new Jt(l.text,t.options.tabSize,c);r&&(s=[]);while((r||u.pos<e.ch)&&!u.eol())u.start=u.pos,i=Ae(a,u,c.state),r&&s.push(new Se(u,i,Xt(o.mode,c.state)));return r?s:new Se(u,i,c.state)}function Oe(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 r=n[1]?"bgClass":"textClass";null==e[r]?e[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(e[r])||(e[r]+=" "+n[2])}return t}function Te(t,e,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=t.options.flattenSpans);var l,c=0,u=null,d=new Jt(e,t.options.tabSize,r),h=t.options.addModeClass&&[null];""==e&&Oe(ke(n,r.state),o);while(!d.eol()){if(d.pos>t.options.maxHighlightLength?(s=!1,a&&Ce(t,e,r,d.pos),d.pos=e.length,l=null):l=Oe(Ae(n,d,r.state,h),o),h){var p=h[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){while(c<d.start)c=Math.min(d.start,c+5e3),i(c,u);u=l}d.start=d.pos}while(c<d.pos){var f=Math.min(d.pos,c+5e3);i(f,u),c=f}}function _e(t,e,n){for(var r,i,o=t.doc,a=n?-1:e-(t.doc.mode.innerMode?1e3:100),s=e;s>a;--s){if(s<=o.first)return o.first;var l=Qt(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ve?c.lookAhead:0)<=o.modeFrontier))return s;var u=H(l.text,null,t.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}function Me(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontier<e-10)){for(var n=t.first,r=e-1;r>n;r--){var i=Qt(t,r).stateAfter;if(i&&(!(i instanceof ve)||r+i.lookAhead<e)){n=r+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,n)}}var Ne=!1,Pe=!1;function Le(){Ne=!0}function De(){Pe=!0}function je(t,e,n){this.marker=t,this.from=e,this.to=n}function Ie(t,e){if(t)for(var n=0;n<t.length;++n){var r=t[n];if(r.marker==e)return r}}function Re(t,e){for(var n,r=0;r<t.length;++r)t[r]!=e&&(n||(n=[])).push(t[r]);return n}function Fe(t,e,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&t.markedSpans&&r.has(t.markedSpans)?t.markedSpans.push(e):(t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],r&&r.add(t.markedSpans)),e.marker.attachLine(t)}function Be(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);if(s||o.from==e&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);(r||(r=[])).push(new je(a,o.from,l?null:o.to))}}return r}function ze(t,e,n){var r;if(t)for(var i=0;i<t.length;++i){var o=t[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=e:o.to>e);if(s||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=e:o.from<e);(r||(r=[])).push(new je(a,l?null:o.from-e,null==o.to?null:o.to-e))}}return r}function He(t,e){if(e.full)return null;var n=oe(t,e.from.line)&&Qt(t,e.from.line).markedSpans,r=oe(t,e.to.line)&&Qt(t,e.to.line).markedSpans;if(!n&&!r)return null;var i=e.from.ch,o=e.to.ch,a=0==le(e.from,e.to),s=Be(n,i,a),l=ze(r,o,a),c=1==e.text.length,u=J(e.text).length+(c?i:0);if(s)for(var d=0;d<s.length;++d){var h=s[d];if(null==h.to){var p=Ie(l,h.marker);p?c&&(h.to=null==p.to?null:p.to+u):h.to=i}}if(l)for(var f=0;f<l.length;++f){var g=l[f];if(null!=g.to&&(g.to+=u),null==g.from){var m=Ie(s,g.marker);m||(g.from=u,c&&(s||(s=[])).push(g))}else g.from+=u,c&&(s||(s=[])).push(g)}s&&(s=Ve(s)),l&&l!=s&&(l=Ve(l));var v=[s];if(!c){var b,y=e.text.length-2;if(y>0&&s)for(var w=0;w<s.length;++w)null==s[w].to&&(b||(b=[])).push(new je(s[w].marker,null,null));for(var x=0;x<y;++x)v.push(b);v.push(l)}return v}function Ve(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 qe(t,e,n){var r=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||r&&-1!=q(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:e,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(le(c.to,s.from)<0||le(c.from,s.to)>0)){var u=[l,1],d=le(c.from,s.from),h=le(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function Ue(t){var e=t.markedSpans;if(e){for(var n=0;n<e.length;++n)e[n].marker.detachLine(t);t.markedSpans=null}}function We(t,e){if(e){for(var n=0;n<e.length;++n)e[n].marker.attachLine(t);t.markedSpans=e}}function $e(t){return t.inclusiveLeft?-1:0}function Ge(t){return t.inclusiveRight?1:0}function Ye(t,e){var n=t.lines.length-e.lines.length;if(0!=n)return n;var r=t.find(),i=e.find(),o=le(r.from,i.from)||$e(t)-$e(e);if(o)return-o;var a=le(r.to,i.to)||Ge(t)-Ge(e);return a||e.id-t.id}function Xe(t,e){var n,r=Pe&&t.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(e?i.from:i.to)&&(!n||Ye(n,i.marker)<0)&&(n=i.marker);return n}function Ke(t){return Xe(t,!0)}function Ze(t){return Xe(t,!1)}function Je(t,e){var n,r=Pe&&t.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<e)&&(null==o.to||o.to>e)&&(!n||Ye(n,o.marker)<0)&&(n=o.marker)}return n}function Qe(t,e,n,r,i){var o=Qt(t,e),a=Pe&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=le(c.from,n)||$e(l.marker)-$e(i),d=le(c.to,r)||Ge(l.marker)-Ge(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?le(c.to,n)>=0:le(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?le(c.from,r)<=0:le(c.from,r)<0)))return!0}}}function tn(t){var e;while(e=Ke(t))t=e.find(-1,!0).line;return t}function en(t){var e;while(e=Ze(t))t=e.find(1,!0).line;return t}function nn(t){var e,n;while(e=Ze(t))t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function rn(t,e){var n=Qt(t,e),r=tn(n);return n==r?e:re(r)}function on(t,e){if(e>t.lastLine())return e;var n,r=Qt(t,e);if(!an(t,r))return e;while(n=Ze(r))r=n.find(1,!0).line;return re(r)+1}function an(t,e){var n=Pe&&e.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&sn(t,e,r))return!0}}function sn(t,e,n){if(null==n.to){var r=n.marker.find(1,!0);return sn(t,r.line,Ie(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==e.text.length)return!0;for(var i=void 0,o=0;o<e.markedSpans.length;++o)if(i=e.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&sn(t,e,i))return!0}function ln(t){t=tn(t);for(var e=0,n=t.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==t)break;e+=i.height}for(var o=n.parent;o;n=o,o=n.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 cn(t){if(0==t.height)return 0;var e,n=t.text.length,r=t;while(e=Ke(r)){var i=e.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}r=t;while(e=Ze(r)){var o=e.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function un(t){var e=t.display,n=t.doc;e.maxLine=Qt(n,n.first),e.maxLineLength=cn(e.maxLine),e.maxLineChanged=!0,n.iter((function(t){var n=cn(t);n>e.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var dn=function(t,e,n){this.text=t,We(this,e),this.height=n?n(this):1};function hn(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ue(t),We(t,n);var i=r?r(t):1;i!=t.height&&ne(t,i)}function pn(t){t.parent=null,Ue(t)}dn.prototype.lineNo=function(){return re(this)},At(dn);var fn={},gn={};function mn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?gn:fn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function vn(t,e){var n=N("span",null,null,l?"padding-right: .1px":null),r={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,a=void 0;r.pos=0,r.addToken=yn,jt(t.display.measure)&&(a=gt(o,t.doc.direction))&&(r.addToken=xn(r.addToken,a)),r.map=[];var s=e!=t.display.externalMeasured&&re(o);kn(o,r,we(t,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=j(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=j(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Dt(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var c=r.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return wt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=j(r.pre.className,r.textClass||"")),r}function bn(t){var e=M("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function yn(t,e,n,r,i,o,l){if(e){var c,u=t.splitSpaces?wn(e,t.trailingSpace):e,d=t.cm.state.specialChars,h=!1;if(d.test(e)){c=document.createDocumentFragment();var p=0;while(1){d.lastIndex=p;var f=d.exec(e),g=f?f.index-p:e.length-p;if(g){var m=document.createTextNode(u.slice(p,p+g));a&&s<9?c.appendChild(M("span",[m])):c.appendChild(m),t.map.push(t.pos,t.pos+g,m),t.col+=g,t.pos+=g}if(!f)break;p+=g+1;var v=void 0;if("\t"==f[0]){var b=t.cm.options.tabSize,y=b-t.col%b;v=c.appendChild(M("span",Z(y),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),t.col+=y}else"\r"==f[0]||"\n"==f[0]?(v=c.appendChild(M("span","\r"==f[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",f[0]),t.col+=1):(v=t.cm.options.specialCharPlaceholder(f[0]),v.setAttribute("cm-text",f[0]),a&&s<9?c.appendChild(M("span",[v])):c.appendChild(v),t.col+=1);t.map.push(t.pos,t.pos+1,v),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),a&&s<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||r||i||h||o||l){var w=n||"";r&&(w+=r),i&&(w+=i);var x=M("span",[c],w,o);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return t.content.appendChild(x)}t.content.appendChild(c)}}function wn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;i<t.length;i++){var o=t.charAt(i);" "!=o||!n||i!=t.length-1&&32!=t.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function xn(t,e){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,h=0;h<e.length;h++)if(d=e[h],d.to>c&&d.from<=c)break;if(d.to>=u)return t(n,r,i,o,a,s,l);t(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function Cn(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function kn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,c,u,d,h,p=i.length,f=0,g=1,m="",v=0;;){if(v==f){l=c=u=s="",h=null,d=null,v=1/0;for(var b=[],y=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==f&&C.widgetNode)b.push(C);else if(x.from<=f&&(null==x.to||x.to>f||C.collapsed&&x.to==f&&x.from==f)){if(null!=x.to&&x.to!=f&&v>x.to&&(v=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==f&&(u+=" "+C.startStyle),C.endStyle&&x.to==v&&(y||(y=[])).push(C.endStyle,x.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var k in C.attributes)(h||(h={}))[k]=C.attributes[k];C.collapsed&&(!d||Ye(d.marker,C)<0)&&(d=x)}else x.from>f&&v>x.from&&(v=x.from)}if(y)for(var A=0;A<y.length;A+=2)y[A+1]==v&&(c+=" "+y[A]);if(!d||d.from==f)for(var S=0;S<b.length;++S)Cn(e,0,b[S]);if(d&&(d.from||0)==f){if(Cn(e,(null==d.to?p+1:d.to)-f,d.marker,null==d.from),null==d.to)return;d.to==f&&(d=!1)}}if(f>=p)break;var E=Math.min(p,v);while(1){if(m){var O=f+m.length;if(!d){var T=O>E?m.slice(0,E-f):m;e.addToken(e,T,a?a+l:l,u,f+T.length==v?c:"",s,h)}if(O>=E){m=m.slice(E-f),f=E;break}f=O,u=""}m=i.slice(o,o=n[g++]),a=mn(n[g++],e.cm.options)}}else for(var _=1;_<n.length;_+=2)e.addToken(e,i.slice(o,o=n[_]),mn(n[_+1],e.cm.options))}function An(t,e,n){this.line=e,this.rest=nn(e),this.size=this.rest?re(J(this.rest))-n+1:1,this.node=this.text=null,this.hidden=an(t,e)}function Sn(t,e,n){for(var r,i=[],o=e;o<n;o=r){var a=new An(t.doc,Qt(t.doc,o),o);r=o+a.size,i.push(a)}return i}var En=null;function On(t){En?En.ops.push(t):t.ownsGroup=En={ops:[t],delayedCallbacks:[]}}function Tn(t){var e=t.delayedCallbacks,n=0;do{for(;n<e.length;n++)e[n].call(null);for(var r=0;r<t.ops.length;r++){var i=t.ops[r];if(i.cursorActivityHandlers)while(i.cursorActivityCalled<i.cursorActivityHandlers.length)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<e.length)}function _n(t,e){var n=t.ownsGroup;if(n)try{Tn(n)}finally{En=null,e(n)}}var Mn=null;function Nn(t,e){var n=bt(t,e);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);En?r=En.delayedCallbacks:Mn?r=Mn:(r=Mn=[],setTimeout(Pn,0));for(var o=function(t){r.push((function(){return n[t].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function Pn(){var t=Mn;Mn=null;for(var e=0;e<t.length;++e)t[e]()}function Ln(t,e,n,r){for(var i=0;i<e.changes.length;i++){var o=e.changes[i];"text"==o?Rn(t,e):"gutter"==o?Bn(t,e,n,r):"class"==o?Fn(t,e):"widget"==o&&zn(t,e,r)}e.changes=null}function Dn(t){return t.node==t.text&&(t.node=M("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),a&&s<8&&(t.node.style.zIndex=2)),t.node}function jn(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 r=Dn(e);e.background=r.insertBefore(M("div",null,n),r.firstChild),t.display.input.setUneditable(e.background)}}function In(t,e){var n=t.display.externalMeasured;return n&&n.line==e.line?(t.display.externalMeasured=null,e.measure=n.measure,n.built):vn(t,e)}function Rn(t,e){var n=e.text.className,r=In(t,e);e.text==e.node&&(e.node=r.pre),e.text.parentNode.replaceChild(r.pre,e.text),e.text=r.pre,r.bgClass!=e.bgClass||r.textClass!=e.textClass?(e.bgClass=r.bgClass,e.textClass=r.textClass,Fn(t,e)):n&&(e.text.className=n)}function Fn(t,e){jn(t,e),e.line.wrapClass?Dn(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 Bn(t,e,n,r){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 i=Dn(e);e.gutterBackground=M("div",null,"CodeMirror-gutter-background "+e.line.gutterClass,"left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),t.display.input.setUneditable(e.gutterBackground),i.insertBefore(e.gutterBackground,e.text)}var o=e.line.gutterMarkers;if(t.options.lineNumbers||o){var a=Dn(e),s=e.gutter=M("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),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(M("div",ae(t.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<t.display.gutterSpecs.length;++l){var c=t.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(M("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function zn(t,e,n){e.alignable&&(e.alignable=null);for(var r=S("CodeMirror-linewidget"),i=e.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&e.node.removeChild(i);Vn(t,e,n)}function Hn(t,e,n,r){var i=In(t,e);return e.text=e.node=i.pre,i.bgClass&&(e.bgClass=i.bgClass),i.textClass&&(e.textClass=i.textClass),Fn(t,e),Bn(t,e,n,r),Vn(t,e,r),e.node}function Vn(t,e,n){if(qn(t,e.line,e,n,!0),e.rest)for(var r=0;r<e.rest.length;r++)qn(t,e.rest[r],e,n,!1)}function qn(t,e,n,r,i){if(e.widgets)for(var o=Dn(n),a=0,s=e.widgets;a<s.length;++a){var l=s[a],c=M("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Un(l,c,n,r),t.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),Nn(l,"redraw")}}function Un(t,e,n,r){if(t.noHScroll){(n.alignable||(n.alignable=[])).push(e);var i=r.wrapperWidth;e.style.left=r.fixedPos+"px",t.coverGutter||(i-=r.gutterTotalWidth,e.style.paddingLeft=r.gutterTotalWidth+"px"),e.style.width=i+"px"}t.coverGutter&&(e.style.zIndex=5,e.style.position="relative",t.noHScroll||(e.style.marginLeft=-r.gutterTotalWidth+"px"))}function Wn(t){if(null!=t.height)return t.height;var e=t.doc.cm;if(!e)return 0;if(!P(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;"),_(e.display.measure,M("div",[t.node],null,n))}return t.height=t.node.parentNode.offsetHeight}function $n(t,e){for(var n=_t(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 Gn(t){return t.lineSpace.offsetTop}function Yn(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function Xn(t){if(t.cachedPaddingH)return t.cachedPaddingH;var e=_(t.measure,M("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(t.cachedPaddingH=r),r}function Kn(t){return U-t.display.nativeBarWidth}function Zn(t){return t.display.scroller.clientWidth-Kn(t)-t.display.barWidth}function Jn(t){return t.display.scroller.clientHeight-Kn(t)-t.display.barHeight}function Qn(t,e,n){var r=t.options.lineWrapping,i=r&&Zn(t);if(!e.measure.heights||r&&e.measure.width!=i){var o=e.measure.heights=[];if(r){e.measure.width=i;for(var a=e.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function tr(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){for(var r=0;r<t.rest.length;r++)if(t.rest[r]==e)return{map:t.measure.maps[r],cache:t.measure.caches[r]};for(var i=0;i<t.rest.length;i++)if(re(t.rest[i])>n)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}}function er(t,e){e=tn(e);var n=re(e),r=t.display.externalMeasured=new An(t.doc,e,n);r.lineN=n;var i=r.built=vn(t,r);return r.text=i.pre,_(t.display.lineMeasure,i.pre),r}function nr(t,e,n,r){return or(t,ir(t,e),n,r)}function rr(t,e){if(e>=t.display.viewFrom&&e<t.display.viewTo)return t.display.view[Fr(t,e)];var n=t.display.externalMeasured;return n&&e>=n.lineN&&e<n.lineN+n.size?n:void 0}function ir(t,e){var n=re(e),r=rr(t,n);r&&!r.text?r=null:r&&r.changes&&(Ln(t,r,n,Lr(t)),t.curOp.forceUpdate=!0),r||(r=er(t,e));var i=tr(r,e,n);return{line:e,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function or(t,e,n,r,i){e.before&&(n=-1);var o,a=n+(r||"");return e.cache.hasOwnProperty(a)?o=e.cache[a]:(e.rect||(e.rect=e.view.text.getBoundingClientRect()),e.hasHeights||(Qn(t,e.view,e.rect),e.hasHeights=!0),o=ur(t,e,n,r),o.bogus||(e.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var ar,sr={left:0,right:0,top:0,bottom:0};function lr(t,e,n){for(var r,i,o,a,s,l,c=0;c<t.length;c+=3)if(s=t[c],l=t[c+1],e<s?(i=0,o=1,a="left"):e<l?(i=e-s,o=i+1):(c==t.length-3||e==l&&t[c+3]>e)&&(o=l-s,i=o-1,e>=l&&(a="right")),null!=i){if(r=t[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)while(c&&t[c-2]==t[c-3]&&t[c-1].insertLeft)r=t[2+(c-=3)],a="left";if("right"==n&&i==l-s)while(c<t.length-3&&t[c+3]==t[c+4]&&!t[c+5].insertLeft)r=t[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function cr(t,e){var n=sr;if("left"==e){for(var r=0;r<t.length;r++)if((n=t[r]).left!=n.right)break}else for(var i=t.length-1;i>=0;i--)if((n=t[i]).left!=n.right)break;return n}function ur(t,e,n,r){var i,o=lr(e.map,n,r),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){while(c&&lt(e.line.text.charAt(o.coverStart+c)))--c;while(o.coverStart+u<o.coverEnd&&lt(e.line.text.charAt(o.coverStart+u)))++u;if(i=a&&s<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():cr(E(l,c,u).getClientRects(),r),i.left||i.right||0==c)break;u=c,c-=1,d="right"}a&&s<11&&(i=dr(t.display.measure,i))}else{var p;c>0&&(d=r="right"),i=t.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var f=l.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+Pr(t.display),top:f.top,bottom:f.bottom}:sr}for(var g=i.top-e.rect.top,m=i.bottom-e.rect.top,v=(g+m)/2,b=e.view.measure.heights,y=0;y<b.length-1;y++)if(v<b[y])break;var w=y?b[y-1]:0,x=b[y],C={left:("right"==d?i.right:i.left)-e.rect.left,right:("left"==d?i.left:i.right)-e.rect.left,top:w,bottom:x};return i.left||i.right||(C.bogus=!0),t.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=m),C}function dr(t,e){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!zt(t))return e;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:e.left*n,right:e.right*n,top:e.top*r,bottom:e.bottom*r}}function hr(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 pr(t){t.display.externalMeasure=null,T(t.display.lineMeasure);for(var e=0;e<t.display.view.length;e++)hr(t.display.view[e])}function fr(t){pr(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function gr(t){return u&&v?-(t.body.getBoundingClientRect().left-parseInt(getComputedStyle(t.body).marginLeft)):t.defaultView.pageXOffset||(t.documentElement||t.body).scrollLeft}function mr(t){return u&&v?-(t.body.getBoundingClientRect().top-parseInt(getComputedStyle(t.body).marginTop)):t.defaultView.pageYOffset||(t.documentElement||t.body).scrollTop}function vr(t){var e=tn(t),n=e.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=Wn(n[i]));return r}function br(t,e,n,r,i){if(!i){var o=vr(e);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=ln(e);if("local"==r?a+=Gn(t.display):a-=t.display.viewOffset,"page"==r||"window"==r){var s=t.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:mr(R(t)));var l=s.left+("window"==r?0:gr(R(t)));n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function yr(t,e,n){if("div"==n)return e;var r=e.left,i=e.top;if("page"==n)r-=gr(R(t)),i-=mr(R(t));else if("local"==n||!n){var o=t.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=t.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function wr(t,e,n,r,i){return r||(r=Qt(t.doc,e.line)),br(t,r,nr(t,r,e.ch,i),n)}function xr(t,e,n,r,i,o){function a(e,a){var s=or(t,i,e,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,br(t,r,s,n)}r=r||Qt(t.doc,e.line),i||(i=ir(t,r));var s=gt(r,t.doc.direction),l=e.ch,c=e.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(t,e,n){var r=s[e],i=1==r.level;return a(n?t-1:t,i!=n)}var d=pt(s,l,c),h=ht,p=u(l,d,"before"==c);return null!=h&&(p.other=u(l,h,"before"!=c)),p}function Cr(t,e){var n=0;e=fe(t.doc,e),t.options.lineWrapping||(n=Pr(t.display)*e.ch);var r=Qt(t.doc,e.line),i=ln(r)+Gn(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function kr(t,e,n,r,i){var o=se(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function Ar(t,e,n){var r=t.doc;if(n+=t.display.viewOffset,n<0)return kr(r.first,0,null,-1,-1);var i=ie(r,n),o=r.first+r.size-1;if(i>o)return kr(r.first+r.size-1,Qt(r,o).text.length,null,1,1);e<0&&(e=0);for(var a=Qt(r,i);;){var s=Tr(t,a,i,e,n),l=Je(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=Qt(r,i=c.line)}}function Sr(t,e,n,r){r-=vr(e);var i=e.text.length,o=ut((function(e){return or(t,n,e-1).bottom<=r}),i,0);return i=ut((function(e){return or(t,n,e).top>r}),o,i),{begin:o,end:i}}function Er(t,e,n,r){n||(n=ir(t,e));var i=br(t,e,or(t,n,r),"line").top;return Sr(t,e,n,i)}function Or(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function Tr(t,e,n,r,i){i-=ln(e);var o=ir(t,e),a=vr(e),s=0,l=e.text.length,c=!0,u=gt(e,t.doc.direction);if(u){var d=(t.options.lineWrapping?Mr:_r)(t,e,n,o,u,r,i);c=1!=d.level,s=c?d.from:d.to-1,l=c?d.to:d.from-1}var h,p,f=null,g=null,m=ut((function(e){var n=or(t,o,e);return n.top+=a,n.bottom+=a,!!Or(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(f=e,g=n),!0)}),s,l),v=!1;if(g){var b=r-g.left<g.right-r,y=b==c;m=f+(y?0:1),p=y?"after":"before",h=b?g.left:g.right}else{c||m!=l&&m!=s||m++,p=0==m?"after":m==e.text.length?"before":or(t,o,m-(c?1:0)).bottom+a<=i==c?"after":"before";var w=xr(t,se(n,m,p),"line",e,o);h=w.left,v=i<w.top?-1:i>=w.bottom?1:0}return m=ct(e.text,m,1),kr(n,m,p,v,r-h)}function _r(t,e,n,r,i,o,a){var s=ut((function(s){var l=i[s],c=1!=l.level;return Or(xr(t,se(n,c?l.to:l.from,c?"before":"after"),"line",e,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=xr(t,se(n,c?l.from:l.to,c?"after":"before"),"line",e,r);Or(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function Mr(t,e,n,r,i,o,a){var s=Sr(t,e,r,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h<i.length;h++){var p=i[h];if(!(p.from>=c||p.to<=l)){var f=1!=p.level,g=or(t,r,f?Math.min(c,p.to)-1:Math.max(l,p.from)).right,m=g<o?o-g+1e9:g-o;(!u||d>m)&&(u=p,d=m)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function Nr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ar){ar=M("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ar.appendChild(document.createTextNode("x")),ar.appendChild(M("br"));ar.appendChild(document.createTextNode("x"))}_(t.measure,ar);var n=ar.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),T(t.measure),n||1}function Pr(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=M("span","xxxxxxxxxx"),n=M("pre",[e],"CodeMirror-line-like");_(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function Lr(t){for(var e=t.display,n={},r={},i=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+i,r[s]=o.clientWidth}return{fixedPos:Dr(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function Dr(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function jr(t){var e=Nr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/Pr(t.display)-3);return function(i){if(an(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*e:o+e}}function Ir(t){var e=t.doc,n=jr(t);e.iter((function(t){var e=n(t);e!=t.height&&ne(t,e)}))}function Rr(t,e,n,r){var i=t.display;if(!n&&"true"==_t(e).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=e.clientX-s.left,a=e.clientY-s.top}catch(d){return null}var l,c=Ar(t,o,a);if(r&&c.xRel>0&&(l=Qt(t.doc,c.line).text).length==c.ch){var u=H(l,l.length,t.options.tabSize)-l.length;c=se(c.line,Math.max(0,Math.round((o-Xn(t.display).left)/Pr(t.display))-u))}return c}function Fr(t,e){if(e>=t.display.viewTo)return null;if(e-=t.display.viewFrom,e<0)return null;for(var n=t.display.view,r=0;r<n.length;r++)if(e-=n[r].size,e<0)return r}function Br(t,e,n,r){null==e&&(e=t.doc.first),null==n&&(n=t.doc.first+t.doc.size),r||(r=0);var i=t.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>e)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Pe&&rn(t.doc,e)<i.viewTo&&Hr(t);else if(n<=i.viewFrom)Pe&&on(t.doc,n+r)>i.viewFrom?Hr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)Hr(t);else if(e<=i.viewFrom){var o=Vr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Hr(t)}else if(n>=i.viewTo){var a=Vr(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Hr(t)}else{var s=Vr(t,e,e,-1),l=Vr(t,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Sn(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Hr(t)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:e<c.lineN+c.size&&(i.externalMeasured=null))}function zr(t,e,n){t.curOp.viewChanged=!0;var r=t.display,i=t.display.externalMeasured;if(i&&e>=i.lineN&&e<i.lineN+i.size&&(r.externalMeasured=null),!(e<r.viewFrom||e>=r.viewTo)){var o=r.view[Fr(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==q(a,n)&&a.push(n)}}}function Hr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Vr(t,e,n,r){var i,o=Fr(t,e),a=t.display.view;if(!Pe||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(r>0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,n+=i}while(rn(t.doc,n)!=n){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function qr(t,e,n){var r=t.display,i=r.view;0==i.length||e>=r.viewTo||n<=r.viewFrom?(r.view=Sn(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=Sn(t,e,r.viewFrom).concat(r.view):r.viewFrom<e&&(r.view=r.view.slice(Fr(t,e))),r.viewFrom=e,r.viewTo<n?r.view=r.view.concat(Sn(t,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Fr(t,n)))),r.viewTo=n}function Ur(t){for(var e=t.display.view,n=0,r=0;r<e.length;r++){var i=e[r];i.hidden||i.node&&!i.changes||++n}return n}function Wr(t){t.display.input.showSelection(t.display.input.prepareSelection())}function $r(t,e){void 0===e&&(e=!0);var n=t.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=t.options.$customCursor;a&&(e=!0);for(var s=0;s<n.sel.ranges.length;s++)if(e||s!=n.sel.primIndex){var l=n.sel.ranges[s];if(!(l.from().line>=t.display.viewTo||l.to().line<t.display.viewFrom)){var c=l.empty();if(a){var u=a(t,l);u&&Gr(t,u,i)}else(c||t.options.showCursorWhenSelecting)&&Gr(t,l.head,i);c||Xr(t,l,o)}}return r}function Gr(t,e,n){var r=xr(t,e,"div",null,null,!t.options.singleCursorHeightPerLine),i=n.appendChild(M("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*t.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var o=wr(t,e,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:t.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(M("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Yr(t,e){return t.top-e.top||t.left-e.left}function Xr(t,e,n){var r=t.display,i=t.doc,o=document.createDocumentFragment(),a=Xn(t.display),s=a.left,l=Math.max(r.sizerWidth,Zn(t)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(t,e,n,r){e<0&&(e=0),e=Math.round(e),r=Math.round(r),o.appendChild(M("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(r-e)+"px"))}function d(e,n,r){var o,a,d=Qt(i,e),h=d.text.length;function p(n,r){return wr(t,se(e,n),"div",d,r)}function f(e,n,r){var i=Er(t,d,null,e),o="ltr"==n==("after"==r)?"left":"right",a="after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1);return p(a,o)[o]}var g=gt(d,i.direction);return dt(g,n||0,null==r?h:r,(function(t,e,i,d){var m="ltr"==i,v=p(t,m?"left":"right"),b=p(e-1,m?"right":"left"),y=null==n&&0==t,w=null==r&&e==h,x=0==d,C=!g||d==g.length-1;if(b.top-v.top<=3){var k=(c?y:w)&&x,A=(c?w:y)&&C,S=k?s:(m?v:b).left,E=A?l:(m?b:v).right;u(S,v.top,E-S,v.bottom)}else{var O,T,_,M;m?(O=c&&y&&x?s:v.left,T=c?l:f(t,i,"before"),_=c?s:f(e,i,"after"),M=c&&w&&C?l:b.right):(O=c?f(t,i,"before"):s,T=!c&&y&&x?l:v.right,_=!c&&w&&C?s:b.left,M=c?f(e,i,"after"):l),u(O,v.top,T-O,v.bottom),v.bottom<b.top&&u(s,v.bottom,null,b.top),u(_,b.top,M-_,b.bottom)}(!o||Yr(v,o)<0)&&(o=v),Yr(b,o)<0&&(o=b),(!a||Yr(v,a)<0)&&(a=v),Yr(b,a)<0&&(a=b)})),{start:o,end:a}}var h=e.from(),p=e.to();if(h.line==p.line)d(h.line,h.ch,p.ch);else{var f=Qt(i,h.line),g=Qt(i,p.line),m=tn(f)==tn(g),v=d(h.line,h.ch,m?f.text.length+1:null).end,b=d(p.line,m?0:null,p.ch).start;m&&(v.top<b.top-2?(u(v.right,v.top,null,v.bottom),u(s,b.top,b.left,b.bottom)):u(v.right,v.top,b.left-v.right,v.bottom)),v.bottom<b.top&&u(s,v.bottom,null,b.top)}n.appendChild(o)}function Kr(t){if(t.state.focused){var e=t.display;clearInterval(e.blinker);var n=!0;e.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?e.blinker=setInterval((function(){t.hasFocus()||ti(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Zr(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Qr(t))}function Jr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&ti(t))}),100)}function Qr(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(wt(t,"focus",t,e),t.state.focused=!0,D(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),Kr(t))}function ti(t,e){t.state.delayingBlurEvent||(t.state.focused&&(wt(t,"blur",t,e),t.state.focused=!1,O(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function ei(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=Math.max(0,e.scroller.getBoundingClientRect().top),i=e.lineDiv.getBoundingClientRect().top,o=0,l=0;l<e.view.length;l++){var c=e.view[l],u=t.options.lineWrapping,d=void 0,h=0;if(!c.hidden){if(i+=c.line.height,a&&s<8){var p=c.node.offsetTop+c.node.offsetHeight;d=p-n,n=p}else{var f=c.node.getBoundingClientRect();d=f.bottom-f.top,!u&&c.text.firstChild&&(h=c.text.firstChild.getBoundingClientRect().right-f.left-1)}var g=c.line.height-d;if((g>.005||g<-.005)&&(i<r&&(o-=g),ne(c.line,d),ni(c.line),c.rest))for(var m=0;m<c.rest.length;m++)ni(c.rest[m]);if(h>t.display.sizerWidth){var v=Math.ceil(h/Pr(t.display));v>t.display.maxLineLength&&(t.display.maxLineLength=v,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(e.scroller.scrollTop+=o)}function ni(t){if(t.widgets)for(var e=0;e<t.widgets.length;++e){var n=t.widgets[e],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function ri(t,e,n){var r=n&&null!=n.top?Math.max(0,n.top):t.scroller.scrollTop;r=Math.floor(r-Gn(t));var i=n&&null!=n.bottom?n.bottom:r+t.wrapper.clientHeight,o=ie(e,r),a=ie(e,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=ie(e,ln(Qt(e,s))+t.wrapper.clientHeight)):Math.min(l,e.lastLine())>=a&&(o=ie(e,ln(Qt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ii(t,e){if(!xt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(e.top+r.top<0?i=!0:e.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!g){var a=M("div","",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Gn(t.display))+"px;\n height: "+(e.bottom-e.top+Kn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(a),a.scrollIntoView(i),t.display.lineSpace.removeChild(a)}}}function oi(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?se(e.line,e.ch+1,"before"):e,e=e.ch?se(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var o=0;o<5;o++){var a=!1,s=xr(t,e),l=n&&n!=e?xr(t,n):s;i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r};var c=si(t,i),u=t.doc.scrollTop,d=t.doc.scrollLeft;if(null!=c.scrollTop&&(fi(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(mi(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ai(t,e){var n=si(t,e);null!=n.scrollTop&&fi(t,n.scrollTop),null!=n.scrollLeft&&mi(t,n.scrollLeft)}function si(t,e){var n=t.display,r=Nr(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Jn(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Yn(n),l=e.top<r,c=e.bottom>s-r;if(e.top<i)a.scrollTop=l?0:e.top;else if(e.bottom>i+o){var u=Math.min(e.top,(c?s:e.bottom)-o);u!=i&&(a.scrollTop=u)}var d=t.options.fixedGutter?0:n.gutters.offsetWidth,h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-d,p=Zn(t)-n.gutters.offsetWidth,f=e.right-e.left>p;return f&&(e.right=e.left+p),e.left<10?a.scrollLeft=0:e.left<h?a.scrollLeft=Math.max(0,e.left+d-(f?0:10)):e.right>p+h-3&&(a.scrollLeft=e.right+(f?0:10)-p),a}function li(t,e){null!=e&&(hi(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function ci(t){hi(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function ui(t,e,n){null==e&&null==n||hi(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function di(t,e){hi(t),t.curOp.scrollToPos=e}function hi(t){var e=t.curOp.scrollToPos;if(e){t.curOp.scrollToPos=null;var n=Cr(t,e.from),r=Cr(t,e.to);pi(t,n,r,e.margin)}}function pi(t,e,n,r){var i=si(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});ui(t,i.scrollLeft,i.scrollTop)}function fi(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Wi(t,{top:e}),gi(t,e,!0),n&&Wi(t),Ri(t,100))}function gi(t,e,n){e=Math.max(0,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 mi(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,Xi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function vi(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Yn(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:r,scrollHeight:r+Kn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var bi=function(t,e,n){this.cm=n;var r=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),vt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),vt(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};bi.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r: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&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},bi.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},bi.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},bi.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new V,this.disableVert=new V},bi.prototype.enableZeroWidthBar=function(t,e,n){function r(){var i=t.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=t?t.style.visibility="hidden":e.set(1e3,r)}t.style.visibility="",e.set(1e3,r)},bi.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var yi=function(){};function wi(t,e){e||(e=vi(t));var n=t.display.barWidth,r=t.display.barHeight;xi(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&ei(t),xi(t,vi(t)),n=t.display.barWidth,r=t.display.barHeight}function xi(t,e){var n=t.display,r=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}yi.prototype.update=function(){return{bottom:0,right:0}},yi.prototype.setScrollLeft=function(){},yi.prototype.setScrollTop=function(){},yi.prototype.clear=function(){};var Ci={native:bi,null:yi};function ki(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&O(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Ci[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),vt(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?mi(t,e):fi(t,e)}),t),t.display.scrollbars.addClass&&D(t.display.wrapper,t.display.scrollbars.addClass)}var Ai=0;function Si(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:++Ai,markArrays:null},On(t.curOp)}function Ei(t){var e=t.curOp;e&&_n(e,(function(t){for(var e=0;e<t.ops.length;e++)t.ops[e].cm.curOp=null;Oi(t)}))}function Oi(t){for(var e=t.ops,n=0;n<e.length;n++)Ti(e[n]);for(var r=0;r<e.length;r++)_i(e[r]);for(var i=0;i<e.length;i++)Mi(e[i]);for(var o=0;o<e.length;o++)Ni(e[o]);for(var a=0;a<e.length;a++)Pi(e[a])}function Ti(t){var e=t.cm,n=e.display;zi(e),t.updateMaxLine&&un(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 Bi(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function _i(t){t.updatedDisplay=t.mustUpdate&&qi(t.cm,t.update)}function Mi(t){var e=t.cm,n=e.display;t.updatedDisplay&&ei(e),t.barMeasure=vi(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=nr(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+Kn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Zn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Ni(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<e.doc.scrollLeft&&mi(e,Math.min(e.display.scroller.scrollLeft,t.maxScrollLeft),!0),e.display.maxLineChanged=!1);var n=t.focus&&t.focus==L(R(e));t.preparedSelection&&e.display.input.showSelection(t.preparedSelection,n),(t.updatedDisplay||t.startHeight!=e.doc.height)&&wi(e,t.barMeasure),t.updatedDisplay&&Yi(e,t.barMeasure),t.selectionChanged&&Kr(e),e.state.focused&&t.updateInput&&e.display.input.reset(t.typing),n&&Zr(t.cm)}function Pi(t){var e=t.cm,n=e.display,r=e.doc;if(t.updatedDisplay&&Ui(e,t.update),null==n.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=t.scrollTop&&gi(e,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&mi(e,t.scrollLeft,!0,!0),t.scrollToPos){var i=oi(e,fe(r,t.scrollToPos.from),fe(r,t.scrollToPos.to),t.scrollToPos.margin);ii(e,i)}var o=t.maybeHiddenMarkers,a=t.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||wt(o[s],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&wt(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=e.display.scroller.scrollTop),t.changeObjs&&wt(e,"changes",e,t.changeObjs),t.update&&t.update.finish()}function Li(t,e){if(t.curOp)return e();Si(t);try{return e()}finally{Ei(t)}}function Di(t,e){return function(){if(t.curOp)return e.apply(t,arguments);Si(t);try{return e.apply(t,arguments)}finally{Ei(t)}}}function ji(t){return function(){if(this.curOp)return t.apply(this,arguments);Si(this);try{return t.apply(this,arguments)}finally{Ei(this)}}}function Ii(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Si(e);try{return t.apply(this,arguments)}finally{Ei(e)}}}function Ri(t,e){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(e,B(Fi,t))}function Fi(t){var e=t.doc;if(!(e.highlightFrontier>=t.display.viewTo)){var n=+new Date+t.options.workTime,r=xe(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?Xt(e.mode,r.state):null,l=ye(t,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&h<a.length;++h)d=a[h]!=o.styles[h];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=t.options.maxHighlightLength&&Ce(t,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Ri(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Li(t,(function(){for(var e=0;e<i.length;e++)zr(t,i[e],"text")}))}}var Bi=function(t,e,n){var r=t.display;this.viewport=e,this.visible=ri(r,t.doc,e),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Zn(t),this.force=n,this.dims=Lr(t),this.events=[]};function zi(t){var e=t.display;!e.scrollbarsClipped&&e.scroller.offsetWidth&&(e.nativeBarWidth=e.scroller.offsetWidth-e.scroller.clientWidth,e.heightForcer.style.height=Kn(t)+"px",e.sizer.style.marginBottom=-e.nativeBarWidth+"px",e.sizer.style.borderRightWidth=Kn(t)+"px",e.scrollbarsClipped=!0)}function Hi(t){if(t.hasFocus())return null;var e=L(R(t));if(!e||!P(t.display.lineDiv,e))return null;var n={activeElt:e};if(window.getSelection){var r=F(t).getSelection();r.anchorNode&&r.extend&&P(t.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Vi(t){if(t&&t.activeElt&&t.activeElt!=L(t.activeElt.ownerDocument)&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&P(document.body,t.anchorNode)&&P(document.body,t.focusNode))){var e=t.activeElt.ownerDocument,n=e.defaultView.getSelection(),r=e.createRange();r.setEnd(t.anchorNode,t.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(t.focusNode,t.focusOffset)}}function qi(t,e){var n=t.display,r=t.doc;if(e.editorIsHidden)return Hr(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==Ur(t))return!1;Ki(t)&&(Hr(t),e.dims=Lr(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Pe&&(o=rn(t.doc,o),a=on(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;qr(t,o,a),n.viewOffset=ln(Qt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=Ur(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Hi(t);return l>4&&(n.lineDiv.style.display="none"),$i(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Vi(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Ri(t,400)),n.updateLineNumbers=null,!0}function Ui(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Zn(t))r&&(e.visible=ri(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Yn(t.display)-Jn(t),n.top)}),e.visible=ri(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!qi(t,e))break;ei(t);var i=vi(t);Wr(t),wi(t,i),Yi(t,i),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 Wi(t,e){var n=new Bi(t,e);if(qi(t,n)){ei(t),Ui(t,n);var r=vi(t);Wr(t),wi(t,r),Yi(t,r),n.finish()}}function $i(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=r.view,u=r.viewFrom,d=0;d<c.length;d++){var h=c[d];if(h.hidden);else if(h.node&&h.node.parentNode==o){while(a!=h.node)a=s(a);var p=i&&null!=e&&e<=u&&h.lineNumber;h.changes&&(q(h.changes,"gutter")>-1&&(p=!1),Ln(t,h,u,n)),p&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(ae(t.options,u)))),a=h.node.nextSibling}else{var f=Hn(t,h,u,n);o.insertBefore(f,a)}u+=h.size}while(a)a=s(a)}function Gi(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",Nn(t,"gutterChanged",t)}function Yi(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+Kn(t)+"px"}function Xi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=Dr(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"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=r+i+"px")}}function Ki(t){if(!t.options.lineNumbers)return!1;var e=t.doc,n=ae(t.options,e.first+e.size-1),r=t.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(M("div",[M("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Gi(t.display),!0}return!1}function Zi(t,e){for(var n=[],r=!1,i=0;i<t.length;i++){var o=t[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!e)continue;r=!0}n.push({className:o,style:a})}return e&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Ji(t){var e=t.gutters,n=t.gutterSpecs;T(e),t.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=e.appendChild(M("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(t.lineGutter=s,s.style.width=(t.lineNumWidth||1)+"px")}e.style.display=n.length?"":"none",Gi(t)}function Qi(t){Ji(t.display),Br(t),Xi(t)}function to(t,e,r,i){var o=this;this.input=r,o.scrollbarFiller=M("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=M("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=N("div",null,"CodeMirror-code"),o.selectionDiv=M("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=M("div",null,"CodeMirror-cursors"),o.measure=M("div",null,"CodeMirror-measure"),o.lineMeasure=M("div",null,"CodeMirror-measure"),o.lineSpace=N("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=N("div",[o.lineSpace],"CodeMirror-lines");o.mover=M("div",[c],null,"position: relative"),o.sizer=M("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=M("div",null,null,"position: absolute; height: "+U+"px; width: 1px;"),o.gutters=M("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=M("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=M("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),o.wrapper.setAttribute("translate","no"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&b||(o.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(o.wrapper):t(o.wrapper)),o.viewFrom=o.viewTo=e.first,o.reportedViewFrom=o.reportedViewTo=e.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Zi(i.gutters,i.lineNumbers),Ji(o),r.init(o)}Bi.prototype.signal=function(t,e){kt(t,e)&&this.events.push(arguments)},Bi.prototype.finish=function(){for(var t=0;t<this.events.length;t++)wt.apply(null,this.events[t])};var eo=0,no=null;function ro(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 io(t){var e=ro(t);return e.x*=no,e.y*=no,e}function oo(t,e){u&&102==d&&(null==t.display.chromeScrollHack?t.display.sizer.style.pointerEvents="none":clearTimeout(t.display.chromeScrollHack),t.display.chromeScrollHack=setTimeout((function(){t.display.chromeScrollHack=null,t.display.sizer.style.pointerEvents=""}),100));var r=ro(e),i=r.x,o=r.y,a=no;0===e.deltaMode&&(i=e.deltaX,o=e.deltaY,a=1);var s=t.display,c=s.scroller,p=c.scrollWidth>c.clientWidth,f=c.scrollHeight>c.clientHeight;if(i&&p||o&&f){if(o&&y&&l)t:for(var g=e.target,m=s.view;g!=c;g=g.parentNode)for(var v=0;v<m.length;v++)if(m[v].node==g){t.display.currentWheelTarget=g;break t}if(i&&!n&&!h&&null!=a)return o&&f&&fi(t,Math.max(0,c.scrollTop+o*a)),mi(t,Math.max(0,c.scrollLeft+i*a)),(!o||o&&f)&&St(e),void(s.wheelStartX=null);if(o&&null!=a){var b=o*a,w=t.doc.scrollTop,x=w+s.wrapper.clientHeight;b<0?w=Math.max(0,w+b-50):x=Math.min(t.doc.height,x+b+50),Wi(t,{top:w,bottom:x})}eo<20&&0!==e.deltaMode&&(null==s.wheelStartX?(s.wheelStartX=c.scrollLeft,s.wheelStartY=c.scrollTop,s.wheelDX=i,s.wheelDY=o,setTimeout((function(){if(null!=s.wheelStartX){var t=c.scrollLeft-s.wheelStartX,e=c.scrollTop-s.wheelStartY,n=e&&s.wheelDY&&e/s.wheelDY||t&&s.wheelDX&&t/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(no=(no*eo+n)/(eo+1),++eo)}}),200)):(s.wheelDX+=i,s.wheelDY+=o))}}a?no=-.53:n?no=15:u?no=-.7:p&&(no=-1/3);var ao=function(t,e){this.ranges=t,this.primIndex=e};ao.prototype.primary=function(){return this.ranges[this.primIndex]},ao.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var e=0;e<this.ranges.length;e++){var n=this.ranges[e],r=t.ranges[e];if(!ce(n.anchor,r.anchor)||!ce(n.head,r.head))return!1}return!0},ao.prototype.deepCopy=function(){for(var t=[],e=0;e<this.ranges.length;e++)t[e]=new so(ue(this.ranges[e].anchor),ue(this.ranges[e].head));return new ao(t,this.primIndex)},ao.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},ao.prototype.contains=function(t,e){e||(e=t);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(le(e,r.from())>=0&&le(t,r.to())<=0)return n}return-1};var so=function(t,e){this.anchor=t,this.head=e};function lo(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return le(t.from(),e.from())})),n=q(e,i);for(var o=1;o<e.length;o++){var a=e[o],s=e[o-1],l=le(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=he(s.from(),a.from()),u=de(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new so(d?u:c,d?c:u))}}return new ao(e,n)}function co(t,e){return new ao([new so(t,e||t)],0)}function uo(t){return t.text?se(t.from.line+t.text.length-1,J(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function ho(t,e){if(le(t,e.from)<0)return t;if(le(t,e.to)<=0)return uo(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=uo(e).ch-e.to.ch),se(n,r)}function po(t,e){for(var n=[],r=0;r<t.sel.ranges.length;r++){var i=t.sel.ranges[r];n.push(new so(ho(i.anchor,e),ho(i.head,e)))}return lo(t.cm,n,t.sel.primIndex)}function fo(t,e,n){return t.line==e.line?se(n.line,t.ch-e.ch+n.ch):se(n.line+(t.line-e.line),t.ch)}function go(t,e,n){for(var r=[],i=se(t.first,0),o=i,a=0;a<e.length;a++){var s=e[a],l=fo(s.from,i,o),c=fo(uo(s),i,o);if(i=s.to,o=c,"around"==n){var u=t.sel.ranges[a],d=le(u.head,u.anchor)<0;r[a]=new so(d?c:l,d?l:c)}else r[a]=new so(l,l)}return new ao(r,t.sel.primIndex)}function mo(t){t.doc.mode=$t(t.options,t.doc.modeOption),vo(t)}function vo(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,Ri(t,100),t.state.modeGen++,t.curOp&&Br(t)}function bo(t,e){return 0==e.from.ch&&0==e.to.ch&&""==J(e.text)&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function yo(t,e,n,r){function i(t){return n?n[t]:null}function o(t,n,i){hn(t,n,i,r),Nn(t,"change",t,e)}function a(t,e){for(var n=[],o=t;o<e;++o)n.push(new dn(c[o],i(o),r));return n}var s=e.from,l=e.to,c=e.text,u=Qt(t,s.line),d=Qt(t,l.line),h=J(c),p=i(c.length-1),f=l.line-s.line;if(e.full)t.insert(0,a(0,c.length)),t.remove(c.length,t.size-c.length);else if(bo(t,e)){var g=a(0,c.length-1);o(d,d.text,p),f&&t.remove(s.line,f),g.length&&t.insert(s.line,g)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,s.ch)+h+u.text.slice(l.ch),p);else{var m=a(1,c.length-1);m.push(new dn(h+u.text.slice(l.ch),p,r)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),t.insert(s.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),i(0)),t.remove(s.line+1,f);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(d,h+d.text.slice(l.ch),p);var v=a(1,c.length-1);f>1&&t.remove(s.line+1,f-1),t.insert(s.line+1,v)}Nn(t,"change",t,e)}function wo(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a<t.linked.length;++a){var s=t.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;n&&!l||(e(s.doc,l),r(s.doc,t,l))}}}r(t,null,!0)}function xo(t,e){if(e.cm)throw new Error("This document is already in use.");t.doc=e,e.cm=t,Ir(t),mo(t),Co(t),t.options.direction=e.direction,t.options.lineWrapping||un(t),t.options.mode=e.modeOption,Br(t)}function Co(t){("rtl"==t.doc.direction?D:O)(t.display.lineDiv,"CodeMirror-rtl")}function ko(t){Li(t,(function(){Co(t),Br(t)}))}function Ao(t){this.done=[],this.undone=[],this.undoDepth=t?t.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t?t.maxGeneration:1}function So(t,e){var n={from:ue(e.from),to:uo(e),text:te(t,e.from,e.to)};return Po(t,n,e.from.line,e.to.line+1),wo(t,(function(t){return Po(t,n,e.from.line,e.to.line+1)}),!0),n}function Eo(t){while(t.length){var e=J(t);if(!e.ranges)break;t.pop()}}function Oo(t,e){return e?(Eo(t.done),J(t.done)):t.done.length&&!J(t.done).ranges?J(t.done):t.done.length>1&&!t.done[t.done.length-2].ranges?(t.done.pop(),J(t.done)):void 0}function To(t,e,n,r){var i=t.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=Oo(i,i.lastOp==r)))a=J(o.changes),0==le(e.from,e.to)&&0==le(e.from,a.to)?a.to=uo(e):o.changes.push(So(t,e));else{var l=J(i.done);l&&l.ranges||No(t.sel,i.done),o={changes:[So(t,e)],generation:i.generation},i.done.push(o);while(i.done.length>i.undoDepth)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,a||wt(t,"historyAdded")}function _o(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Mo(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||_o(t,o,J(i.done),e))?i.done[i.done.length-1]=e:No(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Eo(i.undone)}function No(t,e){var n=J(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Po(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Lo(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 Do(t,e){var n=e["spans_"+t.id];if(!n)return null;for(var r=[],i=0;i<e.text.length;++i)r.push(Lo(n[i]));return r}function jo(t,e){var n=Do(t,e),r=He(t,e);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)t:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue t;o.push(l)}else a&&(n[i]=a)}return n}function Io(t,e,n){for(var r=[],i=0;i<t.length;++i){var o=t[i];if(o.ranges)r.push(n?ao.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),e)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&q(e,Number(u[1]))>-1&&(J(s)[d]=c[d],delete c[d])}}}return r}function Ro(t,e,n,r){if(r){var i=t.anchor;if(n){var o=le(e,i)<0;o!=le(n,i)<0?(i=e,e=n):o!=le(e,n)<0&&(e=n)}return new so(i,e)}return new so(n||e,e)}function Fo(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Uo(t,new ao([Ro(t.sel.primary(),e,n,i)],0),r)}function Bo(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o<t.sel.ranges.length;o++)r[o]=Ro(t.sel.ranges[o],e[o],null,i);var a=lo(t.cm,r,t.sel.primIndex);Uo(t,a,n)}function zo(t,e,n,r){var i=t.sel.ranges.slice(0);i[e]=n,Uo(t,lo(t.cm,i,t.sel.primIndex),r)}function Ho(t,e,n,r){Uo(t,co(e,n),r)}function Vo(t,e,n){var r={ranges:e.ranges,update:function(e){this.ranges=[];for(var n=0;n<e.length;n++)this.ranges[n]=new so(fe(t,e[n].anchor),fe(t,e[n].head))},origin:n&&n.origin};return wt(t,"beforeSelectionChange",t,r),t.cm&&wt(t.cm,"beforeSelectionChange",t.cm,r),r.ranges!=e.ranges?lo(t.cm,r.ranges,r.ranges.length-1):e}function qo(t,e,n){var r=t.history.done,i=J(r);i&&i.ranges?(r[r.length-1]=e,Wo(t,e,n)):Uo(t,e,n)}function Uo(t,e,n){Wo(t,e,n),Mo(t,t.sel,t.cm?t.cm.curOp.id:NaN,n)}function Wo(t,e,n){(kt(t,"beforeSelectionChange")||t.cm&&kt(t.cm,"beforeSelectionChange"))&&(e=Vo(t,e,n));var r=n&&n.bias||(le(e.primary().head,t.sel.primary().head)<0?-1:1);$o(t,Yo(t,e,r,!0)),n&&!1===n.scroll||!t.cm||"nocursor"==t.cm.getOption("readOnly")||ci(t.cm)}function $o(t,e){e.equals(t.sel)||(t.sel=e,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,Ct(t.cm)),Nn(t,"cursorActivity",t))}function Go(t){$o(t,Yo(t,t.sel,null,!1))}function Yo(t,e,n,r){for(var i,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=Ko(t,a.anchor,s&&s.anchor,n,r),c=a.head==a.anchor?l:Ko(t,a.head,s&&s.head,n,r);(i||l!=a.anchor||c!=a.head)&&(i||(i=e.ranges.slice(0,o)),i[o]=new so(l,c))}return i?lo(t.cm,i,e.primIndex):e}function Xo(t,e,n,r,i){var o=Qt(t,e.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=e.ch:s.from<e.ch))&&(null==s.to||(u?s.to>=e.ch:s.to>e.ch))){if(i&&(wt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(d=Zo(t,d,-r,d&&d.line==e.line?o:null)),d&&d.line==e.line&&(h=le(d,n))&&(r<0?h<0:h>0))return Xo(t,d,e,r,i)}var p=l.find(r<0?-1:1);return(r<0?c:u)&&(p=Zo(t,p,r,p.line==e.line?o:null)),p?Xo(t,p,e,r,i):null}}return e}function Ko(t,e,n,r,i){var o=r||1,a=Xo(t,e,n,o,i)||!i&&Xo(t,e,n,o,!0)||Xo(t,e,n,-o,i)||!i&&Xo(t,e,n,-o,!0);return a||(t.cantEdit=!0,se(t.first,0))}function Zo(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?fe(t,se(e.line-1)):null:n>0&&e.ch==(r||Qt(t,e.line)).text.length?e.line<t.first+t.size-1?se(e.line+1,0):null:new se(e.line,e.ch+n)}function Jo(t){t.setSelection(se(t.firstLine(),0),se(t.lastLine()),$)}function Qo(t,e,n){var r={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(e,n,i,o){e&&(r.from=fe(t,e)),n&&(r.to=fe(t,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),wt(t,"beforeChange",t,r),t.cm&&wt(t.cm,"beforeChange",t.cm,r),r.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function ta(t,e,n){if(t.cm){if(!t.cm.curOp)return Di(t.cm,ta)(t,e,n);if(t.cm.state.suppressEdits)return}if(!(kt(t,"beforeChange")||t.cm&&kt(t.cm,"beforeChange"))||(e=Qo(t,e,!0),e)){var r=Ne&&!n&&qe(t,e.from,e.to);if(r)for(var i=r.length-1;i>=0;--i)ea(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else ea(t,e)}}function ea(t,e){if(1!=e.text.length||""!=e.text[0]||0!=le(e.from,e.to)){var n=po(t,e);To(t,e,n,t.cm?t.cm.curOp.id:NaN),ia(t,e,n,He(t,e));var r=[];wo(t,(function(t,n){n||-1!=q(r,t.history)||(ca(t.history,e),r.push(t.history)),ia(t,e,null,He(t,e))}))}}function na(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,c=0;c<s.length;c++)if(i=s[c],n?i.ranges&&!i.equals(t.sel):!i.ranges)break;if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(i=s.pop(),!i.ranges){if(r)return void s.push(i);break}if(No(i,l),n&&!i.equals(t.sel))return void Uo(t,i,{clearRedo:!1});a=i}var u=[];No(a,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=kt(t,"beforeChange")||t.cm&&kt(t.cm,"beforeChange"),h=function(n){var r=i.changes[n];if(r.origin=e,d&&!Qo(t,r,!1))return s.length=0,{};u.push(So(t,r));var o=n?po(t,r):J(s);ia(t,r,o,jo(t,r)),!n&&t.cm&&t.cm.scrollIntoView({from:r.from,to:uo(r)});var a=[];wo(t,(function(t,e){e||-1!=q(a,t.history)||(ca(t.history,r),a.push(t.history)),ia(t,r,null,jo(t,r))}))},p=i.changes.length-1;p>=0;--p){var f=h(p);if(f)return f.v}}}}function ra(t,e){if(0!=e&&(t.first+=e,t.sel=new ao(Q(t.sel.ranges,(function(t){return new so(se(t.anchor.line+e,t.anchor.ch),se(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Br(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++)zr(t.cm,r,"gutter")}}function ia(t,e,n,r){if(t.cm&&!t.cm.curOp)return Di(t.cm,ia)(t,e,n,r);if(e.to.line<t.first)ra(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 i=e.text.length-1-(t.first-e.from.line);ra(t,i),e={from:se(t.first,0),to:se(e.to.line+i,e.to.ch),text:[J(e.text)],origin:e.origin}}var o=t.lastLine();e.to.line>o&&(e={from:e.from,to:se(o,Qt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=te(t,e.from,e.to),n||(n=po(t,e)),t.cm?oa(t.cm,e,r):yo(t,e,r),Wo(t,n,$),t.cantEdit&&Ko(t,se(t.firstLine(),0))&&(t.cantEdit=!1)}}function oa(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=re(tn(Qt(r,o.line))),r.iter(l,a.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&Ct(t),yo(r,e,n,jr(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=cn(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),Me(r,o.line),Ri(t,400);var c=e.text.length-(a.line-o.line)-1;e.full?Br(t):o.line!=a.line||1!=e.text.length||bo(t.doc,e)?Br(t,o.line,a.line+1,c):zr(t,o.line,"text");var u=kt(t,"changes"),d=kt(t,"change");if(d||u){var h={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};d&&Nn(t,"change",t,h),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}function aa(t,e,n,r,i){var o;r||(r=n),le(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),"string"==typeof e&&(e=t.splitLines(e)),ta(t,{from:n,to:r,text:e,origin:i})}function sa(t,e,n,r){n<t.line?t.line+=r:e<t.line&&(t.line=e,t.ch=0)}function la(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i],a=!0;if(o.ranges){o.copied||(o=t[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)sa(o.ranges[s].anchor,e,n,r),sa(o.ranges[s].head,e,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=se(c.from.line+r,c.from.ch),c.to=se(c.to.line+r,c.to.ch);else if(e<=c.to.line){a=!1;break}}a||(t.splice(0,i+1),i=0)}}}function ca(t,e){var n=e.from.line,r=e.to.line,i=e.text.length-(r-n)-1;la(t.done,n,r,i),la(t.undone,n,r,i)}function ua(t,e,n,r){var i=e,o=e;return"number"==typeof e?o=Qt(t,pe(t,e)):i=re(e),null==i?null:(r(o,i)&&t.cm&&zr(t.cm,i,n),o)}function da(t){this.lines=t,this.parent=null;for(var e=0,n=0;n<t.length;++n)t[n].parent=this,e+=t[n].height;this.height=e}function ha(t){this.children=t;for(var e=0,n=0,r=0;r<t.length;++r){var i=t[r];e+=i.chunkSize(),n+=i.height,i.parent=this}this.size=e,this.height=n,this.parent=null}so.prototype.from=function(){return he(this.anchor,this.head)},so.prototype.to=function(){return de(this.anchor,this.head)},so.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},da.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=t,r=t+e;n<r;++n){var i=this.lines[n];this.height-=i.height,pn(i),Nn(i,"delete")}this.lines.splice(t,e)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,e,n){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=this},iterN:function(t,e,n){for(var r=t+e;t<r;++t)if(n(this.lines[t]))return!0}},ha.prototype={chunkSize:function(){return this.size},removeInner:function(t,e){this.size-=e;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(t<i){var o=Math.min(e,i-t),a=r.height;if(r.removeInner(t,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(e-=o))break;t=0}else t-=i}if(this.size-e<25&&(this.children.length>1||!(this.children[0]instanceof da))){var s=[];this.collapse(s),this.children=[new da(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e<this.children.length;++e)this.children[e].collapse(t)},insertInner:function(t,e,n){this.size+=e.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(t<=o){if(i.insertInner(t,e,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new da(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}t-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var e=t.children.splice(t.children.length-5,5),n=new ha(e);if(t.parent){t.size-=n.size,t.height-=n.height;var r=q(t.parent.children,t);t.parent.children.splice(r+1,0,n)}else{var i=new ha(t.children);i.parent=t,t.children=[i,n],t=i}n.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(t<o){var a=Math.min(e,o-t);if(i.iterN(t,a,n))return!0;if(0==(e-=a))break;t=0}else t-=o}}};var pa=function(t,e,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=t,this.node=e};function fa(t,e,n){ln(e)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&li(t,n)}function ga(t,e,n,r){var i=new pa(t,n,r),o=t.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ua(t,e,"widget",(function(e){var n=e.widgets||(e.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!an(t,e)){var r=ln(e)<t.scrollTop;ne(e,e.height+Wn(i)),r&&li(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&Nn(o,"lineWidgetAdded",o,i,"number"==typeof e?e:re(e)),i}pa.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,n=this.line,r=re(n);if(null!=r&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(n.widgets=null);var o=Wn(this);ne(n,Math.max(0,n.height-o)),t&&(Li(t,(function(){fa(t,n,-o),zr(t,r,"widget")})),Nn(t,"lineWidgetCleared",t,this,r))}},pa.prototype.changed=function(){var t=this,e=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Wn(this)-e;i&&(an(this.doc,r)||ne(r,r.height+i),n&&Li(n,(function(){n.curOp.forceUpdate=!0,fa(n,r,i),Nn(n,"lineWidgetChanged",n,t,re(r))})))},At(pa);var ma=0,va=function(t,e){this.lines=[],this.type=e,this.doc=t,this.id=++ma};function ba(t,e,n,r,i){if(r&&r.shared)return wa(t,e,n,r,i);if(t.cm&&!t.cm.curOp)return Di(t.cm,ba)(t,e,n,r,i);var o=new va(t,i),a=le(e,n);if(r&&z(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Qe(t,e.line,e,n,o)||e.line!=n.line&&Qe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");De()}o.addToHistory&&To(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(r){c&&o.collapsed&&!c.options.lineWrapping&&tn(r)==c.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&ne(r,0),Fe(r,new je(o,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){an(t,e)&&ne(e,0)})),o.clearOnEnter&&vt(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Le(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++ma,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Br(c,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=e.line;u<=n.line;u++)zr(c,u,"text");o.atomic&&Go(c.doc),Nn(c,"markerAdded",c,o)}return o}va.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Si(t),kt(this,"clear")){var n=this.find();n&&Nn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Ie(a.markedSpans,this);t&&!this.collapsed?zr(t,re(a),"text"):t&&(null!=s.to&&(i=re(a)),null!=s.from&&(r=re(a))),a.markedSpans=Re(a.markedSpans,s),null==s.from&&this.collapsed&&!an(this.doc,a)&&t&&ne(a,Nr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=tn(this.lines[l]),u=cn(c);u>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&Br(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Go(t.doc)),t&&Nn(t,"markerCleared",t,this,r,i),e&&Ei(t),this.parent&&this.parent.clear()}},va.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Ie(o.markedSpans,this);if(null!=a.from&&(n=se(e?o:re(o),a.from),-1==t))return n;if(null!=a.to&&(r=se(e?o:re(o),a.to),1==t))return r}return n&&{from:n,to:r}},va.prototype.changed=function(){var t=this,e=this.find(-1,!0),n=this,r=this.doc.cm;e&&r&&Li(r,(function(){var i=e.line,o=re(e.line),a=rr(r,o);if(a&&(hr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!an(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=Wn(n)-s;l&&ne(i,i.height+l)}Nn(r,"markerChanged",r,t)}))},va.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;e.maybeHiddenMarkers&&-1!=q(e.maybeHiddenMarkers,this)||(e.maybeUnhiddenMarkers||(e.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},va.prototype.detachLine=function(t){if(this.lines.splice(q(this.lines,t),1),!this.lines.length&&this.doc.cm){var e=this.doc.cm.curOp;(e.maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)}},At(va);var ya=function(t,e){this.markers=t,this.primary=e;for(var n=0;n<t.length;++n)t[n].parent=this};function wa(t,e,n,r,i){r=z(r),r.shared=!1;var o=[ba(t,e,n,r,i)],a=o[0],s=r.widgetNode;return wo(t,(function(t){s&&(r.widgetNode=s.cloneNode(!0)),o.push(ba(t,fe(t,e),fe(t,n),r,i));for(var l=0;l<t.linked.length;++l)if(t.linked[l].isParent)return;a=J(o)})),new ya(o,a)}function xa(t){return t.findMarks(se(t.first,0),t.clipPos(se(t.lastLine())),(function(t){return t.parent}))}function Ca(t,e){for(var n=0;n<e.length;n++){var r=e[n],i=r.find(),o=t.clipPos(i.from),a=t.clipPos(i.to);if(le(o,a)){var s=ba(t,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function ka(t){for(var e=function(e){var n=t[e],r=[n.primary.doc];wo(n.primary.doc,(function(t){return r.push(t)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==q(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<t.length;n++)e(n)}ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();Nn(this,"clear")}},ya.prototype.find=function(t,e){return this.primary.find(t,e)},At(ya);var Aa=0,Sa=function(t,e,n,r,i){if(!(this instanceof Sa))return new Sa(t,e,n,r,i);null==n&&(n=0),ha.call(this,[new da([new dn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=se(n,0);this.sel=co(o),this.history=new Ao(null),this.id=++Aa,this.modeOption=e,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),yo(this,{from:o,to:o,text:t}),Uo(this,co(o),$)};Sa.prototype=nt(ha.prototype,{constructor:Sa,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,r=0;r<e.length;++r)n+=e[r].height;this.insertInner(t-this.first,e,n)},remove:function(t,e){this.removeInner(t-this.first,e)},getValue:function(t){var e=ee(this,this.first,this.first+this.size);return!1===t?e:e.join(t||this.lineSeparator())},setValue:Ii((function(t){var e=se(this.first,0),n=this.first+this.size-1;ta(this,{from:e,to:se(n,Qt(this,n).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&ui(this.cm,0,0),Uo(this,co(e),$)})),replaceRange:function(t,e,n,r){e=fe(this,e),n=n?fe(this,n):e,aa(this,t,e,n,r)},getRange:function(t,e,n){var r=te(this,fe(this,t),fe(this,e));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(t){var e=this.getLineHandle(t);return e&&e.text},getLineHandle:function(t){if(oe(this,t))return Qt(this,t)},getLineNumber:function(t){return re(t)},getLineHandleVisualStart:function(t){return"number"==typeof t&&(t=Qt(this,t)),tn(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return fe(this,t)},getCursor:function(t){var e,n=this.sel.primary();return e=null==t||"head"==t?n.head:"anchor"==t?n.anchor:"end"==t||"to"==t||!1===t?n.to():n.from(),e},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ii((function(t,e,n){Ho(this,fe(this,"number"==typeof t?se(t,e||0):t),null,n)})),setSelection:Ii((function(t,e,n){Ho(this,fe(this,t),fe(this,e||t),n)})),extendSelection:Ii((function(t,e,n){Fo(this,fe(this,t),e&&fe(this,e),n)})),extendSelections:Ii((function(t,e){Bo(this,me(this,t),e)})),extendSelectionsBy:Ii((function(t,e){var n=Q(this.sel.ranges,t);Bo(this,me(this,n),e)})),setSelections:Ii((function(t,e,n){if(t.length){for(var r=[],i=0;i<t.length;i++)r[i]=new so(fe(this,t[i].anchor),fe(this,t[i].head||t[i].anchor));null==e&&(e=Math.min(t.length-1,this.sel.primIndex)),Uo(this,lo(this.cm,r,e),n)}})),addSelection:Ii((function(t,e,n){var r=this.sel.ranges.slice(0);r.push(new so(fe(this,t),fe(this,e||t))),Uo(this,lo(this.cm,r,r.length-1),n)})),getSelection:function(t){for(var e,n=this.sel.ranges,r=0;r<n.length;r++){var i=te(this,n[r].from(),n[r].to());e=e?e.concat(i):i}return!1===t?e:e.join(t||this.lineSeparator())},getSelections:function(t){for(var e=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=te(this,n[r].from(),n[r].to());!1!==t&&(i=i.join(t||this.lineSeparator())),e[r]=i}return e},replaceSelection:function(t,e,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=t;this.replaceSelections(r,e,n||"+input")},replaceSelections:Ii((function(t,e,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(t[o]),origin:n}}for(var s=e&&"end"!=e&&go(this,r,e),l=r.length-1;l>=0;l--)ta(this,r[l]);s?qo(this,s):this.cm&&ci(this.cm)})),undo:Ii((function(){na(this,"undo")})),redo:Ii((function(){na(this,"redo")})),undoSelection:Ii((function(){na(this,"undo",!0)})),redoSelection:Ii((function(){na(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,r=0;r<t.done.length;r++)t.done[r].ranges||++e;for(var i=0;i<t.undone.length;i++)t.undone[i].ranges||++n;return{undo:e,redo:n}},clearHistory:function(){var t=this;this.history=new Ao(this.history),wo(this,(function(e){return e.history=t.history}),!0)},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:Io(this.history.done),undone:Io(this.history.undone)}},setHistory:function(t){var e=this.history=new Ao(this.history);e.done=Io(t.done.slice(0),null,!0),e.undone=Io(t.undone.slice(0),null,!0)},setGutterMarker:Ii((function(t,e,n){return ua(this,t,"gutter",(function(t){var r=t.gutterMarkers||(t.gutterMarkers={});return r[e]=n,!n&&at(r)&&(t.gutterMarkers=null),!0}))})),clearGutter:Ii((function(t){var e=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[t]&&ua(e,n,"gutter",(function(){return n.gutterMarkers[t]=null,at(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(t){var e;if("number"==typeof t){if(!oe(this,t))return null;if(e=t,t=Qt(this,t),!t)return null}else if(e=re(t),null==e)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:Ii((function(t,e,n){return ua(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass";if(t[r]){if(S(n).test(t[r]))return!1;t[r]+=" "+n}else t[r]=n;return!0}))})),removeLineClass:Ii((function(t,e,n){return ua(this,t,"gutter"==e?"gutter":"class",(function(t){var r="text"==e?"textClass":"background"==e?"bgClass":"gutter"==e?"gutterClass":"wrapClass",i=t[r];if(!i)return!1;if(null==n)t[r]=null;else{var o=i.match(S(n));if(!o)return!1;var a=o.index+o[0].length;t[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:Ii((function(t,e,n){return ga(this,t,e,n)})),removeLineWidget:function(t){t.clear()},markText:function(t,e,n){return ba(this,fe(this,t),fe(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 t=fe(this,t),ba(this,t,t,n,"bookmark")},findMarksAt:function(t){t=fe(this,t);var e=[],n=Qt(this,t.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=t.ch)&&(null==i.to||i.to>=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=fe(this,t),e=fe(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==t.line&&t.ch>=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&t.push(n[r].marker)})),t},posFromIndex:function(t){var e,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>t)return e=t,!0;t-=o,++n})),fe(this,se(n,e))},indexFromPos:function(t){t=fe(this,t);var e=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 Sa(ee(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 r=new Sa(ee(this,e,n),t.mode||this.modeOption,e,this.lineSep,this.direction);return t.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:t.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],Ca(r,xa(this)),r},unlinkDoc:function(t){if(t instanceof Bs&&(t=t.doc),this.linked)for(var e=0;e<this.linked.length;++e){var n=this.linked[e];if(n.doc==t){this.linked.splice(e,1),t.unlinkDoc(this),ka(xa(this));break}}if(t.history==this.history){var r=[t.id];wo(t,(function(t){return r.push(t.id)}),!0),t.history=new Ao(null),t.history.done=Io(this.history.done,r),t.history.undone=Io(this.history.undone,r)}},iterLinkedDocs:function(t){wo(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):It(t)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Ii((function(t){"rtl"!=t&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter((function(t){return t.order=null})),this.cm&&ko(this.cm))}))}),Sa.prototype.eachLine=Sa.prototype.iter;var Ea=0;function Oa(t){var e=this;if(Ma(e),!xt(e,t)&&!$n(e.display,t)){St(t),a&&(Ea=+new Date);var n=Rr(e,t,!0),r=t.dataTransfer.files;if(n&&!e.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,l=function(){++s==i&&Di(e,(function(){n=fe(e.doc,n);var t={from:n,to:n,text:e.doc.splitLines(o.filter((function(t){return null!=t})).join(e.doc.lineSeparator())),origin:"paste"};ta(e.doc,t),qo(e.doc,co(fe(e.doc,n),fe(e.doc,uo(t))))}))()},c=function(t,n){if(e.options.allowDropFileTypes&&-1==q(e.options.allowDropFileTypes,t.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var t=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(t)||(o[n]=t),l()},r.readAsText(t)}},u=0;u<r.length;u++)c(r[u],u);else{if(e.state.draggingText&&e.doc.sel.contains(n)>-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var d=t.dataTransfer.getData("Text");if(d){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),Wo(e.doc,co(n,n)),h)for(var p=0;p<h.length;++p)aa(e.doc,"",h[p].anchor,h[p].head,"drag");e.replaceSelection(d,"around","paste"),e.display.input.focus()}}catch(f){}}}}function Ta(t,e){if(a&&(!t.state.draggingText||+new Date-Ea<100))Tt(e);else if(!xt(t,e)&&!$n(t.display,e)&&(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setDragImage&&!p)){var n=M("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}function _a(t,e){var n=Rr(t,e);if(n){var r=document.createDocumentFragment();Gr(t,n,r),t.display.dragCursor||(t.display.dragCursor=M("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),_(t.display.dragCursor,r)}}function Ma(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function Na(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<e.length;r++){var i=e[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var e=0;e<n.length;e++)t(n[e])}))}}var Pa=!1;function La(){Pa||(Da(),Pa=!0)}function Da(){var t;vt(window,"resize",(function(){null==t&&(t=setTimeout((function(){t=null,Na(ja)}),100))})),vt(window,"blur",(function(){return Na(ti)}))}function ja(t){var e=t.display;e.cachedCharWidth=e.cachedTextHeight=e.cachedPaddingH=null,e.scrollbarsClipped=!1,t.setSize()}for(var Ia={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:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ra=0;Ra<10;Ra++)Ia[Ra+48]=Ia[Ra+96]=String(Ra);for(var Fa=65;Fa<=90;Fa++)Ia[Fa]=String.fromCharCode(Fa);for(var Ba=1;Ba<=12;Ba++)Ia[Ba+111]=Ia[Ba+63235]="F"+Ba;var za={};function Ha(t){var e,n,r,i,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))i=!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);r=!0}}return e&&(t="Alt-"+t),n&&(t="Ctrl-"+t),i&&(t="Cmd-"+t),r&&(t="Shift-"+t),t}function Va(t){var e={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete t[n];continue}for(var i=Q(n.split(" "),Ha),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.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 c in e)t[c]=e[c];return t}function qa(t,e,n,r){e=Ga(e);var i=e.call?e.call(t,r):e[t];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(e.fallthrough){if("[object Array]"!=Object.prototype.toString.call(e.fallthrough))return qa(t,e.fallthrough,n,r);for(var o=0;o<e.fallthrough.length;o++){var a=qa(t,e.fallthrough[o],n,r);if(a)return a}}}function Ua(t){var e="string"==typeof t?t:Ia[t.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e}function Wa(t,e,n){var r=t;return e.altKey&&"Alt"!=r&&(t="Alt-"+t),(k?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(t="Ctrl-"+t),(k?e.ctrlKey:e.metaKey)&&"Mod"!=r&&(t="Cmd-"+t),!n&&e.shiftKey&&"Shift"!=r&&(t="Shift-"+t),t}function $a(t,e){if(h&&34==t.keyCode&&t["char"])return!1;var n=Ia[t.keyCode];return null!=n&&!t.altGraphKey&&(3==t.keyCode&&t.code&&(n=t.code),Wa(n,t,e))}function Ga(t){return"string"==typeof t?za[t]:t}function Ya(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){var o=e(n[i]);while(r.length&&le(o.from,J(r).to)<=0){var a=r.pop();if(le(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Li(t,(function(){for(var e=r.length-1;e>=0;e--)aa(t.doc,"",r[e].from,r[e].to,"+delete");ci(t)}))}function Xa(t,e,n){var r=ct(t.text,e+n,n);return r<0||r>t.text.length?null:r}function Ka(t,e,n){var r=Xa(t,e.ch,n);return null==r?null:new se(e.line,r,n<0?"after":"before")}function Za(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=gt(n,e.doc.direction);if(o){var a,s=i<0?J(o):o[0],l=i<0==(1==s.level),c=l?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var u=ir(e,n);a=i<0?n.text.length-1:0;var d=or(e,u,a).top;a=ut((function(t){return or(e,u,t).top==d}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=Xa(n,a,1))}else a=i<0?s.to:s.from;return new se(r,a,c)}}return new se(r,i<0?n.text.length:0,i<0?"before":"after")}function Ja(t,e,n,r){var i=gt(e,t.doc.direction);if(!i)return Ka(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=pt(i,n.ch,n.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Ka(e,n,r);var s,l=function(t,n){return Xa(e,t instanceof se?t.ch:t,n)},c=function(n){return t.options.lineWrapping?(s=s||ir(t,e),Er(t,e,s,n)):{begin:0,end:e.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==t.doc.direction||1==a.level){var d=1==a.level==r<0,h=l(n,d?1:-1);if(null!=h&&(d?h<=a.to&&h<=u.end:h>=a.from&&h>=u.begin)){var p=d?"before":"after";return new se(n.line,h,p)}}var f=function(t,e,r){for(var o=function(t,e){return e?new se(n.line,l(t,1),"before"):new se(n.line,t,"after")};t>=0&&t<i.length;t+=e){var a=i[t],s=e>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return o(c,s)}},g=f(o+r,r,u);if(g)return g;var m=r>0?u.end:l(u.begin,-1);return null==m||r>0&&m==e.text.length||(g=f(r>0?0:i.length-1,r,c(m)),!g)?null:g}za.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"},za.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"},za.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},za.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"]},za["default"]=y?za.macDefault:za.pcDefault;var Qa={selectAll:Jo,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),$)},killLine:function(t){return Ya(t,(function(e){if(e.empty()){var n=Qt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line<t.lastLine()?{from:e.head,to:se(e.head.line+1,0)}:{from:e.head,to:se(e.head.line,n)}}return{from:e.from(),to:e.to()}}))},deleteLine:function(t){return Ya(t,(function(e){return{from:se(e.from().line,0),to:fe(t.doc,se(e.to().line+1,0))}}))},delLineLeft:function(t){return Ya(t,(function(t){return{from:se(t.from().line,0),to:t.from()}}))},delWrappedLineLeft:function(t){return Ya(t,(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return{from:r,to:e.from()}}))},delWrappedLineRight:function(t){return Ya(t,(function(e){var n=t.charCoords(e.head,"div").top+5,r=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div");return{from:e.from(),to:r}}))},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(se(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(se(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy((function(e){return ts(t,e.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy((function(e){return ns(t,e.head)}),{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy((function(e){return es(t,e.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:n},"div")}),Y)},goLineLeft:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:n},"div")}),Y)},goLineLeftSmart:function(t){return t.extendSelectionsBy((function(e){var n=t.cursorCoords(e.head,"div").top+5,r=t.coordsChar({left:0,top:n},"div");return r.ch<t.getLine(r.line).search(/\S/)?ns(t,e.head):r}),Y)},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,"codepoint")},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(),r=t.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=H(t.getLine(o.line),o.ch,r);e.push(Z(r-a%r))}t.replaceSelections(e)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return Li(t,(function(){for(var e=t.listSelections(),n=[],r=0;r<e.length;r++)if(e[r].empty()){var i=e[r].head,o=Qt(t.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new se(i.line,i.ch-1)),i.ch>0)i=new se(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),se(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=Qt(t.doc,i.line-1).text;a&&(i=new se(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),se(i.line-1,a.length-1),i,"+transpose"))}n.push(new so(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Li(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r<e.length;r++)t.indentLine(e[r].from().line,null,!0);ci(t)}))},openLine:function(t){return t.replaceSelection("\n","start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function ts(t,e){var n=Qt(t.doc,e),r=tn(n);return r!=n&&(e=re(r)),Za(!0,t,r,e,1)}function es(t,e){var n=Qt(t.doc,e),r=en(n);return r!=n&&(e=re(r)),Za(!0,t,n,e,-1)}function ns(t,e){var n=ts(t,e.line),r=Qt(t.doc,n.line),i=gt(r,t.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return se(n.line,a?0:o,n.sticky)}return n}function rs(t,e,n){if("string"==typeof e&&(e=Qa[e],!e))return!1;t.display.input.ensurePolled();var r=t.display.shift,i=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),i=e(t)!=W}finally{t.display.shift=r,t.state.suppressEdits=!1}return i}function is(t,e,n){for(var r=0;r<t.state.keyMaps.length;r++){var i=qa(e,t.state.keyMaps[r],n,t);if(i)return i}return t.options.extraKeys&&qa(e,t.options.extraKeys,n,t)||qa(e,t.options.keyMap,n,t)}var os=new V;function as(t,e,n,r){var i=t.state.keySeq;if(i){if(Ua(e))return"handled";if(/\'$/.test(e)?t.state.keySeq=null:os.set(50,(function(){t.state.keySeq==i&&(t.state.keySeq=null,t.display.input.reset())})),ss(t,i+" "+e,n,r))return!0}return ss(t,e,n,r)}function ss(t,e,n,r){var i=is(t,e,r);return"multi"==i&&(t.state.keySeq=e),"handled"==i&&Nn(t,"keyHandled",t,e,n),"handled"!=i&&"multi"!=i||(St(n),Kr(t)),!!i}function ls(t,e){var n=$a(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?as(t,"Shift-"+n,e,(function(e){return rs(t,e,!0)}))||as(t,n,e,(function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return rs(t,e)})):as(t,n,e,(function(e){return rs(t,e)})))}function cs(t,e,n){return as(t,"'"+n+"'",e,(function(e){return rs(t,e,!0)}))}var us=null;function ds(t){var e=this;if((!t.target||t.target==e.display.input.getField())&&(e.curOp.focus=L(R(e)),!xt(e,t))){a&&s<11&&27==t.keyCode&&(t.returnValue=!1);var r=t.keyCode;e.display.shift=16==r||t.shiftKey;var i=ls(e,t);h&&(us=i?r:null,i||88!=r||Ft||!(y?t.metaKey:t.ctrlKey)||e.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(e.display.lineDiv.className)||hs(e)}}function hs(t){var e=t.display.lineDiv;function n(t){18!=t.keyCode&&t.altKey||(O(e,"CodeMirror-crosshair"),yt(document,"keyup",n),yt(document,"mouseover",n))}D(e,"CodeMirror-crosshair"),vt(document,"keyup",n),vt(document,"mouseover",n)}function ps(t){16==t.keyCode&&(this.doc.sel.shift=!1),xt(this,t)}function fs(t){var e=this;if((!t.target||t.target==e.display.input.getField())&&!($n(e.display,t)||xt(e,t)||t.ctrlKey&&!t.altKey||y&&t.metaKey)){var n=t.keyCode,r=t.charCode;if(h&&n==us)return us=null,void St(t);if(!h||t.which&&!(t.which<10)||!ls(e,t)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(cs(e,t,i)||e.display.input.onKeyPress(t))}}}var gs,ms,vs=400,bs=function(t,e,n){this.time=t,this.pos=e,this.button=n};function ys(t,e){var n=+new Date;return ms&&ms.compare(n,t,e)?(gs=ms=null,"triple"):gs&&gs.compare(n,t,e)?(ms=new bs(n,t,e),gs=null,"double"):(gs=new bs(n,t,e),ms=null,"single")}function ws(t){var e=this,n=e.display;if(!(xt(e,t)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=t.shiftKey,$n(n,t))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!_s(e,t)){var r=Rr(e,t),i=Mt(t),o=r?ys(r,i):"single";F(e).focus(),1==i&&e.state.selectingText&&e.state.selectingText(t),r&&xs(e,i,r,o,t)||(1==i?r?ks(e,r,o,t):_t(t)==n.scroller&&St(t):2==i?(r&&Fo(e.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(A?e.display.input.onContextMenu(t):Jr(e)))}}function xs(t,e,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),o=(1==e?"Left":2==e?"Middle":"Right")+o,as(t,Wa(o,i),i,(function(e){if("string"==typeof e&&(e=Qa[e]),!e)return!1;var r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),r=e(t,n)!=W}finally{t.state.suppressEdits=!1}return r}))}function Cs(t,e,n){var r=t.getOption("configureMouse"),i=r?r(t,e,n):{};if(null==i.unit){var o=w?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==e?"char":"double"==e?"word":"line"}return(null==i.extend||t.doc.extend)&&(i.extend=t.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}function ks(t,e,n,r){a?setTimeout(B(Zr,t),0):t.curOp.focus=L(R(t));var i,o=Cs(t,n,r),s=t.doc.sel;t.options.dragDrop&&Lt&&!t.isReadOnly()&&"single"==n&&(i=s.contains(e))>-1&&(le((i=s.ranges[i]).from(),e)<0||e.xRel>0)&&(le(i.to(),e)>0||e.xRel<0)?As(t,r,e,o):Es(t,r,e,o)}function As(t,e,n,r){var i=t.display,o=!1,c=Di(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Jr(t)),yt(i.wrapper.ownerDocument,"mouseup",c),yt(i.wrapper.ownerDocument,"mousemove",u),yt(i.scroller,"dragstart",d),yt(i.scroller,"drop",c),o||(St(e),r.addNew||Fo(t.doc,n,null,null,r.extend),l&&!p||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=c,c.copy=!r.moveOnDrag,vt(i.wrapper.ownerDocument,"mouseup",c),vt(i.wrapper.ownerDocument,"mousemove",u),vt(i.scroller,"dragstart",d),vt(i.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ss(t,e,n){if("char"==n)return new so(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new so(se(e.line,0),fe(t.doc,se(e.line+1,0)));var r=n(t,e);return new so(r.from,r.to)}function Es(t,e,n,r){a&&Jr(t);var i=t.display,o=t.doc;St(e);var s,l,c=o.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?u[l]:new so(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new so(n,n)),n=Rr(t,e,!0,!0),l=-1;else{var d=Ss(t,n,r.unit);s=r.extend?Ro(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=u.length,Uo(o,lo(t,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(Uo(o,lo(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):zo(o,l,s,G):(l=0,Uo(o,new ao([s],0),G),c=o.sel);var h=n;function p(e){if(0!=le(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],a=t.options.tabSize,u=H(Qt(o,n.line).text,n.ch,a),d=H(Qt(o,e.line).text,e.ch,a),p=Math.min(u,d),f=Math.max(u,d),g=Math.min(n.line,e.line),m=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=m;g++){var v=Qt(o,g).text,b=X(v,p,a);p==f?i.push(new so(se(g,b),se(g,b))):v.length>b&&i.push(new so(se(g,b),se(g,X(v,f,a))))}i.length||i.push(new so(n,n)),Uo(o,lo(t,c.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var y,w=s,x=Ss(t,e,r.unit),C=w.anchor;le(x.anchor,C)>0?(y=x.head,C=he(w.from(),x.anchor)):(y=x.anchor,C=de(w.to(),x.head));var k=c.ranges.slice(0);k[l]=Os(t,new so(fe(o,C),y)),Uo(o,lo(t,k,l),G)}}var f=i.wrapper.getBoundingClientRect(),g=0;function m(e){var n=++g,a=Rr(t,e,!0,"rectangle"==r.unit);if(a)if(0!=le(a,h)){t.curOp.focus=L(R(t)),p(a);var s=ri(i,o);(a.line>=s.to||a.line<s.from)&&setTimeout(Di(t,(function(){g==n&&m(e)})),150)}else{var l=e.clientY<f.top?-20:e.clientY>f.bottom?20:0;l&&setTimeout(Di(t,(function(){g==n&&(i.scroller.scrollTop+=l,m(e))})),50)}}function v(e){t.state.selectingText=!1,g=1/0,e&&(St(e),i.input.focus()),yt(i.wrapper.ownerDocument,"mousemove",b),yt(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var b=Di(t,(function(t){0!==t.buttons&&Mt(t)?m(t):v(t)})),y=Di(t,v);t.state.selectingText=y,vt(i.wrapper.ownerDocument,"mousemove",b),vt(i.wrapper.ownerDocument,"mouseup",y)}function Os(t,e){var n=e.anchor,r=e.head,i=Qt(t.doc,n.line);if(0==le(n,r)&&n.sticky==r.sticky)return e;var o=gt(i);if(!o)return e;var a=pt(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=pt(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var h=o[c+(l?-1:0)],p=l==(1==h.level),f=p?h.from:h.to,g=p?"after":"before";return n.ch==f&&n.sticky==g?e:new so(new se(n.line,f,g),r)}function Ts(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(h){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&St(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!kt(t,n))return Ot(e);o-=s.top-a.viewOffset;for(var l=0;l<t.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i){var u=ie(t.doc,o),d=t.display.gutterSpecs[l];return wt(t,n,t,u,d.className,e),Ot(e)}}}function _s(t,e){return Ts(t,e,"gutterClick",!0)}function Ms(t,e){$n(t.display,e)||Ns(t,e)||xt(t,e,"contextmenu")||A||t.display.input.onContextMenu(e)}function Ns(t,e){return!!kt(t,"gutterContextMenu")&&Ts(t,e,"gutterContextMenu",!1)}function Ps(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fr(t)}bs.prototype.compare=function(t,e,n){return this.time+vs>t&&0==le(e,this.pos)&&n==this.button};var Ls={toString:function(){return"CodeMirror.Init"}},Ds={},js={};function Is(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=Ls&&i(t,e,n)}:i)}t.defineOption=n,t.Init=Ls,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,mo(t)}),!0),n("indentUnit",2,mo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){vo(t),fr(t),Br(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(se(r,o))}r++}));for(var i=n.length-1;i>=0;i--)aa(t.doc,e,n[i],se(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Ls&&t.refresh()})),n("specialCharPlaceholder",bn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ps(t),Qi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=Ga(e),i=n!=Ls&&Ga(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Fs,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Zi(e,t.options.lineNumbers),Qi(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Dr(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return wi(t)}),!0),n("scrollbarStyle","native",(function(t){ki(t),wi(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Zi(t.options.gutters,e),Qi(t)}),!0),n("firstLineNumber",1,Qi,!0),n("lineNumberFormatter",(function(t){return t}),Qi,!0),n("showCursorWhenSelecting",!1,Wr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(ti(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Rs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Wr,!0),n("singleCursorHeightPerLine",!0,Wr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,vo,!0),n("addModeClass",!1,vo,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,vo,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Rs(t,e,n){var r=n&&n!=Ls;if(!e!=!r){var i=t.display.dragFunctions,o=e?vt:yt;o(t.display.scroller,"dragstart",i.start),o(t.display.scroller,"dragenter",i.enter),o(t.display.scroller,"dragover",i.over),o(t.display.scroller,"dragleave",i.leave),o(t.display.scroller,"drop",i.drop)}}function Fs(t){t.options.lineWrapping?(D(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(O(t.display.wrapper,"CodeMirror-wrap"),un(t)),Ir(t),Br(t),fr(t),setTimeout((function(){return wi(t)}),100)}function Bs(t,e){var n=this;if(!(this instanceof Bs))return new Bs(t,e);this.options=e=e?z(e):{},z(Ds,e,!1);var r=e.value;"string"==typeof r?r=new Sa(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Bs.inputStyles[e.inputStyle](this),o=this.display=new to(t,r,i,e);for(var c in o.wrapper.CodeMirror=this,Ps(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ki(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 V,keySeq:null,specialChars:null},e.autofocus&&!b&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),zs(this),La(),Si(this),this.curOp.forceUpdate=!0,xo(this,r),e.autofocus&&!b||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Qr(n)}),20):ti(this),js)js.hasOwnProperty(c)&&js[c](this,e[c],Ls);Ki(this),e.finishInit&&e.finishInit(this);for(var u=0;u<Hs.length;++u)Hs[u](this);Ei(this),l&&e.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function zs(t){var e=t.display;vt(e.scroller,"mousedown",Di(t,ws)),vt(e.scroller,"dblclick",a&&s<11?Di(t,(function(e){if(!xt(t,e)){var n=Rr(t,e);if(n&&!_s(t,e)&&!$n(t.display,e)){St(e);var r=t.findWordAt(n);Fo(t.doc,r.anchor,r.head)}}})):function(e){return xt(t,e)||St(e)}),vt(e.scroller,"contextmenu",(function(e){return Ms(t,e)})),vt(e.input.getField(),"contextmenu",(function(n){e.scroller.contains(n.target)||Ms(t,n)}));var n,r={end:0};function i(){e.activeTouch&&(n=setTimeout((function(){return e.activeTouch=null}),1e3),r=e.activeTouch,r.end=+new Date)}function o(t){if(1!=t.touches.length)return!1;var e=t.touches[0];return e.radiusX<=1&&e.radiusY<=1}function l(t,e){if(null==e.left)return!0;var n=e.left-t.left,r=e.top-t.top;return n*n+r*r>400}vt(e.scroller,"touchstart",(function(i){if(!xt(t,i)&&!o(i)&&!_s(t,i)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),vt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),vt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!$n(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=t.coordsChar(e.activeTouch,"page");o=!r.prev||l(r,r.prev)?new so(a,a):!r.prev.prev||l(r,r.prev.prev)?t.findWordAt(a):new so(se(a.line,0),fe(t.doc,se(a.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),St(n)}i()})),vt(e.scroller,"touchcancel",i),vt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(fi(t,e.scroller.scrollTop),mi(t,e.scroller.scrollLeft,!0),wt(t,"scroll",t))})),vt(e.scroller,"mousewheel",(function(e){return oo(t,e)})),vt(e.scroller,"DOMMouseScroll",(function(e){return oo(t,e)})),vt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){xt(t,e)||Tt(e)},over:function(e){xt(t,e)||(_a(t,e),Tt(e))},start:function(e){return Ta(t,e)},drop:Di(t,Oa),leave:function(e){xt(t,e)||Ma(t)}};var c=e.input.getField();vt(c,"keyup",(function(e){return ps.call(t,e)})),vt(c,"keydown",Di(t,ds)),vt(c,"keypress",Di(t,fs)),vt(c,"focus",(function(e){return Qr(t,e)})),vt(c,"blur",(function(e){return ti(t,e)}))}Bs.defaults=Ds,Bs.optionHandlers=js;var Hs=[];function Vs(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=xe(t,e).state:n="prev");var a=t.options.tabSize,s=Qt(o,e),l=H(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&(c=o.mode.indent(i,s.text.slice(u.length),s.text),c==W||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>o.first?H(Qt(o,e-1).text,null,a):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0;if(t.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)h+=a,d+="\t";if(h<c&&(d+=Z(c-h)),d!=u)return aa(o,d,se(e,0),se(e,u.length),"+input"),s.stateAfter=null,!0;for(var f=0;f<o.sel.ranges.length;f++){var g=o.sel.ranges[f];if(g.head.line==e&&g.head.ch<u.length){var m=se(e,u.length);zo(o,f,new so(m,m));break}}}Bs.defineInitHook=function(t){return Hs.push(t)};var qs=null;function Us(t){qs=t}function Ws(t,e,n,r,i){var o=t.doc;t.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||t.state.pasteIncoming>a,l=It(e),c=null;if(s&&r.ranges.length>1)if(qs&&qs.text.join("\n")==e){if(r.ranges.length%qs.text.length==0){c=[];for(var u=0;u<qs.text.length;u++)c.push(o.splitLines(qs.text[u]))}}else l.length==r.ranges.length&&t.options.pasteLinesPerSelection&&(c=Q(l,(function(t){return[t]})));for(var d=t.curOp.updateInput,h=r.ranges.length-1;h>=0;h--){var p=r.ranges[h],f=p.from(),g=p.to();p.empty()&&(n&&n>0?f=se(f.line,f.ch-n):t.state.overwrite&&!s?g=se(g.line,Math.min(Qt(o,g.line).text.length,g.ch+J(l).length)):s&&qs&&qs.lineWise&&qs.text.join("\n")==l.join("\n")&&(f=g=se(f.line,0)));var m={from:f,to:g,text:c?c[h%c.length]:l,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};ta(t.doc,m),Nn(t,"inputRead",t,m)}e&&!s&&Gs(t,e),ci(t),t.curOp.updateInput<2&&(t.curOp.updateInput=d),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function $s(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||!e.hasFocus()||Li(e,(function(){return Ws(e,n,0,null,"paste")})),!0}function Gs(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(e.indexOf(o.electricChars.charAt(s))>-1){a=Vs(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Vs(t,i.head.line,"smart"));a&&Nn(t,"electricInput",t,i.head.line)}}}function Ys(t){for(var e=[],n=[],r=0;r<t.doc.sel.ranges.length;r++){var i=t.doc.sel.ranges[r].head.line,o={anchor:se(i,0),head:se(i+1,0)};n.push(o),e.push(t.getRange(o.anchor,o.head))}return{text:e,ranges:n}}function Xs(t,e,n,r){t.setAttribute("autocorrect",n?"":"off"),t.setAttribute("autocapitalize",r?"":"off"),t.setAttribute("spellcheck",!!e)}function Ks(){var t=M("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),e=M("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?t.style.width="1000px":t.setAttribute("wrap","off"),m&&(t.style.border="1px solid black"),Xs(t),e}function Zs(t){var e=t.optionHandlers,n=t.helpers={};t.prototype={constructor:t,focus:function(){F(this).focus(),this.display.input.focus()},setOption:function(t,n){var r=this.options,i=r[t];r[t]==n&&"mode"!=t||(r[t]=n,e.hasOwnProperty(t)&&Di(this,e[t])(this,n,i),wt(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"](Ga(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:ji((function(e,n){var r=e.token?e:t.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");tt(this.state.overlays,{mode:r,modeSpec:e,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(t){return t.priority})),this.state.modeGen++,Br(this)})),removeOverlay:ji((function(t){for(var e=this.state.overlays,n=0;n<e.length;++n){var r=e[n].modeSpec;if(r==t||"string"==typeof t&&r.name==t)return e.splice(n,1),this.state.modeGen++,void Br(this)}})),indentLine:ji((function(t,e,n){"string"!=typeof e&&"number"!=typeof e&&(e=null==e?this.options.smartIndent?"smart":"prev":e?"add":"subtract"),oe(this.doc,t)&&Vs(this,t,e,n)})),indentSelection:ji((function(t){for(var e=this.doc.sel.ranges,n=-1,r=0;r<e.length;r++){var i=e[r];if(i.empty())i.head.line>n&&(Vs(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&ci(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Vs(this,l,t);var c=this.doc.sel.ranges;0==o.ch&&e.length==c.length&&c[r].from().ch>0&&zo(this.doc,r,new so(o,c[r].to()),$)}}})),getTokenAt:function(t,e){return Ee(this,t,e)},getLineTokens:function(t,e){return Ee(this,se(t),e,!0)},getTokenTypeAt:function(t){t=fe(this.doc,t);var e,n=we(this,Qt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){e=n[2*a+2];break}r=a+1}}var s=e?e.indexOf("overlay "):-1;return s<0?e:0==s?null:e.slice(0,s-1)},getModeAt:function(e){var n=this.doc.mode;return n.innerMode?t.innerMode(n,this.getTokenAt(e).state).mode:n},getHelper:function(t,e){return this.getHelpers(t,e)[0]},getHelpers:function(t,e){var r=[];if(!n.hasOwnProperty(e))return r;var i=n[e],o=this.getModeAt(t);if("string"==typeof o[e])i[o[e]]&&r.push(i[o[e]]);else if(o[e])for(var a=0;a<o[e].length;a++){var s=i[o[e][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(o,this)&&-1==q(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(t,e){var n=this.doc;return t=pe(n,null==t?n.first+n.size-1:t),xe(this,t+1,e).state},cursorCoords:function(t,e){var n,r=this.doc.sel.primary();return n=null==t?r.head:"object"==typeof t?fe(this.doc,t):t?r.from():r.to(),xr(this,n,e||"page")},charCoords:function(t,e){return wr(this,fe(this.doc,t),e||"page")},coordsChar:function(t,e){return t=yr(this,t,e||"page"),Ar(this,t.left,t.top)},lineAtHeight:function(t,e){return t=yr(this,{top:t,left:0},e||"page").top,ie(this.doc,t+this.display.viewOffset)},heightAtLine:function(t,e,n){var r,i=!1;if("number"==typeof t){var o=this.doc.first+this.doc.size-1;t<this.doc.first?t=this.doc.first:t>o&&(t=o,i=!0),r=Qt(this.doc,t)}else r=t;return br(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-ln(r):0)},defaultTextHeight:function(){return Nr(this.display)},defaultCharWidth:function(){return Pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display;t=xr(this,fe(this.doc,t));var a=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"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||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>c&&(s=c-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==i?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&ai(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:ji(ds),triggerOnKeyPress:ji(fs),triggerOnKeyUp:ps,triggerOnMouseDown:ji(ws),execCommand:function(t){if(Qa.hasOwnProperty(t))return Qa[t].call(null,this)},triggerElectric:ji((function(t){Gs(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=fe(this.doc,t),a=0;a<e;++a)if(o=Js(this.doc,o,i,n,r),o.hitSide)break;return o},moveH:ji((function(t,e){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Js(n.doc,r.head,t,e,n.options.rtlMoveVisually):t<0?r.from():r.to()}),Y)})),deleteH:ji((function(t,e){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ya(this,(function(n){var i=Js(r,n.head,t,e,!1);return t<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(t,e,n,r){var i=1,o=r;e<0&&(i=-1,e=-e);for(var a=fe(this.doc,t),s=0;s<e;++s){var l=xr(this,a,"div");if(null==o?o=l.left:l.left=o,a=Qs(this,l,i,n),a.hitSide)break}return a},moveV:ji((function(t,e){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return t<0?a.from():a.to();var s=xr(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Qs(n,s,t,e);return"page"==e&&a==r.sel.primary()&&li(n,wr(n,l,"div").top-s.top),l}),Y),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(t){var e=this.doc,n=Qt(e,t.line).text,r=t.ch,i=t.ch;if(n){var o=this.getHelper(t,"wordChars");"before"!=t.sticky&&i!=n.length||!r?++i:--r;var a=n.charAt(r),s=ot(a,o)?function(t){return ot(t,o)}:/\s/.test(a)?function(t){return/\s/.test(t)}:function(t){return!/\s/.test(t)&&!ot(t)};while(r>0&&s(n.charAt(r-1)))--r;while(i<n.length&&s(n.charAt(i)))++i}return new so(se(t.line,r),se(t.line,i))},toggleOverwrite:function(t){null!=t&&t==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?D(this.display.cursorDiv,"CodeMirror-overwrite"):O(this.display.cursorDiv,"CodeMirror-overwrite"),wt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==L(R(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ji((function(t,e){ui(this,t,e)})),getScrollInfo:function(){var t=this.display.scroller;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight-Kn(this)-this.display.barHeight,width:t.scrollWidth-Kn(this)-this.display.barWidth,clientHeight:Jn(this),clientWidth:Zn(this)}},scrollIntoView:ji((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:se(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?di(this,t):pi(this,t.from,t.to,t.margin)})),setSize:ji((function(t,e){var n=this,r=function(t){return"number"==typeof t||/^\d+$/.test(String(t))?t+"px":t};null!=t&&(this.display.wrapper.style.width=r(t)),null!=e&&(this.display.wrapper.style.height=r(e)),this.options.lineWrapping&&pr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(t){if(t.widgets)for(var e=0;e<t.widgets.length;e++)if(t.widgets[e].noHScroll){zr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,wt(this,"refresh",this)})),operation:function(t){return Li(this,t)},startOperation:function(){return Si(this)},endOperation:function(){return Ei(this)},refresh:ji((function(){var t=this.display.cachedTextHeight;Br(this),this.curOp.forceUpdate=!0,fr(this),ui(this,this.doc.scrollLeft,this.doc.scrollTop),Gi(this.display),(null==t||Math.abs(t-Nr(this.display))>.5||this.options.lineWrapping)&&Ir(this),wt(this,"refresh",this)})),swapDoc:ji((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),xo(this,t),fr(this),this.display.input.reset(),ui(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Nn(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}},At(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}function Js(t,e,n,r,i){var o=e,a=n,s=Qt(t,e.line),l=i&&"rtl"==t.direction?-n:n;function c(){var n=e.line+l;return!(n<t.first||n>=t.first+t.size)&&(e=new se(n,e.ch,e.sticky),s=Qt(t,n))}function u(o){var a;if("codepoint"==r){var u=s.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new se(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(d?2:1))),-n)}}else a=i?Ja(t.cm,s,e,n):Ka(s,e,n);if(null==a){if(o||!c())return!1;e=Za(i,t.cm,s,e.line,l)}else e=a;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var d=null,h="group"==r,p=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;;f=!1){if(n<0&&!u(!f))break;var g=s.text.charAt(e.ch)||"\n",m=ot(g,p)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||f||m||(m="s"),d&&d!=m){n<0&&(n=1,u(),e.sticky="after");break}if(m&&(d=m),n>0&&!u(!f))break}var v=Ko(t,e,o,a,!0);return ce(o,v)&&(v.hitSide=!0),v}function Qs(t,e,n,r){var i,o,a=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,F(t).innerHeight||a(t).documentElement.clientHeight),c=Math.max(l-.5*Nr(t.display),3);i=(n>0?e.bottom:e.top)+n*c}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;;){if(o=Ar(t,s,i),!o.outside)break;if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var tl=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function el(t,e){var n=rr(t,e.line);if(!n||n.hidden)return null;var r=Qt(t.doc,e.line),i=tr(n,r,e.line),o=gt(r,t.doc.direction),a="left";if(o){var s=pt(o,e.ch);a=s%2?"right":"left"}var l=lr(i.map,e.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function nl(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function rl(t,e){return e&&(t.bad=!0),t}function il(t,e,n,r,i){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(t){return function(e){return e.id==t}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(t){t&&(u(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void d(n);var o,p=e.getAttribute("cm-marker");if(p){var f=t.findMarks(se(r,0),se(i+1,0),c(+p));return void(f.length&&(o=f[0].find(0))&&d(te(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&u();for(var m=0;m<e.childNodes.length;m++)h(e.childNodes[m]);/^(pre|p)$/i.test(e.nodeName)&&(l=!0),g&&(a=!0)}else 3==e.nodeType&&d(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;;){if(h(e),e==n)break;e=e.nextSibling,l=!1}return o}function ol(t,e,n){var r;if(e==t.display.lineDiv){if(r=t.display.lineDiv.childNodes[n],!r)return rl(t.clipPos(se(t.display.viewTo-1)),!0);e=null,n=0}else for(r=e;;r=r.parentNode){if(!r||r==t.display.lineDiv)return null;if(r.parentNode&&r.parentNode==t.display.lineDiv)break}for(var i=0;i<t.display.view.length;i++){var o=t.display.view[i];if(o.node==r)return al(o,e,n)}}function al(t,e,n){var r=t.text.firstChild,i=!1;if(!e||!P(r,e))return rl(se(re(t.line),0),!0);if(e==r&&(i=!0,e=r.childNodes[n],n=0,!e)){var o=t.rest?J(t.rest):t.line;return rl(se(re(o),o.text.length),i)}var a=3==e.nodeType?e:null,s=e;a||1!=e.childNodes.length||3!=e.firstChild.nodeType||(a=e.firstChild,n&&(n=a.nodeValue.length));while(s.parentNode!=r)s=s.parentNode;var l=t.measure,c=l.maps;function u(e,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?l.map:c[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==e||s==n){var u=re(i<0?t.line:t.rest[i]),d=o[a]+r;return(r<0||s!=e)&&(d=o[a+(r?1:0)]),se(u,d)}}}var d=u(a,s,n);if(d)return rl(d,i);for(var h=s.nextSibling,p=a?a.nodeValue.length-n:0;h;h=h.nextSibling){if(d=u(h,h.firstChild,0),d)return rl(se(d.line,d.ch-p),i);p+=h.textContent.length}for(var f=s.previousSibling,g=n;f;f=f.previousSibling){if(d=u(f,f.firstChild,-1),d)return rl(se(d.line,d.ch+g),i);g+=f.textContent.length}}tl.prototype.init=function(t){var e=this,n=this,r=n.cm,i=n.div=t.lineDiv;function o(t){for(var e=t.target;e;e=e.parentNode){if(e==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(e.className))break}return!1}function a(t){if(o(t)&&!xt(r,t)){if(r.somethingSelected())Us({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=Ys(r);Us({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation((function(){r.setSelections(e.ranges,0,$),r.replaceSelection("",null,"cut")}))}if(t.clipboardData){t.clipboardData.clearData();var a=qs.text.join("\n");if(t.clipboardData.setData("Text",a),t.clipboardData.getData("Text")==a)return void t.preventDefault()}var s=Ks(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=qs.text.join("\n");var c=L(i.ownerDocument);I(l),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==i&&n.showPrimarySelection()}),50)}}i.contentEditable=!0,Xs(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),vt(i,"paste",(function(t){!o(t)||xt(r,t)||$s(t,r)||s<=11&&setTimeout(Di(r,(function(){return e.updateFromDOM()})),20)})),vt(i,"compositionstart",(function(t){e.composing={data:t.data,done:!1}})),vt(i,"compositionupdate",(function(t){e.composing||(e.composing={data:t.data,done:!1})})),vt(i,"compositionend",(function(t){e.composing&&(t.data!=e.composing.data&&e.readFromDOMSoon(),e.composing.done=!0)})),vt(i,"touchstart",(function(){return n.forceCompositionEnd()})),vt(i,"input",(function(){e.composing||e.readFromDOMSoon()})),vt(i,"copy",a),vt(i,"cut",a)},tl.prototype.screenReaderLabelChanged=function(t){t?this.div.setAttribute("aria-label",t):this.div.removeAttribute("aria-label")},tl.prototype.prepareSelection=function(){var t=$r(this.cm,!1);return t.focus=L(this.div.ownerDocument)==this.div,t},tl.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},tl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},tl.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,r=e.doc.sel.primary(),i=r.from(),o=r.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||o.line<e.display.viewFrom)t.removeAllRanges();else{var a=ol(e,t.anchorNode,t.anchorOffset),s=ol(e,t.focusNode,t.focusOffset);if(!a||a.bad||!s||s.bad||0!=le(he(a,s),i)||0!=le(de(a,s),o)){var l=e.display.view,c=i.line>=e.display.viewFrom&&el(e,i)||{node:l[0].measure.map[2],offset:0},u=o.line<e.display.viewTo&&el(e,o);if(!u){var d=l[l.length-1].measure,h=d.maps?d.maps[d.maps.length-1]:d.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&u){var p,f=t.rangeCount&&t.getRangeAt(0);try{p=E(c.node,c.offset,u.offset,u.node)}catch(g){}p&&(!n&&e.state.focused?(t.collapse(c.node,c.offset),p.collapsed||(t.removeAllRanges(),t.addRange(p))):(t.removeAllRanges(),t.addRange(p)),f&&null==t.anchorNode?t.addRange(f):n&&this.startGracePeriod()),this.rememberSelection()}else t.removeAllRanges()}}},tl.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)},tl.prototype.showMultipleSelections=function(t){_(this.cm.display.cursorDiv,t.cursors),_(this.cm.display.selectionDiv,t.selection)},tl.prototype.rememberSelection=function(){var t=this.getSelection();this.lastAnchorNode=t.anchorNode,this.lastAnchorOffset=t.anchorOffset,this.lastFocusNode=t.focusNode,this.lastFocusOffset=t.focusOffset},tl.prototype.selectionInEditor=function(){var t=this.getSelection();if(!t.rangeCount)return!1;var e=t.getRangeAt(0).commonAncestorContainer;return P(this.div,e)},tl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&L(this.div.ownerDocument)==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},tl.prototype.blur=function(){this.div.blur()},tl.prototype.getField=function(){return this.div},tl.prototype.supportsTouch=function(){return!0},tl.prototype.receivedFocus=function(){var t=this,e=this;function n(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,n))}this.selectionInEditor()?setTimeout((function(){return t.pollSelection()}),20):Li(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,n)},tl.prototype.selectionChanged=function(){var t=this.getSelection();return t.anchorNode!=this.lastAnchorNode||t.anchorOffset!=this.lastAnchorOffset||t.focusNode!=this.lastFocusNode||t.focusOffset!=this.lastFocusOffset},tl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var t=this.getSelection(),e=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&nl(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=ol(e,t.anchorNode,t.anchorOffset),r=ol(e,t.focusNode,t.focusOffset);n&&r&&Li(e,(function(){Uo(e.doc,co(n,r),$),(n.bad||r.bad)&&(e.curOp.selectionChanged=!0)}))}}},tl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var t,e,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=se(a.line-1,Qt(r.doc,a.line-1).length)),s.ch==Qt(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=se(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(t=Fr(r,a.line))?(e=re(i.view[0].line),n=i.view[0].node):(e=re(i.view[t].line),n=i.view[t-1].node.nextSibling);var l,c,u=Fr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=re(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;var d=r.doc.splitLines(il(r,n,c,e,l)),h=te(r.doc,se(e,0),se(l,Qt(r.doc,l).text.length));while(d.length>1&&h.length>1)if(J(d)==J(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),e++}var p=0,f=0,g=d[0],m=h[0],v=Math.min(g.length,m.length);while(p<v&&g.charCodeAt(p)==m.charCodeAt(p))++p;var b=J(d),y=J(h),w=Math.min(b.length-(1==d.length?p:0),y.length-(1==h.length?p:0));while(f<w&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1))++f;if(1==d.length&&1==h.length&&e==a.line)while(p&&p>a.ch&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1))p--,f++;d[d.length-1]=b.slice(0,b.length-f).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var x=se(e,p),C=se(l,h.length?J(h).length-f:0);return d.length>1||d[0]||le(x,C)?(aa(r.doc,d,x,C,"+input"),!0):void 0},tl.prototype.ensurePolled=function(){this.forceCompositionEnd()},tl.prototype.reset=function(){this.forceCompositionEnd()},tl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},tl.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))},tl.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Li(this.cm,(function(){return Br(t.cm)}))},tl.prototype.setUneditable=function(t){t.contentEditable="false"},tl.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Di(this.cm,Ws)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},tl.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},tl.prototype.onContextMenu=function(){},tl.prototype.resetPosition=function(){},tl.prototype.needsContentAttribute=!0;var sl=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null,this.resetting=!1};function ll(t,e){if(e=e?z(e):{},e.value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=L(t.ownerDocument);e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(vt(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(l){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(yt(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Bs((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function cl(t){t.off=yt,t.on=vt,t.wheelEventPixels=io,t.Doc=Sa,t.splitLines=It,t.countColumn=H,t.findColumn=X,t.isWordChar=it,t.Pass=W,t.signal=wt,t.Line=dn,t.changeEnd=uo,t.scrollbarModel=Ci,t.Pos=se,t.cmpPos=le,t.modes=Ht,t.mimeModes=Vt,t.resolveMode=Wt,t.getMode=$t,t.modeExtensions=Gt,t.extendMode=Yt,t.copyState=Xt,t.startState=Zt,t.innerMode=Kt,t.commands=Qa,t.keyMap=za,t.keyName=$a,t.isModifierKey=Ua,t.lookupKey=qa,t.normalizeKeyMap=Va,t.StringStream=Jt,t.SharedTextMarker=ya,t.TextMarker=va,t.LineWidget=pa,t.e_preventDefault=St,t.e_stopPropagation=Et,t.e_stop=Tt,t.addClass=D,t.contains=P,t.rmClass=O,t.keyNames=Ia}sl.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!xt(r,t)){if(r.somethingSelected())Us({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Ys(r);Us({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,$):(n.prevInput="",i.value=e.text.join("\n"),I(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),m&&(i.style.width="0px"),vt(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),vt(i,"paste",(function(t){xt(r,t)||$s(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),vt(i,"cut",o),vt(i,"copy",o),vt(t.scroller,"paste",(function(e){if(!$n(t,e)&&!xt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),vt(t.lineSpace,"selectstart",(function(e){$n(t,e)||St(e)})),vt(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),vt(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},sl.prototype.createField=function(t){this.wrapper=Ks(),this.textarea=this.wrapper.firstChild},sl.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},sl.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=$r(t);if(t.options.moveInputWithCursor){var i=xr(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},sl.prototype.showSelection=function(t){var e=this.cm,n=e.display;_(n.cursorDiv,t.cursors),_(n.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&&t)){var e=this.cm;if(this.resetting=!0,e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null));this.resetting=!1}},sl.prototype.getField=function(){return this.textarea},sl.prototype.supportsTouch=function(){return!1},sl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!b||L(this.textarea.ownerDocument)!=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(){var t=!1,e=this;function n(){var r=e.poll();r||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},sl.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!e.state.focused||Rt(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}var l=0,c=Math.min(r.length,i.length);while(l<c&&r.charCodeAt(l)==i.charCodeAt(l))++l;return Li(e,(function(){Ws(e,i.slice(l),r.length-l,null,t.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,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&&s>=9&&(this.hasSelection=null),this.fastPoll()},sl.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=Rr(n,t),c=r.scroller.scrollTop;if(o&&!h){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(o)&&Di(n,Uo)(n.doc,co(o),$);var d,p=i.style.cssText,f=e.wrapper.style.cssText,g=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-g.top-5)+"px; left: "+(t.clientX-g.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);",l&&(d=i.ownerDocument.defaultView.scrollY),r.input.focus(),l&&i.ownerDocument.defaultView.scrollTo(null,d),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=b,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),A){Tt(t);var m=function(){yt(window,"mouseup",m),setTimeout(b,20)};vt(window,"mouseup",m)}else setTimeout(b,50)}function v(){if(null!=i.selectionStart){var t=n.somethingSelected(),o=""+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function b(){if(e.contextMenuPending==b&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,i.style.cssText=p,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&v();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==e.prevInput?Di(n,Jo)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},sl.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},sl.prototype.setUneditable=function(){},sl.prototype.needsContentAttribute=!1,Is(Bs),Zs(Bs);var ul="iter insert remove copy getEditor constructor".split(" ");for(var dl in Sa.prototype)Sa.prototype.hasOwnProperty(dl)&&q(ul,dl)<0&&(Bs.prototype[dl]=function(t){return function(){return t.apply(this.doc,arguments)}}(Sa.prototype[dl]));return At(Sa),Bs.inputStyles={textarea:sl,contenteditable:tl},Bs.defineMode=function(t){Bs.defaults.mode||"null"==t||(Bs.defaults.mode=t),qt.apply(this,arguments)},Bs.defineMIME=Ut,Bs.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Bs.defineMIME("text/plain","null"),Bs.defineExtension=function(t,e){Bs.prototype[t]=e},Bs.defineDocExtension=function(t,e){Sa.prototype[t]=e},Bs.fromTextArea=ll,cl(Bs),Bs.version="5.65.8",Bs}))},5704:function(t,e,n){"use strict";n.r(e);n("b2a3"),n("948e"),n("6ba6")},"593d":function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Close=void 0;var i=n("5c2e"),o=n("2d61"),a=n("f8f8"),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),Object.defineProperty(e.prototype,"end",{get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return"Z"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return new i.Line(this.start,this.end)},enumerable:!1,configurable:!0}),e.prototype.bbox=function(){return this.line.bbox()},e.prototype.closestPoint=function(t){return this.line.closestPoint(t)},e.prototype.closestPointLength=function(t){return this.line.closestPointLength(t)},e.prototype.closestPointNormalizedLength=function(t){return this.line.closestPointNormalizedLength(t)},e.prototype.closestPointTangent=function(t){return this.line.closestPointTangent(t)},e.prototype.length=function(){return this.line.length()},e.prototype.divideAt=function(t){var e=this.line.divideAt(t);return[e[1].isDifferentiable()?new o.LineTo(e[0]):this.clone(),new o.LineTo(e[1])]},e.prototype.divideAtLength=function(t){var e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new o.LineTo(e[0]):this.clone(),new o.LineTo(e[1])]},e.prototype.getSubdivisions=function(){return[]},e.prototype.pointAt=function(t){return this.line.pointAt(t)},e.prototype.pointAtLength=function(t){return this.line.pointAtLength(t)},e.prototype.tangentAt=function(t){return this.line.tangentAt(t)},e.prototype.tangentAtLength=function(t){return this.line.tangentAtLength(t)},e.prototype.isDifferentiable=function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},e.prototype.scale=function(){return this},e.prototype.rotate=function(){return this},e.prototype.translate=function(){return this},e.prototype.equals=function(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)},e.prototype.clone=function(){return new e},e.prototype.toJSON=function(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}},e.prototype.serialize=function(){return this.type},e}(a.Segment);e.Close=s,function(t){function e(){return new t}t.create=e}(s=e.Close||(e.Close={})),e.Close=s},"5bef":function(t,e,n){(function(t){t(n("56b3"),n("f9d4"),n("7b00"),n("d69f"))})((function(t){"use strict";t.defineMode("pug",(function(e){var n="keyword",r="meta",i="builtin",o="qualifier",a={"{":"}","(":")","[":"]"},s=t.getMode(e,"javascript");function l(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=t.startState(s),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function c(t,e){if(t.sol()&&(e.javaScriptLine=!1,e.javaScriptLineExcludesColon=!1),e.javaScriptLine){if(e.javaScriptLineExcludesColon&&":"===t.peek())return e.javaScriptLine=!1,void(e.javaScriptLineExcludesColon=!1);var n=s.token(t,e.jsState);return t.eol()&&(e.javaScriptLine=!1),n||!0}}function u(t,e){if(e.javaScriptArguments){if(0===e.javaScriptArgumentsDepth&&"("!==t.peek())return void(e.javaScriptArguments=!1);if("("===t.peek()?e.javaScriptArgumentsDepth++:")"===t.peek()&&e.javaScriptArgumentsDepth--,0===e.javaScriptArgumentsDepth)return void(e.javaScriptArguments=!1);var n=s.token(t,e.jsState);return n||!0}}function d(t){if(t.match(/^yield\b/))return"keyword"}function h(t){if(t.match(/^(?:doctype) *([^\n]+)?/))return r}function p(t,e){if(t.match("#{"))return e.isInterpolating=!0,e.interpolationNesting=0,"punctuation"}function f(t,e){if(e.isInterpolating){if("}"===t.peek()){if(e.interpolationNesting--,e.interpolationNesting<0)return t.next(),e.isInterpolating=!1,"punctuation"}else"{"===t.peek()&&e.interpolationNesting++;return s.token(t,e.jsState)||!0}}function g(t,e){if(t.match(/^case\b/))return e.javaScriptLine=!0,n}function m(t,e){if(t.match(/^when\b/))return e.javaScriptLine=!0,e.javaScriptLineExcludesColon=!0,n}function v(t){if(t.match(/^default\b/))return n}function b(t,e){if(t.match(/^extends?\b/))return e.restOfLine="string",n}function y(t,e){if(t.match(/^append\b/))return e.restOfLine="variable",n}function w(t,e){if(t.match(/^prepend\b/))return e.restOfLine="variable",n}function x(t,e){if(t.match(/^block\b *(?:(prepend|append)\b)?/))return e.restOfLine="variable",n}function C(t,e){if(t.match(/^include\b/))return e.restOfLine="string",n}function k(t,e){if(t.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&t.match("include"))return e.isIncludeFiltered=!0,n}function A(t,e){if(e.isIncludeFiltered){var n=L(t,e);return e.isIncludeFiltered=!1,e.restOfLine="string",n}}function S(t,e){if(t.match(/^mixin\b/))return e.javaScriptLine=!0,n}function E(t,e){return t.match(/^\+([-\w]+)/)?(t.match(/^\( *[-\w]+ *=/,!1)||(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0),"variable"):t.match("+#{",!1)?(t.next(),e.mixinCallAfter=!0,p(t,e)):void 0}function O(t,e){if(e.mixinCallAfter)return e.mixinCallAfter=!1,t.match(/^\( *[-\w]+ *=/,!1)||(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0),!0}function T(t,e){if(t.match(/^(if|unless|else if|else)\b/))return e.javaScriptLine=!0,n}function _(t,e){if(t.match(/^(- *)?(each|for)\b/))return e.isEach=!0,n}function M(t,e){if(e.isEach){if(t.match(/^ in\b/))return e.javaScriptLine=!0,e.isEach=!1,n;if(t.sol()||t.eol())e.isEach=!1;else if(t.next()){while(!t.match(/^ in\b/,!1)&&t.next());return"variable"}}}function N(t,e){if(t.match(/^while\b/))return e.javaScriptLine=!0,n}function P(t,e){var n;if(n=t.match(/^(\w(?:[-:\w]*\w)?)\/?/))return e.lastTag=n[1].toLowerCase(),"script"===e.lastTag&&(e.scriptType="application/javascript"),"tag"}function L(n,r){var i;if(n.match(/^:([\w\-]+)/))return e&&e.innerModes&&(i=e.innerModes(n.current().substring(1))),i||(i=n.current().substring(1)),"string"===typeof i&&(i=t.getMode(e,i)),$(n,r,i),"atom"}function D(t,e){if(t.match(/^(!?=|-)/))return e.javaScriptLine=!0,"punctuation"}function j(t){if(t.match(/^#([\w-]+)/))return i}function I(t){if(t.match(/^\.([\w-]+)/))return o}function R(t,e){if("("==t.peek())return t.next(),e.isAttrs=!0,e.attrsNest=[],e.inAttributeName=!0,e.attrValue="",e.attributeIsType=!1,"punctuation"}function F(e,n){if(n.isAttrs){if(a[e.peek()]&&n.attrsNest.push(a[e.peek()]),n.attrsNest[n.attrsNest.length-1]===e.peek())n.attrsNest.pop();else if(e.eat(")"))return n.isAttrs=!1,"punctuation";if(n.inAttributeName&&e.match(/^[^=,\)!]+/))return"="!==e.peek()&&"!"!==e.peek()||(n.inAttributeName=!1,n.jsState=t.startState(s),"script"===n.lastTag&&"type"===e.current().trim().toLowerCase()?n.attributeIsType=!0:n.attributeIsType=!1),"attribute";var r=s.token(e,n.jsState);if(n.attributeIsType&&"string"===r&&(n.scriptType=e.current().toString()),0===n.attrsNest.length&&("string"===r||"variable"===r||"keyword"===r))try{return Function("","var x "+n.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),n.inAttributeName=!0,n.attrValue="",e.backUp(e.current().length),F(e,n)}catch(i){}return n.attrValue+=e.current(),r||!0}}function B(t,e){if(t.match(/^&attributes\b/))return e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0,"keyword"}function z(t){if(t.sol()&&t.eatSpace())return"indent"}function H(t,e){if(t.match(/^ *\/\/(-)?([^\n]*)/))return e.indentOf=t.indentation(),e.indentToken="comment","comment"}function V(t){if(t.match(/^: */))return"colon"}function q(t,e){return t.match(/^(?:\| ?| )([^\n]+)/)?"string":t.match(/^(<[^\n]*)/,!1)?($(t,e,"htmlmixed"),e.innerModeForLine=!0,G(t,e,!0)):void 0}function U(t,e){if(t.eat(".")){var n=null;return"script"===e.lastTag&&-1!=e.scriptType.toLowerCase().indexOf("javascript")?n=e.scriptType.toLowerCase().replace(/"|'/g,""):"style"===e.lastTag&&(n="css"),$(t,e,n),"dot"}}function W(t){return t.next(),null}function $(n,r,i){i=t.mimeModes[i]||i,i=e.innerModes&&e.innerModes(i)||i,i=t.mimeModes[i]||i,i=t.getMode(e,i),r.indentOf=n.indentation(),i&&"null"!==i.name?r.innerMode=i:r.indentToken="string"}function G(e,n,r){if(e.indentation()>n.indentOf||n.innerModeForLine&&!e.sol()||r)return n.innerMode?(n.innerState||(n.innerState=n.innerMode.startState?t.startState(n.innerMode,e.indentation()):{}),e.hideFirstChars(n.indentOf+2,(function(){return n.innerMode.token(e,n.innerState)||!0}))):(e.skipToEnd(),n.indentToken);e.sol()&&(n.indentOf=1/0,n.indentToken=null,n.innerMode=null,n.innerState=null)}function Y(t,e){if(t.sol()&&(e.restOfLine=""),e.restOfLine){t.skipToEnd();var n=e.restOfLine;return e.restOfLine="",n}}function X(){return new l}function K(t){return t.copy()}function Z(t,e){var n=G(t,e)||Y(t,e)||f(t,e)||A(t,e)||M(t,e)||F(t,e)||c(t,e)||u(t,e)||O(t,e)||d(t)||h(t)||p(t,e)||g(t,e)||m(t,e)||v(t)||b(t,e)||y(t,e)||w(t,e)||x(t,e)||C(t,e)||k(t,e)||S(t,e)||E(t,e)||T(t,e)||_(t,e)||N(t,e)||P(t,e)||L(t,e)||D(t,e)||j(t)||I(t)||R(t,e)||B(t,e)||z(t)||q(t,e)||H(t,e)||V(t)||U(t,e)||W(t);return!0===n?null:n}return l.prototype.copy=function(){var e=new l;return e.javaScriptLine=this.javaScriptLine,e.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,e.javaScriptArguments=this.javaScriptArguments,e.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,e.isInterpolating=this.isInterpolating,e.interpolationNesting=this.interpolationNesting,e.jsState=t.copyState(s,this.jsState),e.innerMode=this.innerMode,this.innerMode&&this.innerState&&(e.innerState=t.copyState(this.innerMode,this.innerState)),e.restOfLine=this.restOfLine,e.isIncludeFiltered=this.isIncludeFiltered,e.isEach=this.isEach,e.lastTag=this.lastTag,e.scriptType=this.scriptType,e.isAttrs=this.isAttrs,e.attrsNest=this.attrsNest.slice(),e.inAttributeName=this.inAttributeName,e.attributeIsType=this.attributeIsType,e.attrValue=this.attrValue,e.indentOf=this.indentOf,e.indentToken=this.indentToken,e.innerModeForLine=this.innerModeForLine,e},{startState:X,copyState:K,token:Z}}),"javascript","css","htmlmixed"),t.defineMIME("text/x-pug","pug"),t.defineMIME("text/x-jade","pug")}))},"5c2e":function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;var i=n("6762"),o=n("722a"),a=n("70e6"),s=function(t){function e(e,n,r,o){var a=t.call(this)||this;return"number"===typeof e&&"number"===typeof n?(a.start=new i.Point(e,n),a.end=new i.Point(r,o)):(a.start=i.Point.create(e),a.end=i.Point.create(n)),a}return r(e,t),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return new i.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)},enumerable:!1,configurable:!0}),e.prototype.getCenter=function(){return this.center},e.prototype.round=function(t){return void 0===t&&(t=0),this.start.round(t),this.end.round(t),this},e.prototype.translate=function(t,e){return"number"===typeof t?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this},e.prototype.rotate=function(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this},e.prototype.scale=function(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this},e.prototype.length=function(){return Math.sqrt(this.squaredLength())},e.prototype.squaredLength=function(){var t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e},e.prototype.setLength=function(t){var e=this.length();if(!e)return this;var n=t/e;return this.scale(n,n,this.start)},e.prototype.parallel=function(t){var e=this.clone();if(!e.isDifferentiable())return e;var n=e.start,r=e.end,i=n.clone().rotate(270,r),o=r.clone().rotate(90,n);return n.move(o,t),r.move(i,t),e},e.prototype.vector=function(){return new i.Point(this.end.x-this.start.x,this.end.y-this.start.y)},e.prototype.angle=function(){var t=new i.Point(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)},e.prototype.bbox=function(){var t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),r=Math.max(this.start.y,this.end.y);return new a.Rectangle(t,e,n-t,r-e)},e.prototype.bearing=function(){return this.start.bearing(this.end)},e.prototype.closestPoint=function(t){return this.pointAt(this.closestPointNormalizedLength(t))},e.prototype.closestPointLength=function(t){return this.closestPointNormalizedLength(t)*this.length()},e.prototype.closestPointTangent=function(t){return this.tangentAt(this.closestPointNormalizedLength(t))},e.prototype.closestPointNormalizedLength=function(t){var n=this.vector().dot(new e(this.start,t).vector()),r=Math.min(1,Math.max(0,n/this.squaredLength()));return Number.isNaN(r)?0:r},e.prototype.pointAt=function(t){var e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)},e.prototype.pointAtLength=function(t){var e=this.start,n=this.end,r=!0;t<0&&(r=!1,t=-t);var i=this.length();if(t>=i)return r?n.clone():e.clone();var o=(r?t:i-t)/i;return this.pointAt(o)},e.prototype.divideAt=function(t){var n=this.pointAt(t);return[new e(this.start,n),new e(n,this.end)]},e.prototype.divideAtLength=function(t){var n=this.pointAtLength(t);return[new e(this.start,n),new e(n,this.end)]},e.prototype.containsPoint=function(t){var n=this.start,r=this.end;if(0!==n.cross(t,r))return!1;var i=this.length();return!(new e(n,t).length()>i)&&!(new e(t,r).length()>i)},e.prototype.intersect=function(t,e){var n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null},e.prototype.intersectsWithLine=function(t){var e=new i.Point(this.end.x-this.start.x,this.end.y-this.start.y),n=new i.Point(t.end.x-t.start.x,t.end.y-t.start.y),r=e.x*n.y-e.y*n.x,o=new i.Point(t.start.x-this.start.x,t.start.y-this.start.y),a=o.x*n.y-o.y*n.x,s=o.x*e.y-o.y*e.x;if(0===r||a*r<0||s*r<0)return null;if(r>0){if(a>r||s>r)return null}else if(a<r||s<r)return null;return new i.Point(this.start.x+a*e.x/r,this.start.y+a*e.y/r)},e.prototype.isDifferentiable=function(){return!this.start.equals(this.end)},e.prototype.pointOffset=function(t){var e=i.Point.clone(t),n=this.start,r=this.end,o=(r.x-n.x)*(e.y-n.y)-(r.y-n.y)*(e.x-n.x);return o/this.length()},e.prototype.pointSquaredDistance=function(t,e){var n=i.Point.create(t,e);return this.closestPoint(n).squaredDistance(n)},e.prototype.pointDistance=function(t,e){var n=i.Point.create(t,e);return this.closestPoint(n).distance(n)},e.prototype.tangentAt=function(t){if(!this.isDifferentiable())return null;var n=this.start,r=this.end,i=this.pointAt(t),o=new e(n,r);return o.translate(i.x-n.x,i.y-n.y),o},e.prototype.tangentAtLength=function(t){if(!this.isDifferentiable())return null;var n=this.start,r=this.end,i=this.pointAtLength(t),o=new e(n,r);return o.translate(i.x-n.x,i.y-n.y),o},e.prototype.relativeCcw=function(t,e){var n=i.Point.create(t,e),r=n.x-this.start.x,o=n.y-this.start.y,a=this.end.x-this.start.x,s=this.end.y-this.start.y,l=r*s-o*a;return 0===l&&(l=r*a+o*s,l>0&&(r-=a,o-=s,l=r*a+o*s,l<0&&(l=0))),l<0?-1:l>0?1:0},e.prototype.equals=function(t){return null!=t&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y},e.prototype.clone=function(){return new e(this.start,this.end)},e.prototype.toJSON=function(){return{start:this.start.toJSON(),end:this.end.toJSON()}},e.prototype.serialize=function(){return[this.start.serialize(),this.end.serialize()].join(" ")},e}(o.Geometry);e.Line=s,function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;try{if((null==n||n===t.toStringTag)&&i.Point.isPoint(r.start)&&i.Point.isPoint(r.end)&&"function"===typeof r.vector&&"function"===typeof r.bearing&&"function"===typeof r.parallel&&"function"===typeof r.intersect)return!0}catch(o){return!1}return!1}t.toStringTag="X6.Geometry."+t.name,t.isLine=e}(s=e.Line||(e.Line={})),e.Line=s},"5c95":function(t,e,n){"use strict";t.exports=function(t){var e,n,r,i=t.tokens;for(n=0,r=i.length;n<r;n++)e=i[n],"inline"===e.type&&t.md.inline.parse(e.content,t.md,t.env,e.children)}},"5cc6":function(t,e,n){var r=n("74e8");r("Uint8",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},"5cf7":function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=0;function i(t){return"__private_"+r+++"_"+t}},"5d41":function(t,e,n){var r=n("23e7"),i=n("c65b"),o=n("861d"),a=n("825a"),s=n("c60d"),l=n("06cf"),c=n("e163");function u(t,e){var n,r,d=arguments.length<3?t:arguments[2];return a(t)===d?t[e]:(n=l.f(t,e),n?s(n)?n.value:void 0===n.get?void 0:i(n.get,d):o(r=c(t))?u(r,e,d):void 0)}r({target:"Reflect",stat:!0},{get:u})},"5ddc":function(t,e,n){var r=n("8384"),i=n("ce86"),o=n("4b17"),a=n("76dd");function s(t,e,n){return t=a(t),n=null==n?0:r(o(n),0,t.length),e=i(e),t.slice(n,n+e.length)==e}t.exports=s},"5f1a":function(t,e,n){"use strict";var r=n("ebfb"),i=[["text",n("3615")],["linkify",n("e308")],["newline",n("ff38")],["escape",n("bc99")],["backticks",n("515a")],["strikethrough",n("7a15").tokenize],["emphasis",n("1b19").tokenize],["link",n("3b7e")],["image",n("3d48")],["autolink",n("489c")],["html_inline",n("1d04")],["entity",n("bb57")]],o=[["balance_pairs",n("b401")],["strikethrough",n("7a15").postProcess],["emphasis",n("1b19").postProcess],["fragments_join",n("85b6")]];function a(){var t;for(this.ruler=new r,t=0;t<i.length;t++)this.ruler.push(i[t][0],i[t][1]);for(this.ruler2=new r,t=0;t<o.length;t++)this.ruler2.push(o[t][0],o[t][1])}a.prototype.skipToken=function(t){var e,n,r=t.pos,i=this.ruler.getRules(""),o=i.length,a=t.md.options.maxNesting,s=t.cache;if("undefined"===typeof s[r]){if(t.level<a){for(n=0;n<o;n++)if(t.level++,e=i[n](t,!0),t.level--,e)break}else t.pos=t.posMax;e||t.pos++,s[r]=t.pos}else t.pos=s[r]},a.prototype.tokenize=function(t){var e,n,r=this.ruler.getRules(""),i=r.length,o=t.posMax,a=t.md.options.maxNesting;while(t.pos<o){if(t.level<a)for(n=0;n<i;n++)if(e=r[n](t,!1),e)break;if(e){if(t.pos>=o)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},a.prototype.parse=function(t,e,n,r){var i,o,a,s=new this.State(t,e,n,r);for(this.tokenize(s),o=this.ruler2.getRules(""),a=o.length,i=0;i<a;i++)o[i](s)},a.prototype.State=n("c421"),t.exports=a},"5f96":function(t,e,n){"use strict";var r=n("ebb5"),i=n("e330"),o=r.aTypedArray,a=r.exportTypedArrayMethod,s=i([].join);a("join",(function(t){return s(o(this),t)}))},"5ff5":function(t,e,n){},6:function(t,e){},"609e":function(t,e,n){},"60bd":function(t,e,n){"use strict";var r=n("da84"),i=n("d039"),o=n("e330"),a=n("ebb5"),s=n("e260"),l=n("b622"),c=l("iterator"),u=r.Uint8Array,d=o(s.values),h=o(s.keys),p=o(s.entries),f=a.aTypedArray,g=a.exportTypedArrayMethod,m=u&&u.prototype,v=!i((function(){m[c].call([1])})),b=!!m&&m.values&&m[c]===m.values&&"values"===m.values.name,y=function(){return d(f(this))};g("entries",(function(){return p(f(this))}),v),g("keys",(function(){return h(f(this))}),v),g("values",y,v||!b,{name:"values"}),g(c,y,v||!b,{name:"values"})},"60d5":function(t,e,n){},6107:function(t,e,n){},6185:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n("78c1"),e),i(n("f8f8"),e)},6194:function(t,e,n){},"621a":function(t,e,n){"use strict";var r=n("da84"),i=n("e330"),o=n("83ab"),a=n("4b11"),s=n("5e77"),l=n("9112"),c=n("6964"),u=n("d039"),d=n("19aa"),h=n("5926"),p=n("50c4"),f=n("0b25"),g=n("77a7"),m=n("e163"),v=n("d2bb"),b=n("241c").f,y=n("9bf2").f,w=n("81d5"),x=n("4dae"),C=n("d44e"),k=n("69f3"),A=s.PROPER,S=s.CONFIGURABLE,E=k.get,O=k.set,T="ArrayBuffer",_="DataView",M="prototype",N="Wrong length",P="Wrong index",L=r[T],D=L,j=D&&D[M],I=r[_],R=I&&I[M],F=Object.prototype,B=r.Array,z=r.RangeError,H=i(w),V=i([].reverse),q=g.pack,U=g.unpack,W=function(t){return[255&t]},$=function(t){return[255&t,t>>8&255]},G=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},X=function(t){return q(t,23,4)},K=function(t){return q(t,52,8)},Z=function(t,e){y(t[M],e,{get:function(){return E(this)[e]}})},J=function(t,e,n,r){var i=f(n),o=E(t);if(i+e>o.byteLength)throw z(P);var a=E(o.buffer).bytes,s=i+o.byteOffset,l=x(a,s,s+e);return r?l:V(l)},Q=function(t,e,n,r,i,o){var a=f(n),s=E(t);if(a+e>s.byteLength)throw z(P);for(var l=E(s.buffer).bytes,c=a+s.byteOffset,u=r(+i),d=0;d<e;d++)l[c+d]=u[o?d:e-d-1]};if(a){var tt=A&&L.name!==T;if(u((function(){L(1)}))&&u((function(){new L(-1)}))&&!u((function(){return new L,new L(1.5),new L(NaN),1!=L.length||tt&&!S})))tt&&S&&l(L,"name",T);else{D=function(t){return d(this,j),new L(f(t))},D[M]=j;for(var et,nt=b(L),rt=0;nt.length>rt;)(et=nt[rt++])in D||l(D,et,L[et]);j.constructor=D}v&&m(R)!==F&&v(R,F);var it=new I(new D(2)),ot=i(R.setInt8);it.setInt8(0,2147483648),it.setInt8(1,2147483649),!it.getInt8(0)&&it.getInt8(1)||c(R,{setInt8:function(t,e){ot(this,t,e<<24>>24)},setUint8:function(t,e){ot(this,t,e<<24>>24)}},{unsafe:!0})}else D=function(t){d(this,j);var e=f(t);O(this,{bytes:H(B(e),0),byteLength:e}),o||(this.byteLength=e)},j=D[M],I=function(t,e,n){d(this,R),d(t,j);var r=E(t).byteLength,i=h(e);if(i<0||i>r)throw z("Wrong offset");if(n=void 0===n?r-i:p(n),i+n>r)throw z(N);O(this,{buffer:t,byteLength:n,byteOffset:i}),o||(this.buffer=t,this.byteLength=n,this.byteOffset=i)},R=I[M],o&&(Z(D,"byteLength"),Z(I,"buffer"),Z(I,"byteLength"),Z(I,"byteOffset")),c(R,{getInt8:function(t){return J(this,1,t)[0]<<24>>24},getUint8:function(t){return J(this,1,t)[0]},getInt16:function(t){var e=J(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=J(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return Y(J(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return Y(J(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return U(J(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return U(J(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){Q(this,1,t,W,e)},setUint8:function(t,e){Q(this,1,t,W,e)},setInt16:function(t,e){Q(this,2,t,$,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){Q(this,2,t,$,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){Q(this,4,t,G,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){Q(this,4,t,G,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){Q(this,4,t,X,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){Q(this,8,t,K,e,arguments.length>2?arguments[2]:void 0)}});C(D,T),C(I,_),t.exports={ArrayBuffer:D,DataView:I}},6368:function(t,e,n){},"637e":function(t,e,n){},"63d0":function(t,e,n){"use strict";n("f190")},"63df":function(t,e,n){var r=function(t){return"[object Array]"==Object.prototype.toString.call(t)},i=function(t){return!!t&&t.constructor===Object},o=function(t){return JSON.parse(JSON.stringify(t))},a={name:"json0",uri:"http://sharejs.org/types/JSONv0"},s={};function l(t){t.t="text0";var e={p:t.p.pop()};null!=t.si&&(e.i=t.si),null!=t.sd&&(e.d=t.sd),t.o=[e]}function c(t){t.p.push(t.o[0].p),null!=t.o[0].i&&(t.si=t.o[0].i),null!=t.o[0].d&&(t.sd=t.o[0].d),delete t.t,delete t.o}a.registerSubtype=function(t){s[t.name]=t},a.create=function(t){return void 0===t?null:o(t)},a.invertComponent=function(t){var e={p:t.p};return t.t&&s[t.t]&&(e.t=t.t,e.o=s[t.t].invert(t.o)),void 0!==t.si&&(e.sd=t.si),void 0!==t.sd&&(e.si=t.sd),void 0!==t.oi&&(e.od=t.oi),void 0!==t.od&&(e.oi=t.od),void 0!==t.li&&(e.ld=t.li),void 0!==t.ld&&(e.li=t.ld),void 0!==t.na&&(e.na=-t.na),void 0!==t.lm&&(e.lm=t.p[t.p.length-1],e.p=t.p.slice(0,t.p.length-1).concat([t.lm])),e},a.invert=function(t){for(var e=t.slice().reverse(),n=[],r=0;r<e.length;r++)n.push(a.invertComponent(e[r]));return n},a.checkValidOp=function(t){for(var e=0;e<t.length;e++)if(!r(t[e].p))throw new Error("Missing path")},a.checkList=function(t){if(!r(t))throw new Error("Referenced element not a list")},a.checkObj=function(t){if(!i(t))throw new Error("Referenced element not an object (it was "+JSON.stringify(t)+")")},a.apply=function(t,e){a.checkValidOp(e),e=o(e);for(var n={data:t},r=0;r<e.length;r++){var i=e[r];null==i.si&&null==i.sd||l(i);for(var c=null,u=n,d="data",h=0;h<i.p.length;h++){var p=i.p[h];if(c=u,d,u=u[d],d=p,null==c)throw new Error("Path invalid")}if(i.t&&void 0!==i.o&&s[i.t])u[d]=s[i.t].apply(u[d],i.o);else if(void 0!==i.na){if("number"!=typeof u[d])throw new Error("Referenced element not a number");u[d]+=i.na}else if(void 0!==i.li&&void 0!==i.ld)a.checkList(u),u[d]=i.li;else if(void 0!==i.li)a.checkList(u),u.splice(d,0,i.li);else if(void 0!==i.ld)a.checkList(u),u.splice(d,1);else if(void 0!==i.lm){if(a.checkList(u),i.lm!=d){var f=u[d];u.splice(d,1),u.splice(i.lm,0,f)}}else if(void 0!==i.oi)a.checkObj(u),u[d]=i.oi;else{if(void 0===i.od)throw new Error("invalid / missing instruction in op");a.checkObj(u),delete u[d]}}return n.data},a.shatter=function(t){for(var e=[],n=0;n<t.length;n++)e.push([t[n]]);return e},a.incrementalApply=function(t,e,n){for(var r=0;r<e.length;r++){var i=[e[r]];t=a.apply(t,i),n(i,t)}return t};var u=a.pathMatches=function(t,e,n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r]&&(!n||r!==t.length-1))return!1;return!0};a.append=function(t,e){if(e=o(e),0!==t.length){var n=t[t.length-1];if(null==e.si&&null==e.sd||null==n.si&&null==n.sd||(l(e),l(n)),u(e.p,n.p))if(e.t&&n.t&&e.t===n.t&&s[e.t]){if(n.o=s[e.t].compose(n.o,e.o),null!=e.si||null!=e.sd){for(var r=e.p,i=0;i<n.o.length-1;i++)e.o=[n.o.pop()],e.p=r.slice(),c(e),t.push(e);c(n)}}else null!=n.na&&null!=e.na?t[t.length-1]={p:n.p,na:n.na+e.na}:void 0!==n.li&&void 0===e.li&&e.ld===n.li?void 0!==n.ld?delete n.li:t.pop():void 0!==n.od&&void 0===n.oi&&void 0!==e.oi&&void 0===e.od?n.oi=e.oi:void 0!==n.oi&&void 0!==e.od?void 0!==e.oi?n.oi=e.oi:void 0!==n.od?delete n.oi:t.pop():void 0!==e.lm&&e.p[e.p.length-1]===e.lm||t.push(e);else null==e.si&&null==e.sd||null==n.si&&null==n.sd||(c(e),c(n)),t.push(e)}else t.push(e)},a.compose=function(t,e){a.checkValidOp(t),a.checkValidOp(e);for(var n=o(t),r=0;r<e.length;r++)a.append(n,e[r]);return n},a.normalize=function(t){var e=[];t=r(t)?t:[t];for(var n=0;n<t.length;n++){var i=t[n];null==i.p&&(i.p=[]),a.append(e,i)}return e},a.commonLengthForOps=function(t,e){var n=t.p.length,r=e.p.length;if((null!=t.na||t.t)&&n++,(null!=e.na||e.t)&&r++,0===n)return-1;if(0===r)return null;n--,r--;for(var i=0;i<n;i++){var o=t.p[i];if(i>=r||o!==e.p[i])return null}return n},a.canOpAffectPath=function(t,e){return null!=a.commonLengthForOps({p:e},t)},a.transformComponent=function(t,e,n,i){e=o(e);var u=a.commonLengthForOps(n,e),d=a.commonLengthForOps(e,n),h=e.p.length,p=n.p.length;if((null!=e.na||e.t)&&h++,(null!=n.na||n.t)&&p++,null!=d&&p>h&&e.p[d]==n.p[d])if(void 0!==e.ld){var f=o(n);f.p=f.p.slice(h),e.ld=a.apply(o(e.ld),[f])}else if(void 0!==e.od){f=o(n);f.p=f.p.slice(h),e.od=a.apply(o(e.od),[f])}if(null!=u){var g=h==p;f=n;if(null==e.si&&null==e.sd||null==n.si&&null==n.sd||(l(e),f=o(n),l(f)),f.t&&s[f.t]){if(e.t&&e.t===f.t){var m=s[e.t].transform(e.o,f.o,i);if(null!=e.si||null!=e.sd)for(var v=e.p,b=0;b<m.length;b++)e.o=[m[b]],e.p=v.slice(),c(e),a.append(t,e);else(!r(m)||m.length>0)&&(e.o=m,a.append(t,e));return t}}else if(void 0!==n.na);else if(void 0!==n.li&&void 0!==n.ld){if(n.p[u]===e.p[u]){if(!g)return t;if(void 0!==e.ld){if(void 0===e.li||"left"!==i)return t;e.ld=o(n.li)}}}else if(void 0!==n.li)void 0!==e.li&&void 0===e.ld&&g&&e.p[u]===n.p[u]?"right"===i&&e.p[u]++:n.p[u]<=e.p[u]&&e.p[u]++,void 0!==e.lm&&g&&n.p[u]<=e.lm&&e.lm++;else if(void 0!==n.ld){if(void 0!==e.lm&&g){if(n.p[u]===e.p[u])return t;v=n.p[u];var y=e.p[u],w=e.lm;(v<w||v===w&&y<w)&&e.lm--}if(n.p[u]<e.p[u])e.p[u]--;else if(n.p[u]===e.p[u]){if(p<h)return t;if(void 0!==e.ld){if(void 0===e.li)return t;delete e.ld}}}else if(void 0!==n.lm)if(void 0!==e.lm&&h===p){y=e.p[u],w=e.lm;var x=n.p[u],C=n.lm;if(x!==C)if(y===x){if("left"!==i)return t;e.p[u]=C,y===w&&(e.lm=C)}else y>x&&e.p[u]--,y>C?e.p[u]++:y===C&&x>C&&(e.p[u]++,y===w&&e.lm++),(w>x||w===x&&w>y)&&e.lm--,w>C?e.lm++:w===C&&(C>x&&w>y||C<x&&w<y?"right"===i&&e.lm++:w>y?e.lm++:w===x&&e.lm--)}else if(void 0!==e.li&&void 0===e.ld&&g){y=n.p[u],w=n.lm;v=e.p[u],v>y&&e.p[u]--,v>w&&e.p[u]++}else{y=n.p[u],w=n.lm;v=e.p[u],v===y?e.p[u]=w:(v>y&&e.p[u]--,(v>w||v===w&&y>w)&&e.p[u]++)}else if(void 0!==n.oi&&void 0!==n.od){if(e.p[u]===n.p[u]){if(void 0===e.oi||!g)return t;if("right"===i)return t;e.od=n.oi}}else if(void 0!==n.oi){if(void 0!==e.oi&&e.p[u]===n.p[u]){if("left"!==i)return t;a.append(t,{p:e.p,od:n.oi})}}else if(void 0!==n.od&&e.p[u]==n.p[u]){if(!g)return t;if(void 0===e.oi)return t;delete e.od}}return a.append(t,e),t},n("cda8")(a,a.transformComponent,a.checkValidOp,a.append);var d=n("3919");a.registerSubtype(d),t.exports=a},"63ea":function(t,e,n){var r=n("c05f");function i(t,e){return r(t,e)}t.exports=i},"641c":function(t,e){var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,o=0;n.Diff=function(t,e){return[t,e]},n.prototype.diff_main=function(t,e,r,i){"undefined"==typeof i&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var a=i;if(null==t||null==e)throw new Error("Null input. (diff_main)");if(t==e)return t?[new n.Diff(o,t)]:[];"undefined"==typeof r&&(r=!0);var s=r,l=this.diff_commonPrefix(t,e),c=t.substring(0,l);t=t.substring(l),e=e.substring(l),l=this.diff_commonSuffix(t,e);var u=t.substring(t.length-l);t=t.substring(0,t.length-l),e=e.substring(0,e.length-l);var d=this.diff_compute_(t,e,s,a);return c&&d.unshift(new n.Diff(o,c)),u&&d.push(new n.Diff(o,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(t,e,a,s){var l;if(!t)return[new n.Diff(i,e)];if(!e)return[new n.Diff(r,t)];var c=t.length>e.length?t:e,u=t.length>e.length?e:t,d=c.indexOf(u);if(-1!=d)return l=[new n.Diff(i,c.substring(0,d)),new n.Diff(o,u),new n.Diff(i,c.substring(d+u.length))],t.length>e.length&&(l[0][0]=l[2][0]=r),l;if(1==u.length)return[new n.Diff(r,t),new n.Diff(i,e)];var h=this.diff_halfMatch_(t,e);if(h){var p=h[0],f=h[1],g=h[2],m=h[3],v=h[4],b=this.diff_main(p,g,a,s),y=this.diff_main(f,m,a,s);return b.concat([new n.Diff(o,v)],y)}return a&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,s):this.diff_bisect_(t,e,s)},n.prototype.diff_lineMode_=function(t,e,a){var s=this.diff_linesToChars_(t,e);t=s.chars1,e=s.chars2;var l=s.lineArray,c=this.diff_main(t,e,!1,a);this.diff_charsToLines_(c,l),this.diff_cleanupSemantic(c),c.push(new n.Diff(o,""));var u=0,d=0,h=0,p="",f="";while(u<c.length){switch(c[u][0]){case i:h++,f+=c[u][1];break;case r:d++,p+=c[u][1];break;case o:if(d>=1&&h>=1){c.splice(u-d-h,d+h),u=u-d-h;for(var g=this.diff_main(p,f,!1,a),m=g.length-1;m>=0;m--)c.splice(u,0,g[m]);u+=g.length}h=0,d=0,p="",f="";break}u++}return c.pop(),c},n.prototype.diff_bisect_=function(t,e,o){for(var a=t.length,s=e.length,l=Math.ceil((a+s)/2),c=l,u=2*l,d=new Array(u),h=new Array(u),p=0;p<u;p++)d[p]=-1,h[p]=-1;d[c+1]=0,h[c+1]=0;for(var f=a-s,g=f%2!=0,m=0,v=0,b=0,y=0,w=0;w<l;w++){if((new Date).getTime()>o)break;for(var x=-w+m;x<=w-v;x+=2){var C=c+x;T=x==-w||x!=w&&d[C-1]<d[C+1]?d[C+1]:d[C-1]+1;var k=T-x;while(T<a&&k<s&&t.charAt(T)==e.charAt(k))T++,k++;if(d[C]=T,T>a)v+=2;else if(k>s)m+=2;else if(g){var A=c+f-x;if(A>=0&&A<u&&-1!=h[A]){var S=a-h[A];if(T>=S)return this.diff_bisectSplit_(t,e,T,k,o)}}}for(var E=-w+b;E<=w-y;E+=2){A=c+E;S=E==-w||E!=w&&h[A-1]<h[A+1]?h[A+1]:h[A-1]+1;var O=S-E;while(S<a&&O<s&&t.charAt(a-S-1)==e.charAt(s-O-1))S++,O++;if(h[A]=S,S>a)y+=2;else if(O>s)b+=2;else if(!g){C=c+f-E;if(C>=0&&C<u&&-1!=d[C]){var T=d[C];k=c+T-C;if(S=a-S,T>=S)return this.diff_bisectSplit_(t,e,T,k,o)}}}}return[new n.Diff(r,t),new n.Diff(i,e)]},n.prototype.diff_bisectSplit_=function(t,e,n,r,i){var o=t.substring(0,n),a=e.substring(0,r),s=t.substring(n),l=e.substring(r),c=this.diff_main(o,a,!1,i),u=this.diff_main(s,l,!1,i);return c.concat(u)},n.prototype.diff_linesToChars_=function(t,e){var n=[],r={};function i(t){var e="",i=0,a=-1,s=n.length;while(a<t.length-1){a=t.indexOf("\n",i),-1==a&&(a=t.length-1);var l=t.substring(i,a+1);(r.hasOwnProperty?r.hasOwnProperty(l):void 0!==r[l])?e+=String.fromCharCode(r[l]):(s==o&&(l=t.substring(i),a=t.length),e+=String.fromCharCode(s),r[l]=s,n[s++]=l),i=a+1}return e}n[0]="";var o=4e4,a=i(t);o=65535;var s=i(e);return{chars1:a,chars2:s,lineArray:n}},n.prototype.diff_charsToLines_=function(t,e){for(var n=0;n<t.length;n++){for(var r=t[n][1],i=[],o=0;o<r.length;o++)i[o]=e[r.charCodeAt(o)];t[n][1]=i.join("")}},n.prototype.diff_commonPrefix=function(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;var n=0,r=Math.min(t.length,e.length),i=r,o=0;while(n<i)t.substring(o,i)==e.substring(o,i)?(n=i,o=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(t,e){if(!t||!e||t.charAt(t.length-1)!=e.charAt(e.length-1))return 0;var n=0,r=Math.min(t.length,e.length),i=r,o=0;while(n<i)t.substring(t.length-i,t.length-o)==e.substring(e.length-i,e.length-o)?(n=i,o=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(t,e){var n=t.length,r=e.length;if(0==n||0==r)return 0;n>r?t=t.substring(n-r):n<r&&(e=e.substring(0,n));var i=Math.min(n,r);if(t==e)return i;var o=0,a=1;while(1){var s=t.substring(i-a),l=e.indexOf(s);if(-1==l)return o;a+=l,0!=l&&t.substring(i-a)!=e.substring(0,a)||(o=a,a++)}},n.prototype.diff_halfMatch_=function(t,e){if(this.Diff_Timeout<=0)return null;var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||2*r.length<n.length)return null;var i=this;function o(t,e,n){var r,o,a,s,l=t.substring(n,n+Math.floor(t.length/4)),c=-1,u="";while(-1!=(c=e.indexOf(l,c+1))){var d=i.diff_commonPrefix(t.substring(n),e.substring(c)),h=i.diff_commonSuffix(t.substring(0,n),e.substring(0,c));u.length<h+d&&(u=e.substring(c-h,c)+e.substring(c,c+d),r=t.substring(0,n-h),o=t.substring(n+d),a=e.substring(0,c-h),s=e.substring(c+d))}return 2*u.length>=t.length?[r,o,a,s,u]:null}var a,s,l,c,u,d=o(n,r,Math.ceil(n.length/4)),h=o(n,r,Math.ceil(n.length/2));if(!d&&!h)return null;a=h?d&&d[4].length>h[4].length?d:h:d,t.length>e.length?(s=a[0],l=a[1],c=a[2],u=a[3]):(c=a[0],u=a[1],s=a[2],l=a[3]);var p=a[4];return[s,l,c,u,p]},n.prototype.diff_cleanupSemantic=function(t){var e=!1,a=[],s=0,l=null,c=0,u=0,d=0,h=0,p=0;while(c<t.length)t[c][0]==o?(a[s++]=c,u=h,d=p,h=0,p=0,l=t[c][1]):(t[c][0]==i?h+=t[c][1].length:p+=t[c][1].length,l&&l.length<=Math.max(u,d)&&l.length<=Math.max(h,p)&&(t.splice(a[s-1],0,new n.Diff(r,l)),t[a[s-1]+1][0]=i,s--,s--,c=s>0?a[s-1]:-1,u=0,d=0,h=0,p=0,l=null,e=!0)),c++;e&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),c=1;while(c<t.length){if(t[c-1][0]==r&&t[c][0]==i){var f=t[c-1][1],g=t[c][1],m=this.diff_commonOverlap_(f,g),v=this.diff_commonOverlap_(g,f);m>=v?(m>=f.length/2||m>=g.length/2)&&(t.splice(c,0,new n.Diff(o,g.substring(0,m))),t[c-1][1]=f.substring(0,f.length-m),t[c+1][1]=g.substring(m),c++):(v>=f.length/2||v>=g.length/2)&&(t.splice(c,0,new n.Diff(o,f.substring(0,v))),t[c-1][0]=i,t[c-1][1]=g.substring(0,g.length-v),t[c+1][0]=r,t[c+1][1]=f.substring(v),c++),c++}c++}},n.prototype.diff_cleanupSemanticLossless=function(t){function e(t,e){if(!t||!e)return 6;var r=t.charAt(t.length-1),i=e.charAt(0),o=r.match(n.nonAlphaNumericRegex_),a=i.match(n.nonAlphaNumericRegex_),s=o&&r.match(n.whitespaceRegex_),l=a&&i.match(n.whitespaceRegex_),c=s&&r.match(n.linebreakRegex_),u=l&&i.match(n.linebreakRegex_),d=c&&t.match(n.blanklineEndRegex_),h=u&&e.match(n.blanklineStartRegex_);return d||h?5:c||u?4:o&&!s&&l?3:s||l?2:o||a?1:0}var r=1;while(r<t.length-1){if(t[r-1][0]==o&&t[r+1][0]==o){var i=t[r-1][1],a=t[r][1],s=t[r+1][1],l=this.diff_commonSuffix(i,a);if(l){var c=a.substring(a.length-l);i=i.substring(0,i.length-l),a=c+a.substring(0,a.length-l),s=c+s}var u=i,d=a,h=s,p=e(i,a)+e(a,s);while(a.charAt(0)===s.charAt(0)){i+=a.charAt(0),a=a.substring(1)+s.charAt(0),s=s.substring(1);var f=e(i,a)+e(a,s);f>=p&&(p=f,u=i,d=a,h=s)}t[r-1][1]!=u&&(u?t[r-1][1]=u:(t.splice(r-1,1),r--),t[r][1]=d,h?t[r+1][1]=h:(t.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){var e=!1,a=[],s=0,l=null,c=0,u=!1,d=!1,h=!1,p=!1;while(c<t.length)t[c][0]==o?(t[c][1].length<this.Diff_EditCost&&(h||p)?(a[s++]=c,u=h,d=p,l=t[c][1]):(s=0,l=null),h=p=!1):(t[c][0]==r?p=!0:h=!0,l&&(u&&d&&h&&p||l.length<this.Diff_EditCost/2&&u+d+h+p==3)&&(t.splice(a[s-1],0,new n.Diff(r,l)),t[a[s-1]+1][0]=i,s--,l=null,u&&d?(h=p=!0,s=0):(s--,c=s>0?a[s-1]:-1,h=p=!1),e=!0)),c++;e&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(o,""));var e,a=0,s=0,l=0,c="",u="";while(a<t.length)switch(t[a][0]){case i:l++,u+=t[a][1],a++;break;case r:s++,c+=t[a][1],a++;break;case o:s+l>1?(0!==s&&0!==l&&(e=this.diff_commonPrefix(u,c),0!==e&&(a-s-l>0&&t[a-s-l-1][0]==o?t[a-s-l-1][1]+=u.substring(0,e):(t.splice(0,0,new n.Diff(o,u.substring(0,e))),a++),u=u.substring(e),c=c.substring(e)),e=this.diff_commonSuffix(u,c),0!==e&&(t[a][1]=u.substring(u.length-e)+t[a][1],u=u.substring(0,u.length-e),c=c.substring(0,c.length-e))),a-=s+l,t.splice(a,s+l),c.length&&(t.splice(a,0,new n.Diff(r,c)),a++),u.length&&(t.splice(a,0,new n.Diff(i,u)),a++),a++):0!==a&&t[a-1][0]==o?(t[a-1][1]+=t[a][1],t.splice(a,1)):a++,l=0,s=0,c="",u="";break}""===t[t.length-1][1]&&t.pop();var d=!1;a=1;while(a<t.length-1)t[a-1][0]==o&&t[a+1][0]==o&&(t[a][1].substring(t[a][1].length-t[a-1][1].length)==t[a-1][1]?(t[a][1]=t[a-1][1]+t[a][1].substring(0,t[a][1].length-t[a-1][1].length),t[a+1][1]=t[a-1][1]+t[a+1][1],t.splice(a-1,1),d=!0):t[a][1].substring(0,t[a+1][1].length)==t[a+1][1]&&(t[a-1][1]+=t[a+1][1],t[a][1]=t[a][1].substring(t[a+1][1].length)+t[a+1][1],t.splice(a+1,1),d=!0)),a++;d&&this.diff_cleanupMerge(t)},n.prototype.diff_xIndex=function(t,e){var n,o=0,a=0,s=0,l=0;for(n=0;n<t.length;n++){if(t[n][0]!==i&&(o+=t[n][1].length),t[n][0]!==r&&(a+=t[n][1].length),o>e)break;s=o,l=a}return t.length!=n&&t[n][0]===r?l:l+(e-s)},n.prototype.diff_prettyHtml=function(t){for(var e=[],n=/&/g,a=/</g,s=/>/g,l=/\n/g,c=0;c<t.length;c++){var u=t[c][0],d=t[c][1],h=d.replace(n,"&amp;").replace(a,"&lt;").replace(s,"&gt;").replace(l,"&para;<br>");switch(u){case i:e[c]='<ins style="background:#e6ffe6;">'+h+"</ins>";break;case r:e[c]='<del style="background:#ffe6e6;">'+h+"</del>";break;case o:e[c]="<span>"+h+"</span>";break}}return e.join("")},n.prototype.diff_text1=function(t){for(var e=[],n=0;n<t.length;n++)t[n][0]!==i&&(e[n]=t[n][1]);return e.join("")},n.prototype.diff_text2=function(t){for(var e=[],n=0;n<t.length;n++)t[n][0]!==r&&(e[n]=t[n][1]);return e.join("")},n.prototype.diff_levenshtein=function(t){for(var e=0,n=0,a=0,s=0;s<t.length;s++){var l=t[s][0],c=t[s][1];switch(l){case i:n+=c.length;break;case r:a+=c.length;break;case o:e+=Math.max(n,a),n=0,a=0;break}}return e+=Math.max(n,a),e},n.prototype.diff_toDelta=function(t){for(var e=[],n=0;n<t.length;n++)switch(t[n][0]){case i:e[n]="+"+encodeURI(t[n][1]);break;case r:e[n]="-"+t[n][1].length;break;case o:e[n]="="+t[n][1].length;break}return e.join("\t").replace(/%20/g," ")},n.prototype.diff_fromDelta=function(t,e){for(var a=[],s=0,l=0,c=e.split(/\t/g),u=0;u<c.length;u++){var d=c[u].substring(1);switch(c[u].charAt(0)){case"+":try{a[s++]=new n.Diff(i,decodeURI(d))}catch(f){throw new Error("Illegal escape in diff_fromDelta: "+d)}break;case"-":case"=":var h=parseInt(d,10);if(isNaN(h)||h<0)throw new Error("Invalid number in diff_fromDelta: "+d);var p=t.substring(l,l+=h);"="==c[u].charAt(0)?a[s++]=new n.Diff(o,p):a[s++]=new n.Diff(r,p);break;default:if(c[u])throw new Error("Invalid diff operation in diff_fromDelta: "+c[u])}}if(l!=t.length)throw new Error("Delta length ("+l+") does not equal source text length ("+t.length+").");return a},n.prototype.match_main=function(t,e,n){if(null==t||null==e||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,t.length)),t==e?0:t.length?t.substring(n,n+e.length)==e?n:this.match_bitap_(t,e,n):-1},n.prototype.match_bitap_=function(t,e,n){if(e.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(e),i=this;function o(t,r){var o=t/e.length,a=Math.abs(n-r);return i.Match_Distance?o+a/i.Match_Distance:a?1:o}var a=this.Match_Threshold,s=t.indexOf(e,n);-1!=s&&(a=Math.min(o(0,s),a),s=t.lastIndexOf(e,n+e.length),-1!=s&&(a=Math.min(o(0,s),a)));var l,c,u=1<<e.length-1;s=-1;for(var d,h=e.length+t.length,p=0;p<e.length;p++){l=0,c=h;while(l<c)o(p,n+c)<=a?l=c:h=c,c=Math.floor((h-l)/2+l);h=c;var f=Math.max(1,n-c+1),g=Math.min(n+c,t.length)+e.length,m=Array(g+2);m[g+1]=(1<<p)-1;for(var v=g;v>=f;v--){var b=r[t.charAt(v-1)];if(m[v]=0===p?(m[v+1]<<1|1)&b:(m[v+1]<<1|1)&b|(d[v+1]|d[v])<<1|1|d[v+1],m[v]&u){var y=o(p,v-1);if(y<=a){if(a=y,s=v-1,!(s>n))break;f=Math.max(1,2*n-s)}}}if(o(p+1,n)>a)break;d=m}return s},n.prototype.match_alphabet_=function(t){for(var e={},n=0;n<t.length;n++)e[t.charAt(n)]=0;for(n=0;n<t.length;n++)e[t.charAt(n)]|=1<<t.length-n-1;return e},n.prototype.patch_addContext_=function(t,e){if(0!=e.length){if(null===t.start2)throw Error("patch not initialized");var r=e.substring(t.start2,t.start2+t.length1),i=0;while(e.indexOf(r)!=e.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin)i+=this.Patch_Margin,r=e.substring(t.start2-i,t.start2+t.length1+i);i+=this.Patch_Margin;var a=e.substring(t.start2-i,t.start2);a&&t.diffs.unshift(new n.Diff(o,a));var s=e.substring(t.start2+t.length1,t.start2+t.length1+i);s&&t.diffs.push(new n.Diff(o,s)),t.start1-=a.length,t.start2-=a.length,t.length1+=a.length+s.length,t.length2+=a.length+s.length}},n.prototype.patch_make=function(t,e,a){var s,l;if("string"==typeof t&&"string"==typeof e&&"undefined"==typeof a)s=t,l=this.diff_main(s,e,!0),l.length>2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(t&&"object"==typeof t&&"undefined"==typeof e&&"undefined"==typeof a)l=t,s=this.diff_text1(l);else if("string"==typeof t&&e&&"object"==typeof e&&"undefined"==typeof a)s=t,l=e;else{if("string"!=typeof t||"string"!=typeof e||!a||"object"!=typeof a)throw new Error("Unknown call format to patch_make.");s=t,l=a}if(0===l.length)return[];for(var c=[],u=new n.patch_obj,d=0,h=0,p=0,f=s,g=s,m=0;m<l.length;m++){var v=l[m][0],b=l[m][1];switch(d||v===o||(u.start1=h,u.start2=p),v){case i:u.diffs[d++]=l[m],u.length2+=b.length,g=g.substring(0,p)+b+g.substring(p);break;case r:u.length1+=b.length,u.diffs[d++]=l[m],g=g.substring(0,p)+g.substring(p+b.length);break;case o:b.length<=2*this.Patch_Margin&&d&&l.length!=m+1?(u.diffs[d++]=l[m],u.length1+=b.length,u.length2+=b.length):b.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,f),c.push(u),u=new n.patch_obj,d=0,f=g,h=p);break}v!==i&&(h+=b.length),v!==r&&(p+=b.length)}return d&&(this.patch_addContext_(u,f),c.push(u)),c},n.prototype.patch_deepCopy=function(t){for(var e=[],r=0;r<t.length;r++){var i=t[r],o=new n.patch_obj;o.diffs=[];for(var a=0;a<i.diffs.length;a++)o.diffs[a]=new n.Diff(i.diffs[a][0],i.diffs[a][1]);o.start1=i.start1,o.start2=i.start2,o.length1=i.length1,o.length2=i.length2,e[r]=o}return e},n.prototype.patch_apply=function(t,e){if(0==t.length)return[e,[]];t=this.patch_deepCopy(t);var n=this.patch_addPadding(t);e=n+e+n,this.patch_splitMax(t);for(var a=0,s=[],l=0;l<t.length;l++){var c,u,d=t[l].start2+a,h=this.diff_text1(t[l].diffs),p=-1;if(h.length>this.Match_MaxBits?(c=this.match_main(e,h.substring(0,this.Match_MaxBits),d),-1!=c&&(p=this.match_main(e,h.substring(h.length-this.Match_MaxBits),d+h.length-this.Match_MaxBits),(-1==p||c>=p)&&(c=-1))):c=this.match_main(e,h,d),-1==c)s[l]=!1,a-=t[l].length2-t[l].length1;else if(s[l]=!0,a=c-d,u=-1==p?e.substring(c,c+h.length):e.substring(c,p+this.Match_MaxBits),h==u)e=e.substring(0,c)+this.diff_text2(t[l].diffs)+e.substring(c+h.length);else{var f=this.diff_main(h,u,!1);if(h.length>this.Match_MaxBits&&this.diff_levenshtein(f)/h.length>this.Patch_DeleteThreshold)s[l]=!1;else{this.diff_cleanupSemanticLossless(f);for(var g,m=0,v=0;v<t[l].diffs.length;v++){var b=t[l].diffs[v];b[0]!==o&&(g=this.diff_xIndex(f,m)),b[0]===i?e=e.substring(0,c+g)+b[1]+e.substring(c+g):b[0]===r&&(e=e.substring(0,c+g)+e.substring(c+this.diff_xIndex(f,m+b[1].length))),b[0]!==r&&(m+=b[1].length)}}}}return e=e.substring(n.length,e.length-n.length),[e,s]},n.prototype.patch_addPadding=function(t){for(var e=this.Patch_Margin,r="",i=1;i<=e;i++)r+=String.fromCharCode(i);for(i=0;i<t.length;i++)t[i].start1+=e,t[i].start2+=e;var a=t[0],s=a.diffs;if(0==s.length||s[0][0]!=o)s.unshift(new n.Diff(o,r)),a.start1-=e,a.start2-=e,a.length1+=e,a.length2+=e;else if(e>s[0][1].length){var l=e-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],a.start1-=l,a.start2-=l,a.length1+=l,a.length2+=l}if(a=t[t.length-1],s=a.diffs,0==s.length||s[s.length-1][0]!=o)s.push(new n.Diff(o,r)),a.length1+=e,a.length2+=e;else if(e>s[s.length-1][1].length){l=e-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,l),a.length1+=l,a.length2+=l}return r},n.prototype.patch_splitMax=function(t){for(var e=this.Match_MaxBits,a=0;a<t.length;a++)if(!(t[a].length1<=e)){var s=t[a];t.splice(a--,1);var l=s.start1,c=s.start2,u="";while(0!==s.diffs.length){var d=new n.patch_obj,h=!0;d.start1=l-u.length,d.start2=c-u.length,""!==u&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(o,u)));while(0!==s.diffs.length&&d.length1<e-this.Patch_Margin){var p=s.diffs[0][0],f=s.diffs[0][1];p===i?(d.length2+=f.length,c+=f.length,d.diffs.push(s.diffs.shift()),h=!1):p===r&&1==d.diffs.length&&d.diffs[0][0]==o&&f.length>2*e?(d.length1+=f.length,l+=f.length,h=!1,d.diffs.push(new n.Diff(p,f)),s.diffs.shift()):(f=f.substring(0,e-d.length1-this.Patch_Margin),d.length1+=f.length,l+=f.length,p===o?(d.length2+=f.length,c+=f.length):h=!1,d.diffs.push(new n.Diff(p,f)),f==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(f.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var g=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);""!==g&&(d.length1+=g.length,d.length2+=g.length,0!==d.diffs.length&&d.diffs[d.diffs.length-1][0]===o?d.diffs[d.diffs.length-1][1]+=g:d.diffs.push(new n.Diff(o,g))),h||t.splice(++a,0,d)}}},n.prototype.patch_toText=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=t[n];return e.join("")},n.prototype.patch_fromText=function(t){var e=[];if(!t)return e;var a=t.split("\n"),s=0,l=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;while(s<a.length){var c=a[s].match(l);if(!c)throw new Error("Invalid patch string: "+a[s]);var u=new n.patch_obj;e.push(u),u.start1=parseInt(c[1],10),""===c[2]?(u.start1--,u.length1=1):"0"==c[2]?u.length1=0:(u.start1--,u.length1=parseInt(c[2],10)),u.start2=parseInt(c[3],10),""===c[4]?(u.start2--,u.length2=1):"0"==c[4]?u.length2=0:(u.start2--,u.length2=parseInt(c[4],10)),s++;while(s<a.length){var d=a[s].charAt(0);try{var h=decodeURI(a[s].substring(1))}catch(p){throw new Error("Illegal escape in patch_fromText: "+h)}if("-"==d)u.diffs.push(new n.Diff(r,h));else if("+"==d)u.diffs.push(new n.Diff(i,h));else if(" "==d)u.diffs.push(new n.Diff(o,h));else{if("@"==d)break;if(""!==d)throw new Error('Invalid patch mode "'+d+'" in: '+h)}s++}}return e},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){var t,e;t=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1,e=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;for(var n,a=["@@ -"+t+" +"+e+" @@\n"],s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:n="+";break;case r:n="-";break;case o:n=" ";break}a[s+1]=n+encodeURI(this.diffs[s][1])+"\n"}return a.join("").replace(/%20/g," ")},t.exports=n,t.exports["diff_match_patch"]=n,t.exports["DIFF_DELETE"]=r,t.exports["DIFF_INSERT"]=i,t.exports["DIFF_EQUAL"]=o},"646c":function(t,e,n){"use strict";var r=n("55be").isSpace;t.exports=function(t,e,n,i){var o,a,s,l,c,u,d,h,p,f,g,m,v,b,y,w,x,C,k,A,S=t.lineMax,E=t.bMarks[e]+t.tShift[e],O=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(62!==t.src.charCodeAt(E++))return!1;if(i)return!0;l=p=t.sCount[e]+1,32===t.src.charCodeAt(E)?(E++,l++,p++,o=!1,w=!0):9===t.src.charCodeAt(E)?(w=!0,(t.bsCount[e]+p)%4===3?(E++,l++,p++,o=!1):o=!0):w=!1,f=[t.bMarks[e]],t.bMarks[e]=E;while(E<O){if(a=t.src.charCodeAt(E),!r(a))break;9===a?p+=4-(p+t.bsCount[e]+(o?1:0))%4:p++,E++}for(g=[t.bsCount[e]],t.bsCount[e]=t.sCount[e]+1+(w?1:0),u=E>=O,b=[t.sCount[e]],t.sCount[e]=p-l,y=[t.tShift[e]],t.tShift[e]=E-t.bMarks[e],C=t.md.block.ruler.getRules("blockquote"),v=t.parentType,t.parentType="blockquote",h=e+1;h<n;h++){if(A=t.sCount[h]<t.blkIndent,E=t.bMarks[h]+t.tShift[h],O=t.eMarks[h],E>=O)break;if(62!==t.src.charCodeAt(E++)||A){if(u)break;for(x=!1,s=0,c=C.length;s<c;s++)if(C[s](t,h,n,!0)){x=!0;break}if(x){t.lineMax=h,0!==t.blkIndent&&(f.push(t.bMarks[h]),g.push(t.bsCount[h]),y.push(t.tShift[h]),b.push(t.sCount[h]),t.sCount[h]-=t.blkIndent);break}f.push(t.bMarks[h]),g.push(t.bsCount[h]),y.push(t.tShift[h]),b.push(t.sCount[h]),t.sCount[h]=-1}else{l=p=t.sCount[h]+1,32===t.src.charCodeAt(E)?(E++,l++,p++,o=!1,w=!0):9===t.src.charCodeAt(E)?(w=!0,(t.bsCount[h]+p)%4===3?(E++,l++,p++,o=!1):o=!0):w=!1,f.push(t.bMarks[h]),t.bMarks[h]=E;while(E<O){if(a=t.src.charCodeAt(E),!r(a))break;9===a?p+=4-(p+t.bsCount[h]+(o?1:0))%4:p++,E++}u=E>=O,g.push(t.bsCount[h]),t.bsCount[h]=t.sCount[h]+1+(w?1:0),b.push(t.sCount[h]),t.sCount[h]=p-l,y.push(t.tShift[h]),t.tShift[h]=E-t.bMarks[h]}}for(m=t.blkIndent,t.blkIndent=0,k=t.push("blockquote_open","blockquote",1),k.markup=">",k.map=d=[e,0],t.md.block.tokenize(t,e,h),k=t.push("blockquote_close","blockquote",-1),k.markup=">",t.lineMax=S,t.parentType=v,d[1]=t.line,s=0;s<y.length;s++)t.bMarks[s+e]=f[s],t.tShift[s+e]=y[s],t.sCount[s+e]=b[s],t.bsCount[s+e]=g[s];return t.blkIndent=m,!0}},"649e":function(t,e,n){"use strict";var r=n("ebb5"),i=n("b727").some,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("some",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"664f":function(t,e,n){"use strict";var r=n("23e7"),i=n("857a"),o=n("af03");r({target:"String",proto:!0,forced:o("sup")},{sup:function(){return i(this,"sup","","")}})},6762:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t["default"]=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Point=void 0;var s=a(n("ca8e")),l=n("16ef"),c=n("722a"),u=function(t){function e(e,n){var r=t.call(this)||this;return r.x=null==e?0:e,r.y=null==n?0:n,r}return r(e,t),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),e.prototype.round=function(t){return void 0===t&&(t=0),this.x=s.round(this.x,t),this.y=s.round(this.y,t),this},e.prototype.add=function(t,n){var r=e.create(t,n);return this.x+=r.x,this.y+=r.y,this},e.prototype.update=function(t,n){var r=e.create(t,n);return this.x=r.x,this.y=r.y,this},e.prototype.translate=function(t,n){var r=e.create(t,n);return this.x+=r.x,this.y+=r.y,this},e.prototype.rotate=function(t,n){var r=e.rotate(this,t,n);return this.x=r.x,this.y=r.y,this},e.prototype.scale=function(t,n,r){void 0===r&&(r=new e);var i=e.create(r);return this.x=i.x+t*(this.x-i.x),this.y=i.y+n*(this.y-i.y),this},e.prototype.closest=function(t){var n=this;if(1===t.length)return e.create(t[0]);var r=null,i=1/0;return t.forEach((function(t){var e=n.squaredDistance(t);e<i&&(r=t,i=e)})),r?e.create(r):null},e.prototype.distance=function(t){return Math.sqrt(this.squaredDistance(t))},e.prototype.squaredDistance=function(t){var n=e.create(t),r=this.x-n.x,i=this.y-n.y;return r*r+i*i},e.prototype.manhattanDistance=function(t){var n=e.create(t);return Math.abs(n.x-this.x)+Math.abs(n.y-this.y)},e.prototype.magnitude=function(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01},e.prototype.theta=function(t){void 0===t&&(t=new e);var n=e.create(t),r=-(n.y-this.y),i=n.x-this.x,o=Math.atan2(r,i);return o<0&&(o=2*Math.PI+o),180*o/Math.PI},e.prototype.angleBetween=function(t,e){if(this.equals(t)||this.equals(e))return NaN;var n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n},e.prototype.vectorAngle=function(t){var n=new e(0,0);return n.angleBetween(this,t)},e.prototype.toPolar=function(t){return this.update(e.toPolar(this,t)),this},e.prototype.changeInAngle=function(t,n,r){return void 0===r&&(r=new e),this.clone().translate(-t,-n).theta(r)-this.theta(r)},e.prototype.adhereToRect=function(t){return s.containsPoint(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this},e.prototype.bearing=function(t){var n=e.create(t),r=l.Angle.toRad(this.y),i=l.Angle.toRad(n.y),o=this.x,a=n.x,s=l.Angle.toRad(a-o),c=Math.sin(s)*Math.cos(i),u=Math.cos(r)*Math.sin(i)-Math.sin(r)*Math.cos(i)*Math.cos(s),d=l.Angle.toDeg(Math.atan2(c,u)),h=["NE","E","SE","S","SW","W","NW","N"],p=d-22.5;return p<0&&(p+=360),p=parseInt(p/45,10),h[p]},e.prototype.cross=function(t,n){if(null!=t&&null!=n){var r=e.create(t),i=e.create(n);return(i.x-this.x)*(r.y-this.y)-(i.y-this.y)*(r.x-this.x)}return NaN},e.prototype.dot=function(t){var n=e.create(t);return this.x*n.x+this.y*n.y},e.prototype.diff=function(t,n){if("number"===typeof t)return new e(this.x-t,this.y-n);var r=e.create(t);return new e(this.x-r.x,this.y-r.y)},e.prototype.lerp=function(t,n){var r=e.create(t);return new e((1-n)*this.x+n*r.x,(1-n)*this.y+n*r.y)},e.prototype.normalize=function(t){void 0===t&&(t=1);var e=t/this.magnitude();return this.scale(e,e)},e.prototype.move=function(t,n){var r=e.create(t),i=l.Angle.toRad(r.theta(this));return this.translate(Math.cos(i)*n,-Math.sin(i)*n)},e.prototype.reflection=function(t){return e.create(t).move(this,this.distance(t))},e.prototype.snapToGrid=function(t,e){return this.x=s.snapToGrid(this.x,t),this.y=s.snapToGrid(this.y,null==e?t:e),this},e.prototype.equals=function(t){var n=e.create(t);return null!=n&&n.x===this.x&&n.y===this.y},e.prototype.clone=function(){return e.clone(this)},e.prototype.toJSON=function(){return e.toJSON(this)},e.prototype.serialize=function(){return this.x+" "+this.y},e}(c.Geometry);e.Point=u,function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"number"===typeof r.x&&"number"===typeof r.y&&"function"===typeof r.toPolar}t.toStringTag="X6.Geometry."+t.name,t.isPoint=e}(u=e.Point||(e.Point={})),e.Point=u,function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y}function n(t){return null!=t&&Array.isArray(t)&&2===t.length&&"number"===typeof t[0]&&"number"===typeof t[1]}t.isPointLike=e,t.isPointData=n}(u=e.Point||(e.Point={})),e.Point=u,function(t){function e(e,r){return null==e||"number"===typeof e?new t(e,r):n(e)}function n(e){return t.isPoint(e)?new t(e.x,e.y):Array.isArray(e)?new t(e[0],e[1]):new t(e.x,e.y)}function r(e){return t.isPoint(e)?{x:e.x,y:e.y}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}function i(e,r,i){void 0===i&&(i=new t);var o=Math.abs(e*Math.cos(r)),a=Math.abs(e*Math.sin(r)),s=n(i),c=l.Angle.normalize(l.Angle.toDeg(r));return c<90?a=-a:c<180?(o=-o,a=-a):c<270&&(o=-o),new t(s.x+o,s.y+a)}function o(e,r){void 0===r&&(r=new t);var i=n(e),o=n(r),a=i.x-o.x,s=i.y-o.y;return new t(Math.sqrt(a*a+s*s),l.Angle.toRad(o.theta(i)))}function a(t,e){return t===e||null!=t&&null!=e&&(t.x===e.x&&t.y===e.y)}function c(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!==e.length)return!1;if(null!=t&&null!=e)for(var n=0,r=t.length;n<r;n+=1)if(!a(t[n],e[n]))return!1;return!0}function u(e,n,r,i){return new t(s.random(e,n),s.random(r,i))}function d(t,e,n){var r=l.Angle.toRad(l.Angle.normalize(-e)),i=Math.sin(r),o=Math.cos(r);return h(t,o,i,n)}function h(e,r,i,o){void 0===o&&(o=new t);var a=n(e),s=n(o),l=a.x-s.x,c=a.y-s.y,u=l*r-c*i,d=c*r+l*i;return new t(u+s.x,d+s.y)}t.create=e,t.clone=n,t.toJSON=r,t.fromPolar=i,t.toPolar=o,t.equals=a,t.equalPoints=c,t.random=u,t.rotate=d,t.rotateEx=h}(u=e.Point||(e.Point={})),e.Point=u},"693d8":function(t,e,n){(function(t){"use strict";t(n("56b3"),n("9eb9"),n("d5e0"),n("f9d4"),n("a0bd"),n("7b00"),n("1b63"),n("76d2"),n("5bef"),n("e1de"))})((function(t){var e={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"],["lang",/^babel$/,"javascript"],["type",/^text\/babel$/,"javascript"],["type",/^text\/ecmascript-\d+$/,"javascript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["lang",/^less$/i,"text/x-less"],["lang",/^scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"],["type",/^(text\/)?(x-)?scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?less$/i,"text/x-less"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};t.defineMode("vue-template",(function(e,n){var r={token:function(t){if(t.match(/^\{\{.*?\}\}/))return"meta mustache";while(t.next()&&!t.match("{{",!1));return null}};return t.overlayMode(t.getMode(e,n.backdrop||"text/html"),r)})),t.defineMode("vue",(function(n){return t.getMode(n,{name:"htmlmixed",tags:e})}),"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),t.defineMIME("script/x-vue","vue"),t.defineMIME("text/x-vue","vue")}))},"697e":function(t,e,n){var r=n("4b17");function i(t){return"number"==typeof t&&t==r(t)}t.exports=i},"697eb":function(t,e,n){},"6b62":function(t,e,n){"use strict";(function(t){var r=n("53ca"),i=n("5530"),o=n("d4ec"),a=n("bee2"),s=n("262e"),l=n("2caf"),c=n("2b0e"),u=n("2ef0"),d=n("a57f"),h=(n("5136"),n("681b")),p=(n("9a33"),n("f933")),f=n("2909"),g=n("66cb"),m=n.n(g),v=n("257e"),b=n("45eb"),y=n("7e84"),w=n("5122"),x=n("5cf7"),C=n("4d7f"),k=n.n(C);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function A(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a
/**
* vue-class-component v7.2.6
* (c) 2015-present Evan You
* @license MIT
*/}function S(t){return S="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O(t){return T(t)||_(t)||M()}function T(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function _(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function M(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function N(){return"undefined"!==typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function P(t,e){L(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){L(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){L(t,e,n)}))}function L(t,e,n){var r=n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e);r.forEach((function(r){var i=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,i,t,n):Reflect.defineMetadata(r,i,t)}))}var D={__proto__:[]},j=D instanceof Array;function I(t){return function(e,n,r){var i="function"===typeof e?e:e.constructor;i.__decorators__||(i.__decorators__=[]),"number"!==typeof r&&(r=void 0),i.__decorators__.push((function(e){return t(e,n,r)}))}}function R(t){var e=S(t);return null==t||"object"!==e&&"function"!==e}function F(t,e){var n=e.prototype._init;e.prototype._init=function(){var e=this,n=Object.getOwnPropertyNames(t);if(t.$options.props)for(var r in t.$options.props)t.hasOwnProperty(r)||n.push(r);n.forEach((function(n){Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){t[n]=e},configurable:!0})}))};var r=new e;e.prototype._init=n;var i={};return Object.keys(r).forEach((function(t){void 0!==r[t]&&(i[t]=r[t])})),i}var B=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=e.name||t._componentTag||t.name;var n=t.prototype;Object.getOwnPropertyNames(n).forEach((function(t){if("constructor"!==t)if(B.indexOf(t)>-1)e[t]=n[t];else{var r=Object.getOwnPropertyDescriptor(n,t);void 0!==r.value?"function"===typeof r.value?(e.methods||(e.methods={}))[t]=r.value:(e.mixins||(e.mixins=[])).push({data:function(){return E({},t,r.value)}}):(r.get||r.set)&&((e.computed||(e.computed={}))[t]={get:r.get,set:r.set})}})),(e.mixins||(e.mixins=[])).push({data:function(){return F(this,t)}});var r=t.__decorators__;r&&(r.forEach((function(t){return t(e)})),delete t.__decorators__);var i=Object.getPrototypeOf(t.prototype),o=i instanceof c["default"]?i.constructor:c["default"],a=o.extend(e);return V(a,t,o),N()&&P(a,t),a}var H={prototype:!0,arguments:!0,callee:!0,caller:!0};function V(t,e,n){Object.getOwnPropertyNames(e).forEach((function(r){if(!H[r]){var i=Object.getOwnPropertyDescriptor(t,r);if(!i||i.configurable){var o=Object.getOwnPropertyDescriptor(e,r);if(!j){if("cid"===r)return;var a=Object.getOwnPropertyDescriptor(n,r);if(!R(o.value)&&a&&a.value===o.value)return}0,Object.defineProperty(t,r,o)}}}))}function q(t){return"function"===typeof t?z(t):function(e){return z(e,t)}}q.registerHooks=function(t){B.push.apply(B,O(t))};var U="undefined"!==typeof Reflect&&"undefined"!==typeof Reflect.getMetadata;function W(t,e,n){if(U&&!Array.isArray(t)&&"function"!==typeof t&&!t.hasOwnProperty("type")&&"undefined"===typeof t.type){var r=Reflect.getMetadata("design:type",e,n);r!==Object&&(t.type=r)}}function $(t){return void 0===t&&(t={}),function(e,n){W(t,e,n),I((function(e,n){(e.props||(e.props={}))[n]=t}))(e,n)}}function G(t,e){void 0===e&&(e={});var n=e.deep,r=void 0!==n&&n,i=e.immediate,o=void 0!==i&&i;return I((function(e,n){"object"!==typeof e.watch&&(e.watch=Object.create(null));var i=e.watch;"object"!==typeof i[t]||Array.isArray(i[t])?"undefined"===typeof i[t]&&(i[t]=[]):i[t]=[i[t]],i[t].push({handler:n,deep:r,immediate:o})}))}var Y=function(t,e,n){var i=null===t||void 0===t?void 0:t.plugin.components[e];if(i&&i.hotkey){var o=i.hotkey();if(o){if(Array.isArray(o))if(n){var a=o.findIndex((function(t){return"object"===Object(r["a"])(t)&&t.args===n}));o=o[a>-1?a:0]}else o=o[0];return"object"===Object(r["a"])(o)&&(o=o.key),o}}},X=function(t){if("string"!==typeof t)return console.log("Font name is not legal !"),!1;var e,n=document.body,r=document.createElement("span");r.innerHTML=Array(10).join("wi"),r.style.cssText=["position:absolute","width:auto","font-size:128px","left:-99999px"].join(" !important;");var i=function(t){return r.style.fontFamily=t,n.appendChild(r),e=r.clientWidth,n.removeChild(r),e},o=i("monospace"),a=i("serif"),s=i("sans-serif");return o!==i(t+",monospace")||s!==i(t+",sans-serif")||a!==i(t+",serif")},K=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.visible=!1,t.iconIsHtml=!1,t.isMobile=!1,t.hotkeyText="",t}return Object(a["a"])(n,[{key:"mounted",value:function(){this.iconIsHtml=/^<.*>/.test(this.icon?this.icon.trim():"");var t=void 0;!this.engine||!0!==this.hotkey&&void 0!==this.hotkey||(t=Y(this.engine,this.command&&!Array.isArray(this.command)?this.command.name:this.name)),"string"===typeof this.hotkey&&""!==this.hotkey&&(t=Object(d["formatHotkey"])(this.hotkey)),this.isMobile=d["isMobile"],this.hotkeyText=t||""}},{key:"triggerMouseDown",value:function(t){t.preventDefault(),this.disabled||(this.onMouseDown&&this.onMouseDown(t,this.engine),this.visible=!1)}},{key:"triggerMouseEnter",value:function(t){this.onMouseEnter&&this.onMouseEnter(t,this.engine),this.visible=!0}},{key:"triggerMouseLeave",value:function(t){this.onMouseLevel&&this.onMouseLevel(t,this.engine),this.visible=!1}},{key:"triggerClick",value:function(t){var e=t.target.nodeName;if("INPUT"!==e&&"TEXTAREA"!==e&&t.preventDefault(),!this.disabled&&(!this.onClick||!1!==this.onClick(t,this.engine))&&!1!==this.autoExecute){var n,r=this.name,i=[];this.command&&(Array.isArray(this.command)?i=this.command:(r=this.command.name,i=this.command.args)),this.engine&&(n=this.engine.command).execute.apply(n,[r].concat(Object(f["a"])(i)))}}}]),n}(c["default"]);A([$({type:Object})],K.prototype,"engine",void 0),A([$({type:String,required:!0})],K.prototype,"name",void 0),A([$({type:String})],K.prototype,"icon",void 0),A([$({type:[String,Function]})],K.prototype,"content",void 0),A([$({type:String})],K.prototype,"title",void 0),A([$({type:String})],K.prototype,"placement",void 0),A([$({type:[String,Object]})],K.prototype,"hotkey",void 0),A([$({type:Object})],K.prototype,"command",void 0),A([$({type:[Boolean,Object],default:void 0})],K.prototype,"autoExecute",void 0),A([$({type:String})],K.prototype,"className",void 0),A([$({type:[Boolean,Object],default:void 0})],K.prototype,"active",void 0),A([$({type:[Boolean,Object],default:void 0})],K.prototype,"disabled",void 0),A([$(Function)],K.prototype,"onClick",void 0),A([$(Function)],K.prototype,"onMouseDown",void 0),A([$(Function)],K.prototype,"onMouseEnter",void 0),A([$(Function)],K.prototype,"onMouseLevel",void 0),K=A([q({components:{"a-tooltip":p["default"]}})],K);var Z=K;function J(t,e,n,r,i,o,a,s,l,c){"boolean"!==typeof a&&(l=s,s=a,a=!1);const u="function"===typeof n?n.options:n;let d;if(t&&t.render&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(d=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},u._ssrRegister=d):e&&(d=a?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),d)if(u.functional){const t=u.render;u.render=function(e,n){return d.call(n),t(e,n)}}else{const t=u.beforeCreate;u.beforeCreate=t?[].concat(t,d):[d]}return n}const Q="undefined"!==typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function tt(t){return(t,e)=>rt(t,e)}let et;const nt={};function rt(t,e){const n=Q?e.media||"default":t,r=nt[n]||(nt[n]={ids:new Set,styles:[]});if(!r.ids.has(t)){r.ids.add(t);let n=e.source;if(e.map&&(n+="\n/*# sourceURL="+e.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",e.media&&r.element.setAttribute("media",e.media),void 0===et&&(et=document.head||document.getElementsByTagName("head")[0]),et.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(n),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{const t=r.ids.size-1,e=document.createTextNode(n),i=r.element.childNodes;i[t]&&r.element.removeChild(i[t]),i.length?r.element.insertBefore(e,i[t]):r.element.appendChild(e)}}}const it=Z;var ot=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("a-tooltip",{attrs:{placement:t.placement||"bottom",visible:!(!t.title&&!t.hotkeyText||t.isMobile)&&t.visible},scopedSlots:t._u([{key:"title",fn:function(){return[t.title?n("div",{staticClass:"toolbar-tooltip-title"},[t._v(t._s(t.title))]):t._e(),t._v(" "),t.hotkeyText?n("div",{staticClass:"toolbar-tooltip-hotkey",domProps:{innerHTML:t._s(t.hotkeyText)}}):t._e()]},proxy:!0}])},[t._v(" "),n("button",{ref:"element",class:["toolbar-button",t.className,{"toolbar-button-active":t.active,"toolbar-button-disabled":t.disabled}],on:{click:t.triggerClick,mousedown:t.triggerMouseDown,mouseenter:t.triggerMouseEnter,mouseleave:t.triggerMouseLeave}},[t._t("icon",(function(){return[t.iconIsHtml?n("span",{domProps:{innerHTML:t._s(t.icon)}}):t._e(),t._v(" "),!t.iconIsHtml&&t.icon?n("span",{class:"data-icon data-icon-"+t.icon}):t._e()]})),t._v(" "),t._t("default",(function(){return[t._v(t._s("function"===typeof t.content?t.content():t.content))]}))],2)])},at=[];ot._withStripped=!0;const st=function(t){t&&t("data-v-26361b6c_0",{source:"\n.editor-toolbar .toolbar-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: auto;\n min-width: 32px;\n margin: 0;\n text-align: center;\n padding: 0 7px;\n background-color: transparent;\n border: 1px solid transparent;\n border-radius: 3px 3px;\n font-size: 16px;\n cursor: pointer;\n color: #595959;\n outline: none;\n}\n.editor-toolbar.editor-toolbar-popup .toolbar-button {\n min-width: 24px;\n line-height: 24px;\n border-radius: 4px;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button {\n padding: 0 4px;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:hover {\n border: 1px solid transparent;\n background-color: #f5f5f5;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:active,\n.editor-toolbar .toolbar-button-active,\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-active:hover {\n background-color: #e8e8e8;\n border: 1px solid transparent;\n}\n.editor-toolbar .toolbar-button-disabled,\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-disabled:hover {\n background-color: transparent;\n border: 1px solid transparent;\n box-shadow: none;\n color: #000000;\n opacity: 0.25;\n cursor: not-allowed;\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/button.vue"],names:[],mappings:";AAoJA;EACA,oBAAA;EACA,mBAAA;EACA,uBAAA;EACA,WAAA;EACA,eAAA;EACA,SAAA;EACA,kBAAA;EACA,cAAA;EACA,6BAAA;EACA,6BAAA;EACA,sBAAA;EACA,eAAA;EACA,eAAA;EACA,cAAA;EACA,aAAA;AACA;AACA;EACA,eAAA;EACA,iBAAA;EACA,kBAAA;AACA;AACA;EACA,cAAA;AACA;AAEA;EACA,6BAAA;EACA,yBAAA;AACA;AAEA;;;EAGA,yBAAA;EACA,6BAAA;AACA;AAEA;;EAEA,6BAAA;EACA,6BAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;AACA",file:"button.vue",sourcesContent:['<template>\n <a-tooltip\n :placement="placement || \'bottom\'"\n :visible="(!!title || !!hotkeyText) && !isMobile ? visible : false"\n >\n <template #title>\n <div v-if="!!title" class="toolbar-tooltip-title">{{ title }}</div>\n <div\n v-if="!!hotkeyText"\n class="toolbar-tooltip-hotkey"\n v-html="hotkeyText"\n ></div>\n </template>\n <button\n ref="element"\n :class="[\n \'toolbar-button\',\n className,\n {\n \'toolbar-button-active\': active,\n \'toolbar-button-disabled\': disabled,\n },\n ]"\n @click="triggerClick"\n @mousedown="triggerMouseDown"\n @mouseenter="triggerMouseEnter"\n @mouseleave="triggerMouseLeave"\n >\n <slot name="icon">\n <span v-if="iconIsHtml" v-html="icon"></span>\n <span\n v-if="!iconIsHtml && icon"\n :class="`data-icon data-icon-${icon}`"\n />\n </slot>\n <slot>{{ typeof content === "function" ? content() : content }}</slot>\n </button>\n </a-tooltip>\n</template>\n<script lang="ts">\nimport { VNode } from "vue";\nimport { Component, Prop, Vue } from "vue-property-decorator";\nimport { Tooltip } from "ant-design-vue";\nimport {\n EditorInterface,\n EngineInterface,\n formatHotkey,\n isMobile,\n Placement,\n} from "@aomao/engine";\nimport { autoGetHotkey } from "../utils";\nimport { Command } from "../types";\n\n@Component({\n components: {\n "a-tooltip": Tooltip,\n },\n})\nexport default class Button extends Vue {\n @Prop({ type: Object }) engine?: EngineInterface;\n @Prop({ type: String, required: true }) name!: string;\n @Prop({ type: String }) icon?: string;\n @Prop({ type: [String, Function] }) content?: string | (() => string) | VNode;\n @Prop({ type: String }) title?: string;\n @Prop({ type: String }) placement?: Placement;\n @Prop({ type: [String, Object] }) hotkey?: boolean | string;\n @Prop({ type: Object }) command?: Command;\n @Prop({ type: [Boolean, Object], default: undefined }) autoExecute?: boolean;\n @Prop({ type: String }) className?: string;\n @Prop({ type: [Boolean, Object], default: undefined }) active?: boolean;\n @Prop({ type: [Boolean, Object], default: undefined }) disabled?: boolean;\n @Prop(Function) onClick?: (\n event: MouseEvent,\n engine?: EditorInterface\n ) => void | boolean;\n @Prop(Function) onMouseDown?: (\n event: MouseEvent,\n engine?: EditorInterface\n ) => void | boolean;\n @Prop(Function) onMouseEnter?: (\n event: MouseEvent,\n engine?: EditorInterface\n ) => void | boolean;\n @Prop(Function) onMouseLevel?: (\n event: MouseEvent,\n engine?: EditorInterface\n ) => void | boolean;\n\n visible = false;\n iconIsHtml = false;\n isMobile = false;\n hotkeyText = "";\n\n mounted() {\n this.iconIsHtml = /^<.*>/.test(this.icon ? this.icon.trim() : "");\n let hotkeyText: undefined | string = undefined;\n //默认获取插件的热键\n if (this.engine && (this.hotkey === true || this.hotkey === undefined)) {\n hotkeyText = autoGetHotkey(\n this.engine,\n this.command && !Array.isArray(this.command)\n ? this.command.name\n : this.name\n );\n }\n if (typeof this.hotkey === "string" && this.hotkey !== "") {\n hotkeyText = formatHotkey(this.hotkey);\n }\n this.isMobile = isMobile;\n this.hotkeyText = hotkeyText || "";\n }\n\n triggerMouseDown(event: MouseEvent) {\n event.preventDefault();\n if (this.disabled) return;\n if (this.onMouseDown) this.onMouseDown(event, this.engine);\n this.visible = false;\n }\n triggerMouseEnter(event: MouseEvent) {\n if (this.onMouseEnter) this.onMouseEnter(event, this.engine);\n this.visible = true;\n }\n triggerMouseLeave(event: MouseEvent) {\n if (this.onMouseLevel) this.onMouseLevel(event, this.engine);\n this.visible = false;\n }\n triggerClick(event: MouseEvent) {\n const nodeName = (event.target as Node).nodeName;\n if (nodeName !== "INPUT" && nodeName !== "TEXTAREA") event.preventDefault();\n if (this.disabled) return;\n if (this.onClick && this.onClick(event, this.engine) === false) return;\n if (this.autoExecute !== false) {\n let commandName = this.name;\n let commandArgs = [];\n if (this.command) {\n if (!Array.isArray(this.command)) {\n commandName = this.command.name;\n commandArgs = this.command.args;\n } else {\n commandArgs = this.command;\n }\n }\n if (this.engine) this.engine.command.execute(commandName, ...commandArgs);\n }\n }\n}\n<\/script>\n<style>\n.editor-toolbar .toolbar-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: auto;\n min-width: 32px;\n margin: 0;\n text-align: center;\n padding: 0 7px;\n background-color: transparent;\n border: 1px solid transparent;\n border-radius: 3px 3px;\n font-size: 16px;\n cursor: pointer;\n color: #595959;\n outline: none;\n}\n.editor-toolbar.editor-toolbar-popup .toolbar-button {\n min-width: 24px;\n line-height: 24px;\n border-radius: 4px;\n}\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button {\n padding: 0 4px;\n}\n\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:hover {\n border: 1px solid transparent;\n background-color: #f5f5f5;\n}\n\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button:active,\n.editor-toolbar .toolbar-button-active,\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-active:hover {\n background-color: #e8e8e8;\n border: 1px solid transparent;\n}\n\n.editor-toolbar .toolbar-button-disabled,\n.editor-toolbar:not(.editor-toolbar-mobile) .toolbar-button-disabled:hover {\n background-color: transparent;\n border: 1px solid transparent;\n box-shadow: none;\n color: #000000;\n opacity: 0.25;\n cursor: not-allowed;\n}\n</style>\n']},media:void 0})},lt=void 0,ct=void 0,ut=!1,dt=J({render:ot,staticRenderFns:at},st,it,lt,ut,ct,!1,tt,void 0,void 0);var ht=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.hotkeys={},t.isMobile=!1,t.placement="",t}return Object(a["a"])(n,[{key:"getHotkey",value:function(t){var e=t.command,n=t.key,r=t.hotkey;return!this.engine||!0!==r&&void 0!==r||(r=Y(this.engine,e&&!Array.isArray(e)?e.name:this.name,n)),"string"===typeof r&&""!==r&&(r=Object(d["formatHotkey"])(r)),r}},{key:"mounted",value:function(){var t=this;this.items.forEach((function(e){t.hotkeys[e.key]=t.getHotkey(e)})),this.isMobile=d["isMobile"];var e=this.$refs.elementRef;if(e&&this.engine&&this.engine.scrollNode){var n=this.engine.scrollNode.get();if(n){var r=e.getBoundingClientRect(),i=n.getBoundingClientRect();r.top<i.top&&(this.placement="bottom"),r.bottom>i.bottom&&(this.placement="top")}}}},{key:"triggerSelect",value:function(t,e){t.preventDefault(),t.stopPropagation();var n=this.items.find((function(t){return t.key===e}));if(n&&!n.disabled){var r=n.autoExecute,i=n.command;if((!this.onSelect||!1!==this.onSelect(t,e))&&!1!==r){var o,a=this.name,s=[e];i&&(Array.isArray(i)?s=s.concat(i):(a=i.name,s=s.concat(i.args))),this.engine&&(o=this.engine.command).execute.apply(o,[a].concat(Object(f["a"])(s)))}}}}]),n}(c["default"]);A([$({type:Object})],ht.prototype,"engine",void 0),A([$({type:String,required:!0})],ht.prototype,"name",void 0),A([$({type:[String,Array,Number]})],ht.prototype,"values",void 0),A([$({type:Array,default:[]})],ht.prototype,"items",void 0),A([$(String)],ht.prototype,"className",void 0),A([$(String)],ht.prototype,"direction",void 0),A([$(Function)],ht.prototype,"onSelect",void 0),A([$({type:[Boolean,Object],default:void 0})],ht.prototype,"hasDot",void 0),ht=A([q({components:{"a-tooltip":p["default"]}})],ht);var pt=ht;const ft=pt;var gt=function(){var t,e=this,n=e.$createElement,r=e._self._c||n;return r("div",{ref:"elementRef",class:["toolbar-dropdown-list","toolbar-dropdown-"+(e.direction||"vertical"),(t={},t["toolbar-dropdown-placement-"+e.placement]=!!e.placement,t),{"toolbar-dropdown-dot":!1!==e.hasDot},e.className]},e._l(e.items,(function(t){var n=t.key,i=t.placement,o=t.title,a=t.content,s=t.className,l=t.icon,c=t.hotkey,u=t.disabled;return r("a-tooltip",{key:n,attrs:{placement:i||"right"},scopedSlots:e._u([!o&&!1===c||e.isMobile?null:{key:"title",fn:function(){return[o?r("div",{staticClass:"toolbar-tooltip-title"},[e._v(e._s(o))]):e._e(),e._v(" "),e.hotkeys[n]?r("div",{staticClass:"toolbar-tooltip-hotkey",domProps:{innerHTML:e._s(e.hotkeys[n])}}):e._e()]},proxy:!0}],null,!0)},[e._v(" "),r("a",{class:["toolbar-dropdown-list-item",s,{"toolbar-dropdown-list-item-disabled":u}],on:{click:function(t){return e.triggerSelect(t,n)}}},[("string"===typeof e.values&&e.values===n||Array.isArray(e.values)&&e.values.indexOf(n)>-1)&&"horizontal"!==e.direction&&!1!==e.hasDot?r("span",{staticClass:"data-icon data-icon-dot"}):e._e(),e._v(" "),e._t("icon",(function(){return[l?r("span",{class:["data-icon","data-icon-"+l]}):e._e()]})),e._v(" "),r("div",{domProps:{innerHTML:e._s("function"===typeof a?a():a)}})],2)])})),1)},mt=[];gt._withStripped=!0;const vt=void 0,bt=void 0,yt=void 0,wt=!1,xt=J({render:gt,staticRenderFns:mt},vt,ft,bt,wt,yt,!1,void 0,void 0,void 0);var Ct=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.valuesVar="",t.buttonContent=null,t.isRight=!1,t.visible=!1,t}return Object(a["a"])(n,[{key:"mounted",value:function(){if(this.$refs.buttonRef&&d["isMobile"]){var t=this.$refs.buttonRef.getBoundingClientRect();this.isRight=t.left>window.visualViewport.width/2}}},{key:"update",value:function(t){!1!==this.single&&(t=Array.isArray(t)&&t.length>0?t[0]:t);var e=this.items.find((function(e){return"string"===typeof t&&e.key===t||Array.isArray(t)&&t.indexOf(e.key)>-1})),n=this.items.length>0?this.items.find((function(t){return!0===t.isDefault}))||this.items[0]:null;e?this.$slots.default?this.buttonContent=e:"function"===typeof this.content?this.buttonContent={icon:this.icon,content:this.content()}:Array.isArray(t)&&t.length>1?this.buttonContent={icon:this.icon,content:this.content}:this.buttonContent={icon:e.icon,content:"function"===typeof e.content?e.content():e.content}:this.icon||this.content?(!Array.isArray(t)||t.length<1)&&(this.buttonContent={icon:this.icon,content:"function"===typeof this.content?this.content():this.content}):n&&(this.buttonContent={icon:n.icon,content:"function"===typeof n.content?n.content():n.content}),this.valuesVar=t||(this.icon||this.content?"":n?n.key:"")}},{key:"watch",value:function(t){t?document.addEventListener("click",this.hide):document.removeEventListener("click",this.hide)}},{key:"triggerMouseDown",value:function(t){t.preventDefault()}},{key:"triggerClick",value:function(t){t.preventDefault(),this.disabled||(this.visible?this.hide():this.show())}},{key:"show",value:function(){this.visible=!0}},{key:"hide",value:function(t){t&&this.$refs.targetRef&&this.$refs.targetRef.$refs.element.contains(t.target)||(this.visible=!1)}},{key:"triggerSelect",value:function(t,e){this.hide(),this.onSelect&&this.onSelect(t,e)}}]),n}(c["default"]);A([$({type:Object})],Ct.prototype,"engine",void 0),A([$({type:String,required:!0})],Ct.prototype,"name",void 0),A([$({type:[String,Array,Number]})],Ct.prototype,"values",void 0),A([$({type:Array,default:[]})],Ct.prototype,"items",void 0),A([$(String)],Ct.prototype,"icon",void 0),A([$({type:[String,Function]})],Ct.prototype,"content",void 0),A([$(String)],Ct.prototype,"title",void 0),A([$({type:[Boolean,Object],default:void 0})],Ct.prototype,"disabled",void 0),A([$({type:[Boolean,Object],default:void 0})],Ct.prototype,"single",void 0),A([$(String)],Ct.prototype,"className",void 0),A([$(String)],Ct.prototype,"direction",void 0),A([$(Function)],Ct.prototype,"onSelect",void 0),A([$({type:[Boolean,Object],default:void 0})],Ct.prototype,"hasArrow",void 0),A([$({type:[Boolean,Object],default:void 0})],Ct.prototype,"hasDot",void 0),A([$({type:[String],default:void 0})],Ct.prototype,"placement",void 0),A([G("$props.values",{immediate:!0,deep:!0})],Ct.prototype,"update",null),A([G("visible",{immediate:!0,deep:!0})],Ct.prototype,"watch",null),Ct=A([q({components:{AmButton:dt,AmDropdownList:xt}})],Ct);var kt=Ct;const At=kt;var St=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"buttonRef",class:["toolbar-dropdown",{"toolbar-dropdown-right":t.isRight},t.className],on:{click:t.triggerClick,mousedown:t.triggerMouseDown}},[n("div",{class:["toolbar-dropdown-trigger",{"toolbar-dropdown-trigger-active":t.visible,"toolbar-dropdown-trigger-arrow":!1!==t.hasArrow}]},[n("am-button",{ref:"targetRef",attrs:{name:t.name,placement:t.placement,title:t.title,active:t.visible,disabled:t.disabled},scopedSlots:t._u([{key:"default",fn:function(){return[t._t("default",(function(){return[t.buttonContent&&t.buttonContent.icon?n("span",{class:["data-icon","data-icon-"+t.buttonContent.icon]}):t._e(),t._v(" "),t.buttonContent&&!t.buttonContent.icon&&t.buttonContent.content?n("span",{staticClass:"toolbar-dropdown-button-text",domProps:{innerHTML:t._s(t.buttonContent.content)}}):t._e()]}),{item:t.content}),t._v(" "),!1!==t.hasArrow?n("span",{staticClass:"data-icon data-icon-arrow"}):t._e()]},proxy:!0}],null,!0)})],1),t._v(" "),t.visible?n("am-dropdown-list",{attrs:{hasDot:t.hasDot,engine:t.engine,direction:t.direction,name:t.name,items:t.items,values:t.valuesVar,"on-select":t.triggerSelect}}):t._e()],1)},Et=[];St._withStripped=!0;const Ot=function(t){t&&t("data-v-085ec803_0",{source:"\n.toolbar-dropdown {\r\n position: relative;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger {\r\n display: flex;\r\n align-items: stretch;\r\n height: 100%;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-button {\r\n margin: 0;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-dropdown-button-text {\r\n font-size: 12px;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .toolbar-button{\r\n padding-right: 20px;\r\n margin: 0;\n}\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .data-icon-arrow {\r\n position: absolute;\r\n right: 6px;\r\n top: calc(100% / 2 - 2px);\r\n width: 8px;\r\n height: 8px;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjhweCIgaGVpZ2h0PSI1cHgiIHZpZXdCb3g9IjAgMCA4IDUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1Mi41ICg2NzQ2OSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+DQogICAgPHRpdGxlPkdyb3VwIENvcHkgNjwvdGl0bGU+DQogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPg0KICAgICAgICA8ZyBpZD0idG9vbGJhciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyOC4wMDAwMDAsIC0xOC4wMDAwMDApIj4NCiAgICAgICAgICAgIDxnIGlkPSJwYXJhZ3JhcGgtc3R5bGUiPg0KICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIyNi4wMDAwMDAsIDQuMDAwMDAwKSI+DQogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC1Db3B5LTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMi4wMDAwMDAsIDEyLjAwMDAwMCkiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjgiIGhlaWdodD0iOCI+PC9yZWN0Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTAuNTk2MDkzNzUsMi41NTcwMzEyNSBMMy43NDUzMTI1LDYuMzc4MTI1IEMzLjg3NzM0Mzc1LDYuNTI1NzgxMjUgNC4xMDg1OTM3NSw2LjUyNTc4MTI1IDQuMjQwNjI1LDYuMzc4MTI1IEw3LjQwNTQ2ODc1LDIuNTU3MDMxMjUgQzcuNTk2MDkzNzUsMi4zNDI5Njg3NSA3LjQ0NDUzMTI1LDIuMDAzOTA2MjUgNy4xNTc4MTI1LDIuMDAzOTA2MjUgTDAuODQ0NTMxMjUsMi4wMDM5MDYyNSBDMC41NTcwMzEyNSwyLjAwMzkwNjI1IDAuNDA0Njg3NSwyLjM0Mjk2ODc1IDAuNTk2MDkzNzUsMi41NTcwMzEyNSBaIiBpZD0iU2hhcGUiIGZpbGw9IiMwMDAwMDAiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICAgICAgICAgICAgICA8L2c+DQogICAgICAgICAgICAgICAgPC9nPg0KICAgICAgICAgICAgPC9nPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);\r\n background-repeat: no-repeat;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n}\n.toolbar-dropdown .toolbar-dropdown-list {\r\n position: absolute;\r\n top: 32px;\r\n font-size: 12px;\r\n background: #ffffff;\r\n border: 1px solid #e8e8e8;\r\n border-radius: 3px 3px;\r\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);\r\n padding: 5px 0;\r\n height: auto;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\r\n z-index: 999;\r\n max-height: calc(80vh);\r\n overflow: auto;\n}\n.toolbar-dropdown.toolbar-dropdown-right:not(.toolbar-dropdown-right) .toolbar-dropdown-list{\r\n left: 0px;\n}\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list, .editor-toolbar-popup .toolbar-dropdown .toolbar-dropdown-list:not(.toolbar-dropdown-placement-bottom) {\r\n bottom: 32px;\r\n top: auto;\r\n overflow: auto;\n}\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list {\r\n max-height: calc(30vh);\n}\n.editor-toolbar-mobile .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list,.editor-toolbar-popup .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list{\r\n right: 0px;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item {\r\n padding: 2px 10px 2px 16px;\r\n line-height: 30px;\r\n color: #595959;\r\n text-align: left;\r\n position: relative;\r\n display: flex;\r\n white-space: nowrap;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item-disabled {\r\n color: rgba(17, 31, 44, 0.24);\r\n cursor: not-allowed;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item:not(.toolbar-dropdown-list-item-disabled):hover {\r\n color: #262626;\r\n background-color: #f5f5f5;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon {\r\n margin-right: 8px;\n}\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-horizontal .toolbar-dropdown-list-item {\r\n display: inline-block;\n}\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-dot .toolbar-dropdown-list-item {\r\n padding-left: 30px;\r\n padding-right: 16px;\r\n white-space: nowrap;\n}\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon-dot\r\n{\r\n position: absolute;\r\n top: 50%;\r\n left: 8px;\r\n margin-top: -7px;\r\n width: 14px;\r\n height: 14px;\r\n display: block;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTRweCIgaGVpZ2h0PSIxNHB4IiB2aWV3Qm94PSIwIDAgMTQgMTQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjQgKDY3Mzc4KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5VbnRpdGxlZDwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPgogICAgICAgIDxnIGlkPSJjaGVjayIgZmlsbD0iIzAwMDAwMCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIG9wYWNpdHk9IjAiIHg9IjAiIHk9IjAiIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTIuNDY4NzUsMi41OTc2NTYyNSBMMTEuNTEzMDg1OSwyLjU5NzY1NjI1IEMxMS4zNzkxMDE2LDIuNTk3NjU2MjUgMTEuMjUxOTUzMSwyLjY1OTE3OTY5IDExLjE2OTkyMTksMi43NjQ0NTMxMiBMNS41MzMwMDc4MSw5LjkwNTI3MzQ0IEwyLjgzMDA3ODEyLDYuNDgwNDY4NzUgQzIuNzQ2Njc5NjksNi4zNzUxOTUzMSAyLjYyMDg5ODQ0LDYuMzEzNjcxODcgMi40ODY5MTQwNiw2LjMxMzY3MTg3IEwxLjUzMTI1LDYuMzEzNjcxODcgQzEuNDM5NjQ4NDQsNi4zMTM2NzE4NyAxLjM4OTA2MjUsNi40MTg5NDUzMSAxLjQ0NTExNzE5LDYuNDkwMDM5MDYgTDUuMTg5ODQzNzUsMTEuMjM0MTc5NyBDNS4zNjQ4NDM3NSwxMS40NTU2NjQxIDUuNzAxMTcxODcsMTEuNDU1NjY0MSA1Ljg3NzUzOTA2LDExLjIzNDE3OTcgTDEyLjU1NDg4MjgsMi43NzI2NTYyNSBDMTIuNjEwOTM3NSwyLjcwMjkyOTY5IDEyLjU2MDM1MTYsMi41OTc2NTYyNSAxMi40Njg3NSwyLjU5NzY1NjI1IFoiIGlkPSJQYXRoIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=);\r\n background-repeat: no-repeat;\n}\r\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/dropdown.vue"],names:[],mappings:";AAqMA;IACA,kBAAA;AACA;AAEA;IACA,aAAA;IACA,oBAAA;IACA,YAAA;AACA;AAEA;IACA,SAAA;AACA;AAEA;IACA,eAAA;AACA;AAEA;IACA,mBAAA;IACA,SAAA;AACA;AAEA;IACA,kBAAA;IACA,UAAA;IACA,yBAAA;IACA,UAAA;IACA,WAAA;IACA,isDAAA;IACA,4BAAA;IACA,oDAAA;AACA;AAEA;IACA,kBAAA;IACA,SAAA;IACA,eAAA;IACA,mBAAA;IACA,yBAAA;IACA,sBAAA;IACA,0CAAA;IACA,cAAA;IACA,YAAA;IACA,oDAAA;IACA,YAAA;IACA,sBAAA;IACA,cAAA;AACA;AAEA;IACA,SAAA;AACA;AAEA;IACA,YAAA;IACA,SAAA;IACA,cAAA;AACA;AAEA;IACA,sBAAA;AACA;AAGA;IACA,UAAA;AACA;AAEA;IACA,0BAAA;IACA,iBAAA;IACA,cAAA;IACA,gBAAA;IACA,kBAAA;IACA,aAAA;IACA,mBAAA;AACA;AAEA;IACA,6BAAA;IACA,mBAAA;AACA;AAEA;IACA,cAAA;IACA,yBAAA;AACA;AAEA;IACA,iBAAA;AACA;AAEA;IACA,qBAAA;AACA;AAEA;IACA,kBAAA;IACA,mBAAA;IACA,mBAAA;AACA;AAEA;;IAEA,kBAAA;IACA,QAAA;IACA,SAAA;IACA,gBAAA;IACA,WAAA;IACA,YAAA;IACA,cAAA;IACA,igDAAA;IACA,4BAAA;AACA",file:"dropdown.vue",sourcesContent:['<template>\r\n <div\r\n :class="[\r\n \'toolbar-dropdown\',\r\n { \'toolbar-dropdown-right\': isRight },\r\n className,\r\n ]"\r\n ref="buttonRef"\r\n @click="triggerClick"\r\n @mousedown="triggerMouseDown"\r\n >\r\n <div\r\n :class="[\r\n \'toolbar-dropdown-trigger\',\r\n {\r\n \'toolbar-dropdown-trigger-active\': visible,\r\n \'toolbar-dropdown-trigger-arrow\': hasArrow !== false,\r\n },\r\n ]"\r\n >\r\n <am-button\r\n :name="name"\r\n :placement="placement"\r\n :title="title"\r\n :active="visible"\r\n :disabled="disabled"\r\n ref="targetRef"\r\n >\r\n <template #default>\r\n <slot :item="content">\r\n <span\r\n v-if="buttonContent && buttonContent.icon"\r\n :class="[\'data-icon\', `data-icon-${buttonContent.icon}`]"\r\n />\r\n <span\r\n v-if="\r\n buttonContent && !buttonContent.icon && buttonContent.content\r\n "\r\n class="toolbar-dropdown-button-text"\r\n v-html="buttonContent.content"\r\n ></span>\r\n </slot>\r\n <span v-if="hasArrow !== false" class="data-icon data-icon-arrow" />\r\n </template>\r\n </am-button>\r\n </div>\r\n <am-dropdown-list\r\n v-if="visible"\r\n :hasDot="hasDot"\r\n :engine="engine"\r\n :direction="direction"\r\n :name="name"\r\n :items="items"\r\n :values="valuesVar"\r\n :on-select="triggerSelect"\r\n />\r\n </div>\r\n</template>\r\n<script lang="ts">\r\nimport { Component, Prop, Vue, Watch } from "vue-property-decorator";\r\nimport { EngineInterface, isMobile, Placement } from "@aomao/engine";\r\nimport { DropdownListItem } from "../types";\r\nimport AmDropdownList from "./dropdown-list.vue";\r\nimport AmButton from "./button.vue";\r\n\r\n@Component({\r\n components: {\r\n AmButton,\r\n AmDropdownList,\r\n },\r\n})\r\nexport default class Dropdown extends Vue {\r\n @Prop({ type: Object }) engine?: EngineInterface;\r\n @Prop({ type: String, required: true }) name!: string;\r\n @Prop({ type: [String, Array, Number] }) values?: string | number | string[];\r\n @Prop({ type: Array, default: [] }) items!: DropdownListItem[];\r\n @Prop(String) icon?: string;\r\n @Prop({ type: [String, Function] }) content?: string | (() => string);\r\n @Prop(String) title?: string;\r\n @Prop({ type: [Boolean, Object], default: undefined }) disabled?: boolean;\r\n @Prop({ type: [Boolean, Object], default: undefined }) single?: boolean;\r\n @Prop(String) className?: string;\r\n @Prop(String) direction?: "vertical" | "horizontal";\r\n @Prop(Function) onSelect?: (event: MouseEvent, key: string) => void | boolean;\r\n @Prop({ type: [Boolean, Object], default: undefined }) hasArrow?: boolean;\r\n @Prop({ type: [Boolean, Object], default: undefined }) hasDot?: boolean;\r\n @Prop({ type: [String], default: undefined }) placement?: Placement;\r\n valuesVar: string | number | string[] = "";\r\n buttonContent?:\r\n | DropdownListItem\r\n | { icon?: string; content?: string }\r\n | null = null;\r\n isRight = false;\r\n visible = false;\r\n\r\n mounted() {\r\n if (this.$refs.buttonRef && isMobile) {\r\n const rect = (this.$refs.buttonRef as Element).getBoundingClientRect();\r\n this.isRight = rect.left > window.visualViewport.width / 2;\r\n }\r\n }\r\n\r\n @Watch("$props.values", { immediate: true, deep: true })\r\n update(values?: string | number | string[]) {\r\n if (this.single !== false)\r\n values = Array.isArray(values) && values.length > 0 ? values[0] : values;\r\n const item = this.items.find(\r\n (item) =>\r\n (typeof values === "string" && item.key === values) ||\r\n (Array.isArray(values) && values.indexOf(item.key) > -1)\r\n );\r\n const defaultItem =\r\n this.items.length > 0\r\n ? this.items.find((item) => item.isDefault === true) || this.items[0]\r\n : null;\r\n\r\n if (item) {\r\n if (this.$slots.default) {\r\n this.buttonContent = item;\r\n } else if (typeof this.content === "function") {\r\n this.buttonContent = { icon: this.icon, content: this.content() };\r\n } else if (Array.isArray(values) && values.length > 1) {\r\n this.buttonContent = { icon: this.icon, content: this.content };\r\n } else {\r\n this.buttonContent = {\r\n icon: item.icon,\r\n content:\r\n typeof item.content === "function" ? item.content() : item.content,\r\n };\r\n }\r\n } else if (this.icon || this.content) {\r\n if (!Array.isArray(values) || values.length < 1) {\r\n this.buttonContent = {\r\n icon: this.icon,\r\n content:\r\n typeof this.content === "function" ? this.content() : this.content,\r\n };\r\n }\r\n } else if (defaultItem) {\r\n this.buttonContent = {\r\n icon: defaultItem.icon,\r\n content:\r\n typeof defaultItem.content === "function"\r\n ? defaultItem.content()\r\n : defaultItem.content,\r\n };\r\n }\r\n this.valuesVar =\r\n values ||\r\n (this.icon || this.content ? "" : defaultItem ? defaultItem.key : "");\r\n }\r\n\r\n @Watch("visible", { immediate: true, deep: true })\r\n watch(value: boolean) {\r\n if (value) document.addEventListener("click", this.hide);\r\n else document.removeEventListener("click", this.hide);\r\n }\r\n\r\n triggerMouseDown(event: MouseEvent) {\r\n event.preventDefault();\r\n }\r\n\r\n triggerClick(event: MouseEvent) {\r\n event.preventDefault();\r\n if (this.disabled) {\r\n return;\r\n }\r\n if (this.visible) {\r\n this.hide();\r\n } else {\r\n this.show();\r\n }\r\n }\r\n\r\n show() {\r\n this.visible = true;\r\n }\r\n\r\n hide(event?: MouseEvent) {\r\n if (\r\n event &&\r\n this.$refs.targetRef &&\r\n ((this.$refs.targetRef as Vue).$refs.element as Element).contains(\r\n event.target as Node\r\n )\r\n )\r\n return;\r\n this.visible = false;\r\n }\r\n\r\n triggerSelect(event: MouseEvent, key: string) {\r\n this.hide();\r\n if (this.onSelect) this.onSelect(event, key);\r\n }\r\n}\r\n<\/script>\r\n<style>\r\n.toolbar-dropdown {\r\n position: relative;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger {\r\n display: flex;\r\n align-items: stretch;\r\n height: 100%;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-button {\r\n margin: 0;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger .toolbar-dropdown-button-text {\r\n font-size: 12px;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .toolbar-button{\r\n padding-right: 20px;\r\n margin: 0;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-trigger-arrow .data-icon-arrow {\r\n position: absolute;\r\n right: 6px;\r\n top: calc(100% / 2 - 2px);\r\n width: 8px;\r\n height: 8px;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjhweCIgaGVpZ2h0PSI1cHgiIHZpZXdCb3g9IjAgMCA4IDUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+DQogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1Mi41ICg2NzQ2OSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+DQogICAgPHRpdGxlPkdyb3VwIENvcHkgNjwvdGl0bGU+DQogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogICAgPGcgaWQ9IlN5bWJvbHMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPg0KICAgICAgICA8ZyBpZD0idG9vbGJhciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMyOC4wMDAwMDAsIC0xOC4wMDAwMDApIj4NCiAgICAgICAgICAgIDxnIGlkPSJwYXJhZ3JhcGgtc3R5bGUiPg0KICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIyNi4wMDAwMDAsIDQuMDAwMDAwKSI+DQogICAgICAgICAgICAgICAgICAgIDxnIGlkPSJHcm91cC1Db3B5LTYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwMi4wMDAwMDAsIDEyLjAwMDAwMCkiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjgiIGhlaWdodD0iOCI+PC9yZWN0Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTAuNTk2MDkzNzUsMi41NTcwMzEyNSBMMy43NDUzMTI1LDYuMzc4MTI1IEMzLjg3NzM0Mzc1LDYuNTI1NzgxMjUgNC4xMDg1OTM3NSw2LjUyNTc4MTI1IDQuMjQwNjI1LDYuMzc4MTI1IEw3LjQwNTQ2ODc1LDIuNTU3MDMxMjUgQzcuNTk2MDkzNzUsMi4zNDI5Njg3NSA3LjQ0NDUzMTI1LDIuMDAzOTA2MjUgNy4xNTc4MTI1LDIuMDAzOTA2MjUgTDAuODQ0NTMxMjUsMi4wMDM5MDYyNSBDMC41NTcwMzEyNSwyLjAwMzkwNjI1IDAuNDA0Njg3NSwyLjM0Mjk2ODc1IDAuNTk2MDkzNzUsMi41NTcwMzEyNSBaIiBpZD0iU2hhcGUiIGZpbGw9IiMwMDAwMDAiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPg0KICAgICAgICAgICAgICAgICAgICA8L2c+DQogICAgICAgICAgICAgICAgPC9nPg0KICAgICAgICAgICAgPC9nPg0KICAgICAgICA8L2c+DQogICAgPC9nPg0KPC9zdmc+);\r\n background-repeat: no-repeat;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list {\r\n position: absolute;\r\n top: 32px;\r\n font-size: 12px;\r\n background: #ffffff;\r\n border: 1px solid #e8e8e8;\r\n border-radius: 3px 3px;\r\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);\r\n padding: 5px 0;\r\n height: auto;\r\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\r\n z-index: 999;\r\n max-height: calc(80vh);\r\n overflow: auto;\r\n}\r\n\r\n.toolbar-dropdown.toolbar-dropdown-right:not(.toolbar-dropdown-right) .toolbar-dropdown-list{\r\n left: 0px;\r\n}\r\n\r\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list, .editor-toolbar-popup .toolbar-dropdown .toolbar-dropdown-list:not(.toolbar-dropdown-placement-bottom) {\r\n bottom: 32px;\r\n top: auto;\r\n overflow: auto;\r\n}\r\n\r\n.editor-toolbar-mobile .toolbar-dropdown .toolbar-dropdown-list {\r\n max-height: calc(30vh);\r\n}\r\n\r\n\r\n.editor-toolbar-mobile .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list,.editor-toolbar-popup .toolbar-dropdown.toolbar-dropdown-right .toolbar-dropdown-list{\r\n right: 0px;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item {\r\n padding: 2px 10px 2px 16px;\r\n line-height: 30px;\r\n color: #595959;\r\n text-align: left;\r\n position: relative;\r\n display: flex;\r\n white-space: nowrap;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item-disabled {\r\n color: rgba(17, 31, 44, 0.24);\r\n cursor: not-allowed;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item:not(.toolbar-dropdown-list-item-disabled):hover {\r\n color: #262626;\r\n background-color: #f5f5f5;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon {\r\n margin-right: 8px;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-horizontal .toolbar-dropdown-list-item {\r\n display: inline-block;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list.toolbar-dropdown-dot .toolbar-dropdown-list-item {\r\n padding-left: 30px;\r\n padding-right: 16px;\r\n white-space: nowrap;\r\n}\r\n\r\n.toolbar-dropdown .toolbar-dropdown-list .toolbar-dropdown-list-item .data-icon-dot\r\n{\r\n position: absolute;\r\n top: 50%;\r\n left: 8px;\r\n margin-top: -7px;\r\n width: 14px;\r\n height: 14px;\r\n display: block;\r\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTRweCIgaGVpZ2h0PSIxNHB4IiB2aWV3Qm94PSIwIDAgMTQgMTQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUyLjQgKDY3Mzc4KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5VbnRpdGxlZDwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIG9wYWNpdHk9IjAuNDUiPgogICAgICAgIDxnIGlkPSJjaGVjayIgZmlsbD0iIzAwMDAwMCI+CiAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIG9wYWNpdHk9IjAiIHg9IjAiIHk9IjAiIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCI+PC9yZWN0PgogICAgICAgICAgICA8cGF0aCBkPSJNMTIuNDY4NzUsMi41OTc2NTYyNSBMMTEuNTEzMDg1OSwyLjU5NzY1NjI1IEMxMS4zNzkxMDE2LDIuNTk3NjU2MjUgMTEuMjUxOTUzMSwyLjY1OTE3OTY5IDExLjE2OTkyMTksMi43NjQ0NTMxMiBMNS41MzMwMDc4MSw5LjkwNTI3MzQ0IEwyLjgzMDA3ODEyLDYuNDgwNDY4NzUgQzIuNzQ2Njc5NjksNi4zNzUxOTUzMSAyLjYyMDg5ODQ0LDYuMzEzNjcxODcgMi40ODY5MTQwNiw2LjMxMzY3MTg3IEwxLjUzMTI1LDYuMzEzNjcxODcgQzEuNDM5NjQ4NDQsNi4zMTM2NzE4NyAxLjM4OTA2MjUsNi40MTg5NDUzMSAxLjQ0NTExNzE5LDYuNDkwMDM5MDYgTDUuMTg5ODQzNzUsMTEuMjM0MTc5NyBDNS4zNjQ4NDM3NSwxMS40NTU2NjQxIDUuNzAxMTcxODcsMTEuNDU1NjY0MSA1Ljg3NzUzOTA2LDExLjIzNDE3OTcgTDEyLjU1NDg4MjgsMi43NzI2NTYyNSBDMTIuNjEwOTM3NSwyLjcwMjkyOTY5IDEyLjU2MDM1MTYsMi41OTc2NTYyNSAxMi40Njg3NSwyLjU5NzY1NjI1IFoiIGlkPSJQYXRoIj48L3BhdGg+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=);\r\n background-repeat: no-repeat;\r\n}\r\n</style>\r\n']},media:void 0})},Tt=void 0,_t=void 0,Mt=!1,Nt=J({render:St,staticRenderFns:Et},Ot,At,Tt,Mt,_t,!1,tt,void 0,void 0);var Pt=function t(){Object(o["a"])(this,t)};Pt.colors=[["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FAFAFA","#FFFFFF"],["#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1890FF","#2F54EB","#722ED1","#EB2F96"],["#FFE8E6","#FFECE0","#FFEFD1","#FCFCCA","#E4F7D2","#D3F5F0","#D4EEFC","#DEE8FC","#EFE1FA","#FAE1EB"],["#FFA39E","#FFBB96","#FFD591","#FFFB8F","#B7EB8F","#87E8DE","#91D5FF","#ADC6FF","#D3ADF7","#FFADD2"],["#FF4D4F","#FF7A45","#FFA940","#FFEC3D","#73D13D","#36CFC9","#40A9FF","#597EF7","#9254DE","#F759AB"],["#CF1322","#D4380D","#D46B08","#D4B106","#389E0D","#08979C","#096DD9","#1D39C4","#531DAB","#C41D7F"],["#820014","#871400","#873800","#614700","#135200","#00474F","#003A8C","#061178","#22075E","#780650"]],Pt._map=function(){for(var t={},e=Pt.colors,n=0,r=e.length;n<r;n++)for(var i=e[n],o=0,a=i.length;o<a;o++){var s=e[n][o];t[s]={y:n,x:o}}return t}(),Pt.getStroke=function(t){var e=Pt._map[t];return e&&(2===e.y||3===e.y&&e.x>2&&e.x<5)?this.colors[4][e.x]:t},Pt.getColors=function(){return this.colors};var Lt=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.title="",t.special=!1,t.needBorder=!1,t}return Object(a["a"])(n,[{key:"mounted",value:function(){this.special="transparent"===this.color,this.title=this.engine.language.get("toolbar","colorPicker",this.color.toUpperCase()),this.state=this.toState(this.color||"#FFFFFF"),this.needBorder=["#ffffff","#fafafa","transparent"].indexOf(this.state.hex)>=0,this.styles=this.getStyles(this.state)}},{key:"triggerSelect",value:function(t){t.preventDefault(),t.stopPropagation(),this.onSelect&&this.onSelect(this.color,t)}},{key:"refreshStyles",get:function(){return this.getStyles()}},{key:"getContrastingColor",value:function(t){if(!t)return"";if("transparent"===t.hex)return"rgba(0,0,0,0.4)";var e=(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3;return e>=210?"#8C8C8C":"#FFFFFF"}},{key:"toState",value:function(t,e){var n=t["hex"]?m()(t["hex"]):m()(t),r=n.toHsl(),i=n.toHsv(),o=n.toRgb(),a=n.toHex();0===r.s&&(r.h=e||0,i.h=e||0);var s="000000"===a&&0===o.a;return{hsl:r,hex:s?"transparent":"#".concat(a),rgb:o,hsv:i,oldHue:t["h"]||e||r.h,source:t["source"]}}},{key:"getStyles",value:function(t){return{check:{fill:this.getContrastingColor(t||this.state),display:this.active?"block":"none"},block:{backgroundColor:this.color,border:this.setStroke?"1px solid ".concat(Pt.getStroke(this.color)):void 0}}}}]),n}(c["default"]);A([$({type:Object,required:!0})],Lt.prototype,"engine",void 0),A([$(String)],Lt.prototype,"color",void 0),A([$({type:[Boolean,Object],default:void 0})],Lt.prototype,"active",void 0),A([$({type:[Boolean,Object],default:void 0})],Lt.prototype,"setStroke",void 0),A([$(Function)],Lt.prototype,"onSelect",void 0),Lt=A([q({})],Lt);var Dt=Lt;const jt=Dt;var It=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{class:["colorpicker-group-item",{"colorpicker-group-item-border":t.needBorder,"colorpicker-group-item-active":t.active,"colorpicker-group-item-special":t.special}],attrs:{title:t.title},on:{click:t.triggerSelect}},[n("span",{style:t.refreshStyles.block},[n("svg",{style:t.refreshStyles.check,attrs:{viewBox:"0 0 18 18"}},[n("path",{attrs:{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}})])])])},Rt=[];It._withStripped=!0;const Ft=void 0,Bt=void 0,zt=void 0,Ht=!1,Vt=J({render:It,staticRenderFns:Rt},Ft,jt,Bt,Ht,zt,!1,void 0,void 0,void 0);var qt=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){return Object(o["a"])(this,n),e.apply(this,arguments)}return n}(c["default"]);A([$({type:Object,required:!0})],qt.prototype,"engine",void 0),A([$(Array)],qt.prototype,"colors",void 0),A([$({type:[Boolean,Object],default:void 0})],qt.prototype,"setStroke",void 0),A([$(Function)],qt.prototype,"onSelect",void 0),qt=A([q({components:{AmColorPickerItem:Vt}})],qt);var Ut=qt;const Wt=Ut;var $t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"colorpicker-group"},t._l(t.colors,(function(e){return n("am-color-picker-item",{key:e.value,attrs:{engine:t.engine,color:e.value,active:e.active,"on-select":t.onSelect,"set-stroke":t.setStroke}})})),1)},Gt=[];$t._withStripped=!0;const Yt=void 0,Xt=void 0,Kt=void 0,Zt=!1,Jt=J({render:$t,staticRenderFns:Gt},Yt,Wt,Xt,Zt,Kt,!1,void 0,void 0,void 0);var Qt=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.colorValues=[],t.text="",t}return Object(a["a"])(n,[{key:"activeColors",value:function(t,e){return t.map((function(t){return t.map((function(t){var n="string"===typeof t?t:t.value;return{value:n,active:e===n}}))}))}},{key:"mounted",value:function(){this.colorValues=this.activeColors(this.colors||Pt.getColors(),this.defaultActiveColor),this.text=this.engine.language.get("toolbar","colorPicker","transparent"===this.defaultColor?"nonFillText":"defaultText")}},{key:"triggerSelect",value:function(t,e){this.colorValues=this.activeColors(this.colorValues,t),this.onSelect&&this.onSelect(t,e)}},{key:"triggerMouseDown",value:function(t){"INPUT"!==t.target.tagName&&t.preventDefault()}}]),n}(c["default"]);A([$({type:Object,required:!0})],Qt.prototype,"engine",void 0),A([$(Array)],Qt.prototype,"colors",void 0),A([$({type:String,required:!0})],Qt.prototype,"defaultColor",void 0),A([$({type:String,required:!0})],Qt.prototype,"defaultActiveColor",void 0),A([$({type:[Boolean,Object],default:void 0})],Qt.prototype,"setStroke",void 0),A([$(Function)],Qt.prototype,"onSelect",void 0),Qt=A([q({components:{AmColorPickerItem:Vt,AmColorPickerGroup:Jt}})],Qt);var te=Qt;const ee=te;var ne=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"colorpicker-board",on:{mousedown:t.triggerMouseDown}},[n("div",{staticClass:"colorpicker-default",on:{click:function(e){return t.triggerSelect(t.defaultColor,e)}}},[n("am-color-picker-item",{attrs:{engine:t.engine,color:t.defaultColor,"active-colors":[],"on-select":t.triggerSelect}}),t._v(" "),n("span",{staticClass:"colorpicker-default-text"},[t._v("\n "+t._s(t.text)+"\n ")])],1),t._v(" "),t._l(t.colorValues,(function(e,r){return n("am-color-picker-group",{key:r,attrs:{engine:t.engine,colors:e,"on-select":t.triggerSelect,"set-stroke":t.setStroke}})}))],2)},re=[];ne._withStripped=!0;const ie=function(t){t&&t("data-v-3eb43e2e_0",{source:'\n.colorpicker-default {\n display: flex;\n align-items: center;\n padding: 4px 8px;\n margin: 4px 0 8px;\n border-radius: 2px;\n cursor: pointer;\n}\n.colorpicker-default:hover {\n background-color: #f5f5f5;\n}\n.colorpicker-default-text {\n margin-left: 8px;\n}\n.colorpicker-group {\n display: flex;\n width: 100%;\n height: auto;\n position: relative;\n padding: 0 8px;\n}\n.colorpicker-group:nth-child(2){\n margin-bottom: 6px;\n}\n.colorpicker-group:last-child {\n margin-bottom: 0px;\n}\n.colorpicker-group-item {\n width: 24px;\n height: 24px;\n padding: 2px 2px;\n display: inline-block;\n border-radius: 3px 3px;\n border: 1px solid transparent;\n flex: 0 0 auto;\n cursor: pointer;\n background-color: #fff;\n}\n.colorpicker-group-item > span {\n position: relative;\n width: 18px;\n height: 18px;\n display: block;\n border-radius: 2px 2px;\n border: 1px solid transparent;\n}\n.colorpicker-group-item > span svg {\n position: absolute;\n top: -1px;\n left: 1px;\n width: 12px;\n height: 12px;\n}\n.colorpicker-group-item-border > span {\n border: 1px solid #e8e8e8;\n}\n.colorpicker-group-item-special {\n position: relative;\n}\n.colorpicker-group-item-special:after {\n content: "";\n display: block;\n position: absolute;\n top: 10px;\n left: 0px;\n width: 22px;\n height: 0;\n border-bottom: 2px solid #ff5151;\n transform: rotate(45deg);\n}\n.colorpicker-group-item:hover {\n border: 1px solid #d9d9d9;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);\n}\n',map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/color/picker/picker.vue"],names:[],mappings:";AAyFA;IACA,aAAA;IACA,mBAAA;IACA,gBAAA;IACA,iBAAA;IACA,kBAAA;IACA,eAAA;AACA;AAEA;IACA,yBAAA;AACA;AAEA;IACA,gBAAA;AACA;AAEA;IACA,aAAA;IACA,WAAA;IACA,YAAA;IACA,kBAAA;IACA,cAAA;AACA;AAEA;IACA,kBAAA;AACA;AAEA;IACA,kBAAA;AACA;AAEA;IACA,WAAA;IACA,YAAA;IACA,gBAAA;IACA,qBAAA;IACA,sBAAA;IACA,6BAAA;IACA,cAAA;IACA,eAAA;IACA,sBAAA;AACA;AACA;IACA,kBAAA;IACA,WAAA;IACA,YAAA;IACA,cAAA;IACA,sBAAA;IACA,6BAAA;AACA;AACA;IACA,kBAAA;IACA,SAAA;IACA,SAAA;IACA,WAAA;IACA,YAAA;AACA;AACA;IACA,yBAAA;AACA;AACA;IACA,kBAAA;AACA;AACA;IACA,WAAA;IACA,cAAA;IACA,kBAAA;IACA,SAAA;IACA,SAAA;IACA,WAAA;IACA,SAAA;IACA,gCAAA;IACA,wBAAA;AACA;AACA;IACA,yBAAA;IACA,yCAAA;AACA",file:"picker.vue",sourcesContent:['<template>\n <div\n class="colorpicker-board"\n @mousedown="triggerMouseDown"\n >\n <div\n class="colorpicker-default"\n @click="triggerSelect(defaultColor,$event)"\n >\n <am-color-picker-item\n :engine="engine"\n :color="defaultColor"\n :active-colors="[]"\n :on-select="triggerSelect"\n />\n <span class="colorpicker-default-text">\n {{text}}\n </span>\n </div>\n <am-color-picker-group\n v-for="(data,index) in colorValues"\n :engine="engine"\n :colors="data"\n :key="index"\n :on-select="triggerSelect"\n :set-stroke="setStroke"\n />\n </div>\n</template>\n<script lang="ts">\nimport { Component, Prop, Vue } from "vue-property-decorator";\nimport { EngineInterface } from "@aomao/engine";\nimport AmColorPickerItem from \'./item.vue\'\nimport AmColorPickerGroup from \'./group.vue\'\nimport Palette from \'./palette\'\n\n@Component({\n components: {\n AmColorPickerItem,\n AmColorPickerGroup\n },\n})\nexport default class ColorPicker extends Vue {\n @Prop({ type: Object, required: true}) engine!: EngineInterface\n @Prop(Array) colors?: string[][]\n @Prop({ type: String, required: true}) defaultColor!: string\n @Prop({ type: String, required: true}) defaultActiveColor!: string\n @Prop({ type: [Boolean, Object], default: undefined}) setStroke?: boolean\n @Prop(Function) onSelect?: (color: string, event: MouseEvent) => void\n \n\n activeColors(values:Array<Array<string | {value:string,active:boolean}>>,activeValue:string){\n return values.map(group => group.map(color => {\n const value = typeof color === "string" ? color : color.value\n return { value, active:activeValue === value }\n }))\n }\n\n colorValues: {\n value: string;\n active: boolean;\n }[][] = []\n\n text = \'\'\n\n mounted(){\n this.colorValues = this.activeColors(this.colors || Palette.getColors(), this.defaultActiveColor)\n this.text = this.engine.language.get(\n \'toolbar\',\n \'colorPicker\',\n this.defaultColor === \'transparent\'\n ? \'nonFillText\'\n : \'defaultText\',\n )\n }\n\n triggerSelect(color: string, event: MouseEvent){\n this.colorValues = this.activeColors(this.colorValues, color)\n if (this.onSelect) this.onSelect(color, event);\n }\n\n triggerMouseDown(event:MouseEvent){\n if (\'INPUT\' !== (event.target as Element).tagName) {\n event.preventDefault();\n }\n }\n}\n<\/script>\n<style>\n.colorpicker-default {\n display: flex;\n align-items: center;\n padding: 4px 8px;\n margin: 4px 0 8px;\n border-radius: 2px;\n cursor: pointer;\n}\n\n.colorpicker-default:hover {\n background-color: #f5f5f5;\n}\n\n.colorpicker-default-text {\n margin-left: 8px; \n}\n\n.colorpicker-group {\n display: flex;\n width: 100%;\n height: auto;\n position: relative;\n padding: 0 8px;\n}\n\n.colorpicker-group:nth-child(2){\n margin-bottom: 6px;\n}\n\n.colorpicker-group:last-child {\n margin-bottom: 0px;\n}\n\n.colorpicker-group-item {\n width: 24px;\n height: 24px;\n padding: 2px 2px;\n display: inline-block;\n border-radius: 3px 3px;\n border: 1px solid transparent;\n flex: 0 0 auto;\n cursor: pointer;\n background-color: #fff;\n}\n.colorpicker-group-item > span {\n position: relative;\n width: 18px;\n height: 18px;\n display: block;\n border-radius: 2px 2px;\n border: 1px solid transparent;\n}\n.colorpicker-group-item > span svg {\n position: absolute;\n top: -1px;\n left: 1px;\n width: 12px;\n height: 12px;\n}\n.colorpicker-group-item-border > span {\n border: 1px solid #e8e8e8;\n}\n.colorpicker-group-item-special {\n position: relative;\n}\n.colorpicker-group-item-special:after {\n content: "";\n display: block;\n position: absolute;\n top: 10px;\n left: 0px;\n width: 22px;\n height: 0;\n border-bottom: 2px solid #ff5151;\n transform: rotate(45deg);\n}\n.colorpicker-group-item:hover {\n border: 1px solid #d9d9d9;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);\n}\n</style>']},media:void 0})},oe=void 0,ae=void 0,se=!1,le=J({render:ne,staticRenderFns:re},ie,ee,oe,se,ae,!1,tt,void 0,void 0);var ce=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.visible=!1,t.isRight=!1,t.currentColor="",t.buttonContent="",t.listPlacement="",t}return Object(a["a"])(n,[{key:"mounted",value:function(){if(this.$refs.buttonRef&&d["isMobile"]){var t=this.$refs.buttonRef.getBoundingClientRect();this.isRight=t.left>window.visualViewport.width/2}this.currentColor=this.defaultActiveColor}},{key:"unmounted",value:function(){document.removeEventListener("click",this.hideDropdown)}},{key:"getContent",value:function(){this.buttonContent="string"===typeof this.content?this.content:this.content(this.currentColor,Pt.getStroke(this.currentColor),this.disabled)}},{key:"toggleDropdown",value:function(t){t.preventDefault(),this.visible?this.hideDropdown():this.showDropdown()}},{key:"showDropdown",value:function(){this.visible=!0}},{key:"hideDropdown",value:function(t){t&&this.$refs.targetRef&&this.$refs.targetRef.$refs.element.contains(t.target)||(this.visible=!1)}},{key:"watch",value:function(t){var e=this;t?(document.addEventListener("click",this.hideDropdown),setTimeout((function(){var t=e.$refs.elementRef;if(t&&e.engine&&e.engine.scrollNode){var n=e.engine.scrollNode.get();if(n){var r=t.getBoundingClientRect(),i=n.getBoundingClientRect();r.top<i.top&&(e.listPlacement="bottom"),r.bottom>i.bottom&&(e.listPlacement="top")}}}),0)):document.removeEventListener("click",this.hideDropdown)}},{key:"triggerClick",value:function(t){this.triggerSelect(this.currentColor,t)}},{key:"triggerSelect",value:function(t,e){if(this.hideDropdown(),this.currentColor=t,this.buttonContent="string"===typeof this.content?this.content:this.content(t,Pt.getStroke(t),this.disabled),!1!==this.autoExecute){var n,r=this.name,i=[t,this.defaultColor];this.command&&(Array.isArray(this.command)?i=this.command:(r=this.command.name,i=this.command.args)),this.engine&&(n=this.engine.command).execute.apply(n,[r].concat(Object(f["a"])(i)))}this.onSelect&&this.onSelect(t,e)}}]),n}(c["default"]);A([$({type:Object})],ce.prototype,"engine",void 0),A([$({type:String,required:!0})],ce.prototype,"name",void 0),A([$({type:[String,Function],required:!0})],ce.prototype,"content",void 0),A([$(String)],ce.prototype,"buttonTitle",void 0),A([$(String)],ce.prototype,"dropdownTitle",void 0),A([$({type:Object})],ce.prototype,"command",void 0),A([$({type:[Boolean,Object],default:void 0})],ce.prototype,"autoExecute",void 0),A([$({type:[Boolean,Object],default:void 0})],ce.prototype,"disabled",void 0),A([$(Array)],ce.prototype,"colors",void 0),A([$({type:String,required:!0})],ce.prototype,"defaultColor",void 0),A([$({type:String,required:!0})],ce.prototype,"defaultActiveColor",void 0),A([$({type:[Boolean,Object],default:void 0})],ce.prototype,"setStroke",void 0),A([$(Function)],ce.prototype,"onSelect",void 0),A([$({type:[String],default:void 0})],ce.prototype,"placement",void 0),A([G("currentColor",{immediate:!0,deep:!0}),G("$props.disabled",{immediate:!0,deep:!0})],ce.prototype,"getContent",null),A([G("visible",{immediate:!0,deep:!0})],ce.prototype,"watch",null),ce=A([q({components:{AmButton:dt,AmColorPicker:le}})],ce);var ue=ce;const de=ue;var he=function(){var t,e=this,n=e.$createElement,r=e._self._c||n;return r("div",{ref:"buttonRef",class:["toolbar-dropdown","colorpicker-button",{"toolbar-dropdown-right":e.isRight}]},[r("div",{class:["toolbar-dropdown-trigger colorpicker-button-group",{"colorpicker-button-group-active":e.visible}]},[r("am-button",{staticClass:"colorpicker-button-text",attrs:{name:e.name,title:e.buttonTitle,"on-click":e.triggerClick,placement:e.placement,disabled:e.disabled}},[r("span",{domProps:{innerHTML:e._s(e.buttonContent)}})]),e._v(" "),r("am-button",{ref:"targetRef",staticClass:"colorpicker-button-dropdown toolbar-dropdown-trigger-arrow",attrs:{name:e.name,title:e.dropdownTitle,"on-click":e.toggleDropdown,placement:e.placement,disabled:e.disabled},scopedSlots:e._u([{key:"icon",fn:function(){return[r("span",{staticClass:"colorpicker-button-dropdown-empty"})]},proxy:!0}])},[e._v(" "),r("span",{staticClass:"data-icon data-icon-arrow"})])],1),e._v(" "),e.visible?r("div",{ref:"elementRef",class:["toolbar-dropdown-list",(t={},t["toolbar-dropdown-placement-"+e.listPlacement]=!!e.listPlacement,t)],attrs:{"data-element":"ui"}},[r("am-color-picker",{attrs:{engine:e.engine,colors:e.colors,"default-active-color":e.currentColor,"default-color":e.defaultColor,"on-select":e.triggerSelect,"set-stroke":e.setStroke}})],1):e._e()])},pe=[];he._withStripped=!0;const fe=function(t){t&&t("data-v-71c5f20e_0",{source:"\n.editor-toolbar .colorpicker-button .colorpicker-button-group {\n padding: 0 2px;\n}\n.colorpicker-button-group .toolbar-button {\n padding: 0;\n}\n.colorpicker-button-group .colorpicker-button-text {\n margin-right: 0;\n min-width: 26px;\n border-radius: 3px 0 0 3px;\n display: block;\n}\n.editor-toolbar.editor-toolbar-popup\n .colorpicker-button-group\n .colorpicker-button-text {\n margin: 0;\n border-radius: 3px 0 0 3px;\n}\n.colorpicker-button-group .colorpicker-button-text:active {\n background-color: #e8e8e8;\n}\n.colorpicker-button-group .colorpicker-button-dropdown {\n margin-left: -1px;\n min-width: 17px;\n text-align: center;\n padding: 0 0;\n border-radius: 0 3px 3px 0;\n display: block;\n}\n.editor-toolbar.editor-toolbar-popup\n .colorpicker-button-group\n .colorpicker-button-dropdown {\n line-height: 24px;\n min-width: 17px;\n padding: 0 4px;\n margin: 0;\n margin-left: -1px;\n border-radius: 0 3px 3px 0;\n}\n.colorpicker-button-group .colorpicker-button-dropdown:hover,\n.colorpicker-button-group .colorpicker-button-dropdown:active {\n background-color: #e8e8e8;\n}\n.colorpicker-button-group\n .colorpicker-button-dropdown\n .colorpicker-button-dropdown-empty {\n display: inline-block;\n}\n.colorpicker-button-group:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n.colorpicker-button-group-active .toolbar-button,\n.colorpicker-button-group-active:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/color/color.vue"],names:[],mappings:";AAmMA;EACA,cAAA;AACA;AAEA;EACA,UAAA;AACA;AAEA;EACA,eAAA;EACA,eAAA;EACA,0BAAA;EACA,cAAA;AACA;AAEA;;;EAGA,SAAA;EACA,0BAAA;AACA;AAEA;EACA,yBAAA;AACA;AAEA;EACA,iBAAA;EACA,eAAA;EACA,kBAAA;EACA,YAAA;EACA,0BAAA;EACA,cAAA;AACA;AAEA;;;EAGA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,SAAA;EACA,iBAAA;EACA,0BAAA;AACA;AAEA;;EAEA,yBAAA;AACA;AAEA;;;EAGA,qBAAA;AACA;AAEA;EACA,yBAAA;AACA;AACA;;EAEA,yBAAA;AACA",file:"color.vue",sourcesContent:['<template>\n <div\n :class="[\n \'toolbar-dropdown\',\n \'colorpicker-button\',\n { \'toolbar-dropdown-right\': isRight },\n ]"\n ref="buttonRef"\n >\n <div\n :class="[\n \'toolbar-dropdown-trigger colorpicker-button-group\',\n { \'colorpicker-button-group-active\': visible },\n ]"\n >\n <am-button\n class="colorpicker-button-text"\n :name="name"\n :title="buttonTitle"\n :on-click="triggerClick"\n :placement="placement"\n :disabled="disabled"\n >\n <span v-html="buttonContent"></span>\n </am-button>\n <am-button\n class="colorpicker-button-dropdown toolbar-dropdown-trigger-arrow"\n :name="name"\n :title="dropdownTitle"\n :on-click="toggleDropdown"\n :placement="placement"\n :disabled="disabled"\n ref="targetRef"\n >\n <template #icon>\n <span class="colorpicker-button-dropdown-empty" />\n </template>\n <span class="data-icon data-icon-arrow" />\n </am-button>\n </div>\n <div\n v-if="visible"\n ref="elementRef"\n :class="[\n \'toolbar-dropdown-list\',\n { [`toolbar-dropdown-placement-${listPlacement}`]: !!listPlacement },\n ]"\n data-element="ui"\n >\n <am-color-picker\n :engine="engine"\n :colors="colors"\n :default-active-color="currentColor"\n :default-color="defaultColor"\n :on-select="triggerSelect"\n :set-stroke="setStroke"\n />\n </div>\n </div>\n</template>\n<script lang="ts">\nimport { Component, Prop, Vue, Watch } from "vue-property-decorator";\nimport { EngineInterface, isMobile, Placement, $ } from "@aomao/engine";\nimport AmButton from "../button.vue";\nimport AmColorPicker from "./picker/picker.vue";\nimport Palette from "./picker/palette";\nimport { Command } from "../../types";\n\n@Component({\n components: {\n AmButton,\n AmColorPicker,\n },\n})\nexport default class AmColor extends Vue {\n @Prop({ type: Object }) engine?: EngineInterface;\n @Prop({ type: String, required: true }) name!: string;\n @Prop({ type: [String, Function], required: true }) content!:\n | string\n | ((color: string, stroke: string, disabled?: boolean) => string);\n @Prop(String) buttonTitle?: string;\n @Prop(String) dropdownTitle?: string;\n @Prop({ type: Object }) command?: Command;\n @Prop({ type: [Boolean, Object], default: undefined }) autoExecute?: boolean;\n @Prop({ type: [Boolean, Object], default: undefined }) disabled?: boolean;\n @Prop(Array) colors?: string[][];\n @Prop({ type: String, required: true }) defaultColor!: string;\n @Prop({ type: String, required: true }) defaultActiveColor!: string;\n @Prop({ type: [Boolean, Object], default: undefined }) setStroke?: boolean;\n @Prop(Function) onSelect?: (color: string, event: MouseEvent) => void;\n @Prop({ type: [String], default: undefined }) placement?: Placement;\n\n visible = false;\n isRight = false;\n currentColor = "";\n buttonContent?: string = "";\n listPlacement = "";\n\n mounted() {\n if (this.$refs.buttonRef && isMobile) {\n const rect = (this.$refs.buttonRef as Element).getBoundingClientRect();\n this.isRight = rect.left > window.visualViewport.width / 2;\n }\n this.currentColor = this.defaultActiveColor;\n }\n\n unmounted() {\n document.removeEventListener("click", this.hideDropdown);\n }\n @Watch("currentColor", { immediate: true, deep: true })\n @Watch("$props.disabled", { immediate: true, deep: true })\n getContent() {\n this.buttonContent =\n typeof this.content === "string"\n ? this.content\n : this.content(\n this.currentColor,\n Palette.getStroke(this.currentColor),\n this.disabled\n );\n }\n\n toggleDropdown(event: MouseEvent) {\n event.preventDefault();\n if (this.visible) {\n this.hideDropdown();\n } else {\n this.showDropdown();\n }\n }\n\n showDropdown() {\n this.visible = true;\n }\n\n hideDropdown(event?: MouseEvent) {\n if (\n event &&\n this.$refs.targetRef &&\n ((this.$refs.targetRef as Vue).$refs.element as Element).contains(\n event.target as Node\n )\n )\n return;\n this.visible = false;\n }\n\n @Watch("visible", { immediate: true, deep: true })\n watch(value: boolean) {\n if (value) {\n document.addEventListener("click", this.hideDropdown);\n setTimeout(() => {\n const current = this.$refs.elementRef;\n if (!current || !this.engine || !this.engine.scrollNode) return;\n const scrollElement = this.engine.scrollNode.get<HTMLElement>();\n if (!scrollElement) return;\n const rect = (current as Element).getBoundingClientRect();\n const scrollRect = scrollElement.getBoundingClientRect();\n if (rect.top < scrollRect.top) this.listPlacement = "bottom";\n if (rect.bottom > scrollRect.bottom) this.listPlacement = "top";\n }, 0);\n }\n else document.removeEventListener("click", this.hideDropdown);\n }\n\n triggerClick(event: MouseEvent) {\n this.triggerSelect(this.currentColor, event);\n }\n\n triggerSelect(color: string, event: MouseEvent) {\n this.hideDropdown();\n this.currentColor = color;\n this.buttonContent =\n typeof this.content === "string"\n ? this.content\n : this.content(color, Palette.getStroke(color), this.disabled);\n\n if (this.autoExecute !== false) {\n let commandName = this.name;\n let commandArgs = [color, this.defaultColor];\n if (this.command) {\n if (!Array.isArray(this.command)) {\n commandName = this.command.name;\n commandArgs = this.command.args;\n } else {\n commandArgs = this.command;\n }\n }\n if (this.engine) this.engine.command.execute(commandName, ...commandArgs);\n }\n if (this.onSelect) this.onSelect(color, event);\n }\n}\n<\/script>\n<style>\n.editor-toolbar .colorpicker-button .colorpicker-button-group {\n padding: 0 2px;\n}\n\n.colorpicker-button-group .toolbar-button {\n padding: 0;\n}\n\n.colorpicker-button-group .colorpicker-button-text {\n margin-right: 0;\n min-width: 26px;\n border-radius: 3px 0 0 3px;\n display: block;\n}\n\n.editor-toolbar.editor-toolbar-popup\n .colorpicker-button-group\n .colorpicker-button-text {\n margin: 0;\n border-radius: 3px 0 0 3px;\n}\n\n.colorpicker-button-group .colorpicker-button-text:active {\n background-color: #e8e8e8;\n}\n\n.colorpicker-button-group .colorpicker-button-dropdown {\n margin-left: -1px;\n min-width: 17px;\n text-align: center;\n padding: 0 0;\n border-radius: 0 3px 3px 0;\n display: block;\n}\n\n.editor-toolbar.editor-toolbar-popup\n .colorpicker-button-group\n .colorpicker-button-dropdown {\n line-height: 24px;\n min-width: 17px;\n padding: 0 4px;\n margin: 0;\n margin-left: -1px;\n border-radius: 0 3px 3px 0;\n}\n\n.colorpicker-button-group .colorpicker-button-dropdown:hover,\n.colorpicker-button-group .colorpicker-button-dropdown:active {\n background-color: #e8e8e8;\n}\n\n.colorpicker-button-group\n .colorpicker-button-dropdown\n .colorpicker-button-dropdown-empty {\n display: inline-block;\n}\n\n.colorpicker-button-group:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n.colorpicker-button-group-active .toolbar-button,\n.colorpicker-button-group-active:hover .toolbar-button {\n border: 1px solid #e8e8e8;\n}\n</style>\n']},media:void 0})},ge=void 0,me=void 0,ve=!1,be=J({render:he,staticRenderFns:pe},fe,de,ge,ve,me,!1,tt,void 0,void 0);var ye=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.iconIsHtml=!1,t.active=!1,t}return Object(a["a"])(n,[{key:"mounted",value:function(){this.iconIsHtml=/^<.*>/.test(this.icon?this.icon.trim():"")}},{key:"handleMouseDown",value:function(t){t.preventDefault(),this.onMouseDown&&this.onMouseDown(t)}},{key:"handleClick",value:function(t){if(!this.disabled){var e=t.target.nodeName;if("INPUT"!==e&&"TEXTAREA"!==e&&t.preventDefault(),(!this.onClick||!1!==this.onClick(t,this.name,this.engine))&&!1!==this.autoExecute){var n,r=this.name,i=[];this.command&&(Array.isArray(this.command)?i=this.command:(r=this.command.name,i=this.command.args)),this.engine&&(n=this.engine.command).execute.apply(n,[r].concat(Object(f["a"])(i)))}}}},{key:"triggerMouseEnter",value:function(){this.active=!this.disabled}},{key:"triggerMouseLeave",value:function(){this.active=!1}}]),n}(c["default"]);A([$({type:Object})],ye.prototype,"engine",void 0),A([$({type:String,required:!0})],ye.prototype,"name",void 0),A([$({type:String,default:void 0})],ye.prototype,"icon",void 0),A([$({type:String})],ye.prototype,"search",void 0),A([$({type:[String,Function]})],ye.prototype,"description",void 0),A([$({type:String})],ye.prototype,"title",void 0),A([$({type:String})],ye.prototype,"placement",void 0),A([$({type:Object})],ye.prototype,"command",void 0),A([$({type:[Boolean,Object],default:void 0})],ye.prototype,"autoExecute",void 0),A([$({type:String})],ye.prototype,"className",void 0),A([$({type:[Boolean,Object],default:void 0})],ye.prototype,"disabled",void 0),A([$({type:[String,Function,Object]})],ye.prototype,"prompt",void 0),A([$(Function)],ye.prototype,"onClick",void 0),A([$(Function)],ye.prototype,"onMouseDown",void 0),ye=A([q({components:{"a-popover":h["default"]}})],ye);var we=ye;const xe=we;var Ce=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("a-popover",{attrs:{placement:t.placement||"right",content:"function"===typeof t.prompt?t.prompt(t.$props):t.prompt,overlayClassName:t.prompt?"":"prompt-popover-hide"}},[n("div",{class:["toolbar-collapse-item",{"toolbar-collapse-item-active":t.active},{"toolbar-collapse-item-disabled":t.disabled},t.className],on:{mouseenter:t.triggerMouseEnter,mouseleave:t.triggerMouseLeave,click:t.handleClick,mousedown:t.handleMouseDown}},[t._t("icon",(function(){return[t.iconIsHtml?n("span",{domProps:{innerHTML:t._s(t.icon)}}):t._e(),t._v(" "),!t.iconIsHtml&&t.icon?n("span",{class:"data-icon data-icon-"+t.icon}):t._e()]})),t._v(" "),t.title?n("div",{staticClass:"toolbar-collapse-item-text"},[n("div",{staticClass:"toolbar-collapse-item-title"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),t.description?n("div",{staticClass:"toolbar-collapse-item-description"},[t._v("\n "+t._s(t.description)+"\n ")]):t._e()]):t._e()],2)])},ke=[];Ce._withStripped=!0;const Ae=function(t){t&&t("data-v-ed80cffa_0",{source:"\n.prompt-popover-hide {\n display: none;\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/collapse/item.vue"],names:[],mappings:";AAoHA;EACA,aAAA;AACA",file:"item.vue",sourcesContent:['<template>\n <a-popover\n :placement="placement || \'right\'"\n :content="typeof prompt === \'function\' ? prompt($props) : prompt"\n :overlayClassName="prompt ? \'\' : \'prompt-popover-hide\'"\n >\n <div\n :class="[\n \'toolbar-collapse-item\',\n { \'toolbar-collapse-item-active\': active },\n { \'toolbar-collapse-item-disabled\': disabled },\n className,\n ]"\n @mouseenter="triggerMouseEnter"\n @mouseleave="triggerMouseLeave"\n @click="handleClick"\n @mousedown="handleMouseDown"\n >\n <slot name="icon">\n <span v-if="iconIsHtml" v-html="icon"></span>\n <span\n v-if="!iconIsHtml && icon"\n :class="`data-icon data-icon-${icon}`"\n />\n </slot>\n <div v-if="title" class="toolbar-collapse-item-text">\n <div class="toolbar-collapse-item-title">\n {{ title }}\n </div>\n <div v-if="description" class="toolbar-collapse-item-description">\n {{ description }}\n </div>\n </div>\n </div>\n </a-popover>\n</template>\n<script lang="ts">\nimport { Component, Prop, Vue } from "vue-property-decorator";\nimport { Popover } from "ant-design-vue";\nimport { VNode } from "vue";\nimport { EngineInterface, Placement } from "@aomao/engine";\nimport { Command } from "../../types";\n\n@Component({\n components: {\n "a-popover": Popover,\n },\n})\nexport default class CollapseItem extends Vue {\n @Prop({ type: Object }) engine?: EngineInterface;\n @Prop({ type: String, required: true }) name!: string;\n @Prop({ type: String, default: undefined }) icon?: string;\n @Prop({ type: String }) search?: string;\n @Prop({ type: [String, Function] }) description?:\n | string\n | (() => string)\n | VNode;\n @Prop({ type: String }) title?: string;\n @Prop({ type: String }) placement?: Placement;\n @Prop({ type: Object }) command?: Command;\n @Prop({ type: [Boolean, Object], default: undefined }) autoExecute?: boolean;\n @Prop({ type: String }) className?: string;\n @Prop({ type: [Boolean, Object], default: undefined }) disabled?: boolean;\n @Prop({ type: [String, Function, Object] }) prompt?:\n | string\n | ((props: any) => string) | ((props: any) => VNode)\n | VNode;\n @Prop(Function) onClick?: (event: MouseEvent, name: string, engine?: EngineInterface) => void | boolean;\n @Prop(Function) onMouseDown?: (event: MouseEvent) => void | boolean;\n\n iconIsHtml = false;\n active = false;\n\n mounted() {\n this.iconIsHtml = /^<.*>/.test(this.icon ? this.icon.trim() : "");\n }\n\n handleMouseDown(event: MouseEvent) {\n event.preventDefault();\n if (this.onMouseDown) this.onMouseDown(event);\n }\n\n handleClick(event: MouseEvent) {\n if (this.disabled) return;\n\n const nodeName = (event.target as Node).nodeName;\n if (nodeName !== "INPUT" && nodeName !== "TEXTAREA") event.preventDefault();\n\n if (this.onClick && this.onClick(event, this.name, this.engine) === false) {\n return;\n }\n if (this.autoExecute !== false) {\n let commandName = this.name;\n let commandArgs = [];\n if (this.command) {\n if (!Array.isArray(this.command)) {\n commandName = this.command.name;\n commandArgs = this.command.args;\n } else {\n commandArgs = this.command;\n }\n }\n if (this.engine) this.engine.command.execute(commandName, ...commandArgs);\n }\n }\n\n triggerMouseEnter() {\n this.active = this.disabled ? false : true;\n }\n\n triggerMouseLeave() {\n this.active = false;\n }\n}\n<\/script>\n<style>\n.prompt-popover-hide {\n display: none;\n}\n</style>\n']},media:void 0})},Se=void 0,Ee=void 0,Oe=!1,Te=J({render:Ce,staticRenderFns:ke},Ae,xe,Se,Oe,Ee,!1,tt,void 0,void 0);var _e=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.handleOmit=u["omit"],t}return Object(a["a"])(n,[{key:"onClick",value:function(t,e,n){var r,i=this.items.find((function(t){return t.name===e}));return i&&i.onClick&&(r=i.onClick(t,e,n)),this.onSelect&&this.onSelect(t,e,n),r}}]),n}(c["default"]);A([$(Object)],_e.prototype,"engine",void 0),A([$(String)],_e.prototype,"title",void 0),A([$({type:Array,required:!0,default:[]})],_e.prototype,"items",void 0),A([$(Function)],_e.prototype,"onSelect",void 0),_e=A([q({components:{AmCollapseItem:Te}})],_e);var Me=_e;const Ne=Me;var Pe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"toolbar-collapse-group"},[t.title?n("div",{staticClass:"toolbar-collapse-group-title"},[t._v(t._s(t.title))]):t._e(),t._v(" "),t._l(t.items,(function(e){return n("am-collapse-item",t._b({key:e.name,attrs:{engine:t.engine,"on-click":t.onClick}},"am-collapse-item",Object.assign({},t.handleOmit(e,"onClick","onDisabled")),!1))}))],2)},Le=[];Pe._withStripped=!0;const De=void 0,je=void 0,Ie=void 0,Re=!1,Fe=J({render:Pe,staticRenderFns:Le},De,Ne,je,Re,Ie,!1,void 0,void 0,void 0);var Be=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.isCustomize=!1,t.visible=!1,t.isRight=!1,t}return Object(a["a"])(n,[{key:"show",value:function(){var t=this;this.visible=!0,setTimeout((function(){document.addEventListener("click",t.hide)}),10)}},{key:"hide",value:function(t){document.removeEventListener("click",this.hide),this.visible=!1}},{key:"mounted",value:function(){if(this.isCustomize=!(this.icon||this.content),this.visible=this.isCustomize,this.$refs.collapse&&d["isMobile"]){var t=this.$refs.collapse.getBoundingClientRect();this.isRight=t.left>window.visualViewport.width/2}}},{key:"unmounted",value:function(){this.isCustomize&&document.removeEventListener("click",this.hide)}},{key:"triggerClick",value:function(){this.visible?this.hide():this.show()}},{key:"triggerSelect",value:function(t,e){this.hide(),this.onSelect&&this.onSelect(t,e)}}]),n}(c["default"]);A([$(Object)],Be.prototype,"engine",void 0),A([$(String)],Be.prototype,"header",void 0),A([$({type:Array,required:!0,default:[]})],Be.prototype,"groups",void 0),A([$({type:[Boolean,Object],default:void 0})],Be.prototype,"disabled",void 0),A([$(String)],Be.prototype,"className",void 0),A([$({type:String,default:void 0})],Be.prototype,"icon",void 0),A([$({type:[String,Function],default:void 0})],Be.prototype,"content",void 0),A([$(Function)],Be.prototype,"onSelect",void 0),Be=A([q({components:{AmButton:dt,AmCollapseGroup:Fe}})],Be);var ze=Be;const He=ze;var Ve=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"collapse",class:["toolbar-dropdown toolbar-collapse",{"toolbar-dropdown-right":t.isRight},t.className]},[t.isCustomize?t._e():n("am-button",{attrs:{name:"collapse",icon:t.icon,content:t.content,"on-click":t.triggerClick,active:t.visible,disabled:t.disabled}}),t._v(" "),t.visible?n("div",{staticClass:"toolbar-dropdown-list",attrs:{"data-element":"ui"}},[t._t("header",(function(){return[t.header?n("div",{staticClass:"toolbar-collapse-header",domProps:{innerHTML:t._s(t.header)}}):t._e()]})),t._v(" "),n("div",{staticClass:"toolbar-collapse-content"},t._l(t.groups,(function(e,r){return n("am-collapse-group",t._b({key:r,attrs:{engine:t.engine,"on-select":t.triggerSelect}},"am-collapse-group",e,!1))})),1)],2):t._e()],1)},qe=[];Ve._withStripped=!0;const Ue=function(t){t&&t("data-v-54003d33_0",{source:"\n.toolbar-collapse-header {\n color: #8c8c8c;\n margin: 4px 16px 0;\n font-size: 12px;\n line-height: 20px;\n text-align: left;\n padding-bottom: 8px;\n margin-bottom: 6px;\n border-bottom: 1px solid #e8e8e8;\n}\n.toolbar-collapse-header code{\n background-color: #f5f5f5;\n border-radius: 4px;\n padding: 2px;\n border: 1px solid #d9d9d9;\n}\n.toolbar-collapse-content {\n min-width: 200px\n}\n.toolbar-collapse-group-title {\n padding: 2px 16px;\n text-align: left;\n color: #8c8c8c;\n font-weight: 700;\n font-size: 12px;\n line-height: 24px;\n}\n.toolbar-collapse-item {\n display: flex;\n cursor: pointer;\n padding: 4px 16px 0;\n}\n.toolbar-collapse-item-active {\n background-color: #f4f4f4;\n}\n.editor-toolbar .toolbar-collapse-item-disabled, .data-toolbar-component-list .toolbar-collapse-item-disabled, .editor-toolbar:not(.editor-toolbar-mobile) .toolbar-collapse-item-disabled:hover, .data-toolbar-component-list .toolbar-collapse-item-disabled:hover {\n background-color: transparent;\n border: 1px solid transparent;\n box-shadow: none;\n color: #000000;\n opacity: 0.25;\n cursor: not-allowed;\n}\n.toolbar-collapse-item .toolbar-collapse-item-text\n{\n display: block;\n text-align: left;\n margin-left: 8px;\n}\n.toolbar-collapse-item .toolbar-collapse-item-title{\n display: block;\n color: #595959;\n line-height: 24px;\n font-size: 14px;\n font-weight: normal;\n}\n.toolbar-collapse-item .toolbar-collapse-item-description\n{\n display: block;\n font-size: 12px;\n color: rgba(0,0,0,.45);\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/collapse/collapse.vue"],names:[],mappings:";AA2GA;IACA,cAAA;IACA,kBAAA;IACA,eAAA;IACA,iBAAA;IACA,gBAAA;IACA,mBAAA;IACA,kBAAA;IACA,gCAAA;AACA;AAEA;IACA,yBAAA;IACA,kBAAA;IACA,YAAA;IACA,yBAAA;AACA;AAEA;IACA;AACA;AAEA;IACA,iBAAA;IACA,gBAAA;IACA,cAAA;IACA,gBAAA;IACA,eAAA;IACA,iBAAA;AACA;AAEA;IACA,aAAA;IACA,eAAA;IACA,mBAAA;AACA;AAEA;IACA,yBAAA;AACA;AAEA;EACA,6BAAA;EACA,6BAAA;EACA,gBAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;AACA;AAEA;;IAEA,cAAA;IACA,gBAAA;IACA,gBAAA;AACA;AAEA;IACA,cAAA;IACA,cAAA;IACA,iBAAA;IACA,eAAA;IACA,mBAAA;AACA;AAEA;;IAEA,cAAA;IACA,eAAA;IACA,sBAAA;AACA",file:"collapse.vue",sourcesContent:['<template>\n <div\n :class="[\'toolbar-dropdown toolbar-collapse\', {\'toolbar-dropdown-right\': isRight},className]"\n ref="collapse"\n >\n <am-button\n v-if="!isCustomize"\n name="collapse"\n :icon="icon"\n :content="content"\n :on-click="triggerClick"\n :active="visible"\n :disabled="disabled"\n />\n <div v-if="visible" class="toolbar-dropdown-list" data-element="ui">\n <slot name="header">\n <div v-if="header" class="toolbar-collapse-header" v-html="header" />\n </slot>\n <div class="toolbar-collapse-content">\n <am-collapse-group \n v-for="(group,index) in groups"\n :key="index"\n :engine="engine"\n v-bind="group"\n :on-select="triggerSelect"\n />\n </div>\n </div>\n</div>\n</template>\n<script lang="ts">\nimport { Component, Prop, Vue } from "vue-property-decorator";\nimport { VNode } from "vue";\nimport { EngineInterface, isMobile } from "@aomao/engine";\nimport { CollapseGroupProps } from \'../../types\';\nimport AmButton from \'../button.vue\';\nimport AmCollapseGroup from \'./group.vue\';\n\n@Component({\n components: {\n AmButton,\n AmCollapseGroup\n },\n})\nexport default class AmCollapse extends Vue {\n @Prop(Object) engine?: EngineInterface\n @Prop(String) header?: string\n @Prop({ type: Array, required: true, default: [] }) groups!: Array<CollapseGroupProps>\n @Prop({ type: [Boolean, Object], default: undefined}) disabled?: boolean\n @Prop(String) className?: string\n\t@Prop({ type: String, default: undefined}) icon?: string\n @Prop({ type: [String, Function], default: undefined}) content?: string | (() => string) | VNode\n @Prop(Function) onSelect?: (event: MouseEvent, name: string) => boolean | void\n\n isCustomize = false\n visible = false\n isRight = false\n\n show(){\n this.visible = true\n setTimeout(() => {\n document.addEventListener(\'click\', this.hide);\n }, 10);\n };\n\n hide(event?: MouseEvent){\n if (event) {\n // let node = event.target;\n // while (node) {\n // if (node === collapse.value) {\n // return;\n // }\n // node = (node as Element).parentNode;\n // }\n }\n document.removeEventListener(\'click\', this.hide);\n this.visible = false\n };\n\n mounted(){\n this.isCustomize = !(this.icon || this.content);\n this.visible = this.isCustomize\n if (this.$refs.collapse && isMobile) {\n\t\t\tconst rect = (this.$refs.collapse as Element).getBoundingClientRect();\n\t\t\tthis.isRight = rect.left > window.visualViewport.width / 2;\n\t\t}\n }\n\n unmounted(){\n if(this.isCustomize) document.removeEventListener(\'click\', this.hide);\n }\n\n triggerClick(){\n if (this.visible) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n triggerSelect(event:MouseEvent,name:string){\n this.hide()\n if(this.onSelect) this.onSelect(event,name)\n }\n}\n<\/script>\n<style>\n.toolbar-collapse-header {\n color: #8c8c8c;\n margin: 4px 16px 0;\n font-size: 12px;\n line-height: 20px;\n text-align: left;\n padding-bottom: 8px;\n margin-bottom: 6px;\n border-bottom: 1px solid #e8e8e8;\n}\n\n.toolbar-collapse-header code{\n background-color: #f5f5f5;\n border-radius: 4px;\n padding: 2px;\n border: 1px solid #d9d9d9;\n}\n\n.toolbar-collapse-content {\n min-width: 200px\n}\n\n.toolbar-collapse-group-title {\n padding: 2px 16px;\n text-align: left;\n color: #8c8c8c;\n font-weight: 700;\n font-size: 12px;\n line-height: 24px;\n}\n\n.toolbar-collapse-item {\n display: flex;\n cursor: pointer;\n padding: 4px 16px 0;\n}\n\n.toolbar-collapse-item-active {\n background-color: #f4f4f4;\n}\n\n.editor-toolbar .toolbar-collapse-item-disabled, .data-toolbar-component-list .toolbar-collapse-item-disabled, .editor-toolbar:not(.editor-toolbar-mobile) .toolbar-collapse-item-disabled:hover, .data-toolbar-component-list .toolbar-collapse-item-disabled:hover {\n background-color: transparent;\n border: 1px solid transparent;\n box-shadow: none;\n color: #000000;\n opacity: 0.25;\n cursor: not-allowed;\n}\n\n.toolbar-collapse-item .toolbar-collapse-item-text\n{\n display: block;\n text-align: left;\n margin-left: 8px;\n}\n\n.toolbar-collapse-item .toolbar-collapse-item-title{\n display: block;\n color: #595959;\n line-height: 24px;\n font-size: 14px;\n font-weight: normal;\n}\n\n.toolbar-collapse-item .toolbar-collapse-item-description\n{\n display: block;\n font-size: 12px;\n color: rgba(0,0,0,.45);\n}\n</style>']},media:void 0})},We=void 0,$e=void 0,Ge=!1,Ye=J({render:Ve,staticRenderFns:qe},Ue,He,We,Ge,$e,!1,tt,void 0,void 0);var Xe=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.isMobile=!1,t}return Object(a["a"])(n,[{key:"mounted",value:function(){this.isMobile=d["isMobile"]}},{key:"getPopupContainer",value:function(){return document.querySelector(".data-toolbar-popup-wrapper")||document.querySelector(".editor-toolbar")||document.body}}]),n}(c["default"]);A([$(Object)],Xe.prototype,"engine",void 0),A([$({type:Array,default:[]})],Xe.prototype,"items",void 0),A([$(String)],Xe.prototype,"icon",void 0),A([$([String,Function])],Xe.prototype,"content",void 0),A([$(Boolean)],Xe.prototype,"popup",void 0),Xe=A([q({components:{AmButton:dt,AmCollapse:Ye,AmDropdown:Nt,AmColor:be,"a-popover":h["default"]}})],Xe);var Ke=Xe;const Ze=Ke;var Je=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"editor-toolbar-group"},[t.icon||t.content?n("a-popover",{attrs:{"get-popup-container":t.getPopupContainer,"overlay-class-name":"editor-toolbar-popover","arrow-point-at-center":!0,placement:t.isMobile?"topRight":void 0},scopedSlots:t._u([{key:"content",fn:function(){return[n("div",{class:["editor-toolbar",{"editor-toolbar-mobile":t.isMobile&&!t.popup,"editor-toolbar-popup":t.popup}],attrs:{"data-element":"ui"}},[t._l(t.items,(function(e,r){return["button"===e.type?n("am-button",t._b({key:r,attrs:{placement:"top",engine:t.engine}},"am-button",e,!1)):t._e(),t._v(" "),"dropdown"===e.type?n("am-dropdown",t._b({key:r,attrs:{placement:"top",engine:t.engine}},"am-dropdown",e,!1)):t._e(),t._v(" "),"color"===e.type?n("am-color",t._b({key:r,attrs:{placement:"top",engine:t.engine}},"am-color",e,!1)):t._e(),t._v(" "),"collapse"===e.type?n("am-collapse",t._b({key:r,attrs:{placement:"top",engine:t.engine}},"am-collapse",e,!1)):t._e()]}))],2)]},proxy:!0}],null,!1,2736660531)},[t._v(" "),n("am-button",{attrs:{name:"group-popover",icon:t.icon,content:t.content}})],1):t._e(),t._v(" "),t.icon||t.content?t._e():[t._l(t.items,(function(e,r){return["button"===e.type?n("am-button",t._b({key:r,attrs:{engine:t.engine}},"am-button",e,!1)):t._e(),t._v(" "),"dropdown"===e.type?n("am-dropdown",t._b({key:r,attrs:{engine:t.engine}},"am-dropdown",e,!1)):t._e(),t._v(" "),"color"===e.type?n("am-color",t._b({key:r,attrs:{engine:t.engine}},"am-color",e,!1)):t._e(),t._v(" "),"collapse"===e.type?n("am-collapse",t._b({key:r,attrs:{engine:t.engine}},"am-collapse",e,!1)):t._e()]}))]],2)},Qe=[];Je._withStripped=!0;const tn=function(t){t&&t("data-v-45231865_0",{source:"\n.editor-toolbar-group {\r\n padding: 4px;\r\n width: auto;\r\n border-left: 1px solid #e8e8e8;\r\n display: flex;\r\n align-items: stretch;\n}\n.editor-toolbar .editor-toolbar-group:nth-child(1) {\r\n border-left: none;\n}\r\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/group.vue"],names:[],mappings:";AA0EA;IACA,YAAA;IACA,WAAA;IACA,8BAAA;IACA,aAAA;IACA,oBAAA;AACA;AAEA;IACA,iBAAA;AACA",file:"group.vue",sourcesContent:['<template>\r\n <div class="editor-toolbar-group">\r\n <a-popover\r\n :get-popup-container="getPopupContainer"\r\n overlay-class-name="editor-toolbar-popover"\r\n :arrow-point-at-center="true"\r\n :placement="isMobile ? \'topRight\' : undefined"\r\n v-if="!!icon || !!content"\r\n >\r\n <template #content>\r\n <div :class="[\'editor-toolbar\', {\'editor-toolbar-mobile\': isMobile && !popup,\r\n \'editor-toolbar-popup\': popup,}]" data-element="ui">\r\n <template v-for="(item , index) in items">\r\n <am-button v-if="item.type === \'button\'" :key="index" v-bind="item" placement="top" :engine="engine" />\r\n <am-dropdown v-if="item.type === \'dropdown\'" :key="index" v-bind="item" placement="top" :engine="engine" />\r\n <am-color v-if="item.type === \'color\'" :key="index" v-bind="item" placement="top" :engine="engine" />\r\n <am-collapse v-if="item.type === \'collapse\'" :key="index" v-bind="item" placement="top" :engine="engine" />\r\n </template>\r\n </div>\r\n </template>\r\n <am-button name="group-popover" :icon="icon" :content="content" />\r\n </a-popover>\r\n <template v-if="!icon && !content">\r\n <template v-for="(item , index) in items">\r\n <am-button v-if="item.type === \'button\'" :key="index" v-bind="item" :engine="engine" />\r\n <am-dropdown v-if="item.type === \'dropdown\'" :key="index" v-bind="item" :engine="engine" />\r\n <am-color v-if="item.type === \'color\'" :key="index" v-bind="item" :engine="engine" />\r\n <am-collapse v-if="item.type === \'collapse\'" :key="index" v-bind="item" :engine="engine" />\r\n </template>\r\n </template>\r\n </div>\r\n</template>\r\n\r\n<script lang="ts">\r\nimport { Component, Vue, Prop } from "vue-property-decorator";\r\nimport { EngineInterface, isMobile } from \'@aomao/engine\'\r\nimport { Popover } from \'ant-design-vue\'\r\nimport AmButton from \'./button.vue\'\r\nimport { GroupButtonProps, GroupColorProps, GroupDropdownProps, ToolbarCollapseGroupProps } from "../types";\r\nimport { VNode } from "vue";\r\nimport AmDropdown from \'./dropdown.vue\'\r\nimport AmColor from \'./color/color.vue\'\r\nimport AmCollapse from \'./collapse/collapse.vue\'\r\n\r\n@Component({\r\n components:{\r\n AmButton,\r\n AmCollapse,\r\n AmDropdown,\r\n AmColor,\r\n \'a-popover\': Popover\r\n }\r\n})\r\nexport default class ToolbarGroup extends Vue {\r\n @Prop(Object) engine!: EngineInterface\r\n @Prop({ type: Array, default: []}) items!: (GroupButtonProps\r\n\t\t\t\t| GroupDropdownProps\r\n\t\t\t\t| GroupColorProps\r\n\t\t\t\t| ToolbarCollapseGroupProps)[]\r\n\t@Prop(String) icon?: string\r\n @Prop([String, Function]) content?: string | (() => string) | VNode\r\n @Prop(Boolean) popup?: boolean\r\n isMobile = false\r\n\r\n mounted() {\r\n this.isMobile = isMobile\r\n }\r\n\r\n getPopupContainer(){\r\n return document.querySelector(\'.data-toolbar-popup-wrapper\') || document.querySelector(\'.editor-toolbar\') || document.body\r\n }\r\n}\r\n<\/script>\r\n<style>\r\n.editor-toolbar-group {\r\n padding: 4px;\r\n width: auto;\r\n border-left: 1px solid #e8e8e8;\r\n display: flex;\r\n align-items: stretch;\r\n}\r\n\r\n.editor-toolbar .editor-toolbar-group:nth-child(1) {\r\n border-left: none;\r\n}\r\n</style>']},media:void 0})},en=void 0,nn=void 0,rn=!1,on=J({render:Je,staticRenderFns:Qe},tn,Ze,en,rn,nn,!1,tt,void 0,void 0);var an={toolbar:{collapse:{title:"Type <code>".concat(d["isMacos"]?"⌘":"Ctrl","</code> + <code>/</code> to quickly insert a card")},undo:{title:"Undo"},redo:{title:"Redo"},paintformat:{title:"Format brush"},removeformat:{title:"Clear format"},heading:{title:"Text and title",p:"Text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6"},fontfamily:{title:"Font family",notInstalled:"The font may not be installed",items:{default:"Default",arial:"Arial",comicSansMS:"Comic Sans MS",courierNew:"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact",timesNewRoman:"Times New Roman",trebuchetMS:"Trebuchet MS",verdana:"Verdana",fangSong:"FangSong",stFangsong:"STFangsong",stSong:"STSong",stKaiti:"STKaiti",simSun:"SimSum",microsoftYaHei:"Microsoft YaHei",kaiTi:"KaiTi",kaitiSC:"KaiTi SC",simHei:"SimHei",heitiSC:"Heiti SC",fzHei:"FZHeiTi",fzKai:"FZKaiTi",fzFangSong:"FZFangSong"}},fontsize:{title:"Font size"},fontcolor:{title:"Font color",more:"More colors"},backcolor:{title:"Background color",more:"More colors"},bold:{title:"Bold"},italic:{title:"Italic"},strikethrough:{title:"Strikethrough"},underline:{title:"Underline"},moremark:{title:"More text styles",sup:"Sup",sub:"Sub",code:"Inline code"},alignment:{title:"Alignment",left:"Align left",center:"Align center",right:"Align right",justify:"Align justify"},unorderedlist:{title:"Unordered list"},orderedlist:{title:"Ordered list"},tasklist:{title:"Task list"},indent:{title:"Ident",in:"Increase indent",out:"Reduce indent"},"line-height":{title:"Line height",default:"Default"},link:{title:"Insert Link"},quote:{title:"Insert reference"},hr:{title:"Insert dividing line"},colorPicker:{defaultText:"Default Color",nonFillText:"No fill color","#000000":"Black","#262626":"Dark Gray 3","#595959":"Dark Gray 2","#8C8C8C":"Dark Gray 1","#BFBFBF":"Gray","#D9D9D9":"Light Gray 4","#E9E9E9":"Light Gray 3","#F5F5F5":"Light Gray 2","#FAFAFA":"Light Gray 1","#FFFFFF":"White","#F5222D":"Red","#FA541C":"Chinese Red","#FA8C16":"Orange","#FADB14":"Yellow","#52C41A":"Green","#13C2C2":"Cyan","#1890FF":"Light Blue","#2F54EB":"Blue","#722ED1":"Purple","#EB2F96":"Magenta","#FFE8E6":"Red 1","#FFECE0":"Chinese Red 1","#FFEFD1":"Orange 1","#FCFCCA":"Yellow 1","#E4F7D2":"Green 1","#D3F5F0":"Cyan 1","#D4EEFC":"Light Blue 1","#DEE8FC":"Blue 1","#EFE1FA":"Purple 1","#FAE1EB":"Magenta 1","#FFA39E":"Red 2","#FFBB96":"Chinese Red 2","#FFD591":"Orange 2","#FFFB8F":"Yellow 2","#B7EB8F":"Green 2","#87E8DE":"Cyan 2","#91D5FF":"Light Blue 2","#ADC6FF":"Blue 2","#D3ADF7":"Purple 2","#FFADD2":"Magenta 2","#FF4D4F":"Red 3","#FF7A45":"Chinese Red 3","#FFA940":"Orange 3","#FFEC3D":"Yellow 3","#73D13D":"Green 3","#36CFC9":"Cyan 3","#40A9FF":"Light Blue 3","#597EF7":"Blue 3","#9254DE":"Purple 3","#F759AB":"Magenta 3","#CF1322":"Red 4","#D4380D":"Chinese Red 4","#D46B08":"Orange 4","#D4B106":"Yellow 4","#389E0D":"Green 4","#08979C":"Cyan 4","#096DD9":"Light Blue 4","#1D39C4":"Blue 4","#531DAB":"Purple 4","#C41D7F":"Magenta 4","#820014":"Red 5","#871400":"Chinese Red 5","#873800":"Orange 5","#614700":"Yellow 5","#135200":"Green 5","#00474F":"Cyan 5","#003A8C":"Light Blue 5","#061178":"Blue 5","#22075E":"Purple 5","#780650":"Magenta 5"},component:{placeholder:"Card name"},image:{title:"Image"},codeblock:{title:"Codeblock"},table:{title:"Table"},file:{title:"File"},video:{title:"Video"},math:{title:"Formula"},status:{title:"Status"},mind:{title:"Mind Map"},commonlyUsed:{title:"Commonly used"},searchEmtpy:{title:"No matching card"}}},sn={toolbar:{collapse:{title:"输入 <code>".concat(d["isMacos"]?"⌘":"Ctrl","</code> + <code>/</code> 快速插入卡片")},undo:{title:"撤销"},redo:{title:"重做"},paintformat:{title:"格式刷"},removeformat:{title:"清除格式"},heading:{title:"正文与标题",p:"正文",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},fontfamily:{title:"字体",notInstalled:"可能未安装该字体",items:{default:"默认",arial:"Arial",comicSansMS:"Comic Sans MS",courierNew:"Courier New",georgia:"Georgia",helvetica:"Helvetica",impact:"Impact",timesNewRoman:"Times New Roman",trebuchetMS:"Trebuchet MS",verdana:"Verdana",fangSong:"仿宋",stFangsong:"华文仿宋",stSong:"华文宋体",stKaiti:"华文楷体",simSun:"宋体",microsoftYaHei:"微软雅黑",kaiTi:"楷体",kaitiSC:"楷体-简",simHei:"黑体",heitiSC:"黑体-简",fzHei:"方正黑体",fzKai:"方正楷体",fzFangSong:"方正仿宋"}},fontsize:{title:"字号"},fontcolor:{title:"字体颜色",more:"更多颜色"},backcolor:{title:"背景颜色",more:"更多颜色"},bold:{title:"粗体"},italic:{title:"斜体"},strikethrough:{title:"删除线"},underline:{title:"下划线"},moremark:{title:"更多文本样式",sup:"上标",sub:"下标",code:"行内代码"},alignment:{title:"对齐方式",left:"左对齐",center:"居中对齐",right:"右对齐",justify:"两端对齐"},unorderedlist:{title:"无序列表"},orderedlist:{title:"有序列表"},tasklist:{title:"任务列表"},indent:{title:"缩进",in:"增加缩进",out:"减少缩进"},"line-height":{title:"行高",default:"默认"},link:{title:"链接"},quote:{title:"插入引用"},hr:{title:"插入分割线"},colorPicker:{defaultText:"默认",nonFillText:"无填充色","#000000":"黑色","#262626":"深灰 3","#595959":"深灰 2","#8C8C8C":"深灰 1","#BFBFBF":"灰色","#D9D9D9":"浅灰 4","#E9E9E9":"浅灰 3","#F5F5F5":"浅灰 2","#FAFAFA":"浅灰 1","#FFFFFF":"白色","#F5222D":"红色","#FA541C":"朱红","#FA8C16":"橙色","#FADB14":"黄色","#52C41A":"绿色","#13C2C2":"青色","#1890FF":"浅蓝","#2F54EB":"蓝色","#722ED1":"紫色","#EB2F96":"玫红","#FFE8E6":"红色 1","#FFECE0":"朱红 1","#FFEFD1":"橙色 1","#FCFCCA":"黄色 1","#E4F7D2":"绿色 1","#D3F5F0":"青色 1","#D4EEFC":"浅蓝 1","#DEE8FC":"蓝色 1","#EFE1FA":"紫色 1","#FAE1EB":"玫红 1","#FFA39E":"红色 2","#FFBB96":"朱红 2","#FFD591":"橙色 2","#FFFB8F":"黄色 2","#B7EB8F":"绿色 2","#87E8DE":"青色 2","#91D5FF":"浅蓝 2","#ADC6FF":"蓝色 2","#D3ADF7":"紫色 2","#FFADD2":"玫红 2","#FF4D4F":"红色 3","#FF7A45":"朱红 3","#FFA940":"橙色 3","#FFEC3D":"黄色 3","#73D13D":"绿色 3","#36CFC9":"青色 3","#40A9FF":"浅蓝 3","#597EF7":"蓝色 3","#9254DE":"紫色 3","#F759AB":"玫红 3","#CF1322":"红色 4","#D4380D":"朱红 4","#D46B08":"橙色 4","#D4B106":"黄色 4","#389E0D":"绿色 4","#08979C":"青色 4","#096DD9":"浅蓝 4","#1D39C4":"蓝色 4","#531DAB":"紫色 4","#C41D7F":"玫红 4","#820014":"红色 5","#871400":"朱红 5","#873800":"橙色 5","#614700":"黄色 5","#135200":"绿色 5","#00474F":"青色 5","#003A8C":"浅蓝 5","#061178":"蓝色 5","#22075E":"紫色 5","#780650":"玫红 5"},component:{placeholder:"卡片名称"},image:{title:"图片"},codeblock:{title:"代码块"},table:{title:"表格"},file:{title:"附件"},video:{title:"视频"},math:{title:"公式"},status:{title:"状态"},mind:{title:"脑图"},commonlyUsed:{title:"常用"},searchEmtpy:{title:"无匹配卡片"}}},ln={"en-US":an,"zh-CN":sn},cn=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.currentRows=4,t.currentCols=4,t.selectedRows=0,t.selectedCols=0,t}return Object(a["a"])(n,[{key:"triggerSelect",value:function(t,e,n){t.preventDefault(),this.onSelect&&this.onSelect(t,e+1,n+1)}},{key:"triggerHover",value:function(t,e){var n=Math.max(this.minRows,Math.min(this.maxRows,t+2)),r=Math.max(this.minCols,Math.min(this.maxCols,e+2));this.currentRows=n,this.currentCols=r,this.selectedRows=t+1,this.selectedCols=e+1}}]),n}(c["default"]);A([$({type:Number,default:10})],cn.prototype,"maxRows",void 0),A([$({type:Number,default:10})],cn.prototype,"maxCols",void 0),A([$({type:Number,default:4})],cn.prototype,"minRows",void 0),A([$({type:Number,default:4})],cn.prototype,"minCols",void 0),A([$(Function)],cn.prototype,"onSelect",void 0),cn=A([q({})],cn);var un=cn;const dn=un;var hn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"data-toolbar-table-selector",attrs:{"data-element":"ui"}},[t._l(t.currentRows,(function(e){return n("div",{key:e,staticClass:"data-toolbar-table-selector-tr"},t._l(t.currentCols,(function(r,i){return n("div",{key:i,class:[{"data-toolbar-table-selector-td":!0},{actived:e-1<t.selectedRows&&r-1<t.selectedCols}],on:{mousedown:function(n){return t.triggerSelect(n,e-1,r-1)},mouseover:function(n){return t.triggerHover(e-1,r-1)}}})})),0)})),t._v(" "),n("div",{staticClass:"data-toolbar-table-selector-info"},[t._v("\n "+t._s(void 0===t.selectedRows?0:t.selectedRows)+"x"+t._s(void 0===t.selectedCols?0:t.selectedCols)+"\n ")])],2)},pn=[];hn._withStripped=!0;const fn=function(t){t&&t("data-v-54af51ca_0",{source:"\n.data-toolbar-table-selector .data-toolbar-table-selector-tr {\n display: flex;\n flex-wrap: nowrap;\n}\n.data-toolbar-table-selector\n .data-toolbar-table-selector-tr\n .data-toolbar-table-selector-td {\n width: 20px;\n height: 16px;\n border: 1px solid #d9d9d9;\n margin-right: -1px;\n margin-bottom: -1px;\n cursor: pointer;\n}\n.data-toolbar-table-selector\n .data-toolbar-table-selector-tr\n .data-toolbar-table-selector-td.actived {\n background: #ddefff;\n}\n.data-toolbar-table-selector .data-toolbar-table-selector-info {\n text-align: center;\n}\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/table.vue"],names:[],mappings:";AA8DA;EACA,aAAA;EACA,iBAAA;AACA;AACA;;;EAGA,WAAA;EACA,YAAA;EACA,yBAAA;EACA,kBAAA;EACA,mBAAA;EACA,eAAA;AACA;AACA;;;EAGA,mBAAA;AACA;AACA;EACA,kBAAA;AACA",file:"table.vue",sourcesContent:['<template>\n <div data-element="ui" class="data-toolbar-table-selector">\n <div\n class="data-toolbar-table-selector-tr"\n v-for="row in currentRows"\n :key="row"\n >\n <div\n v-for="(col, index) in currentCols"\n :class="[\n { \'data-toolbar-table-selector-td\': true },\n { actived: row - 1 < selectedRows && col - 1 < selectedCols },\n ]"\n :key="index"\n @mousedown="triggerSelect($event, row - 1, col - 1)"\n @mouseover="triggerHover(row - 1, col - 1)"\n />\n </div>\n <div class="data-toolbar-table-selector-info">\n {{ selectedRows === undefined ? 0 : selectedRows }}x{{\n selectedCols === undefined ? 0 : selectedCols\n }}\n </div>\n </div>\n</template>\n\n<script lang="ts">\nimport { Component, Prop, Vue } from "vue-property-decorator";\n\n@Component({})\nexport default class TableSelector extends Vue {\n @Prop({ type: Number, default: 10 }) maxRows!: number;\n @Prop({ type: Number, default: 10 }) maxCols!: number;\n @Prop({ type: Number, default: 4 }) minRows!: number;\n @Prop({ type: Number, default: 4 }) minCols!: number;\n @Prop(Function) onSelect?: (\n event: MouseEvent,\n rows: number,\n cols: number\n ) => void;\n\n currentRows = 4;\n currentCols = 4;\n selectedRows = 0;\n selectedCols = 0;\n\n triggerSelect(event: MouseEvent, rows: number, cols: number) {\n event.preventDefault();\n if (this.onSelect) this.onSelect(event, rows + 1, cols + 1);\n }\n\n triggerHover(rows: number, cols: number) {\n const showRows = Math.max(this.minRows, Math.min(this.maxRows, rows + 2));\n const showCols = Math.max(this.minCols, Math.min(this.maxCols, cols + 2));\n this.currentRows = showRows;\n this.currentCols = showCols;\n this.selectedRows = rows + 1;\n this.selectedCols = cols + 1;\n }\n}\n<\/script>\n<style>\n.data-toolbar-table-selector .data-toolbar-table-selector-tr {\n display: flex;\n flex-wrap: nowrap;\n}\n.data-toolbar-table-selector\n .data-toolbar-table-selector-tr\n .data-toolbar-table-selector-td {\n width: 20px;\n height: 16px;\n border: 1px solid #d9d9d9;\n margin-right: -1px;\n margin-bottom: -1px;\n cursor: pointer;\n}\n.data-toolbar-table-selector\n .data-toolbar-table-selector-tr\n .data-toolbar-table-selector-td.actived {\n background: #ddefff;\n}\n.data-toolbar-table-selector .data-toolbar-table-selector-info {\n text-align: center;\n}\n</style>\n']},media:void 0})},gn=void 0,mn=void 0,vn=!1,bn=J({render:hn,staticRenderFns:pn},fn,dn,gn,vn,mn,!1,tt,void 0,void 0);var yn=[{key:"default",value:""},{key:"arial",value:"Arial"},{key:"comicSansMS",value:'"Comic Sans MS"'},{key:"courierNew",value:'"Courier New"'},{key:"georgia",value:"Georgia"},{key:"helvetica",value:"Helvetica"},{key:"impact",value:"Impact"},{key:"timesNewRoman",value:'"Times New Roman"'},{key:"trebuchetMS",value:'"Trebuchet MS"'},{key:"verdana",value:"Verdana"},{key:"fangSong",value:"FangSong, 仿宋, FZFangSong-Z02S, STFangsong, fangsong"},{key:"stFangsong",value:"STFangsong, 华文仿宋, FangSong, FZFangSong-Z02S, fangsong"},{key:"stSong",value:'STSong, 华文宋体, SimSun, "Songti SC", NSimSun, serif'},{key:"stKaiti",value:'STKaiti, 华文楷体, KaiTi, "Kaiti SC", cursive'},{key:"simSun",value:'SimSun, 宋体, "Songti SC", NSimSun, STSong, serif'},{key:"microsoftYaHei",value:'"Microsoft YaHei", 微软雅黑, "PingFang SC", SimHei, STHeiti, sans-serif'},{key:"kaiTi",value:'KaiTi, 楷体, STKaiti, "Kaiti SC", cursive'},{key:"kaitiSC",value:'"Kaiti SC"'},{key:"simHei",value:'SimHei, 黑体, "Microsoft YaHei", "PingFang SC", STHeiti, sans-serif'},{key:"heitiSC",value:'"Heiti SC"'},{key:"fzHei",value:"FZHei-B01S"},{key:"fzKai",value:"FZKai-Z03S"},{key:"fzFangSong",value:"FZFangSong-Z02S"}],wn=function(t,e){return t.map((function(t){var n=t.key,r=t.value,i="default"!==n&&!r.split(",").some((function(t){return X(t.trim())}));return{key:r,faimlyName:e?e[n]:n,content:'<span style="font-family: '.concat(r,'">').concat(e?e[n]:n,"</span>"),hotkey:!1,disabled:i,title:i?e&&e["notInstalled"]||"The font may not be installed":void 0}}))};function xn(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var Cn=".editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .toolbar-button {\n font-weight: bold;\n min-width: 73px;\n}\n\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h1,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h2,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h3,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h4,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h5,\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h6 {\n line-height: 1.6;\n font-weight: bold;\n color: #262626;\n}\n\n.heading-item-h1 {\n font-size: 28px;\n}\n\n.heading-item-h2 {\n font-size: 24px;\n}\n\n.heading-item-h3 {\n font-size: 20px;\n}\n\n.heading-item-h4 {\n font-size: 16px;\n}\n\n.heading-item-h5 {\n font-size: 14px;\n}\n\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-heading .heading-item-h6 {\n font-size: 14px;\n font-weight: normal;\n}\n\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-fontsize .toolbar-button {\n font-weight: bold;\n min-width: 58px;\n}\n\n.editor-toolbar .toolbar-dropdown.toolbar-dropdown-fontfamily .toolbar-button {\n font-size: 12px;\n}";xn(Cn);var kn=function(t){var e=t.language.get("toolbar");return[{type:"collapse",header:e["collapse"]["title"],icon:"collapse",groups:[{items:[{name:"image-uploader",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\t\t\t\t\t\twidth="24"\n\t\t\t\t\t\t\t\t\t\theight="24"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<g fill="none" fill-rule="evenodd">\n\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\tstroke="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=".667"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFF"\n\t\t\t\t\t\t\t\t\t\t\t\tx=".333"\n\t\t\t\t\t\t\t\t\t\t\t\ty=".333"\n\t\t\t\t\t\t\t\t\t\t\t\twidth="23.333"\n\t\t\t\t\t\t\t\t\t\t\t\theight="23.333"\n\t\t\t\t\t\t\t\t\t\t\t\trx="1.333"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<g fill-rule="nonzero">\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\td="M8.625 8a1.126 1.126 0 010 2.25 1.126 1.126 0 010-2.25z"\n\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFD666"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\td="M17.95 14.88a.144.144 0 01-.092.033H6.14a.139.139 0 01-.14-.137.14.14 0 01.033-.089l2.981-3.45a.143.143 0 01.198-.018c.005.005.012.01.017.017l1.74 2.016 2.767-3.203a.143.143 0 01.198-.017l.018.017 4.018 4.64a.137.137 0 01-.02.191z"\n\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#CCC"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\td="M17.91 14.88a.144.144 0 01-.092.033H9.333l4.363-4.864a.143.143 0 01.198-.017l.018.017 4.018 4.64a.137.137 0 01-.02.191z"\n\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#737373"\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</span>',title:e["image"]["title"],search:"图片,tupian,image,img"},{name:"codeblock",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\t\t\t\t\t\twidth="24"\n\t\t\t\t\t\t\t\t\t\theight="24"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<g fill="none" fill-rule="evenodd">\n\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\tstroke="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFF"\n\t\t\t\t\t\t\t\t\t\t\t\tx=".5"\n\t\t\t\t\t\t\t\t\t\t\t\ty=".5"\n\t\t\t\t\t\t\t\t\t\t\t\twidth="23"\n\t\t\t\t\t\t\t\t\t\t\t\theight="23"\n\t\t\t\t\t\t\t\t\t\t\t\trx="2"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\td="M19.331 11.815c-.407-.22-.665-.678-.665-1.181V8.062c0-.202-.148-.367-.33-.367h-.933a.153.153 0 01-.153-.153v-.64c0-.084.068-.152.153-.152h.933c.651 0 1.18.588 1.18 1.312v2.572c0 .14.072.269.186.33l.843.455c.05.026.08.078.08.134v.894c0 .056-.03.108-.08.134l-.843.455a.373.373 0 00-.186.33v2.572c0 .724-.529 1.312-1.18 1.312h-.933a.153.153 0 01-.153-.153v-.64c0-.084.068-.152.153-.152h.933c.182 0 .33-.165.33-.367v-2.572c0-.503.258-.961.665-1.18l.344-.186-.344-.185zM5.044 11.815c.407-.22.665-.678.665-1.181V8.062c0-.202.148-.367.33-.367h.933a.153.153 0 00.153-.153v-.64a.153.153 0 00-.153-.152H6.04c-.651 0-1.18.588-1.18 1.312v2.572c0 .14-.072.269-.186.33l-.843.455a.153.153 0 00-.08.134v.894c0 .056.03.108.08.134l.843.455c.114.061.186.19.186.33v2.572c0 .724.529 1.312 1.18 1.312h.933a.153.153 0 00.153-.153v-.64a.153.153 0 00-.153-.152H6.04c-.182 0-.33-.165-.33-.367v-2.572c0-.503-.258-.961-.665-1.18L4.7 12l.344-.185z"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#595959"\n\t\t\t\t\t\t\t\t\t\t\t\tfill-rule="nonzero"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#1890FF"\n\t\t\t\t\t\t\t\t\t\t\t\topacity=".25"\n\t\t\t\t\t\t\t\t\t\t\t\td="M8.25 8.25h7.5v1.125h-7.5z"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#D2E8DB"\n\t\t\t\t\t\t\t\t\t\t\t\td="M8.25 10.5h4.5v1.125h-4.5z"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#E0E0E0"\n\t\t\t\t\t\t\t\t\t\t\t\td="M8.25 12.75h4.5v1.125h-4.5zM8.25 15h6v1.125h-6z"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</span>',title:e["codeblock"]["title"],search:"代码块,daimakuai,code"},{name:"table",command:{name:"table",args:[3,3]},placement:"rightTop",onDisabled:function(){return!!t.card.active||!t.command.queryEnabled("table")},prompt:t.card.active||!t.command.queryEnabled("table")?void 0:function(e){return(new c["default"]).$createElement(bn,{props:{onSelect:function(n,r,i){e.onClick&&e.onClick(n,"table"),t.command.execute("table",r,i)}}})},icon:'<span><svg\n\t\t\t\t\t\t\t\t\twidth="24px"\n\t\t\t\t\t\t\t\t\theight="24px"\n\t\t\t\t\t\t\t\t\tview-box="0 0 24 24"\n\t\t\t\t\t\t\t\t\tversion="1.1"\n\t\t\t\t\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<g\n\t\t\t\t\t\t\t\t\t\tstroke="none"\n\t\t\t\t\t\t\t\t\t\tstroke-width="1"\n\t\t\t\t\t\t\t\t\t\tfill="none"\n\t\t\t\t\t\t\t\t\t\tfill-rule="evenodd"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<g transform="translate(-16.000000, -93.000000)">\n\t\t\t\t\t\t\t\t\t\t\t<g>\n\t\t\t\t\t\t\t\t\t\t\t\t<g transform="translate(16.000000, 53.000000)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<g transform="translate(0.000000, 40.000000)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<g>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.666666667"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFFFFF"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="0.333333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="0.333333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="23.3333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="23.3333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trx="1.33333333"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<g transform="translate(5.250000, 6.750000)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td="M0.75,0 L3.75,0 L3.75,10.5 L0.75,10.5 C0.335786438,10.5 5.07265313e-17,10.1642136 0,9.75 L0,0.75 C-5.07265313e-17,0.335786438 0.335786438,7.6089797e-17 0.75,0 Z"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#F0F0F0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></path>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td="M0.25,2.75 L13.25,2.75 L13.25,0.75 C13.25,0.473857625 13.0261424,0.25 12.75,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,2.75 Z"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#595959"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill-opacity="0.15"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#25B864"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></path>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="5.25"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="13.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle-Copy"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="7.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="13.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="6.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="10.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle-Copy-5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="9.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="0"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="1"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="10.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#737373"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tx="0.375"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ty="0.375"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth="12.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theight="9.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trx="0.75"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></rect>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td="M3.5,10.25 L3.5,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,9.75 C0.25,10.0261424 0.473857625,10.25 0.75,10.25 L3.5,10.25 Z"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#737373"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></path>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td="M0.25,2.75 L13.25,2.75 L13.25,0.75 C13.25,0.473857625 13.0261424,0.25 12.75,0.25 L0.75,0.25 C0.473857625,0.25 0.25,0.473857625 0.25,0.75 L0.25,2.75 Z"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid="Rectangle"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke="#737373"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width="0.5"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t></path>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t</svg></span>',title:e["table"]["title"],search:"biaoge,table"},{name:"file-uploader",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\twidth="24"\n\t\t\t\t\t\t\t\t\t\theight="24"\n\t\t\t\t\t\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<g fill="none" fill-rule="evenodd">\n\t\t\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\t\t\tstroke="#E8E8E8"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#FFF"\n\t\t\t\t\t\t\t\t\t\t\t\tx=".5"\n\t\t\t\t\t\t\t\t\t\t\t\ty=".5"\n\t\t\t\t\t\t\t\t\t\t\t\twidth="23"\n\t\t\t\t\t\t\t\t\t\t\t\theight="23"\n\t\t\t\t\t\t\t\t\t\t\t\trx="2"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#E0E0E0"\n\t\t\t\t\t\t\t\t\t\t\t\td="M11.25 15h8.25v1.125h-8.25zM14.25 11.25h5.25v1.125h-5.25zM14.25 8.25h5.25v1.125h-5.25z"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\td="M11.216 8.324a2.593 2.593 0 00-3.791 0l-2.896 3.04a.108.108 0 00-.029.074c0 .028.01.055.029.075l.41.43c.038.041.101.041.14 0l2.896-3.04a1.841 1.841 0 012.69 0c.36.378.557.88.557 1.413 0 .534-.197 1.035-.557 1.413l-2.95 3.1-.48.502c-.446.47-1.173.47-1.62 0a1.226 1.226 0 01-.335-.851c0-.322.119-.624.335-.851l2.928-3.075a.382.382 0 01.276-.12h.001c.105 0 .201.043.274.12.075.078.115.18.115.29a.416.416 0 01-.115.288l-2.393 2.512a.108.108 0 00-.029.075c0 .028.01.054.03.074l.409.43c.038.041.102.041.14 0l2.392-2.513c.221-.232.342-.54.342-.867 0-.328-.122-.637-.342-.868a1.131 1.131 0 00-1.653 0l-.284.3-2.642 2.776a2.06 2.06 0 00-.564 1.43c0 .54.2 1.047.564 1.428.376.394.868.591 1.36.591.494 0 .986-.197 1.361-.591l3.43-3.602c.505-.532.785-1.24.785-1.991a2.867 2.867 0 00-.784-1.992z"\n\t\t\t\t\t\t\t\t\t\t\t\tfill="#595959"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</span>',title:e["file"]["title"],search:"附件,文件,fujian,wenjian,file"},{name:"video-uploader",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-16.000000, -641.000000)">\n <g>\n <g transform="translate(16.000000, 641.000000)">\n <g>\n <rect stroke="#E8E8E8" fill="#FFFFFF" x="0.5" y="0.5" width="23" height="23" rx="2"/>\n <g transform="translate(6.000000, 6.000000)" fill-rule="nonzero">\n <rect fill="#000000" opacity="0" x="0" y="0" width="12" height="12"/>\n <path d="M6,0.75 C3.10078125,0.75 0.75,3.10078125 0.75,6 C0.75,8.89921875 3.10078125,11.25 6,11.25 C8.89921875,11.25 11.25,8.89921875 11.25,6 C11.25,3.10078125 8.89921875,0.75 6,0.75 Z M6,10.359375 C3.59296875,10.359375 1.640625,8.40703125 1.640625,6 C1.640625,3.59296875 3.59296875,1.640625 6,1.640625 C8.40703125,1.640625 10.359375,3.59296875 10.359375,6 C10.359375,8.40703125 8.40703125,10.359375 6,10.359375 Z" id="Shape" fill="#595959"/>\n <path d="M7.93963415,5.8884912 L5.23140244,4.02687575 C5.13445122,3.96020395 5,4.02514402 5,4.13857268 L5,7.86180356 C5,7.97523223 5.13536585,8.03930643 5.23140244,7.97350049 L7.93963415,6.11188505 C8.02012195,6.05646952 8.02012195,5.94390673 7.93963415,5.8884912 Z" id="Shape" fill="#71D19A"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n\t\t\t\t\t\t\t\t</span>',title:e["video"]["title"],search:"视频,MP4,shipin,video"},{name:"math",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><g fill="none" fill-rule="evenodd"><rect stroke="#E8E8E8" fill="#FFF" x=".5" y=".5" width="23" height="23" rx="2"/><path d="M14.073 14.18a.122.122 0 01.004.073l-.346 1.404a.122.122 0 01-.119.093H9.438a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h.61v-3.924h-.61a.122.122 0 01-.122-.122v-.384c0-.068.055-.122.122-.122h.355l-.012-.063a.976.976 0 00-.96-.8h-.487v3.845H9.35c.068 0 .122.055.122.122v.384a.122.122 0 01-.122.122H6.341a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h1.017V9.706H6.87a.976.976 0 00-.96.8l-.097.535h-.437a.122.122 0 01-.122-.132l.143-1.797A.122.122 0 015.52 9h4.654c.064 0 .117.049.122.112l.116 1.458h3.19c.06 0 .113.046.12.107l.214 1.718a.122.122 0 01-.121.137h-.339a.122.122 0 01-.117-.09l-.16-.577a.91.91 0 00-.877-.667h-1.134v1.57h.423c.26 0 .471-.211.471-.471v-.192c0-.068.055-.122.122-.122h.407c.067 0 .122.054.122.122v1.953a.122.122 0 01-.122.122h-.407a.122.122 0 01-.122-.122v-.192a.47.47 0 00-.47-.47h-.424v1.726h1.187c.34 0 .655-.177.832-.467l.291-.475h-.155a.122.122 0 01-.122-.122v-.384c0-.067.054-.122.122-.122h.577l1.468-2.004-1.305-1.92h-.659a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h2.196c.067 0 .122.055.122.122v.384a.122.122 0 01-.122.122h-.317l.718 1.057.774-1.057h-.362a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h1.87c.068 0 .123.055.123.122v.384a.122.122 0 01-.122.122h-.614l-1.238 1.69 1.518 2.234h.659c.067 0 .122.055.122.122v.384a.122.122 0 01-.122.122h-2.196a.122.122 0 01-.122-.122v-.384c0-.067.055-.122.122-.122h.317l-.931-1.37-1.004 1.37h.398c.068 0 .122.055.122.122v.384a.122.122 0 01-.122.122h-1.14z" fill-opacity=".65" fill="#000"/></g></svg>\n\t\t\t\t\t\t\t\t</span>',title:e["math"]["title"],search:"公式,数学公式,gongshi,formula,math,latex"},{name:"status",icon:'<span>\n\t\t\t\t\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><g fill="none" fill-rule="evenodd"><rect stroke="#E8E8E8" stroke-width=".667" fill="#FFF" x=".333" y=".333" width="23.333" height="23.333" rx="1.333"/><g transform="translate(6 6)"><path d="M2.534 6.192L.53 4.34a.667.667 0 01-.144-.788L1.98.37A.667.667 0 012.575 0h9.714c.369 0 .667.298.667.667v5.036a.667.667 0 01-.667.666H2.986a.667.667 0 01-.452-.177z" fill="#BFBFBF"/><path d="M.598 4.07a.267.267 0 00.02.226l4.125 7.146a.267.267 0 00.364.097l4.62-2.666a.267.267 0 00.097-.365L5.698 1.363a.267.267 0 00-.186-.13L2.095.648a.267.267 0 00-.295.17L.598 4.07z" stroke="#595959" stroke-width=".8" fill="#FFF"/><path d="M3.956 3.036a.667.667 0 11-1.333 0 .667.667 0 011.333 0z" fill="#595959"/><circle fill="#595959" transform="scale(-1 1) rotate(30 0 -9.207)" cx="3.283" cy="3.047" r="1"/></g></g></svg>\n\t\t\t\t\t\t\t\t</span>',title:e["status"]["title"],search:"status,label,状态"}]}]},{type:"button",name:"undo",icon:"undo",title:e["undo"]["title"],onDisabled:function(){return!t.command.queryState("undo")||!t.command.queryEnabled("undo")},onActive:function(){return!1}},{type:"button",name:"redo",icon:"redo",title:e["redo"]["title"],onDisabled:function(){return!t.command.queryState("redo")||!t.command.queryEnabled("redo")},onActive:function(){return!1}},{type:"button",name:"paintformat",icon:"paintformat",title:e["paintformat"]["title"]},{type:"button",name:"removeformat",icon:"clean",title:e["removeformat"]["title"]},{type:"dropdown",name:"heading",className:"toolbar-dropdown-heading",title:e["heading"]["title"],items:[{key:"p",className:"heading-item-p",content:e["heading"]["p"]},{key:"h1",className:"heading-item-h1",content:e["heading"]["h1"]},{key:"h2",className:"heading-item-h2",content:e["heading"]["h2"]},{key:"h3",className:"heading-item-h3",content:e["heading"]["h3"]},{key:"h4",className:"heading-item-h4",content:e["heading"]["h4"]},{key:"h5",className:"heading-item-h5",content:e["heading"]["h5"]},{key:"h6",className:"heading-item-h6",content:e["heading"]["h6"]}]},{type:"dropdown",name:"fontsize",className:"toolbar-dropdown-fontsize",title:e["fontsize"]["title"],items:[{key:"12px",content:"12px",hotkey:!1},{key:"13px",content:"13px",hotkey:!1},{key:"14px",content:"14px",hotkey:!1},{key:"15px",content:"15px",hotkey:!1},{key:"16px",content:"16px",hotkey:!1},{key:"19px",content:"19px",hotkey:!1},{key:"22px",content:"22px",hotkey:!1},{key:"24px",content:"24px",hotkey:!1},{key:"29px",content:"29px",hotkey:!1},{key:"32px",content:"32px",hotkey:!1},{key:"40px",content:"40px",hotkey:!1},{key:"48px",content:"48px",hotkey:!1}].map((function(e){return e.key===t.container.css("font-size")?Object(i["a"])(Object(i["a"])({},e),{},{isDefault:!0}):e})),onDisabled:function(){var e=t.command.queryState("heading")||"p";return/^h\d$/.test(e)||!t.command.queryEnabled("fontsize")}},{type:"dropdown",name:"fontfamily",className:"toolbar-dropdown-fontfamily",title:e["fontfamily"]["title"],items:wn(yn,Object(i["a"])(Object(i["a"])({},e["fontfamily"]["items"]),{},{notInstalled:e["fontfamily"]["notInstalled"]})),onActive:function(e){var n,r=t.command.queryState("fontfamily");if(!r||!Array.isArray(r)||0===r.length)return"";var i=r[0].split(",").map((function(t){return t.replace(/"/g,"").trim().toLowerCase()}));return(null===(n=e.find((function(t){return i.indexOf(t["faimlyName"].trim().toLowerCase())>-1})))||void 0===n?void 0:n.key)||""}},{type:"button",name:"bold",icon:"bold",title:e["bold"]["title"],onDisabled:function(){var e=t.command.queryState("heading")||"p";return/^h\d$/.test(e)||!t.command.queryEnabled("bold")}},{type:"button",name:"italic",icon:"italic",title:e["italic"]["title"]},{type:"button",name:"strikethrough",icon:"strikethrough",title:e["strikethrough"]["title"]},{type:"button",name:"underline",icon:"underline",title:e["underline"]["title"]},{type:"dropdown",name:"moremark",icon:"moremark",single:!1,title:e["moremark"]["title"],items:[{key:"sup",icon:"sup",content:e["moremark"]["sup"],disabled:!t.command.queryEnabled("sup"),command:{name:"sup",args:[]}},{key:"sub",icon:"sub",disabled:!t.command.queryEnabled("sub"),content:e["moremark"]["sub"],command:{name:"sub",args:[]}},{key:"code",icon:"code",disabled:!t.command.queryEnabled("code"),content:e["moremark"]["code"],command:{name:"code",args:[]}}],onDisabled:function(){var e=[];return!0===t.command.queryEnabled("sup")&&e.push("sup"),!0===t.command.queryEnabled("sub")&&e.push("sub"),!0===t.command.queryEnabled("code")&&e.push("code"),0===e.length},onActive:function(){var e=[];return!0===t.command.queryState("sup")&&e.push("sup"),!0===t.command.queryState("sub")&&e.push("sub"),!0===t.command.queryState("code")&&e.push("code"),e}},{type:"color",name:"fontcolor",defaultColor:"#262626",defaultActiveColor:"#F5222D",buttonTitle:e["fontcolor"]["title"],dropdownTitle:e["fontcolor"]["more"],content:function(t,e,n){return!0===n&&(t="#BFBFBF",e="#BFBFBF"),'<svg\n\t\t\t\t\t\twidth="16px"\n\t\t\t\t\t\theight="16px"\n\t\t\t\t\t\tviewBox="0 0 16 16"\n\t\t\t\t\t\tstyle="margin-bottom: -2"\n\t\t\t\t\t>\n\t\t\t\t\t\t<title>color-font</title>\n\t\t\t\t\t\t<desc>Created with Sketch.</desc>\n\t\t\t\t\t\t<g\n\t\t\t\t\t\t\tid="color-font"\n\t\t\t\t\t\t\tstroke="none"\n\t\t\t\t\t\t\tstroke-width="1"\n\t\t\t\t\t\t\tfill="none"\n\t\t\t\t\t\t\tfill-rule="evenodd"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\tid="Rectangle-55"\n\t\t\t\t\t\t\t\tstroke='.concat(e,'\n\t\t\t\t\t\t\t\tstroke-width="0.5"\n\t\t\t\t\t\t\t\tfill=').concat(t,'\n\t\t\t\t\t\t\t\tx="2"\n\t\t\t\t\t\t\t\ty="12.75"\n\t\t\t\t\t\t\t\twidth="12"\n\t\t\t\t\t\t\t\theight="1.5"\n\t\t\t\t\t\t\t\trx="0.125"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td="M5.29102819,11.25 L3.96365715,11.25 C3.87952002,11.25 3.8113134,11.1817934 3.8113134,11.0976562 C3.8113134,11.08076 3.81412419,11.0639814 3.81963067,11.0480076 L7.0756112,1.60269506 C7.09679504,1.5412426 7.15463644,1.5 7.21963767,1.5 L8.81868806,1.5 C8.883726,1.5 8.94159158,1.54128846 8.96274706,1.60278951 L12.2118,11.048102 C12.239168,11.1276636 12.1968568,11.2143472 12.1172952,11.2417152 C12.1013495,11.2472004 12.0846037,11.25 12.067741,11.25 L10.6761419,11.25 C10.6099165,11.25 10.5512771,11.2072154 10.531066,11.1441494 L9.69970662,8.55 L6.27433466,8.55 L5.43599205,11.1444975 C5.41567115,11.2073865 5.35711879,11.25 5.29102819,11.25 Z M8.02635163,3.18571429 L7.96199183,3.18571429 L6.63904023,7.30714286 L9.33500105,7.30714286 L8.02635163,3.18571429 Z"\n\t\t\t\t\t\t\t\tid="A"\n\t\t\t\t\t\t\t\tfill="#595959"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</g>\n\t\t\t\t\t</svg>')}},{type:"color",name:"backcolor",defaultColor:"transparent",defaultActiveColor:"#FADB14",buttonTitle:e["backcolor"]["title"],dropdownTitle:e["backcolor"]["more"],content:function(t,e,n){return!0===n&&(t="#BFBFBF",e="#BFBFBF"),'<svg\n width="16px"\n height="16px"\n viewBox="0 0 16 16"\n style="margin-bottom: -2"\n\t\t\t\t\t>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect stroke="'.concat(e,'" stroke-width="0.5" fill="').concat(t,'" x="2" y="12.75" width="12" height="1.5" rx="0.125"></rect>\n <g transform="translate(2.781250, 1.375000)" fill-rule="nonzero"><path fill="#595959" d="M2.86079849,6.64817222 L2.05713835,5.84451208 C2.00832281,5.79569655 2.00832281,5.71655092 2.05713835,5.66773539 L3.61029491,4.11457882 L3.11963835,3.62392225 C3.07082281,3.57510672 3.07082281,3.49596109 3.11963835,3.44714556 L6.47839556,0.0883883476 C6.52721109,0.0395728112 6.60635672,0.0395728112 6.65517225,0.0883883476 L11.5165314,4.94974747 C11.5653469,4.998563 11.5653469,5.07770863 11.5165314,5.12652416 L8.15777416,8.48528137 C8.10895863,8.53409691 8.029813,8.53409691 7.98099747,8.48528137 L7.38889678,7.89318068 L5.83574021,9.44633725 C5.78692467,9.49515278 5.70777905,9.49515278 5.65896351,9.44633725 L5.0267407,8.81411444 L4.48856529,9.35326519 C4.39477378,9.44720966 4.26747335,9.5 4.13472392,9.5 L0.608857988,9.5 C0.470786801,9.5 0.358857988,9.38807119 0.358857988,9.25 C0.358857988,9.18363253 0.385247413,9.11998865 0.432210608,9.07309408 L2.86079849,6.64817222 Z M6.56678391,1.67937861 L4.71062861,3.53553391 L8.06938582,6.89429112 L9.92554112,5.03813582 L6.56678391,1.67937861 Z M3.64812861,5.75612373 L5.74735186,7.85534699 L6.54284699,7.05985186 L4.44362373,4.96062861 L3.64812861,5.75612373 Z" id="Combined-Shape"></path></g></g>\n\t\t\t\t\t</svg>')}},{type:"dropdown",name:"alignment",title:e["alignment"]["title"],items:[{key:"left",icon:"align-left",content:e["alignment"]["left"]},{key:"center",icon:"align-center",content:e["alignment"]["center"]},{key:"right",icon:"align-right",content:e["alignment"]["right"]},{key:"justify",icon:"align-justify",content:e["alignment"]["justify"]}]},{type:"button",name:"unorderedlist",icon:"unordered-list",title:e["unorderedlist"]["title"]},{type:"button",name:"orderedlist",icon:"ordered-list",title:e["orderedlist"]["title"]},{type:"button",name:"tasklist",icon:"task-list",title:e["tasklist"]["title"]},{type:"dropdown",name:"indent",icon:"indent",hasDot:!1,title:e["indent"]["title"],items:[{key:"in",icon:"indent",content:e["indent"]["in"]},{key:"out",icon:"outdent",content:e["indent"]["out"]}]},{type:"dropdown",name:"line-height",content:function(){return'<span class="data-icon data-icon-line-height"></span>'},title:e["line-height"]["title"],items:[{key:"default",content:e["line-height"]["default"]},{key:"1",content:"1"},{key:"1.15",content:"1.15"},{key:"1.5",content:"1.5"},{key:"2",content:"2"},{key:"2.5",content:"2.5"},{key:"3",content:"3"}]},{type:"button",name:"link",icon:"link",command:{name:"link",args:["_blank"]},title:e["link"]["title"],onDisabled:function(){var e=t.change,n=t.card,r=e.range.get(),i=n.find(r.startNode);return!!i&&!i.isCursor(r.startNode)||r.containsCard()||!t.command.queryEnabled("link")}},{type:"button",name:"quote",icon:"quote",title:e["quote"]["title"]},{type:"button",name:"hr",icon:"hr",title:e["hr"]["title"]}]},An=function(e){Object(s["a"])(c,e);var n=Object(l["a"])(c);function c(){var t;return Object(o["a"])(this,c),t=n.apply(this,arguments),t.groupValue=[],t.isMobile=!1,t.caluTimeoutRef=null,t.updateTimer=null,t.scrollTimer=null,t.mobileView={top:0},t.hideMobileToolbar=function(){t.mobileView={top:-120},t.scrollTimer&&clearTimeout(t.scrollTimer),t.scrollTimer=setTimeout((function(){t.calcuMobileView()}),200)},t.handleReadonly=function(){t.engine.readonly?t.hideMobileToolbar():t.calcuMobileView()},t}return Object(a["a"])(c,[{key:"mounted",value:function(){this.engine.language.add(ln),this.engine.on("select",this.updateByTimeout),this.engine.on("change",this.updateByTimeout),this.engine.on("blur",this.updateByTimeout),this.engine.on("focus",this.updateByTimeout),d["isMobile"]?(this.engine.isFocus()||this.hideMobileToolbar(),this.engine.on("readonly",this.handleReadonly),this.engine.on("blur",this.hideMobileToolbar),document.addEventListener("scroll",this.calcuMobileView),visualViewport.addEventListener("resize",this.calcuMobileView),visualViewport.addEventListener("scroll",this.calcuMobileView)):this.engine.on("readonly",this.updateByTimeout),this.updateByTimeout(),this.isMobile=d["isMobile"]}},{key:"unmounted",value:function(){this.engine.off("select",this.updateByTimeout),this.engine.off("change",this.updateByTimeout),this.engine.off("readonly",this.updateByTimeout),this.engine.off("blur",this.updateByTimeout),this.engine.off("focus",this.updateByTimeout),d["isMobile"]?(this.engine.off("readonly",this.handleReadonly),this.engine.off("blur",this.hideMobileToolbar),document.removeEventListener("scroll",this.calcuMobileView),visualViewport.removeEventListener("resize",this.calcuMobileView),visualViewport.removeEventListener("scroll",this.calcuMobileView)):this.engine.off("readonly",this.updateByTimeout)}},{key:"updateByTimeout",value:function(){var t=this;this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout((function(){t.update()}),100)}},{key:"calcuMobileView",value:function(){var e=this;this.engine.isFocus()&&!this.engine.readonly&&(this.caluTimeoutRef&&clearTimeout(this.caluTimeoutRef),this.caluTimeoutRef=setTimeout((function(){var n=e.$refs.toolbarRef,r=n.getBoundingClientRect(),i=Object(d["removeUnit"])(getComputedStyle(n).borderTopWidth),o=Object(d["removeUnit"])(getComputedStyle(n).borderBottomWidth),a=r.height||0;e.mobileView.top=t.Math.max(document.body.scrollTop,document.documentElement.scrollTop)+(window.visualViewport.height||0)-a+i+o}),100))}},{key:"update",value:function(){var t=this;d["isMobile"]&&this.calcuMobileView();var e=[],n=kn(this.engine);this.items.forEach((function(o){var a={items:[]};Array.isArray(o)||(a.icon=o.icon,a.content=o.content,o=o.items),o.forEach((function(e){var o=void 0;if("string"===typeof e){var s=n.find((function(t){return"collapse"===e?t.type===e:"collapse"!==t.type&&t.name===e}));s&&(o=s)}else{var l=n.find((function(t){return"collapse"===e.type?t.type===e.type:"collapse"!==t.type&&t.name===e.name}));if("collapse"===e.type){var c=Object(i["a"])(Object(i["a"])({},Object(u["merge"])(Object(u["omit"])(Object(i["a"])({},l),"groups"),Object(u["omit"])(Object(i["a"])({},e),"groups"))),{},{groups:[]});e.groups.forEach((function(t){var e=[];t.items.forEach((function(t){var n=void 0;l.groups.some((function(e){return e.items.some((function(e){var r=e.name===("string"===typeof t?t:t.name);return r&&(n=Object(i["a"])(Object(i["a"])({},e),"string"===typeof t?{}:t)),r}))})),n?e.push(n):"object"===Object(r["a"])(t)&&e.push(t)})),e.length>0&&c.groups.push(Object(i["a"])(Object(i["a"])({},Object(u["omit"])(t,"itmes")),{},{items:e}))})),o=c.groups.length>0?c:void 0}else"dropdown"===e.type?(o=l?Object(u["merge"])(l,Object(u["omit"])(Object(i["a"])({},e),"type","items")):Object(i["a"])({},e),o.items=e.items):o=l?Object(u["merge"])(l,Object(u["omit"])(Object(i["a"])({},e),"type")):Object(i["a"])({},e)}o&&("button"===o.type?o.onActive?o.active=o.onActive():t.engine.command.queryEnabled(o.name)&&(o.active=t.engine.command.queryState(o.name)):"dropdown"===o.type&&(o.onActive?o.values=o.onActive(o.items):o.values=t.engine.command.queryState(o.name)),"collapse"!==o.type?o.disabled=o.onDisabled?o.onDisabled():!t.engine.command.queryEnabled(o.name):(o.groups.forEach((function(e){return e.items.forEach((function(e){e.disabled=e.onDisabled?e.onDisabled():!t.engine.command.queryEnabled(e.name)}))})),o.disabled=!o.groups.some((function(t){return t.items.some((function(t){return!t.disabled}))}))),a.items.push(o))})),a.items.length>0&&e.push(a)})),this.groupValue=e}},{key:"preventDefault",value:function(t){t.preventDefault()}},{key:"triggerMouseOver",value:function(t){this.preventDefault(t)}},{key:"triggerMouseMove",value:function(t){this.preventDefault(t)}},{key:"triggerContextMenu",value:function(t){this.preventDefault(t)}}]),c}(c["default"]);A([$({type:Object,required:!0})],An.prototype,"engine",void 0),A([$({type:Array,default:[]})],An.prototype,"items",void 0),A([$(String)],An.prototype,"className",void 0),A([$({type:Boolean,default:!1})],An.prototype,"popup",void 0),An=A([q({components:{AmGroup:on}})],An);var Sn=An;const En=Sn;var On=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"toolbarRef",class:["editor-toolbar",t.className,{"editor-toolbar-mobile":t.isMobile&&!t.popup,"editor-toolbar-popup":t.popup}],style:t.isMobile?{top:t.mobileView.top+"px"}:{},attrs:{"data-element":"ui"},on:{mouseover:t.triggerMouseOver,mousemove:t.triggerMouseMove,contextmenu:t.triggerContextMenu}},[n("div",{staticClass:"editor-toolbar-content"},t._l(t.groupValue,(function(e,r){return n("am-group",t._b({key:r,attrs:{engine:t.engine,popup:t.popup}},"am-group",e,!1))})),1)])},Tn=[];On._withStripped=!0;const _n=function(t){t&&t("data-v-00e9b844_0",{source:"\n.ant-tooltip .toolbar-tooltip-title {\r\n font-size: 12px;\r\n text-align: center;\n}\n.ant-tooltip .toolbar-tooltip-hotkey {\r\n font-size: 12px;\r\n color: rgba(255, 255, 255, 0.85);\r\n text-align: center;\n}\n.editor-toolbar {\r\n position: relative;\r\n width: 100%;\r\n padding: 0;\r\n z-index: 200;\r\n border-top: 1px solid rgba(0, 0, 0, 0.05);\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.05);\r\n user-select: none;\n}\n.editor-toolbar .editor-toolbar-content {\r\n position: relative;\r\n flex-direction: row;\r\n background: transparent;\r\n text-align: center;\r\n width: 100%;\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\n}\n.editor-toolbar.editor-toolbar-mobile,\r\n.editor-toolbar.editor-toolbar-popover {\r\n position: absolute;\r\n left: 0;\r\n box-shadow: none;\n}\n.editor-toolbar.editor-toolbar-popup {\r\n position: initial;\r\n box-shadow: none;\r\n top: 0;\r\n left: 0;\r\n border: 0 none;\n}\n.editor-toolbar-mobile .editor-toolbar-content {\r\n text-align: left;\r\n padding: 0 12px;\n}\n.editor-toolbar-mobile .editor-toolbar-group,\r\n.editor-toolbar-popup .editor-toolbar-group {\r\n border: 0 none;\r\n padding: 0;\n}\n.editor-toolbar-popup .editor-toolbar-content {\r\n text-align: center;\r\n padding: 0;\n}\n.editor-toolbar-popover .editor-toolbar {\r\n position: relative;\r\n box-shadow: none;\r\n border: 0 none;\r\n left: 0;\r\n top: 0;\r\n display: flex;\n}\n.editor-toolbar-popover {\r\n border-radius: 3px;\r\n background: transparent;\n}\n.editor-toolbar-popover .ant-popover-inner {\r\n border-radius: 3px;\n}\n.editor-toolbar-popover .ant-popover-inner-content {\r\n padding: 2px;\n}\n.am-engine-mobile {\r\n margin-bottom: 40px;\n}\r\n",map:{version:3,sources:["/Users/zhangbin/work/am-editor-vue2/packages/toolbar/src/components/toolbar.vue"],names:[],mappings:";AAiSA;EACA,eAAA;EACA,kBAAA;AACA;AAEA;EACA,eAAA;EACA,gCAAA;EACA,kBAAA;AACA;AAEA;EACA,kBAAA;EACA,WAAA;EACA,UAAA;EACA,YAAA;EACA,yCAAA;EACA,4CAAA;EACA,iBAAA;AACA;AAEA;EACA,kBAAA;EACA,mBAAA;EACA,uBAAA;EACA,kBAAA;EACA,WAAA;EACA,aAAA;EACA,uBAAA;EACA,eAAA;AACA;AAEA;;EAEA,kBAAA;EACA,OAAA;EACA,gBAAA;AACA;AAEA;EACA,iBAAA;EACA,gBAAA;EACA,MAAA;EACA,OAAA;EACA,cAAA;AACA;AAEA;EACA,gBAAA;EACA,eAAA;AACA;AAEA;;EAEA,cAAA;EACA,UAAA;AACA;AAEA;EACA,kBAAA;EACA,UAAA;AACA;AAEA;EACA,kBAAA;EACA,gBAAA;EACA,cAAA;EACA,OAAA;EACA,MAAA;EACA,aAAA;AACA;AAEA;EACA,kBAAA;EACA,uBAAA;AACA;AAEA;EACA,kBAAA;AACA;AAEA;EACA,YAAA;AACA;AAEA;EACA,mBAAA;AACA",file:"toolbar.vue",sourcesContent:['<template>\r\n <div\r\n ref="toolbarRef"\r\n :class="[\r\n \'editor-toolbar\',\r\n className,\r\n {\r\n \'editor-toolbar-mobile\': isMobile && !popup,\r\n \'editor-toolbar-popup\': popup,\r\n },\r\n ]"\r\n :style="isMobile ? { top: `${mobileView.top}px` } : {}"\r\n data-element="ui"\r\n @mouseover="triggerMouseOver"\r\n @mousemove="triggerMouseMove"\r\n @contextmenu="triggerContextMenu"\r\n >\r\n <div class="editor-toolbar-content">\r\n <am-group\r\n v-for="(group, index) in groupValue"\r\n :key="index"\r\n :engine="engine"\r\n :popup="popup"\r\n v-bind="group"\r\n />\r\n </div>\r\n </div>\r\n</template>\r\n<script lang="ts">\r\nimport { Component, Vue, Prop } from "vue-property-decorator";\r\nimport { merge, omit } from "lodash";\r\nimport { EngineInterface, isMobile, removeUnit } from "@aomao/engine";\r\nimport {\r\n ToolbarButtonProps,\r\n CollapseItemProps,\r\n ToolbarColorProps,\r\n ToolbarDropdownProps,\r\n GroupDataProps,\r\n ToolbarCollapseGroupProps,\r\n GroupItemProps,\r\n} from "../types";\r\nimport AmGroup from "./group.vue";\r\nimport locales from "../locales";\r\nimport {\r\n getToolbarDefaultConfig,\r\n fontFamilyDefaultData,\r\n fontfamily,\r\n} from "../config";\r\n\r\n@Component({\r\n components: {\r\n AmGroup,\r\n },\r\n})\r\nexport default class Toolbar extends Vue {\r\n @Prop({ type: Object, required: true }) engine!: EngineInterface;\r\n @Prop({ type: Array, default: [] }) items!: Array<GroupItemProps>;\r\n @Prop(String) className?: string;\r\n @Prop({ type: Boolean, default: false }) popup!: boolean;\r\n\r\n groupValue: GroupDataProps[] = [];\r\n isMobile = false;\r\n caluTimeoutRef: NodeJS.Timeout | null = null;\r\n updateTimer: NodeJS.Timeout | null = null;\r\n scrollTimer: NodeJS.Timeout | null = null;\r\n mobileView = { top: 0 };\r\n\r\n mounted() {\r\n this.engine.language.add(locales);\r\n this.engine.on("select", this.updateByTimeout);\r\n this.engine.on("change", this.updateByTimeout);\r\n this.engine.on("blur", this.updateByTimeout);\r\n this.engine.on("focus", this.updateByTimeout);\r\n if (isMobile) {\r\n if (!this.engine.isFocus()) this.hideMobileToolbar();\r\n this.engine.on("readonly", this.handleReadonly);\r\n this.engine.on("blur", this.hideMobileToolbar);\r\n document.addEventListener("scroll", this.calcuMobileView);\r\n visualViewport.addEventListener("resize", this.calcuMobileView);\r\n visualViewport.addEventListener("scroll", this.calcuMobileView);\r\n } else {\r\n this.engine.on("readonly", this.updateByTimeout);\r\n }\r\n this.updateByTimeout();\r\n this.isMobile = isMobile;\r\n }\r\n\r\n unmounted() {\r\n this.engine.off("select", this.updateByTimeout);\r\n this.engine.off("change", this.updateByTimeout);\r\n this.engine.off("readonly", this.updateByTimeout);\r\n this.engine.off("blur", this.updateByTimeout);\r\n this.engine.off("focus", this.updateByTimeout);\r\n if (isMobile) {\r\n this.engine.off("readonly", this.handleReadonly);\r\n this.engine.off("blur", this.hideMobileToolbar);\r\n document.removeEventListener("scroll", this.calcuMobileView);\r\n visualViewport.removeEventListener("resize", this.calcuMobileView);\r\n visualViewport.removeEventListener("scroll", this.calcuMobileView);\r\n } else {\r\n this.engine.off("readonly", this.updateByTimeout);\r\n }\r\n }\r\n\r\n hideMobileToolbar = () => {\r\n this.mobileView = { top: -120 };\r\n if (this.scrollTimer) clearTimeout(this.scrollTimer);\r\n this.scrollTimer = setTimeout(() => {\r\n this.calcuMobileView();\r\n }, 200);\r\n };\r\n\r\n handleReadonly = () => {\r\n if (this.engine.readonly) {\r\n this.hideMobileToolbar();\r\n } else {\r\n this.calcuMobileView();\r\n }\r\n };\r\n\r\n updateByTimeout() {\r\n if (this.updateTimer) clearTimeout(this.updateTimer);\r\n this.updateTimer = setTimeout(() => {\r\n this.update();\r\n }, 100);\r\n }\r\n\r\n //计算移动浏览器的视图变化\r\n calcuMobileView() {\r\n if (!this.engine.isFocus() || this.engine.readonly) return;\r\n\r\n if (this.caluTimeoutRef) clearTimeout(this.caluTimeoutRef);\r\n this.caluTimeoutRef = setTimeout(() => {\r\n const element = this.$refs.toolbarRef as Element;\r\n const rect = element.getBoundingClientRect();\r\n const borderTop = removeUnit(getComputedStyle(element).borderTopWidth);\r\n const borderBottom = removeUnit(\r\n getComputedStyle(element).borderBottomWidth\r\n );\r\n const height = rect.height || 0;\r\n\r\n this.mobileView.top =\r\n global.Math.max(\r\n document.body.scrollTop,\r\n document.documentElement.scrollTop\r\n ) +\r\n (window.visualViewport.height || 0) -\r\n height +\r\n borderTop +\r\n borderBottom;\r\n }, 100);\r\n }\r\n\r\n update() {\r\n if (isMobile) this.calcuMobileView();\r\n const data: Array<GroupDataProps> = [];\r\n const defaultConfig = getToolbarDefaultConfig(this.engine);\r\n\r\n this.items.forEach((group) => {\r\n const dataGroup: GroupDataProps = { items: [] };\r\n if (!Array.isArray(group)) {\r\n dataGroup.icon = group.icon;\r\n dataGroup.content = group.content;\r\n\r\n group = group.items;\r\n }\r\n group.forEach((item) => {\r\n let customItem:\r\n | ToolbarButtonProps\r\n | ToolbarDropdownProps\r\n | ToolbarColorProps\r\n | ToolbarCollapseGroupProps\r\n | undefined = undefined;\r\n if (typeof item === "string") {\r\n const defaultItem = defaultConfig.find((config) =>\r\n item === "collapse"\r\n ? config.type === item\r\n : config.type !== "collapse" && config.name === item\r\n );\r\n if (defaultItem) customItem = defaultItem;\r\n } else {\r\n const defaultItem = defaultConfig.find((config) =>\r\n item.type === "collapse"\r\n ? config.type === item.type\r\n : config.type !== "collapse" && config.name === item.name\r\n );\r\n // 解析collapse item 为字符串时\r\n if (item.type === "collapse") {\r\n const customCollapse: ToolbarCollapseGroupProps = {\r\n ...merge(\r\n omit({ ...defaultItem }, "groups"),\r\n omit({ ...item }, "groups")\r\n ),\r\n groups: [],\r\n };\r\n item.groups.forEach((group) => {\r\n const items: Array<Omit<CollapseItemProps, "engine">> = [];\r\n group.items.forEach((cItem) => {\r\n let targetItem = undefined;\r\n (defaultItem as ToolbarCollapseGroupProps).groups.some((g) =>\r\n g.items.some((i) => {\r\n const isEqual =\r\n i.name ===\r\n (typeof cItem === "string" ? cItem : cItem.name);\r\n if (isEqual) {\r\n targetItem = {\r\n ...i,\r\n ...(typeof cItem === "string" ? {} : cItem),\r\n };\r\n }\r\n return isEqual;\r\n })\r\n );\r\n if (targetItem) items.push(targetItem);\r\n else if (typeof cItem === "object") items.push(cItem);\r\n });\r\n if (items.length > 0) {\r\n customCollapse.groups.push({ ...omit(group, "itmes"), items });\r\n }\r\n });\r\n customItem =\r\n customCollapse.groups.length > 0 ? customCollapse : undefined;\r\n } else if (item.type === "dropdown") {\r\n customItem = defaultItem\r\n ? merge(defaultItem, omit({ ...item }, "type", "items"))\r\n : { ...item };\r\n (customItem as ToolbarDropdownProps).items = item.items;\r\n } else {\r\n customItem = defaultItem\r\n ? merge(defaultItem, omit({ ...item }, "type"))\r\n : { ...item };\r\n }\r\n }\r\n if (customItem) {\r\n if (customItem.type === "button") {\r\n if (customItem.onActive) customItem.active = customItem.onActive();\r\n else if (this.engine.command.queryEnabled(customItem.name))\r\n customItem.active = this.engine.command.queryState(\r\n customItem.name\r\n );\r\n } else if (customItem.type === "dropdown") {\r\n if (customItem.onActive)\r\n customItem.values = customItem.onActive(customItem.items);\r\n else\r\n customItem.values = this.engine.command.queryState(\r\n customItem.name\r\n );\r\n }\r\n if (customItem.type !== "collapse")\r\n customItem.disabled = customItem.onDisabled\r\n ? customItem.onDisabled()\r\n : !this.engine.command.queryEnabled(customItem.name);\r\n else {\r\n customItem.groups.forEach((group) =>\r\n group.items.forEach((item) => {\r\n item.disabled = item.onDisabled\r\n ? item.onDisabled()\r\n : !this.engine.command.queryEnabled(item.name);\r\n })\r\n );\r\n customItem.disabled = !customItem.groups.some((g) =>\r\n g.items.some((item) => !item.disabled)\r\n );\r\n }\r\n dataGroup.items.push(customItem);\r\n }\r\n });\r\n if (dataGroup.items.length > 0) data.push(dataGroup);\r\n });\r\n this.groupValue = data;\r\n }\r\n\r\n preventDefault(event: MouseEvent) {\r\n event.preventDefault();\r\n }\r\n triggerMouseOver(event: MouseEvent) {\r\n this.preventDefault(event);\r\n }\r\n triggerMouseMove(event: MouseEvent) {\r\n this.preventDefault(event);\r\n }\r\n triggerContextMenu(event: MouseEvent) {\r\n this.preventDefault(event);\r\n }\r\n}\r\n\r\nexport { getToolbarDefaultConfig, fontFamilyDefaultData, fontfamily };\r\n<\/script>\r\n<style>\r\n.ant-tooltip .toolbar-tooltip-title {\r\n font-size: 12px;\r\n text-align: center;\r\n}\r\n\r\n.ant-tooltip .toolbar-tooltip-hotkey {\r\n font-size: 12px;\r\n color: rgba(255, 255, 255, 0.85);\r\n text-align: center;\r\n}\r\n\r\n.editor-toolbar {\r\n position: relative;\r\n width: 100%;\r\n padding: 0;\r\n z-index: 200;\r\n border-top: 1px solid rgba(0, 0, 0, 0.05);\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.05);\r\n user-select: none;\r\n}\r\n\r\n.editor-toolbar .editor-toolbar-content {\r\n position: relative;\r\n flex-direction: row;\r\n background: transparent;\r\n text-align: center;\r\n width: 100%;\r\n display: flex;\r\n justify-content: center;\r\n flex-wrap: wrap;\r\n}\r\n\r\n.editor-toolbar.editor-toolbar-mobile,\r\n.editor-toolbar.editor-toolbar-popover {\r\n position: absolute;\r\n left: 0;\r\n box-shadow: none;\r\n}\r\n\r\n.editor-toolbar.editor-toolbar-popup {\r\n position: initial;\r\n box-shadow: none;\r\n top: 0;\r\n left: 0;\r\n border: 0 none;\r\n}\r\n\r\n.editor-toolbar-mobile .editor-toolbar-content {\r\n text-align: left;\r\n padding: 0 12px;\r\n}\r\n\r\n.editor-toolbar-mobile .editor-toolbar-group,\r\n.editor-toolbar-popup .editor-toolbar-group {\r\n border: 0 none;\r\n padding: 0;\r\n}\r\n\r\n.editor-toolbar-popup .editor-toolbar-content {\r\n text-align: center;\r\n padding: 0;\r\n}\r\n\r\n.editor-toolbar-popover .editor-toolbar {\r\n position: relative;\r\n box-shadow: none;\r\n border: 0 none;\r\n left: 0;\r\n top: 0;\r\n display: flex;\r\n}\r\n\r\n.editor-toolbar-popover {\r\n border-radius: 3px;\r\n background: transparent;\r\n}\r\n\r\n.editor-toolbar-popover .ant-popover-inner {\r\n border-radius: 3px;\r\n}\r\n\r\n.editor-toolbar-popover .ant-popover-inner-content {\r\n padding: 2px;\r\n}\r\n\r\n.am-engine-mobile {\r\n margin-bottom: 40px;\r\n}\r\n</style>\r\n']},media:void 0})},Mn=void 0,Nn=void 0,Pn=!1,Ln=J({render:On,staticRenderFns:Tn},_n,En,Mn,Pn,Nn,!1,tt,void 0,void 0);var Dn=Object(x["a"])("position"),jn=function(){function t(e,n){var r=this;Object(o["a"])(this,t),Object.defineProperty(this,Dn,{writable:!0,value:void 0}),this.SCOPE_NAME="data-toolbar-component",this.handlePreventDefault=function(t){var e;if(0!==(null===(e=r.root)||void 0===e?void 0:e.closest("body").length))return t.preventDefault(),!1},this.otpions=n,this.engine=e,Object(w["a"])(this,Dn)[Dn]=new d["Position"](e)}return Object(a["a"])(t,[{key:"select",value:function(t){var e,n,r;null===(e=this.root)||void 0===e||e.find(".toolbar-collapse-item-active").removeClass("toolbar-collapse-item-active"),null===(n=this.root)||void 0===n||null===(r=n.find(".toolbar-collapse-item").eq(t))||void 0===r||r.addClass("toolbar-collapse-item-active")}},{key:"scroll",value:function(t){if(this.root){var e=this.root.find(".toolbar-collapse-item").toArray(),n=this.root.find(".toolbar-collapse-item-active"),r=e.findIndex((function(t){return t.equal(n)})),i="up"===t?r-1:r+1;i<0&&(i=e.length-1),i>=e.length&&(i=0),n=e[i],this.select(i);var o=0;this.root.find(".toolbar-collapse-group-title,.toolbar-collapse-item").each((function(t){if(n.equal(t))return!1;o+=t.clientHeight}));var a=this.root.get();a.scrollTop=o-a.clientHeight/2}}},{key:"unbindEvents",value:function(){Object(C["deleteScope"])(this.SCOPE_NAME),Object(C["unbind"])("enter",this.SCOPE_NAME),Object(C["unbind"])("up",this.SCOPE_NAME),Object(C["unbind"])("down",this.SCOPE_NAME),Object(C["unbind"])("esc",this.SCOPE_NAME),this.engine.off("keydown:enter",this.handlePreventDefault)}},{key:"bindEvents",value:function(){var t=this;this.unbindEvents(),Object(C["setScope"])(this.SCOPE_NAME),k()("enter",this.SCOPE_NAME,(function(e){var n,r,i;if(0!==(null===(n=t.root)||void 0===n?void 0:n.closest("body").length)){e.preventDefault();var o=null===(r=t.root)||void 0===r?void 0:r.find(".toolbar-collapse-item-active");null===o||void 0===o||null===(i=o.get())||void 0===i||i.click()}})),k()("up",this.SCOPE_NAME,(function(e){var n;0!==(null===(n=t.root)||void 0===n?void 0:n.closest("body").length)&&(e.preventDefault(),t.scroll("up"))})),k()("down",this.SCOPE_NAME,(function(e){var n;0!==(null===(n=t.root)||void 0===n?void 0:n.closest("body").length)&&(e.preventDefault(),t.scroll("down"))})),k()("esc",this.SCOPE_NAME,(function(e){e.preventDefault(),t.unbindEvents();var n=t.otpions.onCancel;n&&n()})),this.engine.on("keydown:enter",this.handlePreventDefault)}},{key:"remove",value:function(){var t;this.root&&0!==this.root.length&&(null===(t=Object(w["a"])(this,Dn)[Dn])||void 0===t||t.destroy(),this.vm&&(this.vm.$destroy(),this.vm=void 0),this.root.remove(),this.root=void 0)}},{key:"render",value:function(t,e,n){var r,i=this;this.unbindEvents(),this.remove(),this.root=Object(d["$"])('<div class="data-toolbar-component-list" />'),t.append(this.root);var o=this.root.get(),a=this.otpions.onSelect;if(n.length>0){var s=this.engine;this.vm=new c["default"]({render:function(t){return t(Ye,{props:{engine:s,groups:n,onSelect:a}})}}),o.append(this.vm.$mount().$el)}else this.root.append('<div class="data-toolbar-component-list-empty">'.concat(this.engine.language.get("toolbar","searchEmtpy","title"),"</div>"));this.bindEvents(),null===(r=Object(w["a"])(this,Dn)[Dn])||void 0===r||r.bind(this.root,e),setTimeout((function(){i.select(0)}),0)}}]),t}(),In=Object(x["a"])("editor"),Rn=Object(x["a"])("root"),Fn=Object(x["a"])("point"),Bn=Object(x["a"])("align"),zn=Object(x["a"])("options"),Hn=Object(x["a"])("vm"),Vn=function(){function t(e){var n,r,i=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(o["a"])(this,t),Object.defineProperty(this,In,{writable:!0,value:void 0}),Object.defineProperty(this,Rn,{writable:!0,value:void 0}),Object.defineProperty(this,Fn,{writable:!0,value:void 0}),Object.defineProperty(this,Bn,{writable:!0,value:void 0}),Object.defineProperty(this,zn,{writable:!0,value:void 0}),Object.defineProperty(this,Hn,{writable:!0,value:void 0}),Object(w["a"])(this,Fn)[Fn]={left:0,top:-9999},Object(w["a"])(this,Bn)[Bn]="bottom",Object(w["a"])(this,zn)[zn]={},this.onSelect=function(){var t,e=null===(t=d["Range"].from(Object(w["a"])(i,In)[In]))||void 0===t?void 0:t.cloneRange().shrinkToTextNode(),n=window.getSelection();if(e&&n&&n.focusNode&&!e.collapsed&&!Object(w["a"])(i,In)[In].card.getSingleSelectedCard(e)&&(e.commonAncestorNode.inEditor(Object(w["a"])(i,In)[In].container)||e.commonAncestorNode.isRoot(Object(w["a"])(i,In)[In].container))){var r=e.startNode.next();if((null===r||void 0===r?void 0:r.isElement())&&1===Math.abs(e.endOffset-e.startOffset)){var o=Object(w["a"])(i,In)[In].card.closest(r);if(o)return void i.hide()}var a=e.startNode.prev();if((null===a||void 0===a?void 0:a.isElement())&&1===Math.abs(e.startOffset-e.endOffset)){var s=Object(w["a"])(i,In)[In].card.closest(a);if(s)return void i.hide()}var l=e.getSubRanges();if(0===l.length||Object(w["a"])(i,In)[In].card.active&&!Object(w["a"])(i,In)[In].card.active.isEditable)i.hide();else{var c=l[0],u=l[l.length-1],h=c.cloneRange().collapse(!0).getBoundingClientRect(),p=u.cloneRange().collapse(!1).getBoundingClientRect(),f=void 0;i.showContent((function(){var t,e,r;if(f=null===(t=Object(w["a"])(i,Rn)[Rn].get())||void 0===t?void 0:t.getBoundingClientRect(),f){Object(w["a"])(i,Bn)[Bn]=u.startNode.equal(n.focusNode)&&(!c.startNode.equal(n.focusNode)||n.focusOffset>n.anchorOffset)?"bottom":"top";var o=12,a="bottom"===Object(w["a"])(i,Bn)[Bn]?p:h;"top"===Object(w["a"])(i,Bn)[Bn]&&a.top-f.height-o<window.innerHeight-((null===(e=Object(w["a"])(i,In)[In].scrollNode)||void 0===e?void 0:e.height())||0)?Object(w["a"])(i,Bn)[Bn]="bottom":"bottom"===Object(w["a"])(i,Bn)[Bn]&&a.bottom+f.height+o>window.innerHeight&&(Object(w["a"])(i,Bn)[Bn]="top"),a="bottom"===Object(w["a"])(i,Bn)[Bn]?p:h;var s=null===(r=Object(w["a"])(i,In)[In].scrollNode)||void 0===r?void 0:r.get(),l=null===s||void 0===s?void 0:s.getBoundingClientRect(),d="top"===Object(w["a"])(i,Bn)[Bn]?a.top-f.height-o-((null===l||void 0===l?void 0:l.top)||0)+((null===s||void 0===s?void 0:s.scrollTop)||0):a.bottom+o-((null===l||void 0===l?void 0:l.top)||0)+((null===s||void 0===s?void 0:s.scrollTop)||0),g=a.left-((null===l||void 0===l?void 0:l.left)||0)+((null===s||void 0===s?void 0:s.scrollLeft)||0)+a.width-f.width/2;g<0&&(g=16),Object(w["a"])(i,Fn)[Fn]={left:g,top:d},Object(w["a"])(i,Rn)[Rn].css({left:"".concat(Object(w["a"])(i,Fn)[Fn].left,"px"),top:"".concat(Object(w["a"])(i,Fn)[Fn].top,"px")})}else i.hide()}))}}else i.hide()},this.hide=function(t){if(null===t||void 0===t?void 0:t.target){var e=Object(d["$"])(t.target);if(e.closest(".data-toolbar-popup-wrapper").length>0||e.closest(d["UI_SELECTOR"]).length>0)return}Object(w["a"])(i,Rn)[Rn].css({left:"0px",top:"-9999px"})},Object(w["a"])(this,zn)[zn]=a,Object(w["a"])(this,In)[In]=e,Object(w["a"])(this,Rn)[Rn]=Object(d["$"])('<div class="data-toolbar-popup-wrapper"></div>'),((null===(n=Object(w["a"])(this,In)[In].scrollNode)||void 0===n?void 0:n.get())||document.body).appendChild(Object(w["a"])(this,Rn)[Rn][0]),Object(d["isEngine"])(e)?Object(w["a"])(this,In)[In].on("select",this.onSelect):document.addEventListener("selectionchange",this.onSelect),d["isMobile"]||window.addEventListener("scroll",this.onSelect),window.addEventListener("resize",this.onSelect),null===(r=Object(w["a"])(this,In)[In].scrollNode)||void 0===r||r.on("scroll",this.onSelect),document.addEventListener("mousedown",this.hide)}return Object(a["a"])(t,[{key:"showContent",value:function(t){var e,n=this,o=Object(w["a"])(this,In)[In].trigger("toolbar-render",Object(w["a"])(this,zn)[zn]);if(!o&&0===(Object(w["a"])(this,zn)[zn].items||[]).length)return null===(e=Object(w["a"])(this,Hn)[Hn])||void 0===e||e.$destroy(),Object(w["a"])(this,Hn)[Hn]=void 0,void this.hide();var a,s=Ln;"object"===Object(r["a"])(o)&&(null===(a=Object(w["a"])(this,Hn)[Hn])||void 0===a||a.$destroy(),Object(w["a"])(this,Hn)[Hn]=void 0,s=o);Object(w["a"])(this,Hn)[Hn]||(Object(w["a"])(this,Hn)[Hn]=new c["default"]({render:function(t){return t(s,{props:Object(i["a"])(Object(i["a"])({},Object(w["a"])(n,zn)[zn]),{},{engine:Object(w["a"])(n,In)[In],popup:!0})})}}),Object(w["a"])(this,Rn)[Rn].empty().append(Object(w["a"])(this,Hn)[Hn].$mount().$el)),setTimeout((function(){t&&t()}),200)}},{key:"destroy",value:function(){var t;Object(w["a"])(this,Rn)[Rn].remove(),Object(d["isEngine"])(Object(w["a"])(this,In)[In])?Object(w["a"])(this,In)[In].off("select",this.onSelect):document.removeEventListener("selectionchange",this.onSelect),d["isMobile"]||window.removeEventListener("scroll",this.onSelect),window.removeEventListener("resize",this.onSelect),null===(t=Object(w["a"])(this,In)[In].scrollNode)||void 0===t||t.off("scroll",this.onSelect),document.removeEventListener("mousedown",this.hide),Object(w["a"])(this,Hn)[Hn]&&(Object(w["a"])(this,Hn)[Hn].$destroy(),Object(w["a"])(this,Hn)[Hn]=void 0)}}]),t}(),qn=".data-toolbar-component-list {\n position: absolute;\n min-height: 0px;\n top: 10px;\n left: 0;\n}\n\n.data-toolbar-component-list .toolbar-dropdown-list {\n top:0px;\n position: relative;\n}\n\n.data-toolbar-component-placeholder {\n color: rgba(0,0,0,0.25);\n pointer-events: none;\n width: 76px;\n}\n\n.data-toolbar-component-list-empty {\n position: relative;\n font-size: 14px;\n background: #ffffff;\n border: 1px solid #e8e8e8;\n border-radius: 3px 3px;\n box-shadow: 0 2px 10px rgb(0 0 0 / 12%);\n padding: 5px 16px;\n line-height: 32px;\n min-width: 200px;\n height: auto;\n transition: all 0.25s cubic-bezier(0.3, 1.2, 0.2, 1);\n z-index: 999;\n max-height: calc(80vh);\n overflow: auto;\n}\n/** ------------------- popup ---------------------- **/\n.data-toolbar-popup-wrapper {\n position: absolute;\n z-index: 9999;\n padding: 4px;\n background-color: #fff;\n border-radius: 4px;\n border: 1px solid #dee0e3;\n box-shadow: 0 4px 8px 0 rgba(31, 35, 41, 0.1);\n}\n\n.data-toolbar-popup-wrapper .editor-toolbar-popover {\n width: -webkit-max-content;\n width: -moz-max-content;\n width: max-content;\n}\n\n.data-toolbar-popup-wrapper .editor-toolbar-popover .ant-popover-inner-content {\n padding: 4px;\n background-color: #fff;\n border-radius: 4px;\n border: 1px solid #dee0e3;\n}\n\n.data-toolbar-popup-wrapper .editor-toolbar-popover .ant-popover-arrow {\n display: none;\n}";xn(qn);var Un=Object(x["a"])("collapseData"),Wn=Object(x["a"])("data"),$n=function(t){Object(s["a"])(n,t);var e=Object(l["a"])(n);function n(){var t;Object(o["a"])(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return t=e.call.apply(e,[this].concat(i)),Object.defineProperty(Object(v["a"])(t),Un,{writable:!0,value:void 0}),Object.defineProperty(Object(v["a"])(t),Wn,{writable:!0,value:void 0}),t}return Object(a["a"])(n,[{key:"init",value:function(){var t=this;Object(d["isEngine"])(this.editor)&&!d["isServer"]&&(this.component=new jn(this.editor,{onCancel:function(){t.changeToText()},onSelect:function(){t.remove()}}))}},{key:"setData",value:function(t){Object(w["a"])(this,Wn)[Wn]=t}},{key:"getData",value:function(){var t=this;if(!Object(d["isEngine"])(this.editor))return[];var e=[],n=kn(this.editor),o=n.find((function(t){var e=t.type;return"collapse"===e})),a=[];o&&(a=o.groups);var s=[];a.forEach((function(t){s.push.apply(s,Object(f["a"])(t.items))}));var l=this.getValue();return(Object(w["a"])(this,Wn)[Wn]||(l?l.data:[])||[]).forEach((function(n){var o=n.title,a=[];n.items.forEach((function(e){var n=e;"string"!==typeof e&&(n=e.name);var o=s.find((function(t){return t.name===n}));o?a.push(Object(i["a"])(Object(i["a"])(Object(i["a"])({},o),"string"!==typeof e?e:{}),{},{disabled:o.onDisabled?o.onDisabled():!t.editor.command.queryEnabled(n)})):"object"===Object(r["a"])(e)&&a.push(e)})),e.push({title:o,items:a})})),e}},{key:"search",value:function(t){var e=[];"string"===typeof t&&(t=t.toLowerCase()),Object(w["a"])(this,Un)[Un]||(Object(w["a"])(this,Un)[Un]=[]),Object(w["a"])(this,Un)[Un].forEach((function(n){n.items.forEach((function(n){n.search&&n.search.toLowerCase().indexOf(t)>=0&&(e.find((function(t){var e=t.name;return e===n.name}))||e.push(Object(i["a"])({},n)))}))}));var n=[];return e.length>0&&n.push({title:"",items:e}),n}},{key:"remove",value:function(){var t;Object(d["isEngine"])(this.editor)&&(null===(t=this.component)||void 0===t||t.remove(),this.editor.card.remove(this.id))}},{key:"changeToText",value:function(){var t,e;if(this.root.inEditor()&&Object(d["isEngine"])(this.editor)){var n=(null===(t=this.keyword)||void 0===t||null===(e=t.get())||void 0===e?void 0:e.innerText)||"";this.remove(),this.editor.node.insertText(n)}}},{key:"destroy",value:function(){var t,e;null===(t=this.component)||void 0===t||t.unbindEvents(),null===(e=this.component)||void 0===e||e.remove()}},{key:"activate",value:function(t){var e;(Object(b["a"])(Object(y["a"])(n.prototype),"activate",this).call(this,t),t)||(null===(e=this.component)||void 0===e||e.unbindEvents(),this.changeToText())}},{key:"handleInput",value:function(){var t,e,n;if(Object(d["isEngine"])(this.editor)){var r=this.editor,i=r.change,o=r.card;if(!i.isComposing()){var a,s=(null===(t=this.keyword)||void 0===t||null===(e=t.get())||void 0===e?void 0:e.innerText.replace(/[\r\n]/g,""))||"";if(""===s)return null===(a=this.component)||void 0===a||a.remove(),void o.remove(this.id);var l=s.substr(1);if(""!==l){var c=this.search(l);null===(n=this.component)||void 0===n||n.render(this.editor.root,this.root,c)}else{var u;null===(u=this.component)||void 0===u||u.render(this.editor.root,this.root,Object(w["a"])(this,Un)[Un]||[])}}}}},{key:"resetPlaceHolder",value:function(){var t,e,n,r;"/"===(null===(t=this.keyword)||void 0===t||null===(e=t.get())||void 0===e?void 0:e.innerText)?null===(n=this.placeholder)||void 0===n||n.show():null===(r=this.placeholder)||void 0===r||r.hide()}},{key:"render",value:function(t){var e,n,r,i=this;this.setData(t);var o=this.editor;if(Object(d["isEngine"])(o)&&!d["isServer"]){var a=o.language.get("toolbar","component");this.root.attributes("data-transient","true"),this.root.attributes("contenteditable","false");var s=Object(d["$"])('<span class="data-toolbar-component-keyword" contenteditable="true">/</span><span class="data-toolbar-component-placeholder">'.concat(a["placeholder"],"</span>")),l=this.getCenter();l.empty().append(s),this.keyword=l.find(".data-toolbar-component-keyword"),this.placeholder=l.find(".data-toolbar-component-placeholder"),null===(e=this.keyword)||void 0===e||e.on("keydown",(function(t){Object(d["isHotkey"])("enter",t)&&t.preventDefault()}));var c=Date.now();null===(n=this.keyword)||void 0===n||n.on("input",(function(){if(i.resetPlaceHolder(),Date.now()-c<200){var t,e,n=null===(t=i.keyword)||void 0===t?void 0:t.first();if(n&&n.isText()&&"/、"===n[0].nodeValue||"//"===(null===n||void 0===n||null===(e=n.get())||void 0===e?void 0:e.nodeValue)){var r,o=null===(r=n.get())||void 0===r?void 0:r.splitText(1);null===o||void 0===o||o.remove()}}setTimeout((function(){i.handleInput()}),10)})),Object(w["a"])(this,Un)[Un]||(Object(w["a"])(this,Un)[Un]=this.getData()),null===(r=this.component)||void 0===r||r.render(o.root,this.root,Object(w["a"])(this,Un)[Un])}}}],[{key:"cardName",get:function(){return"toolbar"}},{key:"cardType",get:function(){return d["CardType"].INLINE}},{key:"singleSelectable",get:function(){return!1}},{key:"autoSelected",get:function(){return!1}}]),n}(d["Card"]),Gn=function(t){return[{title:t.language.get("toolbar","commonlyUsed","title"),items:["image-uploader","codeblock","table","file-uploader","video-uploader","math","status"]}]};d["Plugin"];e["a"]=Ln}).call(this,n("c8ba"))},"6ba6":function(t,e,n){"use strict";n.r(e);n("b2a3"),n("e679")},"6c57":function(t,e,n){var r=n("23e7"),i=n("da84");r({global:!0},{globalThis:i})},"6fd1":function(t,e){t.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},7023:function(t,e,n){},7039:function(t,e,n){var r=n("23e7"),i=n("d039"),o=n("057f").f,a=i((function(){return!Object.getOwnPropertyNames(1)}));r({target:"Object",stat:!0,forced:a},{getOwnPropertyNames:o})},"70e6":function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t["default"]=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Rectangle=void 0;var s=a(n("ca8e")),l=n("16ef"),c=n("5c2e"),u=n("6762"),d=n("722a"),h=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.x=null==e?0:e,o.y=null==n?0:n,o.width=null==r?0:r,o.height=null==i?0:i,o}return r(e,t),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"origin",{get:function(){return new u.Point(this.x,this.y)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topLeft",{get:function(){return new u.Point(this.x,this.y)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topCenter",{get:function(){return new u.Point(this.x+this.width/2,this.y)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topRight",{get:function(){return new u.Point(this.x+this.width,this.y)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return new u.Point(this.x+this.width/2,this.y+this.height/2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomLeft",{get:function(){return new u.Point(this.x,this.y+this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomCenter",{get:function(){return new u.Point(this.x+this.width/2,this.y+this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomRight",{get:function(){return new u.Point(this.x+this.width,this.y+this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"corner",{get:function(){return new u.Point(this.x+this.width,this.y+this.height)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightMiddle",{get:function(){return new u.Point(this.x+this.width,this.y+this.height/2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftMiddle",{get:function(){return new u.Point(this.x,this.y+this.height/2)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topLine",{get:function(){return new c.Line(this.topLeft,this.topRight)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightLine",{get:function(){return new c.Line(this.topRight,this.bottomRight)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomLine",{get:function(){return new c.Line(this.bottomLeft,this.bottomRight)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftLine",{get:function(){return new c.Line(this.topLeft,this.bottomLeft)},enumerable:!1,configurable:!0}),e.prototype.getOrigin=function(){return this.origin},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopCenter=function(){return this.topCenter},e.prototype.getTopRight=function(){return this.topRight},e.prototype.getCenter=function(){return this.center},e.prototype.getCenterX=function(){return this.x+this.width/2},e.prototype.getCenterY=function(){return this.y+this.height/2},e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getBottomCenter=function(){return this.bottomCenter},e.prototype.getBottomRight=function(){return this.bottomRight},e.prototype.getCorner=function(){return this.corner},e.prototype.getRightMiddle=function(){return this.rightMiddle},e.prototype.getLeftMiddle=function(){return this.leftMiddle},e.prototype.getTopLine=function(){return this.topLine},e.prototype.getRightLine=function(){return this.rightLine},e.prototype.getBottomLine=function(){return this.bottomLine},e.prototype.getLeftLine=function(){return this.leftLine},e.prototype.bbox=function(t){if(!t)return this.clone();var n=l.Angle.toRad(t),r=Math.abs(Math.sin(n)),i=Math.abs(Math.cos(n)),o=this.width*i+this.height*r,a=this.width*r+this.height*i;return new e(this.x+(this.width-o)/2,this.y+(this.height-a)/2,o,a)},e.prototype.round=function(t){return void 0===t&&(t=0),this.x=s.round(this.x,t),this.y=s.round(this.y,t),this.width=s.round(this.width,t),this.height=s.round(this.height,t),this},e.prototype.add=function(t,n,r,i){var o=e.create(t,n,r,i),a=Math.min(this.x,o.x),s=Math.min(this.y,o.y),l=Math.max(this.x+this.width,o.x+o.width),c=Math.max(this.y+this.height,o.y+o.height);return this.x=a,this.y=s,this.width=l-a,this.height=c-s,this},e.prototype.update=function(t,n,r,i){var o=e.create(t,n,r,i);return this.x=o.x,this.y=o.y,this.width=o.width,this.height=o.height,this},e.prototype.inflate=function(t,e){var n=t,r=null!=e?e:t;return this.x-=n,this.y-=r,this.width+=2*n,this.height+=2*r,this},e.prototype.snapToGrid=function(t,e){var n=this.origin.snapToGrid(t,e),r=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=r.x-n.x,this.height=r.y-n.y,this},e.prototype.translate=function(t,e){var n=u.Point.create(t,e);return this.x+=n.x,this.y+=n.y,this},e.prototype.scale=function(t,e,n){void 0===n&&(n=new u.Point);var r=this.origin.scale(t,e,n);return this.x=r.x,this.y=r.y,this.width*=t,this.height*=e,this},e.prototype.rotate=function(t,n){if(void 0===n&&(n=this.getCenter()),0!==t){var r=l.Angle.toRad(t),i=Math.cos(r),o=Math.sin(r),a=this.getOrigin(),s=this.getTopRight(),c=this.getBottomRight(),d=this.getBottomLeft();a=u.Point.rotateEx(a,i,o,n),s=u.Point.rotateEx(s,i,o,n),c=u.Point.rotateEx(c,i,o,n),d=u.Point.rotateEx(d,i,o,n);var h=new e(a.x,a.y,0,0);h.add(s.x,s.y,0,0),h.add(c.x,c.y,0,0),h.add(d.x,d.y,0,0),this.update(h)}return this},e.prototype.rotate90=function(){var t=(this.width-this.height)/2;this.x+=t,this.y-=t;var e=this.width;return this.width=this.height,this.height=e,this},e.prototype.moveAndExpand=function(t){var n=e.clone(t);return this.x+=n.x||0,this.y+=n.y||0,this.width+=n.width||0,this.height+=n.height||0,this},e.prototype.getMaxScaleToFit=function(t,n){void 0===n&&(n=this.center);var r=e.clone(t),i=n.x,o=n.y,a=1/0,s=1/0,l=1/0,c=1/0,u=1/0,d=1/0,h=1/0,p=1/0,f=r.topLeft;f.x<i&&(a=(this.x-i)/(f.x-i)),f.y<o&&(u=(this.y-o)/(f.y-o));var g=r.bottomRight;g.x>i&&(s=(this.x+this.width-i)/(g.x-i)),g.y>o&&(d=(this.y+this.height-o)/(g.y-o));var m=r.topRight;m.x>i&&(l=(this.x+this.width-i)/(m.x-i)),m.y<o&&(h=(this.y-o)/(m.y-o));var v=r.bottomLeft;return v.x<i&&(c=(this.x-i)/(v.x-i)),v.y>o&&(p=(this.y+this.height-o)/(v.y-o)),{sx:Math.min(a,s,l,c),sy:Math.min(u,d,h,p)}},e.prototype.getMaxUniformScaleToFit=function(t,e){void 0===e&&(e=this.center);var n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)},e.prototype.containsPoint=function(t,e){return s.containsPoint(this,u.Point.create(t,e))},e.prototype.containsRect=function(t,n,r,i){var o=e.create(t,n,r,i),a=this.x,s=this.y,l=this.width,c=this.height,u=o.x,d=o.y,h=o.width,p=o.height;return 0!==l&&0!==c&&0!==h&&0!==p&&(u>=a&&d>=s&&u+h<=a+l&&d+p<=s+c)},e.prototype.intersectsWithLine=function(t){var e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],r=[];return e.forEach((function(e){var i=t.intersectsWithLine(e);null!==i&&r.indexOf(i.toString())<0&&(n.push(i),r.push(i.toString()))})),n.length>0?n:null},e.prototype.intersectsWithLineFromCenterToPoint=function(t,e){var n=u.Point.clone(t),r=this.center,i=null;null!=e&&0!==e&&n.rotate(e,r);for(var o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new c.Line(r,n),s=o.length-1;s>=0;s-=1){var l=o[s].intersectsWithLine(a);if(null!==l){i=l;break}}return i&&null!=e&&0!==e&&i.rotate(-e,r),i},e.prototype.intersectsWithRect=function(t,n,r,i){var o=e.create(t,n,r,i);if(!this.isIntersectWithRect(o))return null;var a=this.origin,s=this.corner,l=o.origin,c=o.corner,u=Math.max(a.x,l.x),d=Math.max(a.y,l.y);return new e(u,d,Math.min(s.x,c.x)-u,Math.min(s.y,c.y)-d)},e.prototype.isIntersectWithRect=function(t,n,r,i){var o=e.create(t,n,r,i),a=this.origin,s=this.corner,l=o.origin,c=o.corner;return!(c.x<=a.x||c.y<=a.y||l.x>=s.x||l.y>=s.y)},e.prototype.normalize=function(){var t=this.x,e=this.y,n=this.width,r=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,r=-this.height),this.x=t,this.y=e,this.width=n,this.height=r,this},e.prototype.union=function(t){var n=e.clone(t),r=this.origin,i=this.corner,o=n.origin,a=n.corner,s=Math.min(r.x,o.x),l=Math.min(r.y,o.y),c=Math.max(i.x,a.x),u=Math.max(i.y,a.y);return new e(s,l,c-s,u-l)},e.prototype.getNearestSideToPoint=function(t){var e=u.Point.clone(t),n=e.x-this.x,r=this.x+this.width-e.x,i=e.y-this.y,o=this.y+this.height-e.y,a=n,s="left";return r<a&&(a=r,s="right"),i<a&&(a=i,s="top"),o<a&&(s="bottom"),s},e.prototype.getNearestPointToPoint=function(t){var e=u.Point.clone(t);if(this.containsPoint(e)){var n=this.getNearestSideToPoint(e);switch(n){case"right":return new u.Point(this.x+this.width,e.y);case"left":return new u.Point(this.x,e.y);case"bottom":return new u.Point(e.x,this.y+this.height);case"top":return new u.Point(e.x,this.y);default:break}}return e.adhereToRect(this)},e.prototype.equals=function(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.serialize=function(){return this.x+" "+this.y+" "+this.width+" "+this.height},e}(d.Geometry);e.Rectangle=h,function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"number"===typeof r.x&&"number"===typeof r.y&&"number"===typeof r.width&&"number"===typeof r.height&&"function"===typeof r.inflate&&"function"===typeof r.moveAndExpand}t.toStringTag="X6.Geometry."+t.name,t.isRectangle=e}(h=e.Rectangle||(e.Rectangle={})),e.Rectangle=h,function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y&&"number"===typeof t.width&&"number"===typeof t.height}t.isRectangleLike=e}(h=e.Rectangle||(e.Rectangle={})),e.Rectangle=h,function(t){function e(e,r,i,o){return null==e||"number"===typeof e?new t(e,r,i,o):n(e)}function n(e){return t.isRectangle(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.width,e.height)}function r(e){return new t(0,0,e.width,e.height)}function i(e,n){return new t(e.x,e.y,n.width,n.height)}function o(e){return new t(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}t.create=e,t.clone=n,t.fromSize=r,t.fromPositionAndSize=i,t.fromEllipse=o}(h=e.Rectangle||(e.Rectangle={})),e.Rectangle=h},71493:function(t,e,n){"use strict";n("aee6")},"715d":function(t,e,n){(function(t){t(n("56b3"),n("b933"),n("9c7b"))})((function(t){"use strict";function e(t,e,n,r){this.cm=t,this.options=r;var i={listenForChanges:!1};for(var o in r)i[o]=r[o];i.className||(i.className="CodeMirror-search-match"),this.annotation=t.annotateScrollbar(i),this.query=e,this.caseFold=n,this.gap={from:t.firstLine(),to:t.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;t.on("change",this.changeHandler=function(t,e){a.onChange(e)})}t.defineExtension("showMatchesOnScrollbar",(function(t,n,r){return"string"==typeof r&&(r={className:r}),r||(r={}),new e(this,t,n,r)}));var n=1e3;function r(t,e,n){return t<=e?t:Math.max(e,t+n)}e.prototype.findMatches=function(){if(this.gap){for(var e=0;e<this.matches.length;e++){var r=this.matches[e];if(r.from.line>=this.gap.to)break;r.to.line>=this.gap.from&&this.matches.splice(e--,1)}var i=this.cm.getSearchCursor(this.query,t.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),o=this.options&&this.options.maxMatches||n;while(i.findNext()){r={from:i.from(),to:i.to()};if(r.from.line>=this.gap.to)break;if(this.matches.splice(e++,0,r),this.matches.length>o)break}this.gap=null}},e.prototype.onChange=function(e){var n=e.from.line,i=t.changeEnd(e).line,o=i-e.to.line;if(this.gap?(this.gap.from=Math.min(r(this.gap.from,n,o),e.from.line),this.gap.to=Math.max(r(this.gap.to,n,o),e.from.line)):this.gap={from:e.from.line,to:i+1},o)for(var a=0;a<this.matches.length;a++){var s=this.matches[a],l=r(s.from.line,n,o);l!=s.from.line&&(s.from=t.Pos(l,s.from.ch));var c=r(s.to.line,n,o);c!=s.to.line&&(s.to=t.Pos(c,s.to.ch))}clearTimeout(this.update);var u=this;this.update=setTimeout((function(){u.updateAfterChange()}),250)},e.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},e.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}))},"71c8":function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Ellipse=void 0;var i=n("6762"),o=n("70e6"),a=n("722a"),s=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.x=null==e?0:e,o.y=null==n?0:n,o.a=null==r?0:r,o.b=null==i?0:i,o}return r(e,t),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return new i.Point(this.x,this.y)},enumerable:!1,configurable:!0}),e.prototype.bbox=function(){return o.Rectangle.fromEllipse(this)},e.prototype.getCenter=function(){return this.center},e.prototype.inflate=function(t,e){var n=t,r=null!=e?e:t;return this.a+=2*n,this.b+=2*r,this},e.prototype.normalizedDistance=function(t,e){var n=i.Point.create(t,e),r=n.x-this.x,o=n.y-this.y,a=this.a,s=this.b;return r*r/(a*a)+o*o/(s*s)},e.prototype.containsPoint=function(t,e){return this.normalizedDistance(t,e)<=1},e.prototype.intersectsWithLine=function(t){var e=[],n=this.a,r=this.b,o=t.start,a=t.end,s=t.vector(),l=o.diff(new i.Point(this.x,this.y)),c=new i.Point(s.x/(n*n),s.y/(r*r)),u=new i.Point(l.x/(n*n),l.y/(r*r)),d=s.dot(c),h=s.dot(u),p=l.dot(u)-1,f=h*h-d*p;if(f<0)return null;if(f>0){var g=Math.sqrt(f),m=(-h-g)/d,v=(-h+g)/d;if((m<0||m>1)&&(v<0||v>1))return null;m>=0&&m<=1&&e.push(o.lerp(a,m)),v>=0&&v<=1&&e.push(o.lerp(a,v))}else{var b=-h/d;if(!(b>=0&&b<=1))return null;e.push(o.lerp(a,b))}return e},e.prototype.intersectsWithLineFromCenterToPoint=function(t,e){void 0===e&&(e=0);var n=i.Point.clone(t);e&&n.rotate(e,this.getCenter());var r,o=n.x-this.x,a=n.y-this.y;if(0===o)return r=this.bbox().getNearestPointToPoint(n),e?r.rotate(-e,this.getCenter()):r;var s=a/o,l=s*s,c=this.a*this.a,u=this.b*this.b,d=Math.sqrt(1/(1/c+l/u));d=o<0?-d:d;var h=s*d;return r=new i.Point(this.x+d,this.y+h),e?r.rotate(-e,this.getCenter()):r},e.prototype.tangentTheta=function(t){var e,n,r=i.Point.clone(t),o=r.x,a=r.y,s=this.a,l=this.b,c=this.bbox().center,u=c.x,d=c.y,h=30,p=o>c.x+s/2,f=o<c.x-s/2;return p||f?(n=o>c.x?a-h:a+h,e=s*s/(o-u)-s*s*(a-d)*(n-d)/(l*l*(o-u))+u):(e=a>c.y?o+h:o-h,n=l*l/(a-d)-l*l*(o-u)*(e-u)/(s*s*(a-d))+d),new i.Point(e,n).theta(r)},e.prototype.scale=function(t,e){return this.a*=t,this.b*=e,this},e.prototype.rotate=function(t,n){var r=o.Rectangle.fromEllipse(this);r.rotate(t,n);var i=e.fromRect(r);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this},e.prototype.translate=function(t,e){var n=i.Point.create(t,e);return this.x+=n.x,this.y+=n.y,this},e.prototype.equals=function(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b},e.prototype.clone=function(){return new e(this.x,this.y,this.a,this.b)},e.prototype.toJSON=function(){return{x:this.x,y:this.y,a:this.a,b:this.b}},e.prototype.serialize=function(){return this.x+" "+this.y+" "+this.a+" "+this.b},e}(a.Geometry);e.Ellipse=s,function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return(null==n||n===t.toStringTag)&&"number"===typeof r.x&&"number"===typeof r.y&&"number"===typeof r.a&&"number"===typeof r.b&&"function"===typeof r.inflate&&"function"===typeof r.normalizedDistance}t.toStringTag="X6.Geometry."+t.name,t.isEllipse=e}(s=e.Ellipse||(e.Ellipse={})),e.Ellipse=s,function(t){function e(e,r,i,o){return null==e||"number"===typeof e?new t(e,r,i,o):n(e)}function n(e){return t.isEllipse(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.a,e.b)}function r(e){var n=e.center;return new t(n.x,n.y,e.width/2,e.height/2)}t.create=e,t.parse=n,t.fromRect=r}(s=e.Ellipse||(e.Ellipse={})),e.Ellipse=s},"722a":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Geometry=void 0;var r=function(){function t(){}return t.prototype.valueOf=function(){return this.toJSON()},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},t}();e.Geometry=r},7232:function(t,e,n){(function(r){var i;
/*!
* EventEmitter2
* https://github.com/hij1nx/EventEmitter2
*
* Copyright (c) 2013 hij1nx
* Licensed under the MIT license.
*/!function(o){var a=Object.hasOwnProperty,s=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},l=10,c="object"==typeof r&&"function"==typeof r.nextTick,u="function"===typeof Symbol,d="object"===typeof Reflect,h="function"===typeof setImmediate,p=h?setImmediate:setTimeout,f=u?d&&"function"===typeof Reflect.ownKeys?Reflect.ownKeys:function(t){var e=Object.getOwnPropertyNames(t);return e.push.apply(e,Object.getOwnPropertySymbols(t)),e}:Object.keys;function g(){this._events={},this._conf&&m.call(this,this._conf)}function m(t){t&&(this._conf=t,t.delimiter&&(this.delimiter=t.delimiter),t.maxListeners!==o&&(this._maxListeners=t.maxListeners),t.wildcard&&(this.wildcard=t.wildcard),t.newListener&&(this._newListener=t.newListener),t.removeListener&&(this._removeListener=t.removeListener),t.verboseMemoryLeak&&(this.verboseMemoryLeak=t.verboseMemoryLeak),t.ignoreErrors&&(this.ignoreErrors=t.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function v(t,e){var n="(node) warning: possible EventEmitter memory leak detected. "+t+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(n+=" Event name: "+e+"."),"undefined"!==typeof r&&r.emitWarning){var i=new Error(n);i.name="MaxListenersExceededWarning",i.emitter=this,i.count=t,r.emitWarning(i)}else console.error(n),console.trace&&console.trace()}var b=function(t,e,n){var r=arguments.length;switch(r){case 0:return[];case 1:return[t];case 2:return[t,e];case 3:return[t,e,n];default:var i=new Array(r);while(r--)i[r]=arguments[r];return i}};function y(t,e){for(var n,r={},i=t.length,a=e?e.length:0,s=0;s<i;s++)n=t[s],r[n]=s<a?e[s]:o;return r}function w(t,e,n){var r,i;if(this._emitter=t,this._target=e,this._listeners={},this._listenersCount=0,(n.on||n.off)&&(r=n.on,i=n.off),e.addEventListener?(r=e.addEventListener,i=e.removeEventListener):e.addListener?(r=e.addListener,i=e.removeListener):e.on&&(r=e.on,i=e.off),!r&&!i)throw Error("target does not implement any known event API");if("function"!==typeof r)throw TypeError("on method must be a function");if("function"!==typeof i)throw TypeError("off method must be a function");this._on=r,this._off=i;var o=t._observers;o?o.push(this):t._observers=[this]}function x(t,e,n,r){var i=Object.assign({},e);if(!t)return i;if("object"!==typeof t)throw TypeError("options must be an object");var s,l,c,u=Object.keys(t),d=u.length;function h(t){throw Error('Invalid "'+s+'" option value'+(t?". Reason: "+t:""))}for(var p=0;p<d;p++){if(s=u[p],!r&&!a.call(e,s))throw Error('Unknown "'+s+'" option');l=t[s],l!==o&&(c=n[s],i[s]=c?c(l,h):l)}return i}function C(t,e){return"function"===typeof t&&t.hasOwnProperty("prototype")||e("value must be a constructor"),t}function k(t){var e="value must be type of "+t.join("|"),n=t.length,r=t[0],i=t[1];return 1===n?function(t,n){if(typeof t===r)return t;n(e)}:2===n?function(t,n){var o=typeof t;if(o===r||o===i)return t;n(e)}:function(r,i){var o=typeof r,a=n;while(a-- >0)if(o===t[a])return r;i(e)}}Object.assign(w.prototype,{subscribe:function(t,e,n){var r=this,i=this._target,o=this._emitter,a=this._listeners,s=function(){var r=b.apply(null,arguments),a={data:r,name:e,original:t};if(n){var s=n.call(i,a);!1!==s&&o.emit.apply(o,[a.name].concat(r))}else o.emit.apply(o,[e].concat(r))};if(a[t])throw Error("Event '"+t+"' is already listening");this._listenersCount++,o._newListener&&o._removeListener&&!r._onNewListener?(this._onNewListener=function(n){n===e&&null===a[t]&&(a[t]=s,r._on.call(i,t,s))},o.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===e&&!o.hasListeners(n)&&a[t]&&(a[t]=null,r._off.call(i,t,s))},a[t]=null,o.on("removeListener",this._onRemoveListener)):(a[t]=s,r._on.call(i,t,s))},unsubscribe:function(t){var e,n,r,i=this,o=this._listeners,a=this._emitter,s=this._off,l=this._target;if(t&&"string"!==typeof t)throw TypeError("event must be a string");function c(){i._onNewListener&&(a.off("newListener",i._onNewListener),a.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var t=O.call(a,i);a._observers.splice(t,1)}if(t){if(e=o[t],!e)return;s.call(l,t,e),delete o[t],--this._listenersCount||c()}else{n=f(o),r=n.length;while(r-- >0)t=n[r],s.call(l,t,o[t]);this._listeners={},this._listenersCount=0,c()}}});var A=k(["function"]),S=k(["object","function"]);function E(t,e,n){var r,i,o,a=0,s=new t((function(l,c,u){function d(){i&&(i=null),a&&(clearTimeout(a),a=0)}n=x(n,{timeout:0,overload:!1},{timeout:function(t,e){return t*=1,("number"!==typeof t||t<0||!Number.isFinite(t))&&e("timeout must be a positive number"),t}}),r=!n.overload&&"function"===typeof t.prototype.cancel&&"function"===typeof u;var h=function(t){d(),l(t)},p=function(t){d(),c(t)};r?e(h,p,u):(i=[function(t){p(t||Error("canceled"))}],e(h,p,(function(t){if(o)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!==typeof t)throw TypeError("onCancel callback must be a function");i.push(t)})),o=!0),n.timeout>0&&(a=setTimeout((function(){var t=Error("timeout");t.code="ETIMEDOUT",a=0,s.cancel(t),c(t)}),n.timeout))}));return r||(s.cancel=function(t){if(i){for(var e=i.length,n=1;n<e;n++)i[n](t);i[0](t),i=null}}),s}function O(t){var e=this._observers;if(!e)return-1;for(var n=e.length,r=0;r<n;r++)if(e[r]._target===t)return r;return-1}function T(t,e,n,r,i){if(!n)return null;if(0===r){var o=typeof e;if("string"===o){var a,s,l=0,c=0,u=this.delimiter,d=u.length;if(-1!==(s=e.indexOf(u))){a=new Array(5);do{a[l++]=e.slice(c,s),c=s+d}while(-1!==(s=e.indexOf(u,c)));a[l++]=e.slice(c),e=a,i=l}else e=[e],i=1}else"object"===o?i=e.length:(e=[e],i=1)}var h,p,g,m,v,b,y,w=null,x=e[r],C=e[r+1];if(r===i)n._listeners&&("function"===typeof n._listeners?(t&&t.push(n._listeners),w=[n]):(t&&t.push.apply(t,n._listeners),w=[n]));else{if("*"===x){b=f(n),s=b.length;while(s-- >0)h=b[s],"_listeners"!==h&&(y=T(t,e,n[h],r+1,i),y&&(w?w.push.apply(w,y):w=y));return w}if("**"===x){v=r+1===i||r+2===i&&"*"===C,v&&n._listeners&&(w=T(t,e,n,i,i)),b=f(n),s=b.length;while(s-- >0)h=b[s],"_listeners"!==h&&("*"===h||"**"===h?(n[h]._listeners&&!v&&(y=T(t,e,n[h],i,i),y&&(w?w.push.apply(w,y):w=y)),y=T(t,e,n[h],r,i)):y=T(t,e,n[h],h===C?r+2:r,i),y&&(w?w.push.apply(w,y):w=y));return w}n[x]&&(w=T(t,e,n[x],r+1,i))}if(p=n["*"],p&&T(t,e,p,r+1,i),g=n["**"],g)if(r<i){g._listeners&&T(t,e,g,i,i),b=f(g),s=b.length;while(s-- >0)h=b[s],"_listeners"!==h&&(h===C?T(t,e,g[h],r+2,i):h===x?T(t,e,g[h],r+1,i):(m={},m[h]=g[h],T(t,e,{"**":m},r+1,i)))}else g._listeners?T(t,e,g,i,i):g["*"]&&g["*"]._listeners&&T(t,e,g["*"],i,i);return w}function _(t,e,n){var r,i,o=0,a=0,s=this.delimiter,l=s.length;if("string"===typeof t)if(-1!==(r=t.indexOf(s))){i=new Array(5);do{i[o++]=t.slice(a,r),a=r+l}while(-1!==(r=t.indexOf(s,a)));i[o++]=t.slice(a)}else i=[t],o=1;else i=t,o=t.length;if(o>1)for(r=0;r+1<o;r++)if("**"===i[r]&&"**"===i[r+1])return;var c,u=this.listenerTree;for(r=0;r<o;r++)if(c=i[r],u=u[c]||(u[c]={}),r===o-1)return u._listeners?("function"===typeof u._listeners&&(u._listeners=[u._listeners]),n?u._listeners.unshift(e):u._listeners.push(e),!u._listeners.warned&&this._maxListeners>0&&u._listeners.length>this._maxListeners&&(u._listeners.warned=!0,v.call(this,u._listeners.length,c))):u._listeners=e,!0;return!0}function M(t,e,n,r){var i,o,a,s,l=f(t),c=l.length,u=t["_listeners"];while(c-- >0)o=l[c],i=t[o],a="_listeners"===o?n:n?n.concat(o):[o],s=r||"symbol"===typeof o,u&&e.push(s?a:a.join(this.delimiter)),"object"===typeof i&&M.call(this,i,e,a,s);return e}function N(t){var e,n,r,i=f(t),o=i.length;while(o-- >0)n=i[o],e=t[n],e&&(r=!0,"_listeners"===n||N(e)||delete t[n]);return r}function P(t,e,n){this.emitter=t,this.event=e,this.listener=n}function L(t,e,n){if(!0===n)a=!0;else if(!1===n)i=!0;else{if(!n||"object"!==typeof n)throw TypeError("options should be an object or true");var i=n.async,a=n.promisify,s=n.nextTick,l=n.objectify}if(i||s||a){var u=e,d=e._origin||e;if(s&&!c)throw Error("process.nextTick is not supported");a===o&&(a="AsyncFunction"===e.constructor.name),e=function(){var t=arguments,e=this,n=this.event;return a?s?Promise.resolve():new Promise((function(t){p(t)})).then((function(){return e.event=n,u.apply(e,t)})):(s?r.nextTick:p)((function(){e.event=n,u.apply(e,t)}))},e._async=!0,e._origin=d}return[e,l?new P(this,t,e):this]}function D(t){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,m.call(this,t)}function j(t,e,n){n=x(n,{Promise:Promise,timeout:0,overload:!1},{Promise:C});var r=n.Promise;return E(r,(function(n,r,i){var o;if("function"===typeof t.addEventListener)return o=function(){n(b.apply(null,arguments))},i((function(){t.removeEventListener(e,o)})),void t.addEventListener(e,o,{once:!0});var a,s=function(){a&&t.removeListener("error",a),n(b.apply(null,arguments))};"error"!==e&&(a=function(n){t.removeListener(e,s),r(n)},t.once("error",a)),i((function(){a&&t.removeListener("error",a),t.removeListener(e,s)})),t.once(e,s)}),{timeout:n.timeout,overload:n.overload})}P.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},D.EventEmitter2=D,D.prototype.listenTo=function(t,e,n){if("object"!==typeof t)throw TypeError("target musts be an object");var r=this;function i(e){if("object"!==typeof e)throw TypeError("events must be an object");var i,o=n.reducers,a=O.call(r,t);i=-1===a?new w(r,t,n):r._observers[a];for(var s,l=f(e),c=l.length,u="function"===typeof o,d=0;d<c;d++)s=l[d],i.subscribe(s,e[s]||s,u?o:o&&o[s])}return n=x(n,{on:o,off:o,reducers:o},{on:A,off:A,reducers:S}),s(e)?i(y(e)):i("string"===typeof e?y(e.split(/\s+/)):e),this},D.prototype.stopListeningTo=function(t,e){var n=this._observers;if(!n)return!1;var r,i=n.length,o=!1;if(t&&"object"!==typeof t)throw TypeError("target should be an object");while(i-- >0)r=n[i],t&&r._target!==t||(r.unsubscribe(e),o=!0);return o},D.prototype.delimiter=".",D.prototype.setMaxListeners=function(t){t!==o&&(this._maxListeners=t,this._conf||(this._conf={}),this._conf.maxListeners=t)},D.prototype.getMaxListeners=function(){return this._maxListeners},D.prototype.event="",D.prototype.once=function(t,e,n){return this._once(t,e,!1,n)},D.prototype.prependOnceListener=function(t,e,n){return this._once(t,e,!0,n)},D.prototype._once=function(t,e,n,r){return this._many(t,1,e,n,r)},D.prototype.many=function(t,e,n,r){return this._many(t,e,n,!1,r)},D.prototype.prependMany=function(t,e,n,r){return this._many(t,e,n,!0,r)},D.prototype._many=function(t,e,n,r,i){var o=this;if("function"!==typeof n)throw new Error("many only accepts instances of Function");function a(){return 0===--e&&o.off(t,a),n.apply(this,arguments)}return a._origin=n,this._on(t,a,r,i)},D.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||g.call(this);var t,e,n,r,i,o,a=arguments[0],s=this.wildcard;if("newListener"===a&&!this._newListener&&!this._events.newListener)return!1;if(s&&(t=a,"newListener"!==a&&"removeListener"!==a&&"object"===typeof a)){if(n=a.length,u)for(r=0;r<n;r++)if("symbol"===typeof a[r]){o=!0;break}o||(a=a.join(this.delimiter))}var l,c=arguments.length;if(this._all&&this._all.length)for(l=this._all.slice(),r=0,n=l.length;r<n;r++)switch(this.event=a,c){case 1:l[r].call(this,a);break;case 2:l[r].call(this,a,arguments[1]);break;case 3:l[r].call(this,a,arguments[1],arguments[2]);break;default:l[r].apply(this,arguments)}if(s)l=[],T.call(this,l,t,this.listenerTree,0,n);else{if(l=this._events[a],"function"===typeof l){switch(this.event=a,c){case 1:l.call(this);break;case 2:l.call(this,arguments[1]);break;case 3:l.call(this,arguments[1],arguments[2]);break;default:for(e=new Array(c-1),i=1;i<c;i++)e[i-1]=arguments[i];l.apply(this,e)}return!0}l&&(l=l.slice())}if(l&&l.length){if(c>3)for(e=new Array(c-1),i=1;i<c;i++)e[i-1]=arguments[i];for(r=0,n=l.length;r<n;r++)switch(this.event=a,c){case 1:l[r].call(this);break;case 2:l[r].call(this,arguments[1]);break;case 3:l[r].call(this,arguments[1],arguments[2]);break;default:l[r].apply(this,e)}return!0}if(!this.ignoreErrors&&!this._all&&"error"===a)throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},D.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||g.call(this);var t,e,n,r,i,o,a=arguments[0],s=this.wildcard;if("newListener"===a&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(s&&(t=a,"newListener"!==a&&"removeListener"!==a&&"object"===typeof a)){if(r=a.length,u)for(i=0;i<r;i++)if("symbol"===typeof a[i]){e=!0;break}e||(a=a.join(this.delimiter))}var l,c=[],d=arguments.length;if(this._all)for(i=0,r=this._all.length;i<r;i++)switch(this.event=a,d){case 1:c.push(this._all[i].call(this,a));break;case 2:c.push(this._all[i].call(this,a,arguments[1]));break;case 3:c.push(this._all[i].call(this,a,arguments[1],arguments[2]));break;default:c.push(this._all[i].apply(this,arguments))}if(s?(l=[],T.call(this,l,t,this.listenerTree,0)):l=this._events[a],"function"===typeof l)switch(this.event=a,d){case 1:c.push(l.call(this));break;case 2:c.push(l.call(this,arguments[1]));break;case 3:c.push(l.call(this,arguments[1],arguments[2]));break;default:for(n=new Array(d-1),o=1;o<d;o++)n[o-1]=arguments[o];c.push(l.apply(this,n))}else if(l&&l.length){if(l=l.slice(),d>3)for(n=new Array(d-1),o=1;o<d;o++)n[o-1]=arguments[o];for(i=0,r=l.length;i<r;i++)switch(this.event=a,d){case 1:c.push(l[i].call(this));break;case 2:c.push(l[i].call(this,arguments[1]));break;case 3:c.push(l[i].call(this,arguments[1],arguments[2]));break;default:c.push(l[i].apply(this,n))}}else if(!this.ignoreErrors&&!this._all&&"error"===a)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(c)},D.prototype.on=function(t,e,n){return this._on(t,e,!1,n)},D.prototype.prependListener=function(t,e,n){return this._on(t,e,!0,n)},D.prototype.onAny=function(t){return this._onAny(t,!1)},D.prototype.prependAny=function(t){return this._onAny(t,!0)},D.prototype.addListener=D.prototype.on,D.prototype._onAny=function(t,e){if("function"!==typeof t)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),e?this._all.unshift(t):this._all.push(t),this},D.prototype._on=function(t,e,n,r){if("function"===typeof t)return this._onAny(t,e),this;if("function"!==typeof e)throw new Error("on only accepts instances of Function");this._events||g.call(this);var i,a=this;return r!==o&&(i=L.call(this,t,e,r),e=i[0],a=i[1]),this._newListener&&this.emit("newListener",t,e),this.wildcard?(_.call(this,t,e,n),a):(this._events[t]?("function"===typeof this._events[t]&&(this._events[t]=[this._events[t]]),n?this._events[t].unshift(e):this._events[t].push(e),!this._events[t].warned&&this._maxListeners>0&&this._events[t].length>this._maxListeners&&(this._events[t].warned=!0,v.call(this,this._events[t].length,t))):this._events[t]=e,a)},D.prototype.off=function(t,e){if("function"!==typeof e)throw new Error("removeListener only takes instances of Function");var n,r=[];if(this.wildcard){var i="string"===typeof t?t.split(this.delimiter):t.slice();if(r=T.call(this,null,i,this.listenerTree,0),!r)return this}else{if(!this._events[t])return this;n=this._events[t],r.push({_listeners:n})}for(var o=0;o<r.length;o++){var a=r[o];if(n=a._listeners,s(n)){for(var l=-1,c=0,u=n.length;c<u;c++)if(n[c]===e||n[c].listener&&n[c].listener===e||n[c]._origin&&n[c]._origin===e){l=c;break}if(l<0)continue;return this.wildcard?a._listeners.splice(l,1):this._events[t].splice(l,1),0===n.length&&(this.wildcard?delete a._listeners:delete this._events[t]),this._removeListener&&this.emit("removeListener",t,e),this}(n===e||n.listener&&n.listener===e||n._origin&&n._origin===e)&&(this.wildcard?delete a._listeners:delete this._events[t],this._removeListener&&this.emit("removeListener",t,e))}return this.listenerTree&&N(this.listenerTree),this},D.prototype.offAny=function(t){var e,n=0,r=0;if(t&&this._all&&this._all.length>0){for(e=this._all,n=0,r=e.length;n<r;n++)if(t===e[n])return e.splice(n,1),this._removeListener&&this.emit("removeListenerAny",t),this}else{if(e=this._all,this._removeListener)for(n=0,r=e.length;n<r;n++)this.emit("removeListenerAny",e[n]);this._all=[]}return this},D.prototype.removeListener=D.prototype.off,D.prototype.removeAllListeners=function(t){if(t===o)return!this._events||g.call(this),this;if(this.wildcard){var e,n,r=T.call(this,null,t,this.listenerTree,0);if(!r)return this;for(n=0;n<r.length;n++)e=r[n],e._listeners=null;this.listenerTree&&N(this.listenerTree)}else this._events&&(this._events[t]=null);return this},D.prototype.listeners=function(t){var e,n,r,i,a,s=this._events;if(t===o){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!s)return[];e=f(s),i=e.length,r=[];while(i-- >0)n=s[e[i]],"function"===typeof n?r.push(n):r.push.apply(r,n);return r}if(this.wildcard){if(a=this.listenerTree,!a)return[];var l=[],c="string"===typeof t?t.split(this.delimiter):t.slice();return T.call(this,l,c,a,0),l}return s?(n=s[t],n?"function"===typeof n?[n]:n:[]):[]},D.prototype.eventNames=function(t){var e=this._events;return this.wildcard?M.call(this,this.listenerTree,[],null,t):e?f(e):[]},D.prototype.listenerCount=function(t){return this.listeners(t).length},D.prototype.hasListeners=function(t){if(this.wildcard){var e=[],n="string"===typeof t?t.split(this.delimiter):t.slice();return T.call(this,e,n,this.listenerTree,0),e.length>0}var r=this._events,i=this._all;return!!(i&&i.length||r&&(t===o?f(r).length:r[t]))},D.prototype.listenersAny=function(){return this._all?this._all:[]},D.prototype.waitFor=function(t,e){var n=this,r=typeof e;return"number"===r?e={timeout:e}:"function"===r&&(e={filter:e}),e=x(e,{timeout:0,filter:o,handleError:!1,Promise:Promise,overload:!1},{filter:A,Promise:C}),E(e.Promise,(function(r,i,o){function a(){var o=e.filter;if(!o||o.apply(n,arguments))if(n.off(t,a),e.handleError){var s=arguments[0];s?i(s):r(b.apply(null,arguments).slice(1))}else r(b.apply(null,arguments))}o((function(){n.off(t,a)})),n._on(t,a,!1)}),{timeout:e.timeout,overload:e.overload})};var I=D.prototype;Object.defineProperties(D,{defaultMaxListeners:{get:function(){return I._maxListeners},set:function(t){if("number"!==typeof t||t<0||Number.isNaN(t))throw TypeError("n must be a non-negative number");I._maxListeners=t},enumerable:!0},once:{value:j,writable:!0,configurable:!0}}),Object.defineProperties(I,{_maxListeners:{value:l,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),i=function(){return D}.call(e,n,e,t),i===o||(t.exports=i)}()}).call(this,n("4362"))},7276:function(t,e,n){"use strict";var r=n("6d61"),i=n("acac");r("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),i)},7289:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";var e={},n=/[^\s\u00a0]/,r=t.Pos,i=t.cmpPos;function o(t){var e=t.search(n);return-1==e?0:e}function a(t,e,n){return/\bstring\b/.test(t.getTokenTypeAt(r(e.line,0)))&&!/^[\'\"\`]/.test(n)}function s(t,e){var n=t.getMode();return!1!==n.useInnerComments&&n.innerMode?t.getModeAt(e):n}t.commands.toggleComment=function(t){t.toggleComment()},t.defineExtension("toggleComment",(function(t){t||(t=e);for(var n=this,i=1/0,o=this.listSelections(),a=null,s=o.length-1;s>=0;s--){var l=o[s].from(),c=o[s].to();l.line>=i||(c.line>=i&&(c=r(i,0)),i=l.line,null==a?n.uncomment(l,c,t)?a="un":(n.lineComment(l,c,t),a="line"):"un"==a?n.uncomment(l,c,t):n.lineComment(l,c,t))}})),t.defineExtension("lineComment",(function(t,i,l){l||(l=e);var c=this,u=s(c,t),d=c.getLine(t.line);if(null!=d&&!a(c,t,d)){var h=l.lineComment||u.lineComment;if(h){var p=Math.min(0!=i.ch||i.line==t.line?i.line+1:i.line,c.lastLine()+1),f=null==l.padding?" ":l.padding,g=l.commentBlankLines||t.line==i.line;c.operation((function(){if(l.indent){for(var e=null,i=t.line;i<p;++i){var a=c.getLine(i),s=-1===a.search(n)?a:a.slice(0,o(a));(null==e||e.length>s.length)&&(e=s)}for(i=t.line;i<p;++i){a=c.getLine(i);var u=e.length;(g||n.test(a))&&(a.slice(0,u)!=e&&(u=o(a)),c.replaceRange(e+h+f,r(i,0),r(i,u)))}}else for(i=t.line;i<p;++i)(g||n.test(c.getLine(i)))&&c.replaceRange(h+f,r(i,0))}))}else(l.blockCommentStart||u.blockCommentStart)&&(l.fullLines=!0,c.blockComment(t,i,l))}})),t.defineExtension("blockComment",(function(t,o,a){a||(a=e);var l=this,c=s(l,t),u=a.blockCommentStart||c.blockCommentStart,d=a.blockCommentEnd||c.blockCommentEnd;if(u&&d){if(!/\bcomment\b/.test(l.getTokenTypeAt(r(t.line,0)))){var h=Math.min(o.line,l.lastLine());h!=t.line&&0==o.ch&&n.test(l.getLine(h))&&--h;var p=null==a.padding?" ":a.padding;t.line>h||l.operation((function(){if(0!=a.fullLines){var e=n.test(l.getLine(h));l.replaceRange(p+d,r(h)),l.replaceRange(u+p,r(t.line,0));var s=a.blockCommentLead||c.blockCommentLead;if(null!=s)for(var f=t.line+1;f<=h;++f)(f!=h||e)&&l.replaceRange(s+p,r(f,0))}else{var g=0==i(l.getCursor("to"),o),m=!l.somethingSelected();l.replaceRange(d,o),g&&l.setSelection(m?o:l.getCursor("from"),o),l.replaceRange(u,t)}}))}}else(a.lineComment||c.lineComment)&&0!=a.fullLines&&l.lineComment(t,o,a)})),t.defineExtension("uncomment",(function(t,i,o){o||(o=e);var a,l=this,c=s(l,t),u=Math.min(0!=i.ch||i.line==t.line?i.line:i.line-1,l.lastLine()),d=Math.min(t.line,u),h=o.lineComment||c.lineComment,p=[],f=null==o.padding?" ":o.padding;t:if(h){for(var g=d;g<=u;++g){var m=l.getLine(g),v=m.indexOf(h);if(v>-1&&!/comment/.test(l.getTokenTypeAt(r(g,v+1)))&&(v=-1),-1==v&&n.test(m))break t;if(v>-1&&n.test(m.slice(0,v)))break t;p.push(m)}if(l.operation((function(){for(var t=d;t<=u;++t){var e=p[t-d],n=e.indexOf(h),i=n+h.length;n<0||(e.slice(i,i+f.length)==f&&(i+=f.length),a=!0,l.replaceRange("",r(t,n),r(t,i)))}})),a)return!0}var b=o.blockCommentStart||c.blockCommentStart,y=o.blockCommentEnd||c.blockCommentEnd;if(!b||!y)return!1;var w=o.blockCommentLead||c.blockCommentLead,x=l.getLine(d),C=x.indexOf(b);if(-1==C)return!1;var k=u==d?x:l.getLine(u),A=k.indexOf(y,u==d?C+b.length:0),S=r(d,C+1),E=r(u,A+1);if(-1==A||!/comment/.test(l.getTokenTypeAt(S))||!/comment/.test(l.getTokenTypeAt(E))||l.getRange(S,E,"\n").indexOf(y)>-1)return!1;var O=x.lastIndexOf(b,t.ch),T=-1==O?-1:x.slice(0,t.ch).indexOf(y,O+b.length);if(-1!=O&&-1!=T&&T+y.length!=t.ch)return!1;T=k.indexOf(y,i.ch);var _=k.slice(i.ch).lastIndexOf(b,T-i.ch);return O=-1==T||-1==_?-1:i.ch+_,(-1==T||-1==O||O==i.ch)&&(l.operation((function(){l.replaceRange("",r(u,A-(f&&k.slice(A-f.length,A)==f?f.length:0)),r(u,A+y.length));var t=C+b.length;if(f&&x.slice(t,t+f.length)==f&&(t+=f.length),l.replaceRange("",r(d,C),r(d,t)),w)for(var e=d+1;e<=u;++e){var i=l.getLine(e),o=i.indexOf(w);if(-1!=o&&!n.test(i.slice(0,o))){var a=o+w.length;f&&i.slice(a,a+f.length)==f&&(a+=f.length),l.replaceRange("",r(e,o),r(e,a))}}})),!0)}))}))},"72f7":function(t,e,n){"use strict";var r=n("ebb5").exportTypedArrayMethod,i=n("d039"),o=n("da84"),a=n("e330"),s=o.Uint8Array,l=s&&s.prototype||{},c=[].toString,u=a([].join);i((function(){c.call({})}))&&(c=function(){return u(this)});var d=l.toString!=c;r("toString",c,d)},"735e":function(t,e,n){"use strict";var r=n("ebb5"),i=n("81d5"),o=n("f495"),a=n("f5df"),s=n("c65b"),l=n("e330"),c=n("d039"),u=r.aTypedArray,d=r.exportTypedArrayMethod,h=l("".slice),p=c((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t}));d("fill",(function(t){var e=arguments.length;u(this);var n="Big"===h(a(this),0,3)?o(t):+t;return s(i,this,n,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),p)},"741a":function(t,e,n){},"74e8":function(t,e,n){"use strict";var r=n("23e7"),i=n("da84"),o=n("c65b"),a=n("83ab"),s=n("8aa7"),l=n("ebb5"),c=n("621a"),u=n("19aa"),d=n("5c6c"),h=n("9112"),p=n("eac50"),f=n("50c4"),g=n("0b25"),m=n("182d"),v=n("a04b"),b=n("1a2d"),y=n("f5df"),w=n("861d"),x=n("d9b5"),C=n("7c73"),k=n("3a9b"),A=n("d2bb"),S=n("241c").f,E=n("a078b"),O=n("b727").forEach,T=n("2626"),_=n("9bf2"),M=n("06cf"),N=n("69f3"),P=n("7156"),L=N.get,D=N.set,j=N.enforce,I=_.f,R=M.f,F=Math.round,B=i.RangeError,z=c.ArrayBuffer,H=z.prototype,V=c.DataView,q=l.NATIVE_ARRAY_BUFFER_VIEWS,U=l.TYPED_ARRAY_TAG,W=l.TypedArray,$=l.TypedArrayPrototype,G=l.aTypedArrayConstructor,Y=l.isTypedArray,X="BYTES_PER_ELEMENT",K="Wrong length",Z=function(t,e){G(t);var n=0,r=e.length,i=new t(r);while(r>n)i[n]=e[n++];return i},J=function(t,e){I(t,e,{get:function(){return L(this)[e]}})},Q=function(t){var e;return k(H,t)||"ArrayBuffer"==(e=y(t))||"SharedArrayBuffer"==e},tt=function(t,e){return Y(t)&&!x(e)&&e in t&&p(+e)&&e>=0},et=function(t,e){return e=v(e),tt(t,e)?d(2,t[e]):R(t,e)},nt=function(t,e,n){return e=v(e),!(tt(t,e)&&w(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?I(t,e,n):(t[e]=n.value,t)};a?(q||(M.f=et,_.f=nt,J($,"buffer"),J($,"byteOffset"),J($,"byteLength"),J($,"length")),r({target:"Object",stat:!0,forced:!q},{getOwnPropertyDescriptor:et,defineProperty:nt}),t.exports=function(t,e,n){var a=t.match(/\d+$/)[0]/8,l=t+(n?"Clamped":"")+"Array",c="get"+t,d="set"+t,p=i[l],v=p,b=v&&v.prototype,y={},x=function(t,e){var n=L(t);return n.view[c](e*a+n.byteOffset,!0)},k=function(t,e,r){var i=L(t);n&&(r=(r=F(r))<0?0:r>255?255:255&r),i.view[d](e*a+i.byteOffset,r,!0)},_=function(t,e){I(t,e,{get:function(){return x(this,e)},set:function(t){return k(this,e,t)},enumerable:!0})};q?s&&(v=e((function(t,e,n,r){return u(t,b),P(function(){return w(e)?Q(e)?void 0!==r?new p(e,m(n,a),r):void 0!==n?new p(e,m(n,a)):new p(e):Y(e)?Z(v,e):o(E,v,e):new p(g(e))}(),t,v)})),A&&A(v,W),O(S(p),(function(t){t in v||h(v,t,p[t])})),v.prototype=b):(v=e((function(t,e,n,r){u(t,b);var i,s,l,c=0,d=0;if(w(e)){if(!Q(e))return Y(e)?Z(v,e):o(E,v,e);i=e,d=m(n,a);var h=e.byteLength;if(void 0===r){if(h%a)throw B(K);if(s=h-d,s<0)throw B(K)}else if(s=f(r)*a,s+d>h)throw B(K);l=s/a}else l=g(e),s=l*a,i=new z(s);D(t,{buffer:i,byteOffset:d,byteLength:s,length:l,view:new V(i)});while(c<l)_(t,c++)})),A&&A(v,W),b=v.prototype=C($)),b.constructor!==v&&h(b,"constructor",v),j(b).TypedArrayConstructor=v,U&&h(b,U,l);var M=v!=p;y[l]=v,r({global:!0,constructor:!0,forced:M,sham:!q},y),X in v||h(v,X,a),X in b||h(b,X,a),T(l)}):t.exports=function(){}},"76ae":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";function e(t,e){if(!t.hasOwnProperty(e))throw new Error("Undefined state "+e+" in simple mode")}function n(t,e){if(!t)return/(?:)/;var n="";return t instanceof RegExp?(t.ignoreCase&&(n="i"),t.unicode&&(n+="u"),t=t.source):t=String(t),new RegExp((!1===e?"":"^")+"(?:"+t+")",n)}function r(t){if(!t)return null;if(t.apply)return t;if("string"==typeof t)return t.replace(/\./g," ");for(var e=[],n=0;n<t.length;n++)e.push(t[n]&&t[n].replace(/\./g," "));return e}function i(t,i){(t.next||t.push)&&e(i,t.next||t.push),this.regex=n(t.regex),this.token=r(t.token),this.data=t}function o(t,e){return function(n,r){if(r.pending){var i=r.pending.shift();return 0==r.pending.length&&(r.pending=null),n.pos+=i.text.length,i.token}if(r.local){if(r.local.end&&n.match(r.local.end)){var o=r.local.endToken||null;return r.local=r.localState=null,o}var a;o=r.local.mode.token(n,r.localState);return r.local.endScan&&(a=r.local.endScan.exec(n.current()))&&(n.pos=n.start+a.index),o}for(var l=t[r.state],c=0;c<l.length;c++){var u=l[c],d=(!u.data.sol||n.sol())&&n.match(u.regex);if(d){u.data.next?r.state=u.data.next:u.data.push?((r.stack||(r.stack=[])).push(r.state),r.state=u.data.push):u.data.pop&&r.stack&&r.stack.length&&(r.state=r.stack.pop()),u.data.mode&&s(e,r,u.data.mode,u.token),u.data.indent&&r.indent.push(n.indentation()+e.indentUnit),u.data.dedent&&r.indent.pop();var h=u.token;if(h&&h.apply&&(h=h(d)),d.length>2&&u.token&&"string"!=typeof u.token){for(var p=2;p<d.length;p++)d[p]&&(r.pending||(r.pending=[])).push({text:d[p],token:u.token[p-1]});return n.backUp(d[0].length-(d[1]?d[1].length:0)),h[0]}return h&&h.join?h[0]:h}}return n.next(),null}}function a(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=0;for(var r in t)if(t.hasOwnProperty(r)){if(!e.hasOwnProperty(r)||!a(t[r],e[r]))return!1;n++}for(var r in e)e.hasOwnProperty(r)&&n--;return 0==n}function s(e,r,i,o){var s;if(i.persistent)for(var l=r.persistentStates;l&&!s;l=l.next)(i.spec?a(i.spec,l.spec):i.mode==l.mode)&&(s=l);var c=s?s.mode:i.mode||t.getMode(e,i.spec),u=s?s.state:t.startState(c);i.persistent&&!s&&(r.persistentStates={mode:c,spec:i.spec,state:u,next:r.persistentStates}),r.localState=u,r.local={mode:c,end:i.end&&n(i.end),endScan:i.end&&!1!==i.forceEnd&&n(i.end,!1),endToken:o&&o.join?o[o.length-1]:o}}function l(t,e){for(var n=0;n<e.length;n++)if(e[n]===t)return!0}function c(e,n){return function(r,i,o){if(r.local&&r.local.mode.indent)return r.local.mode.indent(r.localState,i,o);if(null==r.indent||r.local||n.dontIndentStates&&l(r.state,n.dontIndentStates)>-1)return t.Pass;var a=r.indent.length-1,s=e[r.state];t:for(;;){for(var c=0;c<s.length;c++){var u=s[c];if(u.data.dedent&&!1!==u.data.dedentIfLineStart){var d=u.regex.exec(i);if(d&&d[0]){a--,(u.next||u.push)&&(s=e[u.next||u.push]),i=i.slice(d[0].length);continue t}}}break}return a<0?0:r.indent[a]}}t.defineSimpleMode=function(e,n){t.defineMode(e,(function(e){return t.simpleMode(e,n)}))},t.simpleMode=function(n,r){e(r,"start");var a={},s=r.meta||{},l=!1;for(var u in r)if(u!=s&&r.hasOwnProperty(u))for(var d=a[u]=[],h=r[u],p=0;p<h.length;p++){var f=h[p];d.push(new i(f,r)),(f.indent||f.dedent)&&(l=!0)}var g={startState:function(){return{state:"start",pending:null,local:null,localState:null,indent:l?[]:null}},copyState:function(e){var n={state:e.state,pending:e.pending,local:e.local,localState:null,indent:e.indent&&e.indent.slice(0)};e.localState&&(n.localState=t.copyState(e.local.mode,e.localState)),e.stack&&(n.stack=e.stack.slice(0));for(var r=e.persistentStates;r;r=r.next)n.persistentStates={mode:r.mode,spec:r.spec,state:r.state==e.localState?n.localState:t.copyState(r.mode,r.state),next:n.persistentStates};return n},token:o(a,n),innerMode:function(t){return t.local&&{mode:t.local.mode,state:t.localState}},indent:c(a,s)};if(s)for(var m in s)s.hasOwnProperty(m)&&(g[m]=s[m]);return g}}))},"76d2":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";t.defineMode("stylus",(function(t){var p,f,b,y,w=t.indentUnit,x="",C=m(e),k=/^(a|b|i|s|col|em)$/i,A=m(o),S=m(a),E=m(c),O=m(l),T=m(n),_=g(n),M=m(i),N=m(r),P=m(s),L=/^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/,D=g(u),j=m(d),I=new RegExp(/^\-(moz|ms|o|webkit)-/i),R=m(h),F="",B={};while(x.length<w)x+=" ";function z(t,e){if(F=t.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/),e.context.line.firstWord=F?F[0].replace(/^\s*/,""):"",e.context.line.indent=t.indentation(),p=t.peek(),t.match("//"))return t.skipToEnd(),["comment","comment"];if(t.match("/*"))return e.tokenize=H,H(t,e);if('"'==p||"'"==p)return t.next(),e.tokenize=V(p),e.tokenize(t,e);if("@"==p)return t.next(),t.eatWhile(/[\w\\-]/),["def",t.current()];if("#"==p){if(t.next(),t.match(/^[0-9a-f]{3}([0-9a-f]([0-9a-f]{2}){0,2})?\b(?!-)/i))return["atom","atom"];if(t.match(/^[a-z][\w-]*/i))return["builtin","hash"]}return t.match(I)?["meta","vendor-prefixes"]:t.match(/^-?[0-9]?\.?[0-9]/)?(t.eatWhile(/[a-z%]/i),["number","unit"]):"!"==p?(t.next(),[t.match(/^(important|optional)/i)?"keyword":"operator","important"]):"."==p&&t.match(/^\.[a-z][\w-]*/i)?["qualifier","qualifier"]:t.match(_)?("("==t.peek()&&(e.tokenize=q),["property","word"]):t.match(/^[a-z][\w-]*\(/i)?(t.backUp(1),["keyword","mixin"]):t.match(/^(\+|-)[a-z][\w-]*\(/i)?(t.backUp(1),["keyword","block-mixin"]):t.string.match(/^\s*&/)&&t.match(/^[-_]+[a-z][\w-]*/)?["qualifier","qualifier"]:t.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)?(t.backUp(1),["variable-3","reference"]):t.match(/^&{1}\s*$/)?["variable-3","reference"]:t.match(D)?["operator","operator"]:t.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)?t.match(/^(\.|\[)[\w-\'\"\]]+/i,!1)&&!X(t.current())?(t.match("."),["variable-2","variable-name"]):["variable-2","word"]:t.match(L)?["operator",t.current()]:/[:;,{}\[\]\(\)]/.test(p)?(t.next(),[null,p]):(t.next(),[null,null])}function H(t,e){var n,r=!1;while(null!=(n=t.next())){if(r&&"/"==n){e.tokenize=null;break}r="*"==n}return["comment","comment"]}function V(t){return function(e,n){var r,i=!1;while(null!=(r=e.next())){if(r==t&&!i){")"==t&&e.backUp(1);break}i=!i&&"\\"==r}return(r==t||!i&&")"!=t)&&(n.tokenize=null),["string","string"]}}function q(t,e){return t.next(),t.match(/\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=V(")"),[null,"("]}function U(t,e,n,r){this.type=t,this.indent=e,this.prev=n,this.line=r||{firstWord:"",indent:0}}function W(t,e,n,r){return r=r>=0?r:w,t.context=new U(n,e.indentation()+r,t.context),n}function $(t,e){var n=t.context.indent-w;return e=e||!1,t.context=t.context.prev,e&&(t.context.indent=n),t.context.type}function G(t,e,n){return B[n.context.type](t,e,n)}function Y(t,e,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return G(t,e,n)}function X(t){return t.toLowerCase()in C}function K(t){return t=t.toLowerCase(),t in A||t in P}function Z(t){return t.toLowerCase()in j}function J(t){return t.toLowerCase().match(I)}function Q(t){var e=t.toLowerCase(),n="variable-2";return X(t)?n="tag":Z(t)?n="block-keyword":K(t)?n="property":e in E||e in R?n="atom":"return"==e||e in O?n="keyword":t.match(/^[A-Z]/)&&(n="string"),n}function tt(t,e){return it(e)&&("{"==t||"]"==t||"hash"==t||"qualifier"==t)||"block-mixin"==t}function et(t,e){return"{"==t&&e.match(/^\s*\$?[\w-]+/i,!1)}function nt(t,e){return":"==t&&e.match(/^[a-z-]+/,!1)}function rt(t){return t.sol()||t.string.match(new RegExp("^\\s*"+v(t.current())))}function it(t){return t.eol()||t.match(/^\s*$/,!1)}function ot(t){var e=/^\s*[-_]*[a-z0-9]+[\w-]*/i,n="string"==typeof t?t.match(e):t.string.match(e);return n?n[0].replace(/^\s*/,""):""}return B.block=function(t,e,n){if("comment"==t&&rt(e)||","==t&&it(e)||"mixin"==t)return W(n,e,"block",0);if(et(t,e))return W(n,e,"interpolation");if(it(e)&&"]"==t&&!/^\s*(\.|#|:|\[|\*|&)/.test(e.string)&&!X(ot(e)))return W(n,e,"block",0);if(tt(t,e))return W(n,e,"block");if("}"==t&&it(e))return W(n,e,"block",0);if("variable-name"==t)return e.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)||Z(ot(e))?W(n,e,"variableName"):W(n,e,"variableName",0);if("="==t)return it(e)||Z(ot(e))?W(n,e,"block"):W(n,e,"block",0);if("*"==t&&(it(e)||e.match(/\s*(,|\.|#|\[|:|{)/,!1)))return y="tag",W(n,e,"block");if(nt(t,e))return W(n,e,"pseudo");if(/@(font-face|media|supports|(-moz-)?document)/.test(t))return W(n,e,it(e)?"block":"atBlock");if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(t))return W(n,e,"keyframes");if(/@extends?/.test(t))return W(n,e,"extend",0);if(t&&"@"==t.charAt(0))return e.indentation()>0&&K(e.current().slice(1))?(y="variable-2","block"):/(@import|@require|@charset)/.test(t)?W(n,e,"block",0):W(n,e,"block");if("reference"==t&&it(e))return W(n,e,"block");if("("==t)return W(n,e,"parens");if("vendor-prefixes"==t)return W(n,e,"vendorPrefixes");if("word"==t){var r=e.current();if(y=Q(r),"property"==y)return rt(e)?W(n,e,"block",0):(y="atom","block");if("tag"==y){if(/embed|menu|pre|progress|sub|table/.test(r)&&K(ot(e)))return y="atom","block";if(e.string.match(new RegExp("\\[\\s*"+r+"|"+r+"\\s*\\]")))return y="atom","block";if(k.test(r)&&(rt(e)&&e.string.match(/=/)||!rt(e)&&!e.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!X(ot(e))))return y="variable-2",Z(ot(e))?"block":W(n,e,"block",0);if(it(e))return W(n,e,"block")}if("block-keyword"==y)return y="keyword",e.current(/(if|unless)/)&&!rt(e)?"block":W(n,e,"block");if("return"==r)return W(n,e,"block",0);if("variable-2"==y&&e.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/))return W(n,e,"block")}return n.context.type},B.parens=function(t,e,n){if("("==t)return W(n,e,"parens");if(")"==t)return"parens"==n.context.prev.type?$(n):e.string.match(/^[a-z][\w-]*\(/i)&&it(e)||Z(ot(e))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ot(e))||!e.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/)&&X(ot(e))?W(n,e,"block"):e.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/)||e.string.match(/^\s*(\(|\)|[0-9])/)||e.string.match(/^\s+[a-z][\w-]*\(/i)||e.string.match(/^\s+[\$-]?[a-z]/i)?W(n,e,"block",0):it(e)?W(n,e,"block"):W(n,e,"block",0);if(t&&"@"==t.charAt(0)&&K(e.current().slice(1))&&(y="variable-2"),"word"==t){var r=e.current();y=Q(r),"tag"==y&&k.test(r)&&(y="variable-2"),"property"!=y&&"to"!=r||(y="atom")}return"variable-name"==t?W(n,e,"variableName"):nt(t,e)?W(n,e,"pseudo"):n.context.type},B.vendorPrefixes=function(t,e,n){return"word"==t?(y="property",W(n,e,"block",0)):$(n)},B.pseudo=function(t,e,n){return K(ot(e.string))?Y(t,e,n):(e.match(/^[a-z-]+/),y="variable-3",it(e)?W(n,e,"block"):$(n))},B.atBlock=function(t,e,n){if("("==t)return W(n,e,"atBlock_parens");if(tt(t,e))return W(n,e,"block");if(et(t,e))return W(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();if(y=/^(only|not|and|or)$/.test(r)?"keyword":T.hasOwnProperty(r)?"tag":N.hasOwnProperty(r)?"attribute":M.hasOwnProperty(r)?"property":S.hasOwnProperty(r)?"string-2":Q(e.current()),"tag"==y&&it(e))return W(n,e,"block")}return"operator"==t&&/^(not|and|or)$/.test(e.current())&&(y="keyword"),n.context.type},B.atBlock_parens=function(t,e,n){if("{"==t||"}"==t)return n.context.type;if(")"==t)return it(e)?W(n,e,"block"):W(n,e,"atBlock");if("word"==t){var r=e.current().toLowerCase();return y=Q(r),/^(max|min)/.test(r)&&(y="property"),"tag"==y&&(y=k.test(r)?"variable-2":"atom"),n.context.type}return B.atBlock(t,e,n)},B.keyframes=function(t,e,n){return"0"==e.indentation()&&("}"==t&&rt(e)||"]"==t||"hash"==t||"qualifier"==t||X(e.current()))?Y(t,e,n):"{"==t?W(n,e,"keyframes"):"}"==t?rt(e)?$(n,!0):W(n,e,"keyframes"):"unit"==t&&/^[0-9]+\%$/.test(e.current())?W(n,e,"keyframes"):"word"==t&&(y=Q(e.current()),"block-keyword"==y)?(y="keyword",W(n,e,"keyframes")):/@(font-face|media|supports|(-moz-)?document)/.test(t)?W(n,e,it(e)?"block":"atBlock"):"mixin"==t?W(n,e,"block",0):n.context.type},B.interpolation=function(t,e,n){return"{"==t&&$(n)&&W(n,e,"block"),"}"==t?e.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||e.string.match(/^\s*[a-z]/i)&&X(ot(e))?W(n,e,"block"):!e.string.match(/^(\{|\s*\&)/)||e.match(/\s*[\w-]/,!1)?W(n,e,"block",0):W(n,e,"block"):"variable-name"==t?W(n,e,"variableName",0):("word"==t&&(y=Q(e.current()),"tag"==y&&(y="atom")),n.context.type)},B.extend=function(t,e,n){return"["==t||"="==t?"extend":"]"==t?$(n):"word"==t?(y=Q(e.current()),"extend"):$(n)},B.variableName=function(t,e,n){return"string"==t||"["==t||"]"==t||e.current().match(/^(\.|\$)/)?(e.current().match(/^\.[\w-]+/i)&&(y="variable-2"),"variableName"):Y(t,e,n)},{startState:function(t){return{tokenize:null,state:"block",context:new U("block",t||0,null)}},token:function(t,e){return!e.tokenize&&t.eatSpace()?null:(f=(e.tokenize||z)(t,e),f&&"object"==typeof f&&(b=f[1],f=f[0]),y=f,e.state=B[e.state](b,t,e),y)},indent:function(t,e,n){var r=t.context,i=e&&e.charAt(0),o=r.indent,a=ot(e),s=n.match(/^\s*/)[0].replace(/\t/g,x).length,l=t.context.prev?t.context.prev.line.firstWord:"",c=t.context.prev?t.context.prev.line.indent:s;return r.prev&&("}"==i&&("block"==r.type||"atBlock"==r.type||"keyframes"==r.type)||")"==i&&("parens"==r.type||"atBlock_parens"==r.type)||"{"==i&&"at"==r.type)?o=r.indent-w:/(\})/.test(i)||(/@|\$|\d/.test(i)||/^\{/.test(e)||/^\s*\/(\/|\*)/.test(e)||/^\s*\/\*/.test(l)||/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(e)||/^(\+|-)?[a-z][\w-]*\(/i.test(e)||/^return/.test(e)||Z(a)?o=s:/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(i)||X(a)?o=/\,\s*$/.test(l)?c:/^\s+/.test(n)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(l)||X(l))?s<=c?c:c+w:s:/,\s*$/.test(n)||!J(a)&&!K(a)||(o=Z(l)?s<=c?c:c+w:/^\{/.test(l)?s<=c?s:c+w:J(l)||K(l)?s>=c?c:s:/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(l)||/=\s*$/.test(l)||X(l)||/^\$[\w-\.\[\]\'\"]/.test(l)?c+w:s)),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"indent"}}));var e=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video"],n=["domain","regexp","url-prefix","url"],r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","dynamic-range","video-dynamic-range"],o=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"],a=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],s=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],l=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],c=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","high","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","standard","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around","unset"],u=["in","and","or","not","is not","is a","is","isnt","defined","if unless"],d=["for","if","else","unless","from","to"],h=["null","true","false","href","title","type","not-allowed","readonly","disabled"],p=["@font-face","@keyframes","@media","@viewport","@page","@host","@supports","@block","@css"],f=e.concat(n,r,i,o,a,l,c,s,u,d,h,p);function g(t){return t=t.sort((function(t,e){return e>t})),new RegExp("^(("+t.join(")|(")+"))\\b")}function m(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=!0;return e}function v(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}t.registerHelper("hintWords","stylus",f),t.defineMIME("text/x-styl","stylus")}))},7702:function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},"774c":function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n("16ef"),e),i(n("6762"),e),i(n("5c2e"),e),i(n("71c8"),e),i(n("70e6"),e),i(n("6185"),e),i(n("35fe"),e),i(n("3911"),e)},"77a7":function(t,e){var n=Array,r=Math.abs,i=Math.pow,o=Math.floor,a=Math.log,s=Math.LN2,l=function(t,e,l){var c,u,d,h=n(l),p=8*l-e-1,f=(1<<p)-1,g=f>>1,m=23===e?i(2,-24)-i(2,-77):0,v=t<0||0===t&&1/t<0?1:0,b=0;t=r(t),t!=t||t===1/0?(u=t!=t?1:0,c=f):(c=o(a(t)/s),d=i(2,-c),t*d<1&&(c--,d*=2),t+=c+g>=1?m/d:m*i(2,1-g),t*d>=2&&(c++,d/=2),c+g>=f?(u=0,c=f):c+g>=1?(u=(t*d-1)*i(2,e),c+=g):(u=t*i(2,g-1)*i(2,e),c=0));while(e>=8)h[b++]=255&u,u/=256,e-=8;c=c<<e|u,p+=e;while(p>0)h[b++]=255&c,c/=256,p-=8;return h[--b]|=128*v,h},c=function(t,e){var n,r=t.length,o=8*r-e-1,a=(1<<o)-1,s=a>>1,l=o-7,c=r-1,u=t[c--],d=127&u;u>>=7;while(l>0)d=256*d+t[c--],l-=8;n=d&(1<<-l)-1,d>>=-l,l+=e;while(l>0)n=256*n+t[c--],l-=8;if(0===d)d=1-s;else{if(d===a)return n?NaN:u?-1/0:1/0;n+=i(2,e),d-=s}return(u?-1:1)*n*i(2,d-e)};t.exports={pack:l,unpack:c}},"77d9":function(t,e,n){n("1d02")},"78c1":function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t["default"]=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return o(e,t),e},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.Path=void 0;var l=n("ca8e"),c=n("5c2e"),u=n("6762"),d=n("35fe"),h=n("3911"),p=n("70e6"),f=n("722a"),g=n("593d"),m=n("2d61"),v=n("cfce"),b=n("2889"),y=n("2490"),w=a(n("b84e")),x=function(t){function e(n){var r=t.call(this)||this;if(r.PRECISION=3,r.segments=[],Array.isArray(n))if(c.Line.isLine(n[0])||d.Curve.isCurve(n[0])){var i=null,o=n;o.forEach((function(t,n){0===n&&r.appendSegment(e.createSegment("M",t.start)),null==i||i.end.equals(t.start)||r.appendSegment(e.createSegment("M",t.start)),c.Line.isLine(t)?r.appendSegment(e.createSegment("L",t.end)):d.Curve.isCurve(t)&&r.appendSegment(e.createSegment("C",t.controlPoint1,t.controlPoint2,t.end)),i=t}))}else{o=n;o.forEach((function(t){t.isSegment&&r.appendSegment(t)}))}else null!=n&&(c.Line.isLine(n)?(r.appendSegment(e.createSegment("M",n.start)),r.appendSegment(e.createSegment("L",n.end))):d.Curve.isCurve(n)?(r.appendSegment(e.createSegment("M",n.start)),r.appendSegment(e.createSegment("C",n.controlPoint1,n.controlPoint2,n.end))):h.Polyline.isPolyline(n)?n.points&&n.points.length&&n.points.forEach((function(t,n){var i=0===n?e.createSegment("M",t):e.createSegment("L",t);r.appendSegment(i)})):n.isSegment&&r.appendSegment(n));return r}return r(e,t),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){var t=this.segments,e=t.length;if(0===e)return null;for(var n=0;n<e;n+=1){var r=t[n];if(r.isVisible)return r.start}return t[e-1].end},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){var t=this.segments,e=t.length;if(0===e)return null;for(var n=e-1;n>=0;n-=1){var r=t[n];if(r.isVisible)return r.end}return t[e-1].end},enumerable:!1,configurable:!0}),e.prototype.moveTo=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this.appendSegment((t=v.MoveTo.create).call.apply(t,s([null],e,!1)))},e.prototype.lineTo=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this.appendSegment((t=m.LineTo.create).call.apply(t,s([null],e,!1)))},e.prototype.curveTo=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return this.appendSegment((t=b.CurveTo.create).call.apply(t,s([null],e,!1)))},e.prototype.arcTo=function(t,e,n,r,i,o,a){var s=this.end||new u.Point,l="number"===typeof o?w.arcToCurves(s.x,s.y,t,e,n,r,i,o,a):w.arcToCurves(s.x,s.y,t,e,n,r,i,o.x,o.y);if(null!=l)for(var c=0,d=l.length;c<d;c+=6)this.curveTo(l[c],l[c+1],l[c+2],l[c+3],l[c+4],l[c+5]);return this},e.prototype.quadTo=function(t,n,r,i){var o=this.end||new u.Point,a=["M",o.x,o.y];if("number"===typeof t)a.push("Q",t,n,r,i);else{var s=n;a.push("Q",t.x,t.y,s.x,s.y)}var l=e.parse(a.join(" "));return this.appendSegment(l.segments.slice(1)),this},e.prototype.close=function(){return this.appendSegment(g.Close.create())},e.prototype.drawPoints=function(t,n){void 0===n&&(n={});var r=w.drawPoints(t,n),i=e.parse(r);i&&i.segments&&this.appendSegment(i.segments)},e.prototype.bbox=function(){var t,e=this.segments,n=e.length;if(0===n)return null;for(var r=0;r<n;r+=1){var i=e[r];if(i.isVisible){var o=i.bbox();null!=o&&(t=t?t.union(o):o)}}if(null!=t)return t;var a=e[n-1];return new p.Rectangle(a.end.x,a.end.y,0,0)},e.prototype.appendSegment=function(t){var e,n=this.segments.length,r=0!==n?this.segments[n-1]:null,i=null;if(Array.isArray(t))for(var o=0,a=t.length;o<a;o+=1){var s=t[o];e=this.prepareSegment(s,r,i),this.segments.push(e),r=e}else null!=t&&t.isSegment&&(e=this.prepareSegment(t,r,i),this.segments.push(e));return this},e.prototype.insertSegment=function(t,e){var n,r=this.segments.length;if(t<0&&(t=r+t+1),t>r||t<0)throw new Error("Index out of range.");var i=null,o=null;if(0!==r&&(t>=1?(i=this.segments[t-1],o=i.nextSegment):(i=null,o=this.segments[0])),Array.isArray(e))for(var a=0,s=e.length;a<s;a+=1){var l=e[a];n=this.prepareSegment(l,i,o),this.segments.splice(t+a,0,n),i=n}else n=this.prepareSegment(e,i,o),this.segments.splice(t,0,n);return this},e.prototype.removeSegment=function(t){var e=this.fixIndex(t),n=this.segments.splice(e,1)[0],r=n.previousSegment,i=n.nextSegment;return r&&(r.nextSegment=i),i&&(i.previousSegment=r),n.isSubpathStart&&i&&this.updateSubpathStartSegment(i),n},e.prototype.replaceSegment=function(t,e){var n,r=this.fixIndex(t),i=this.segments[r],o=i.previousSegment,a=i.nextSegment,s=i.isSubpathStart;if(Array.isArray(e)){this.segments.splice(t,1);for(var l=0,c=e.length;l<c;l+=1){var u=e[l];n=this.prepareSegment(u,o,a),this.segments.splice(t+l,0,n),o=n,s&&n.isSubpathStart&&(s=!1)}}else n=this.prepareSegment(e,o,a),this.segments.splice(r,1,n),s&&n.isSubpathStart&&(s=!1);s&&a&&this.updateSubpathStartSegment(a)},e.prototype.getSegment=function(t){var e=this.fixIndex(t);return this.segments[e]},e.prototype.fixIndex=function(t){var e=this.segments.length;if(0===e)throw new Error("Path has no segments.");var n=t;while(n<0)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n},e.prototype.segmentAt=function(t,e){void 0===e&&(e={});var n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null},e.prototype.segmentAtLength=function(t,e){void 0===e&&(e={});var n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null},e.prototype.segmentIndexAt=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;var n=(0,l.clamp)(t,0,1),r=this.getOptions(e),i=this.length(r),o=i*n;return this.segmentIndexAtLength(o,r)},e.prototype.segmentIndexAtLength=function(t,e){void 0===e&&(e={});var n=this.segments.length;if(0===n)return null;var r=!0;t<0&&(r=!1,t=-t);for(var i=this.getPrecision(e),o=this.getSubdivisions(e),a=0,s=null,l=0;l<n;l+=1){var c=r?l:n-1-l,u=this.segments[c],d=o[c],h=u.length({precision:i,subdivisions:d});if(u.isVisible){if(t<=a+h)return c;s=c}a+=h}return s},e.prototype.getSegmentSubdivisions=function(t){void 0===t&&(t={});for(var e=this.getPrecision(t),n=[],r=0,i=this.segments.length;r<i;r+=1){var o=this.segments[r],a=o.getSubdivisions({precision:e});n.push(a)}return n},e.prototype.updateSubpathStartSegment=function(t){var e=t.previousSegment,n=t;while(n&&!n.isSubpathStart)n.subpathStartSegment=null!=e?e.subpathStartSegment:null,e=n,n=n.nextSegment},e.prototype.prepareSegment=function(t,e,n){t.previousSegment=e,t.nextSegment=n,null!=e&&(e.nextSegment=t),null!=n&&(n.previousSegment=t);var r=t;return t.isSubpathStart&&(t.subpathStartSegment=t,r=n),null!=r&&this.updateSubpathStartSegment(r),t},e.prototype.closestPoint=function(t,e){void 0===e&&(e={});var n=this.closestPointT(t,e);return n?this.pointAtT(n):null},e.prototype.closestPointLength=function(t,e){void 0===e&&(e={});var n=this.getOptions(e),r=this.closestPointT(t,n);return r?this.lengthAtT(r,n):0},e.prototype.closestPointNormalizedLength=function(t,e){void 0===e&&(e={});var n=this.getOptions(e),r=this.closestPointLength(t,n);if(0===r)return 0;var i=this.length(n);return 0===i?0:r/i},e.prototype.closestPointT=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;for(var n,r=this.getPrecision(e),i=this.getSubdivisions(e),o=1/0,a=0,s=this.segments.length;a<s;a+=1){var c=this.segments[a],u=i[a];if(c.isVisible){var d=c.closestPointT(t,{precision:r,subdivisions:u}),h=c.pointAtT(d),p=(0,l.squaredLength)(h,t);p<o&&(n={segmentIndex:a,value:d},o=p)}}return n||{segmentIndex:this.segments.length-1,value:1}},e.prototype.closestPointTangent=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;for(var n,r=this.getPrecision(e),i=this.getSubdivisions(e),o=1/0,a=0,s=this.segments.length;a<s;a+=1){var c=this.segments[a],u=i[a];if(c.isDifferentiable()){var d=c.closestPointT(t,{precision:r,subdivisions:u}),h=c.pointAtT(d),p=(0,l.squaredLength)(h,t);p<o&&(n=c.tangentAtT(d),o=p)}}return n||null},e.prototype.containsPoint=function(t,e){void 0===e&&(e={});var n=this.toPolylines(e);if(!n)return!1;for(var r=0,i=0,o=n.length;i<o;i+=1){var a=n[i];a.containsPoint(t)&&(r+=1)}return r%2===1},e.prototype.pointAt=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();var n=this.getOptions(e),r=this.length(n),i=r*t;return this.pointAtLength(i,n)},e.prototype.pointAtLength=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;if(0===t)return this.start.clone();var n=!0;t<0&&(n=!1,t=-t);for(var r,i=this.getPrecision(e),o=this.getSubdivisions(e),a=0,s=0,l=this.segments.length;s<l;s+=1){var c=n?s:l-1-s,u=this.segments[c],d=o[c],h=u.length({precision:i,subdivisions:d});if(u.isVisible){if(t<=a+h)return u.pointAtLength((n?1:-1)*(t-a),{precision:i,subdivisions:d});r=u}a+=h}if(r)return n?r.end:r.start;var p=this.segments[this.segments.length-1];return p.end.clone()},e.prototype.pointAtT=function(t){var e=this.segments,n=e.length;if(0===n)return null;var r=t.segmentIndex;if(r<0)return e[0].pointAtT(0);if(r>=n)return e[n-1].pointAtT(1);var i=(0,l.clamp)(t.value,0,1);return e[r].pointAtT(i)},e.prototype.divideAt=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;var n=(0,l.clamp)(t,0,1),r=this.getOptions(e),i=this.length(r),o=i*n;return this.divideAtLength(o,r)},e.prototype.divideAtLength=function(t,n){if(void 0===n&&(n={}),0===this.segments.length)return null;var r=!0;t<0&&(r=!1,t=-t);for(var i,o,a,s,l,c=this.getPrecision(n),u=this.getSubdivisions(n),d=0,h=0,p=this.segments.length;h<p;h+=1){var f=r?h:p-1-h,g=this.getSegment(f),m=u[f],v={precision:c,subdivisions:m},b=g.length(v);if(g.isDifferentiable()&&(a=g,s=f,t<=d+b)){o=f,i=g.divideAtLength((r?1:-1)*(t-d),v);break}d+=b}if(!a)return null;i||(o=s,l=r?1:0,i=a.divideAtT(l));var y=this.clone(),w=o;y.replaceSegment(w,i);var x=w,C=w+1,k=w+2;i[0].isDifferentiable()||(y.removeSegment(x),C-=1,k-=1);var A=y.getSegment(C).start;y.insertSegment(C,e.createSegment("M",A)),k+=1,i[1].isDifferentiable()||(y.removeSegment(k-1),k-=1);var S=k-x-1;for(h=k,p=y.segments.length;h<p;h+=1){var E=this.getSegment(h-S);g=y.getSegment(h);if("Z"===g.type&&!E.subpathStartSegment.end.equals(g.subpathStartSegment.end)){var O=e.createSegment("L",E.end);y.replaceSegment(h,O)}}var T=new e(y.segments.slice(0,C)),_=new e(y.segments.slice(C));return[T,_]},e.prototype.intersectsWithLine=function(t,e){void 0===e&&(e={});var n=this.toPolylines(e);if(null==n)return null;for(var r=null,i=0,o=n.length;i<o;i+=1){var a=n[i],s=t.intersect(a);s&&(null==r&&(r=[]),Array.isArray(s)?r.push.apply(r,s):r.push(s))}return r},e.prototype.isDifferentiable=function(){for(var t=0,e=this.segments.length;t<e;t+=1){var n=this.segments[t];if(n.isDifferentiable())return!0}return!1},e.prototype.isValid=function(){var t=this.segments,e=0===t.length||"M"===t[0].type;return e},e.prototype.length=function(t){if(void 0===t&&(t={}),0===this.segments.length)return 0;for(var e=this.getSubdivisions(t),n=0,r=0,i=this.segments.length;r<i;r+=1){var o=this.segments[r],a=e[r];n+=o.length({subdivisions:a})}return n},e.prototype.lengthAtT=function(t,e){void 0===e&&(e={});var n=this.segments.length;if(0===n)return 0;var r=t.segmentIndex;if(r<0)return 0;var i=(0,l.clamp)(t.value,0,1);r>=n&&(r=n-1,i=1);for(var o=this.getPrecision(e),a=this.getSubdivisions(e),s=0,c=0;c<r;c+=1){var u=this.segments[c],d=a[c];s+=u.length({precision:o,subdivisions:d})}var h=this.segments[r],p=a[r];return s+=h.lengthAtT(i,{precision:o,subdivisions:p}),s},e.prototype.tangentAt=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;var n=(0,l.clamp)(t,0,1),r=this.getOptions(e),i=this.length(r),o=i*n;return this.tangentAtLength(o,r)},e.prototype.tangentAtLength=function(t,e){if(void 0===e&&(e={}),0===this.segments.length)return null;var n=!0;t<0&&(n=!1,t=-t);for(var r,i=this.getPrecision(e),o=this.getSubdivisions(e),a=0,s=0,l=this.segments.length;s<l;s+=1){var c=n?s:l-1-s,u=this.segments[c],d=o[c],h=u.length({precision:i,subdivisions:d});if(u.isDifferentiable()){if(t<=a+h)return u.tangentAtLength((n?1:-1)*(t-a),{precision:i,subdivisions:d});r=u}a+=h}if(r){var p=n?1:0;return r.tangentAtT(p)}return null},e.prototype.tangentAtT=function(t){var e=this.segments.length;if(0===e)return null;var n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);var r=(0,l.clamp)(t.value,0,1);return this.segments[n].tangentAtT(r)},e.prototype.getPrecision=function(t){return void 0===t&&(t={}),null==t.precision?this.PRECISION:t.precision},e.prototype.getSubdivisions=function(t){if(void 0===t&&(t={}),null==t.segmentSubdivisions){var e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions},e.prototype.getOptions=function(t){void 0===t&&(t={});var e=this.getPrecision(t),n=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:n}},e.prototype.toPoints=function(t){void 0===t&&(t={});var e=this.segments,n=e.length;if(0===n)return null;for(var r=this.getSubdivisions(t),i=[],o=[],a=0;a<n;a+=1){var s=e[a];if(s.isVisible){var l=r[a];l.length>0?l.forEach((function(t){return o.push(t.start)})):o.push(s.start)}else o.length>0&&(o.push(e[a-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i},e.prototype.toPolylines=function(t){void 0===t&&(t={});var e=this.toPoints(t);return e?e.map((function(t){return new h.Polyline(t)})):null},e.prototype.scale=function(t,e,n){return this.segments.forEach((function(r){return r.scale(t,e,n)})),this},e.prototype.rotate=function(t,e){return this.segments.forEach((function(n){return n.rotate(t,e)})),this},e.prototype.translate=function(t,e){return"number"===typeof t?this.segments.forEach((function(n){return n.translate(t,e)})):this.segments.forEach((function(e){return e.translate(t)})),this},e.prototype.clone=function(){var t=new e;return this.segments.forEach((function(e){return t.appendSegment(e.clone())})),t},e.prototype.equals=function(t){if(null==t)return!1;var e=this.segments,n=t.segments,r=e.length;if(n.length!==r)return!1;for(var i=0;i<r;i+=1){var o=e[i],a=n[i];if(o.type!==a.type||!o.equals(a))return!1}return!0},e.prototype.toJSON=function(){return this.segments.map((function(t){return t.toJSON()}))},e.prototype.serialize=function(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map((function(t){return t.serialize()})).join(" ")},e.prototype.toString=function(){return this.serialize()},e}(f.Geometry);e.Path=x,function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;var n=e[Symbol.toStringTag],r=e;return!(null!=n&&n!==t.toStringTag||!Array.isArray(r.segments)||"function"!==typeof r.moveTo||"function"!==typeof r.lineTo||"function"!==typeof r.curveTo)}t.toStringTag="X6.Geometry."+t.name,t.isPath=e}(x=e.Path||(e.Path={})),e.Path=x,function(t){function e(e){if(!e)return new t;var r=new t,i=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=t.normalize(e).match(i);if(null!=o)for(var a=0,l=o.length;a<l;a+=1){var c=o[a],u=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,d=c.match(u);if(null!=d){var h=d[0],p=d.slice(1).map((function(t){return+t})),f=n.call.apply(n,s([null,h],p,!1));r.appendSegment(f)}}return r}function n(t){for(var e,n,r,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if("M"===t)return(e=v.MoveTo.create).call.apply(e,s([null],i,!1));if("L"===t)return(n=m.LineTo.create).call.apply(n,s([null],i,!1));if("C"===t)return(r=b.CurveTo.create).call.apply(r,s([null],i,!1));if("z"===t||"Z"===t)return g.Close.create();throw new Error('Invalid path segment type "'+t+'"')}t.parse=e,t.createSegment=n}(x=e.Path||(e.Path={})),e.Path=x,function(t){t.normalize=y.normalizePathData,t.isValid=w.isValid,t.drawArc=w.drawArc,t.drawPoints=w.drawPoints,t.arcToCurves=w.arcToCurves}(x=e.Path||(e.Path={})),e.Path=x},"7a15":function(t,e,n){"use strict";function r(t,e){var n,r,i,o,a,s=[],l=e.length;for(n=0;n<l;n++)i=e[n],126===i.marker&&-1!==i.end&&(o=e[i.end],a=t.tokens[i.token],a.type="s_open",a.tag="s",a.nesting=1,a.markup="~~",a.content="",a=t.tokens[o.token],a.type="s_close",a.tag="s",a.nesting=-1,a.markup="~~",a.content="","text"===t.tokens[o.token-1].type&&"~"===t.tokens[o.token-1].content&&s.push(o.token-1));while(s.length){n=s.pop(),r=n+1;while(r<t.tokens.length&&"s_close"===t.tokens[r].type)r++;r--,n!==r&&(a=t.tokens[r],t.tokens[r]=t.tokens[n],t.tokens[n]=a)}}t.exports.tokenize=function(t,e){var n,r,i,o,a,s=t.pos,l=t.src.charCodeAt(s);if(e)return!1;if(126!==l)return!1;if(r=t.scanDelims(t.pos,!0),o=r.length,a=String.fromCharCode(l),o<2)return!1;for(o%2&&(i=t.push("text","",0),i.content=a,o--),n=0;n<o;n+=2)i=t.push("text","",0),i.content=a+a,t.delimiters.push({marker:l,length:0,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return t.pos+=r.length,!0},t.exports.postProcess=function(t){var e,n=t.tokens_meta,i=t.tokens_meta.length;for(r(t,t.delimiters),e=0;e<i;e++)n[e]&&n[e].delimiters&&r(t,n[e].delimiters)}},"7b00":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";function e(t){for(var e={},n=0;n<t.length;++n)e[t[n].toLowerCase()]=!0;return e}t.defineMode("css",(function(e,n){var r=n.inline;n.propertyKeywords||(n=t.resolveMode("text/css"));var i,o,a=e.indentUnit,s=n.tokenHooks,l=n.documentTypes||{},c=n.mediaTypes||{},u=n.mediaFeatures||{},d=n.mediaValueKeywords||{},h=n.propertyKeywords||{},p=n.nonStandardPropertyKeywords||{},f=n.fontProperties||{},g=n.counterDescriptors||{},m=n.colorKeywords||{},v=n.valueKeywords||{},b=n.allowNested,y=n.lineComment,w=!0===n.supportsAtComponent,x=!1!==e.highlightNonStandardPropertyKeywords;function C(t,e){return i=e,t}function k(t,e){var n=t.next();if(s[n]){var r=s[n](t,e);if(!1!==r)return r}return"@"==n?(t.eatWhile(/[\w\\\-]/),C("def",t.current())):"="==n||("~"==n||"|"==n)&&t.eat("=")?C(null,"compare"):'"'==n||"'"==n?(e.tokenize=A(n),e.tokenize(t,e)):"#"==n?(t.eatWhile(/[\w\\\-]/),C("atom","hash")):"!"==n?(t.match(/^\s*\w*/),C("keyword","important")):/\d/.test(n)||"."==n&&t.eat(/\d/)?(t.eatWhile(/[\w.%]/),C("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?C(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?C("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?C(null,n):t.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(t.current())&&(e.tokenize=S),C("variable callee","variable")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),C("property","word")):C(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),C("number","unit")):t.match(/^-[\w\\\-]*/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?C("variable-2","variable-definition"):C("variable-2","variable")):t.match(/^\w+-/)?C("meta","meta"):void 0}function A(t){return function(e,n){var r,i=!1;while(null!=(r=e.next())){if(r==t&&!i){")"==t&&e.backUp(1);break}i=!i&&"\\"==r}return(r==t||!i&&")"!=t)&&(n.tokenize=null),C("string","string")}}function S(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=A(")"),C(null,"(")}function E(t,e,n){this.type=t,this.indent=e,this.prev=n}function O(t,e,n,r){return t.context=new E(n,e.indentation()+(!1===r?0:a),t.context),n}function T(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function _(t,e,n){return P[n.context.type](t,e,n)}function M(t,e,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return _(t,e,n)}function N(t){var e=t.current().toLowerCase();o=v.hasOwnProperty(e)?"atom":m.hasOwnProperty(e)?"keyword":"variable"}var P={top:function(t,e,n){if("{"==t)return O(n,e,"block");if("}"==t&&n.context.prev)return T(n);if(w&&/@component/i.test(t))return O(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return O(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return O(n,e,"atBlock");if(/^@(font-face|counter-style)/i.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))return"keyframes";if(t&&"@"==t.charAt(0))return O(n,e,"at");if("hash"==t)o="builtin";else if("word"==t)o="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return O(n,e,"interpolation");if(":"==t)return"pseudo";if(b&&"("==t)return O(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var r=e.current().toLowerCase();return h.hasOwnProperty(r)?(o="property","maybeprop"):p.hasOwnProperty(r)?(o=x?"string-2":"property","maybeprop"):b?(o=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==t?"block":b||"hash"!=t&&"qualifier"!=t?P.top(t,e,n):(o="error","block")},maybeprop:function(t,e,n){return":"==t?O(n,e,"prop"):_(t,e,n)},prop:function(t,e,n){if(";"==t)return T(n);if("{"==t&&b)return O(n,e,"propBlock");if("}"==t||"{"==t)return M(t,e,n);if("("==t)return O(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e.current())){if("word"==t)N(e);else if("interpolation"==t)return O(n,e,"interpolation")}else o+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?T(n):"word"==t?(o="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?M(t,e,n):")"==t?T(n):"("==t?O(n,e,"parens"):"interpolation"==t?O(n,e,"interpolation"):("word"==t&&N(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(o="variable-3",n.context.type):_(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(o="tag",n.context.type):P.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return O(n,e,"atBlock_parens");if("}"==t||";"==t)return M(t,e,n);if("{"==t)return T(n)&&O(n,e,b?"block":"top");if("interpolation"==t)return O(n,e,"interpolation");if("word"==t){var r=e.current().toLowerCase();o="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":h.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?x?"string-2":"property":v.hasOwnProperty(r)?"atom":m.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?M(t,e,n):"{"==t?T(n)&&O(n,e,b?"block":"top",!1):("word"==t&&(o="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?T(n):"{"==t||"}"==t?M(t,e,n,2):P.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?O(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):_(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,T(n)):"word"==t?(o="@font-face"==n.stateArg&&!f.hasOwnProperty(e.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(t,e,n){return"word"==t?(o="variable","keyframes"):"{"==t?O(n,e,"top"):_(t,e,n)},at:function(t,e,n){return";"==t?T(n):"{"==t||"}"==t?M(t,e,n):("word"==t?o="tag":"hash"==t&&(o="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?T(n):"{"==t||";"==t?M(t,e,n):("word"==t?o="variable":"variable"!=t&&"("!=t&&")"!=t&&(o="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new E(r?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||k)(t,e);return n&&"object"==typeof n&&(i=n[1],n=n[0]),o=n,"comment"!=i&&(e.state=P[e.state](i,t,e)),o},indent:function(t,e){var n=t.context,r=e&&e.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-a)):(n=n.prev,i=n.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=e(n),i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=e(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=e(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],c=e(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=e(u),h=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],p=e(h),f=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=e(f),m=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],v=e(m),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=e(b),w=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],x=e(w),C=n.concat(i).concat(a).concat(l).concat(u).concat(h).concat(b).concat(w);function k(t,e){var n,r=!1;while(null!=(n=t.next())){if(r&&"/"==n){e.tokenize=null;break}r="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",C),t.defineMIME("text/css",{documentTypes:r,mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:v,colorKeywords:y,valueKeywords:x,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=k,k(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:y,valueKeywords:x,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=k,k(t,e)):["operator","operator"]},":":function(t){return!!t.match(/^\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:y,valueKeywords:x,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=k,k(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:o,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:v,colorKeywords:y,valueKeywords:x,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=k,k(t,e))}},name:"css",helperType:"gss"})}))},"7ba6":function(t,e,n){"use strict";var r=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function i(t,e){var n,i,o,a=t.posMax,s=t.pos;if(94!==t.src.charCodeAt(s))return!1;if(e)return!1;if(s+2>=a)return!1;t.pos=s+1;while(t.pos<a){if(94===t.src.charCodeAt(t.pos)){n=!0;break}t.md.inline.skipToken(t)}return n&&s+1!==t.pos?(i=t.src.slice(s+1,t.pos),i.match(/(^|[^\\])(\\\\)*\s/)?(t.pos=s,!1):(t.posMax=t.pos,t.pos=s+1,o=t.push("sup_open","sup",1),o.markup="^",o=t.push("text","",0),o.content=i.replace(r,"$1"),o=t.push("sup_close","sup",-1),o.markup="^",t.pos=t.posMax+1,t.posMax=a,!0)):(t.pos=s,!1)}t.exports=function(t){t.inline.ruler.after("emphasis","sup",i)}},"7bb6":function(t,e,n){},"7c37":function(t,e,n){var r=n("605d");t.exports=function(t){try{if(r)return Function('return require("'+t+'")')()}catch(e){}}},"7ca0":function(t,e){t.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},"7cd2":function(t,e,n){},"7e79":function(t,e,n){!function(e,n){t.exports=n()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e,n){var r=n(2);"string"==typeof r&&(r=[[t.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(4)(r,i),r.locals&&(t.exports=r.locals)},function(t,e,n){"use strict";var r=n(0);n.n(r).a},function(t,e,n){(t.exports=n(3)(!1)).push([t.i,'\n.vue-cropper[data-v-6dae58fd] {\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n direction: ltr;\n touch-action: none;\n text-align: left;\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC");\n}\n.cropper-box[data-v-6dae58fd],\n.cropper-box-canvas[data-v-6dae58fd],\n.cropper-drag-box[data-v-6dae58fd],\n.cropper-crop-box[data-v-6dae58fd],\n.cropper-face[data-v-6dae58fd] {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n user-select: none;\n}\n.cropper-box-canvas img[data-v-6dae58fd] {\n position: relative;\n text-align: left;\n user-select: none;\n transform: none;\n max-width: none;\n max-height: none;\n}\n.cropper-box[data-v-6dae58fd] {\n overflow: hidden;\n}\n.cropper-move[data-v-6dae58fd] {\n cursor: move;\n}\n.cropper-crop[data-v-6dae58fd] {\n cursor: crosshair;\n}\n.cropper-modal[data-v-6dae58fd] {\n background: rgba(0, 0, 0, 0.5);\n}\n.cropper-crop-box[data-v-6dae58fd] {\n /*border: 2px solid #39f;*/\n}\n.cropper-view-box[data-v-6dae58fd] {\n display: block;\n overflow: hidden;\n width: 100%;\n height: 100%;\n outline: 1px solid #39f;\n outline-color: rgba(51, 153, 255, 0.75);\n user-select: none;\n}\n.cropper-view-box img[data-v-6dae58fd] {\n user-select: none;\n text-align: left;\n max-width: none;\n max-height: none;\n}\n.cropper-face[data-v-6dae58fd] {\n top: 0;\n left: 0;\n background-color: #fff;\n opacity: 0.1;\n}\n.crop-info[data-v-6dae58fd] {\n position: absolute;\n left: 0px;\n min-width: 65px;\n text-align: center;\n color: white;\n line-height: 20px;\n background-color: rgba(0, 0, 0, 0.8);\n font-size: 12px;\n}\n.crop-line[data-v-6dae58fd] {\n position: absolute;\n display: block;\n width: 100%;\n height: 100%;\n opacity: 0.1;\n}\n.line-w[data-v-6dae58fd] {\n top: -3px;\n left: 0;\n height: 5px;\n cursor: n-resize;\n}\n.line-a[data-v-6dae58fd] {\n top: 0;\n left: -3px;\n width: 5px;\n cursor: w-resize;\n}\n.line-s[data-v-6dae58fd] {\n bottom: -3px;\n left: 0;\n height: 5px;\n cursor: s-resize;\n}\n.line-d[data-v-6dae58fd] {\n top: 0;\n right: -3px;\n width: 5px;\n cursor: e-resize;\n}\n.crop-point[data-v-6dae58fd] {\n position: absolute;\n width: 8px;\n height: 8px;\n opacity: 0.75;\n background-color: #39f;\n border-radius: 100%;\n}\n.point1[data-v-6dae58fd] {\n top: -4px;\n left: -4px;\n cursor: nw-resize;\n}\n.point2[data-v-6dae58fd] {\n top: -5px;\n left: 50%;\n margin-left: -3px;\n cursor: n-resize;\n}\n.point3[data-v-6dae58fd] {\n top: -4px;\n right: -4px;\n cursor: ne-resize;\n}\n.point4[data-v-6dae58fd] {\n top: 50%;\n left: -4px;\n margin-top: -3px;\n cursor: w-resize;\n}\n.point5[data-v-6dae58fd] {\n top: 50%;\n right: -4px;\n margin-top: -3px;\n cursor: e-resize;\n}\n.point6[data-v-6dae58fd] {\n bottom: -5px;\n left: -4px;\n cursor: sw-resize;\n}\n.point7[data-v-6dae58fd] {\n bottom: -5px;\n left: 50%;\n margin-left: -3px;\n cursor: s-resize;\n}\n.point8[data-v-6dae58fd] {\n bottom: -5px;\n right: -4px;\n cursor: se-resize;\n}\n@media screen and (max-width: 500px) {\n.crop-point[data-v-6dae58fd] {\n position: absolute;\n width: 20px;\n height: 20px;\n opacity: 0.45;\n background-color: #39f;\n border-radius: 100%;\n}\n.point1[data-v-6dae58fd] {\n top: -10px;\n left: -10px;\n}\n.point2[data-v-6dae58fd],\n .point4[data-v-6dae58fd],\n .point5[data-v-6dae58fd],\n .point7[data-v-6dae58fd] {\n display: none;\n}\n.point3[data-v-6dae58fd] {\n top: -10px;\n right: -10px;\n}\n.point4[data-v-6dae58fd] {\n top: 0;\n left: 0;\n}\n.point6[data-v-6dae58fd] {\n bottom: -10px;\n left: -10px;\n}\n.point8[data-v-6dae58fd] {\n bottom: -10px;\n right: -10px;\n}\n}\n',""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=function(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}(r),o=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(o).concat([i]).join("\n")}return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){var r={},i=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}((function(){return window&&document&&document.all&&!window.atob})),o=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var r=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}}(),a=null,s=0,l=[],c=n(5);function u(t,e){for(var n=0;n<t.length;n++){var i=t[n],o=r[i.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](i.parts[a]);for(;a<i.parts.length;a++)o.parts.push(m(i.parts[a],e))}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(m(i.parts[a],e));r[i.id]={id:i.id,refs:1,parts:s}}}}function d(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],a=e.base?o[0]+e.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}function h(t,e){var n=o(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=l[l.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),l.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=o(t.insertAt.before,n);n.insertBefore(e,i)}}function p(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=l.indexOf(t);e>=0&&l.splice(e,1)}function f(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){return n.nc}();r&&(t.attrs.nonce=r)}return g(e,t.attrs),h(t,e),e}function g(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function m(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var l=s++;n=a||(a=f(e)),r=b.bind(null,n,l,!1),i=b.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),h(t,e),e}(e),r=function(t,e,n){var r=n.css,i=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||o)&&(r=c(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),i=function(){p(n),n.href&&URL.revokeObjectURL(n.href)}):(n=f(e),r=function(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),i=function(){p(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=i()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return u(n,e),function(t){for(var i=[],o=0;o<n.length;o++){var a=n[o];(s=r[a.id]).refs--,i.push(s)}for(t&&u(d(t,e),e),o=0;o<i.length;o++){var s;if(0===(s=i[o]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete r[s.id]}}}};var v=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}();function b(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=v(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var i,o=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?t:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"cropper",staticClass:"vue-cropper",on:{mouseover:t.scaleImg,mouseout:t.cancelScale}},[t.imgs?n("div",{staticClass:"cropper-box"},[n("div",{directives:[{name:"show",rawName:"v-show",value:!t.loading,expression:"!loading"}],staticClass:"cropper-box-canvas",style:{width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+t.x/t.scale+"px,"+t.y/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"}},[n("img",{ref:"cropperImg",attrs:{src:t.imgs,alt:"cropper-img"}})])]):t._e(),t._v(" "),n("div",{staticClass:"cropper-drag-box",class:{"cropper-move":t.move&&!t.crop,"cropper-crop":t.crop,"cropper-modal":t.cropping},on:{mousedown:t.startMove,touchstart:t.startMove}}),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.cropping,expression:"cropping"}],staticClass:"cropper-crop-box",style:{width:t.cropW+"px",height:t.cropH+"px",transform:"translate3d("+t.cropOffsertX+"px,"+t.cropOffsertY+"px,0)"}},[n("span",{staticClass:"cropper-view-box"},[n("img",{style:{width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+(t.x-t.cropOffsertX)/t.scale+"px,"+(t.y-t.cropOffsertY)/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"},attrs:{src:t.imgs,alt:"cropper-img"}})]),t._v(" "),n("span",{staticClass:"cropper-face cropper-move",on:{mousedown:t.cropMove,touchstart:t.cropMove}}),t._v(" "),t.info?n("span",{staticClass:"crop-info",style:{top:t.cropInfo.top}},[t._v(t._s(t.cropInfo.width)+" × "+t._s(t.cropInfo.height))]):t._e(),t._v(" "),t.fixedBox?t._e():n("span",[n("span",{staticClass:"crop-line line-w",on:{mousedown:function(e){t.changeCropSize(e,!1,!0,0,1)},touchstart:function(e){t.changeCropSize(e,!1,!0,0,1)}}}),t._v(" "),n("span",{staticClass:"crop-line line-a",on:{mousedown:function(e){t.changeCropSize(e,!0,!1,1,0)},touchstart:function(e){t.changeCropSize(e,!0,!1,1,0)}}}),t._v(" "),n("span",{staticClass:"crop-line line-s",on:{mousedown:function(e){t.changeCropSize(e,!1,!0,0,2)},touchstart:function(e){t.changeCropSize(e,!1,!0,0,2)}}}),t._v(" "),n("span",{staticClass:"crop-line line-d",on:{mousedown:function(e){t.changeCropSize(e,!0,!1,2,0)},touchstart:function(e){t.changeCropSize(e,!0,!1,2,0)}}}),t._v(" "),n("span",{staticClass:"crop-point point1",on:{mousedown:function(e){t.changeCropSize(e,!0,!0,1,1)},touchstart:function(e){t.changeCropSize(e,!0,!0,1,1)}}}),t._v(" "),n("span",{staticClass:"crop-point point2",on:{mousedown:function(e){t.changeCropSize(e,!1,!0,0,1)},touchstart:function(e){t.changeCropSize(e,!1,!0,0,1)}}}),t._v(" "),n("span",{staticClass:"crop-point point3",on:{mousedown:function(e){t.changeCropSize(e,!0,!0,2,1)},touchstart:function(e){t.changeCropSize(e,!0,!0,2,1)}}}),t._v(" "),n("span",{staticClass:"crop-point point4",on:{mousedown:function(e){t.changeCropSize(e,!0,!1,1,0)},touchstart:function(e){t.changeCropSize(e,!0,!1,1,0)}}}),t._v(" "),n("span",{staticClass:"crop-point point5",on:{mousedown:function(e){t.changeCropSize(e,!0,!1,2,0)},touchstart:function(e){t.changeCropSize(e,!0,!1,2,0)}}}),t._v(" "),n("span",{staticClass:"crop-point point6",on:{mousedown:function(e){t.changeCropSize(e,!0,!0,1,2)},touchstart:function(e){t.changeCropSize(e,!0,!0,1,2)}}}),t._v(" "),n("span",{staticClass:"crop-point point7",on:{mousedown:function(e){t.changeCropSize(e,!1,!0,0,2)},touchstart:function(e){t.changeCropSize(e,!1,!0,0,2)}}}),t._v(" "),n("span",{staticClass:"crop-point point8",on:{mousedown:function(e){t.changeCropSize(e,!0,!0,2,2)},touchstart:function(e){t.changeCropSize(e,!0,!0,2,2)}}})])])])};r._withStripped=!0;var i={getData:function(t){return new Promise((function(e,n){var r={};(function(t){var e=null;return new Promise((function(n,r){if(t.src)if(/^data\:/i.test(t.src))e=function(t){t=t.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var e=atob(t),n=e.length,r=new ArrayBuffer(n),i=new Uint8Array(r),o=0;o<n;o++)i[o]=e.charCodeAt(o);return r}(t.src),n(e);else if(/^blob\:/i.test(t.src)){var i=new FileReader;i.onload=function(t){e=t.target.result,n(e)},function(t,e){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.onload=function(t){200!=this.status&&0!==this.status||e(this.response)},n.send()}(t.src,(function(t){i.readAsArrayBuffer(t)}))}else{var o=new XMLHttpRequest;o.onload=function(){if(200!=this.status&&0!==this.status)throw"Could not load image";e=o.response,n(e),o=null},o.open("GET",t.src,!0),o.responseType="arraybuffer",o.send(null)}else r("img error")}))})(t).then((function(t){r.arrayBuffer=t,r.orientation=function(t){var e,n,r,i,o,a,s,l,c,u=new DataView(t),d=u.byteLength;if(255===u.getUint8(0)&&216===u.getUint8(1))for(l=2;l<d;){if(255===u.getUint8(l)&&225===u.getUint8(l+1)){a=l;break}l++}if(a&&(n=a+10,"Exif"===function(t,e,n){var r,i="";for(r=e,n+=e;r<n;r++)i+=String.fromCharCode(t.getUint8(r));return i}(u,a+4,4)&&(o=u.getUint16(n),((i=18761===o)||19789===o)&&42===u.getUint16(n+2,i)&&(r=u.getUint32(n+4,i))>=8&&(s=n+r))),s)for(d=u.getUint16(s,i),c=0;c<d;c++)if(l=s+12*c+2,274===u.getUint16(l,i)){l+=8,e=u.getUint16(l,i);break}return e}(t),e(r)})).catch((function(t){n(t)}))}))}},o=i,a={data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:function(){return[1,1]}},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:function(){return 10}}},computed:{cropInfo:function(){var t={};if(t.top=this.cropOffsertY>21?"-21px":"0px",t.width=this.cropW>0?this.cropW:0,t.height=this.cropH>0?this.cropH:0,this.infoTrue){var e=1;this.high&&!this.full&&(e=window.devicePixelRatio),1!==this.enlarge&!this.full&&(e=Math.abs(Number(this.enlarge))),t.width=t.width*e,t.height=t.height*e,this.full&&(t.width=t.width/this.scale,t.height=t.height/this.scale)}return t.width=t.width.toFixed(0),t.height=t.height.toFixed(0),t},isIE:function(){navigator.userAgent;var t=!!window.ActiveXObject||"ActiveXObject"in window;return t},passive:function(){return this.isIE?null:{passive:!1}}},watch:{img:function(){this.checkedImg()},imgs:function(t){""!==t&&this.reload()},cropW:function(){this.showPreview()},cropH:function(){this.showPreview()},cropOffsertX:function(){this.showPreview()},cropOffsertY:function(){this.showPreview()},scale:function(t,e){this.showPreview()},x:function(){this.showPreview()},y:function(){this.showPreview()},autoCrop:function(t){t&&this.goAutoCrop()},autoCropWidth:function(){this.autoCrop&&this.goAutoCrop()},autoCropHeight:function(){this.autoCrop&&this.goAutoCrop()},mode:function(){this.checkedImg()},rotate:function(){this.showPreview(),(this.autoCrop||this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion:function(t){for(var e=navigator.userAgent.split(" "),n="",r=new RegExp(t,"i"),i=0;i<e.length;i++)r.test(e[i])&&(n=e[i]);return n?n.split("/")[1].split("."):["0","0","0"]},checkOrientationImage:function(t,e,n,r){var i=this;if(this.getVersion("chrome")[0]>=81)e=-1;else if(this.getVersion("safari")[0]>=605){var o=this.getVersion("version");o[0]>13&&o[1]>1&&(e=-1)}else{var a=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(a){var s=a[1];((s=s.split("_"))[0]>13||s[0]>=13&&s[1]>=4)&&(e=-1)}}var l=document.createElement("canvas"),c=l.getContext("2d");switch(c.save(),e){case 2:l.width=n,l.height=r,c.translate(n,0),c.scale(-1,1);break;case 3:l.width=n,l.height=r,c.translate(n/2,r/2),c.rotate(180*Math.PI/180),c.translate(-n/2,-r/2);break;case 4:l.width=n,l.height=r,c.translate(0,r),c.scale(1,-1);break;case 5:l.height=n,l.width=r,c.rotate(.5*Math.PI),c.scale(1,-1);break;case 6:l.width=r,l.height=n,c.translate(r/2,n/2),c.rotate(90*Math.PI/180),c.translate(-n/2,-r/2);break;case 7:l.height=n,l.width=r,c.rotate(.5*Math.PI),c.translate(n,-r),c.scale(-1,1);break;case 8:l.height=n,l.width=r,c.translate(r/2,n/2),c.rotate(-90*Math.PI/180),c.translate(-n/2,-r/2);break;default:l.width=n,l.height=r}c.drawImage(t,0,0,n,r),c.restore(),l.toBlob((function(t){var e=URL.createObjectURL(t);URL.revokeObjectURL(i.imgs),i.imgs=e}),"image/"+this.outputType,1)},checkedImg:function(){var t=this;if(null===this.img||""===this.img)return this.imgs="",void this.clearCrop();this.loading=!0,this.scale=1,this.rotate=0,this.clearCrop();var e=new Image;if(e.onload=function(){if(""===t.img)return t.$emit("imgLoad","error"),t.$emit("img-load","error"),!1;var n=e.width,r=e.height;o.getData(e).then((function(i){t.orientation=i.orientation||1;var o=Number(t.maxImgSize);!t.orientation&&n<o&r<o?t.imgs=t.img:(n>o&&(r=r/n*o,n=o),r>o&&(n=n/r*o,r=o),t.checkOrientationImage(e,t.orientation,n,r))}))},e.onerror=function(){t.$emit("imgLoad","error"),t.$emit("img-load","error")},"data"!==this.img.substr(0,4)&&(e.crossOrigin=""),this.isIE){var n=new XMLHttpRequest;n.onload=function(){var t=URL.createObjectURL(this.response);e.src=t},n.open("GET",this.img,!0),n.responseType="blob",n.send()}else e.src=this.img},startMove:function(t){if(t.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in t?t.clientX:t.touches[0].clientX)-this.x,this.moveY=("clientY"in t?t.clientY:t.touches[0].clientY)-this.y,t.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),2==t.touches.length&&(this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=t.offsetX?t.offsetX:t.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=t.offsetY?t.offsetY:t.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale:function(t){var e=this;t.preventDefault();var n=this.scale,r=this.touches[0].clientX,i=this.touches[0].clientY,o=t.touches[0].clientX,a=t.touches[0].clientY,s=this.touches[1].clientX,l=this.touches[1].clientY,c=t.touches[1].clientX,u=t.touches[1].clientY,d=Math.sqrt(Math.pow(r-s,2)+Math.pow(i-l,2)),h=Math.sqrt(Math.pow(o-c,2)+Math.pow(a-u,2))-d,p=1,f=(p=(p=p/this.trueWidth>p/this.trueHeight?p/this.trueHeight:p/this.trueWidth)>.1?.1:p)*h;if(!this.touchNow){if(this.touchNow=!0,h>0?n+=Math.abs(f):h<0&&n>Math.abs(f)&&(n-=Math.abs(f)),this.touches=t.touches,setTimeout((function(){e.touchNow=!1}),8),!this.checkoutImgAxis(this.x,this.y,n))return!1;this.scale=n}},cancelTouchScale:function(t){window.removeEventListener("touchmove",this.touchScale)},moveImg:function(t){var e=this;if(t.preventDefault(),t.touches&&2===t.touches.length)return this.touches=t.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;var n,r,i="clientX"in t?t.clientX:t.touches[0].clientX,o="clientY"in t?t.clientY:t.touches[0].clientY;n=i-this.moveX,r=o-this.moveY,this.$nextTick((function(){if(e.centerBox){var t,i,o,a,s=e.getImgAxis(n,r,e.scale),l=e.getCropAxis(),c=e.trueHeight*e.scale,u=e.trueWidth*e.scale;switch(e.rotate){case 1:case-1:case 3:case-3:t=e.cropOffsertX-e.trueWidth*(1-e.scale)/2+(c-u)/2,i=e.cropOffsertY-e.trueHeight*(1-e.scale)/2+(u-c)/2,o=t-c+e.cropW,a=i-u+e.cropH;break;default:t=e.cropOffsertX-e.trueWidth*(1-e.scale)/2,i=e.cropOffsertY-e.trueHeight*(1-e.scale)/2,o=t-u+e.cropW,a=i-c+e.cropH}s.x1>=l.x1&&(n=t),s.y1>=l.y1&&(r=i),s.x2<=l.x2&&(n=o),s.y2<=l.y2&&(r=a)}e.x=n,e.y=r,e.$emit("imgMoving",{moving:!0,axis:e.getImgAxis()}),e.$emit("img-moving",{moving:!0,axis:e.getImgAxis()})}))},leaveImg:function(t){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("imgMoving",{moving:!1,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg:function(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale:function(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize:function(t){var e=this;t.preventDefault();var n=this.scale,r=t.deltaY||t.wheelDelta;r=navigator.userAgent.indexOf("Firefox")>0?30*r:r,this.isIE&&(r=-r);var i=this.coe,o=(i=i/this.trueWidth>i/this.trueHeight?i/this.trueHeight:i/this.trueWidth)*r;o<0?n+=Math.abs(o):n>Math.abs(o)&&(n-=Math.abs(o));var a=o<0?"add":"reduce";if(a!==this.coeStatus&&(this.coeStatus=a,this.coe=.2),this.scaling||(this.scalingSet=setTimeout((function(){e.scaling=!1,e.coe=e.coe+=.01}),50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,n))return!1;this.scale=n},changeScale:function(t){var e=this.scale;t=t||1;var n=20;if((t*=n=n/this.trueWidth>n/this.trueHeight?n/this.trueHeight:n/this.trueWidth)>0?e+=Math.abs(t):e>Math.abs(t)&&(e-=Math.abs(t)),!this.checkoutImgAxis(this.x,this.y,e))return!1;this.scale=e},createCrop:function(t){var e=this;t.preventDefault();var n="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,r="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0;this.$nextTick((function(){var t=n-e.cropX,i=r-e.cropY;if(t>0?(e.cropW=t+e.cropChangeX>e.w?e.w-e.cropChangeX:t,e.cropOffsertX=e.cropChangeX):(e.cropW=e.w-e.cropChangeX+Math.abs(t)>e.w?e.cropChangeX:Math.abs(t),e.cropOffsertX=e.cropChangeX+t>0?e.cropChangeX+t:0),e.fixed){var o=e.cropW/e.fixedNumber[0]*e.fixedNumber[1];o+e.cropOffsertY>e.h?(e.cropH=e.h-e.cropOffsertY,e.cropW=e.cropH/e.fixedNumber[1]*e.fixedNumber[0],e.cropOffsertX=t>0?e.cropChangeX:e.cropChangeX-e.cropW):e.cropH=o,e.cropOffsertY=e.cropOffsertY}else i>0?(e.cropH=i+e.cropChangeY>e.h?e.h-e.cropChangeY:i,e.cropOffsertY=e.cropChangeY):(e.cropH=e.h-e.cropChangeY+Math.abs(i)>e.h?e.cropChangeY:Math.abs(i),e.cropOffsertY=e.cropChangeY+i>0?e.cropChangeY+i:0)}))},changeCropSize:function(t,e,n,r,i){t.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=e,this.canChangeY=n,this.changeCropTypeX=r,this.changeCropTypeY=i,this.cropX="clientX"in t?t.clientX:t.touches[0].clientX,this.cropY="clientY"in t?t.clientY:t.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow:function(t){var e=this;t.preventDefault();var n="clientX"in t?t.clientX:t.touches?t.touches[0].clientX:0,r="clientY"in t?t.clientY:t.touches?t.touches[0].clientY:0,i=this.w,o=this.h,a=0,s=0;if(this.centerBox){var l=this.getImgAxis(),c=l.x2,u=l.y2;a=l.x1>0?l.x1:0,s=l.y1>0?l.y1:0,i>c&&(i=c),o>u&&(o=u)}this.$nextTick((function(){var t=n-e.cropX,l=r-e.cropY;if(e.canChangeX&&(1===e.changeCropTypeX?e.cropOldW-t>0?(e.cropW=i-e.cropChangeX-t<=i-a?e.cropOldW-t:e.cropOldW+e.cropChangeX-a,e.cropOffsertX=i-e.cropChangeX-t<=i-a?e.cropChangeX+t:a):(e.cropW=Math.abs(t)+e.cropChangeX<=i?Math.abs(t)-e.cropOldW:i-e.cropOldW-e.cropChangeX,e.cropOffsertX=e.cropChangeX+e.cropOldW):2===e.changeCropTypeX&&(e.cropOldW+t>0?(e.cropW=e.cropOldW+t+e.cropOffsertX<=i?e.cropOldW+t:i-e.cropOffsertX,e.cropOffsertX=e.cropChangeX):(e.cropW=i-e.cropChangeX+Math.abs(t+e.cropOldW)<=i-a?Math.abs(t+e.cropOldW):e.cropChangeX-a,e.cropOffsertX=i-e.cropChangeX+Math.abs(t+e.cropOldW)<=i-a?e.cropChangeX-Math.abs(t+e.cropOldW):a))),e.canChangeY&&(1===e.changeCropTypeY?e.cropOldH-l>0?(e.cropH=o-e.cropChangeY-l<=o-s?e.cropOldH-l:e.cropOldH+e.cropChangeY-s,e.cropOffsertY=o-e.cropChangeY-l<=o-s?e.cropChangeY+l:s):(e.cropH=Math.abs(l)+e.cropChangeY<=o?Math.abs(l)-e.cropOldH:o-e.cropOldH-e.cropChangeY,e.cropOffsertY=e.cropChangeY+e.cropOldH):2===e.changeCropTypeY&&(e.cropOldH+l>0?(e.cropH=e.cropOldH+l+e.cropOffsertY<=o?e.cropOldH+l:o-e.cropOffsertY,e.cropOffsertY=e.cropChangeY):(e.cropH=o-e.cropChangeY+Math.abs(l+e.cropOldH)<=o-s?Math.abs(l+e.cropOldH):e.cropChangeY-s,e.cropOffsertY=o-e.cropChangeY+Math.abs(l+e.cropOldH)<=o-s?e.cropChangeY-Math.abs(l+e.cropOldH):s))),e.canChangeX&&e.fixed){var c=e.cropW/e.fixedNumber[0]*e.fixedNumber[1];c+e.cropOffsertY>o?(e.cropH=o-e.cropOffsertY,e.cropW=e.cropH/e.fixedNumber[1]*e.fixedNumber[0]):e.cropH=c}if(e.canChangeY&&e.fixed){var u=e.cropH/e.fixedNumber[1]*e.fixedNumber[0];u+e.cropOffsertX>i?(e.cropW=i-e.cropOffsertX,e.cropH=e.cropW/e.fixedNumber[0]*e.fixedNumber[1]):e.cropW=u}e.$emit("crop-sizing",{cropW:e.cropW,cropH:e.cropH})}))},checkCropLimitSize:function(){this.cropW,this.cropH;var t=this.limitMinSize,e=new Array;return e=Array.isArray[t]?t:[t,t],[parseFloat(e[0]),parseFloat(e[1])]},changeCropEnd:function(t){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},endCrop:function(){0===this.cropW&&0===this.cropH&&(this.cropping=!1),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop:function(){this.crop=!0},stopCrop:function(){this.crop=!1},clearCrop:function(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove:function(t){if(t.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(t),!1;if(t.touches&&2===t.touches.length)return this.crop=!1,this.startMove(t),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);var e,n,r="clientX"in t?t.clientX:t.touches[0].clientX,i="clientY"in t?t.clientY:t.touches[0].clientY;e=r-this.cropOffsertX,n=i-this.cropOffsertY,this.cropX=e,this.cropY=n,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop:function(t,e){var n=this,r=0,i=0;t&&(t.preventDefault(),r="clientX"in t?t.clientX:t.touches[0].clientX,i="clientY"in t?t.clientY:t.touches[0].clientY),this.$nextTick((function(){var t,o,a=r-n.cropX,s=i-n.cropY;if(e&&(a=n.cropOffsertX,s=n.cropOffsertY),t=a<=0?0:a+n.cropW>n.w?n.w-n.cropW:a,o=s<=0?0:s+n.cropH>n.h?n.h-n.cropH:s,n.centerBox){var l=n.getImgAxis();t<=l.x1&&(t=l.x1),t+n.cropW>l.x2&&(t=l.x2-n.cropW),o<=l.y1&&(o=l.y1),o+n.cropH>l.y2&&(o=l.y2-n.cropH)}n.cropOffsertX=t,n.cropOffsertY=o,n.$emit("cropMoving",{moving:!0,axis:n.getCropAxis()}),n.$emit("crop-moving",{moving:!0,axis:n.getCropAxis()})}))},getImgAxis:function(t,e,n){t=t||this.x,e=e||this.y,n=n||this.scale;var r={x1:0,x2:0,y1:0,y2:0},i=this.trueWidth*n,o=this.trueHeight*n;switch(this.rotate){case 0:r.x1=t+this.trueWidth*(1-n)/2,r.x2=r.x1+this.trueWidth*n,r.y1=e+this.trueHeight*(1-n)/2,r.y2=r.y1+this.trueHeight*n;break;case 1:case-1:case 3:case-3:r.x1=t+this.trueWidth*(1-n)/2+(i-o)/2,r.x2=r.x1+this.trueHeight*n,r.y1=e+this.trueHeight*(1-n)/2+(o-i)/2,r.y2=r.y1+this.trueWidth*n;break;default:r.x1=t+this.trueWidth*(1-n)/2,r.x2=r.x1+this.trueWidth*n,r.y1=e+this.trueHeight*(1-n)/2,r.y2=r.y1+this.trueHeight*n}return r},getCropAxis:function(){var t={x1:0,x2:0,y1:0,y2:0};return t.x1=this.cropOffsertX,t.x2=t.x1+this.cropW,t.y1=this.cropOffsertY,t.y2=t.y1+this.cropH,t},leaveCrop:function(t){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("cropMoving",{moving:!1,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked:function(t){var e=this,n=document.createElement("canvas"),r=new Image,i=this.rotate,o=this.trueWidth,a=this.trueHeight,s=this.cropOffsertX,l=this.cropOffsertY;function c(t,e){n.width=Math.round(t),n.height=Math.round(e)}r.onload=function(){if(0!==e.cropW){var u=n.getContext("2d"),d=1;e.high&!e.full&&(d=window.devicePixelRatio),1!==e.enlarge&!e.full&&(d=Math.abs(Number(e.enlarge)));var h=e.cropW*d,p=e.cropH*d,f=o*e.scale*d,g=a*e.scale*d,m=(e.x-s+e.trueWidth*(1-e.scale)/2)*d,v=(e.y-l+e.trueHeight*(1-e.scale)/2)*d;switch(c(h,p),u.save(),i){case 0:e.full?(c(h/e.scale,p/e.scale),u.drawImage(r,m/e.scale,v/e.scale,f/e.scale,g/e.scale)):u.drawImage(r,m,v,f,g);break;case 1:case-3:e.full?(c(h/e.scale,p/e.scale),m=m/e.scale+(f/e.scale-g/e.scale)/2,v=v/e.scale+(g/e.scale-f/e.scale)/2,u.rotate(90*i*Math.PI/180),u.drawImage(r,v,-m-g/e.scale,f/e.scale,g/e.scale)):(m+=(f-g)/2,v+=(g-f)/2,u.rotate(90*i*Math.PI/180),u.drawImage(r,v,-m-g,f,g));break;case 2:case-2:e.full?(c(h/e.scale,p/e.scale),u.rotate(90*i*Math.PI/180),m/=e.scale,v/=e.scale,u.drawImage(r,-m-f/e.scale,-v-g/e.scale,f/e.scale,g/e.scale)):(u.rotate(90*i*Math.PI/180),u.drawImage(r,-m-f,-v-g,f,g));break;case 3:case-1:e.full?(c(h/e.scale,p/e.scale),m=m/e.scale+(f/e.scale-g/e.scale)/2,v=v/e.scale+(g/e.scale-f/e.scale)/2,u.rotate(90*i*Math.PI/180),u.drawImage(r,-v-f/e.scale,m,f/e.scale,g/e.scale)):(m+=(f-g)/2,v+=(g-f)/2,u.rotate(90*i*Math.PI/180),u.drawImage(r,-v-f,m,f,g));break;default:e.full?(c(h/e.scale,p/e.scale),u.drawImage(r,m/e.scale,v/e.scale,f/e.scale,g/e.scale)):u.drawImage(r,m,v,f,g)}u.restore()}else{var b=o*e.scale,y=a*e.scale,w=n.getContext("2d");switch(w.save(),i){case 0:c(b,y),w.drawImage(r,0,0,b,y);break;case 1:case-3:c(y,b),w.rotate(90*i*Math.PI/180),w.drawImage(r,0,-y,b,y);break;case 2:case-2:c(b,y),w.rotate(90*i*Math.PI/180),w.drawImage(r,-b,-y,b,y);break;case 3:case-1:c(y,b),w.rotate(90*i*Math.PI/180),w.drawImage(r,-b,0,b,y);break;default:c(b,y),w.drawImage(r,0,0,b,y)}w.restore()}t(n)},"data"!==this.img.substr(0,4)&&(r.crossOrigin="Anonymous"),r.src=this.imgs},getCropData:function(t){var e=this;this.getCropChecked((function(n){t(n.toDataURL("image/"+e.outputType,e.outputSize))}))},getCropBlob:function(t){var e=this;this.getCropChecked((function(n){n.toBlob((function(e){return t(e)}),"image/"+e.outputType,e.outputSize)}))},showPreview:function(){var t=this;if(!this.isCanShow)return!1;this.isCanShow=!1,setTimeout((function(){t.isCanShow=!0}),16);var e=this.cropW,n=this.cropH,r=this.scale,i={};i.div={width:"".concat(e,"px"),height:"".concat(n,"px")};var o=(this.x-this.cropOffsertX)/r,a=(this.y-this.cropOffsertY)/r;i.w=e,i.h=n,i.url=this.imgs,i.img={width:"".concat(this.trueWidth,"px"),height:"".concat(this.trueHeight,"px"),transform:"scale(".concat(r,")translate3d(").concat(o,"px, ").concat(a,"px, ").concat(0,"px)rotateZ(").concat(90*this.rotate,"deg)")},i.html='\n <div class="show-preview" style="width: '.concat(i.w,"px; height: ").concat(i.h,'px,; overflow: hidden">\n <div style="width: ').concat(e,"px; height: ").concat(n,'px">\n <img src=').concat(i.url,' style="width: ').concat(this.trueWidth,"px; height: ").concat(this.trueHeight,"px; transform:\n scale(").concat(r,")translate3d(").concat(o,"px, ").concat(a,"px, ").concat(0,"px)rotateZ(").concat(90*this.rotate,'deg)">\n </div>\n </div>'),this.$emit("realTime",i),this.$emit("real-time",i)},reload:function(){var t=this,e=new Image;e.onload=function(){t.w=parseFloat(window.getComputedStyle(t.$refs.cropper).width),t.h=parseFloat(window.getComputedStyle(t.$refs.cropper).height),t.trueWidth=e.width,t.trueHeight=e.height,t.original?t.scale=1:t.scale=t.checkedMode(),t.$nextTick((function(){t.x=-(t.trueWidth-t.trueWidth*t.scale)/2+(t.w-t.trueWidth*t.scale)/2,t.y=-(t.trueHeight-t.trueHeight*t.scale)/2+(t.h-t.trueHeight*t.scale)/2,t.loading=!1,t.autoCrop&&t.goAutoCrop(),t.$emit("img-load","success"),t.$emit("imgLoad","success"),setTimeout((function(){t.showPreview()}),20)}))},e.onerror=function(){t.$emit("imgLoad","error"),t.$emit("img-load","error")},e.src=this.imgs},checkedMode:function(){var t=1,e=(this.trueWidth,this.trueHeight),n=this.mode.split(" ");switch(n[0]){case"contain":this.trueWidth>this.w&&(t=this.w/this.trueWidth),this.trueHeight*t>this.h&&(t=this.h/this.trueHeight);break;case"cover":(e*=t=this.w/this.trueWidth)<this.h&&(t=(e=this.h)/this.trueHeight);break;default:try{var r=n[0];if(-1!==r.search("px")){r=r.replace("px","");var i=parseFloat(r)/this.trueWidth,o=1,a=n[1];-1!==a.search("px")&&(a=a.replace("px",""),o=(e=parseFloat(a))/this.trueHeight),t=Math.min(i,o)}if(-1!==r.search("%")&&(r=r.replace("%",""),t=parseFloat(r)/100*this.w/this.trueWidth),2===n.length&&"auto"===r){var s=n[1];-1!==s.search("px")&&(s=s.replace("px",""),t=(e=parseFloat(s))/this.trueHeight),-1!==s.search("%")&&(s=s.replace("%",""),t=(e=parseFloat(s)/100*this.h)/this.trueHeight)}}catch(e){t=1}}return t},goAutoCrop:function(t,e){if(""!==this.imgs&&null!==this.imgs){this.clearCrop(),this.cropping=!0;var n=this.w,r=this.h;if(this.centerBox){var i=Math.abs(this.rotate)%2>0,o=(i?this.trueHeight:this.trueWidth)*this.scale,a=(i?this.trueWidth:this.trueHeight)*this.scale;n=o<n?o:n,r=a<r?a:r}var s=t||parseFloat(this.autoCropWidth),l=e||parseFloat(this.autoCropHeight);0!==s&&0!==l||(s=.8*n,l=.8*r),s=s>n?n:s,l=l>r?r:l,this.fixed&&(l=s/this.fixedNumber[0]*this.fixedNumber[1]),l>this.h&&(s=(l=this.h)/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(s,l)}},changeCrop:function(t,e){var n=this;if(this.centerBox){var r=this.getImgAxis();t>r.x2-r.x1&&(e=(t=r.x2-r.x1)/this.fixedNumber[0]*this.fixedNumber[1]),e>r.y2-r.y1&&(t=(e=r.y2-r.y1)/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=t,this.cropH=e,this.checkCropLimitSize(),this.$nextTick((function(){n.cropOffsertX=(n.w-n.cropW)/2,n.cropOffsertY=(n.h-n.cropH)/2,n.centerBox&&n.moveCrop(null,!0)}))},refresh:function(){var t=this;this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick((function(){t.checkedImg()}))},rotateLeft:function(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight:function(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear:function(){this.rotate=0},checkoutImgAxis:function(t,e,n){t=t||this.x,e=e||this.y,n=n||this.scale;var r=!0;if(this.centerBox){var i=this.getImgAxis(t,e,n),o=this.getCropAxis();i.x1>=o.x1&&(r=!1),i.x2<=o.x2&&(r=!1),i.y1>=o.y1&&(r=!1),i.y2<=o.y2&&(r=!1)}return r}},mounted:function(){this.support="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";var t=this,e=navigator.userAgent;this.isIOS=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,n,r){for(var i=atob(this.toDataURL(n,r).split(",")[1]),o=i.length,a=new Uint8Array(o),s=0;s<o;s++)a[s]=i.charCodeAt(s);e(new Blob([a],{type:t.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},destroyed:function(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}};n(1);var s=function(t,e,n,r,i,o,a,s){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=l):i&&(l=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:c}}(a,r,[],!1,null,"6dae58fd",null);s.options.__file="src/vue-cropper.vue";var l=s.exports;n.d(e,"VueCropper",(function(){return l}));var c=function(t){t.component("VueCropper",l)};"undefined"!=typeof window&&window.Vue&&c(window.Vue),e.default={version:"0.5.8",install:c,VueCropper:l,vueCropper:l}}])}))},"7e84":function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n("131a"),n("3410");function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}},"7ec2":function(t,e,n){n("a4d3"),n("e01a"),n("d3b7"),n("d28b"),n("3ca3"),n("ddb0"),n("b636"),n("944a"),n("0c47"),n("23dc"),n("d9e2"),n("3410"),n("159b"),n("b0c0"),n("131a"),n("fb6a");var r=n("7037")["default"];function i(){"use strict";
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports["default"]=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(_){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof f?e:f,o=Object.create(i.prototype),a=new E(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=h(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(_){return{type:"throw",arg:_}}}e.wrap=d;var p={};function f(){}function g(){}function m(){}var v={};u(v,s,(function(){return this}));var b=Object.getPrototypeOf,y=b&&b(b(O([])));y&&y!==n&&o.call(y,s)&&(v=y);var w=m.prototype=f.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,a,s,l){var c=h(t[i],t,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&o.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function k(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var r=h(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function O(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:T}}function T(){return{value:void 0,done:!0}}return g.prototype=m,u(w,"constructor",m),u(m,"constructor",g),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},x(C.prototype),u(C.prototype,l,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(d(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),u(w,c,"Generator"),u(w,s,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=i,t.exports.__esModule=!0,t.exports["default"]=t.exports},8097:function(t,e,n){"use strict";var r=n("55be"),i=n("848f"),o=n("d0847"),a=n("9145"),s=n("aeeb"),l=n("5f1a"),c=n("0052"),u=n("d8a6"),d=n("1985"),h={default:n("7702"),zero:n("a3c3"),commonmark:n("d8b4")},p=/^(vbscript|javascript|file|data):/,f=/^data:image\/(gif|png|jpeg|webp);/;function g(t){var e=t.trim().toLowerCase();return!p.test(e)||!!f.test(e)}var m=["http:","https:","mailto:"];function v(t){var e=u.parse(t,!0);if(e.hostname&&(!e.protocol||m.indexOf(e.protocol)>=0))try{e.hostname=d.toASCII(e.hostname)}catch(n){}return u.encode(u.format(e))}function b(t){var e=u.parse(t,!0);if(e.hostname&&(!e.protocol||m.indexOf(e.protocol)>=0))try{e.hostname=d.toUnicode(e.hostname)}catch(n){}return u.decode(u.format(e),u.decode.defaultChars+"%")}function y(t,e){if(!(this instanceof y))return new y(t,e);e||r.isString(t)||(e=t||{},t="default"),this.inline=new l,this.block=new s,this.core=new a,this.renderer=new o,this.linkify=new c,this.validateLink=g,this.normalizeLink=v,this.normalizeLinkText=b,this.utils=r,this.helpers=r.assign({},i),this.options={},this.configure(t),e&&this.set(e)}y.prototype.set=function(t){return r.assign(this.options,t),this},y.prototype.configure=function(t){var e,n=this;if(r.isString(t)&&(e=t,t=h[e],!t))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&n.set(t.options),t.components&&Object.keys(t.components).forEach((function(e){t.components[e].rules&&n[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&n[e].ruler2.enableOnly(t.components[e].rules2)})),this},y.prototype.enable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){n=n.concat(this[e].ruler.enable(t,!0))}),this),n=n.concat(this.inline.ruler2.enable(t,!0));var r=t.filter((function(t){return n.indexOf(t)<0}));if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},y.prototype.disable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){n=n.concat(this[e].ruler.disable(t,!0))}),this),n=n.concat(this.inline.ruler2.disable(t,!0));var r=t.filter((function(t){return n.indexOf(t)<0}));if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},y.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},y.prototype.parse=function(t,e){if("string"!==typeof t)throw new Error("Input data should be a String");var n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},y.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},y.prototype.parseInline=function(t,e){var n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},y.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)},t.exports=y},"81b2":function(t,e,n){var r=n("23e7"),i=n("d066"),o=n("e330"),a=n("d039"),s=n("577e"),l=n("1a2d"),c=n("d6d6"),u=n("b917").ctoi,d=/[^\d+/a-z]/i,h=/[\t\n\f\r ]+/g,p=/[=]+$/,f=i("atob"),g=String.fromCharCode,m=o("".charAt),v=o("".replace),b=o(d.exec),y=a((function(){return""!==f(" ")})),w=!a((function(){f("a")})),x=!y&&!w&&!a((function(){f()})),C=!y&&!w&&1!==f.length;r({global:!0,enumerable:!0,forced:y||w||x||C},{atob:function(t){if(c(arguments.length,1),x||C)return f(t);var e,n,r=v(s(t),h,""),o="",a=0,y=0;if(r.length%4==0&&(r=v(r,p,"")),r.length%4==1||b(d,r))throw new(i("DOMException"))("The string is not correctly encoded","InvalidCharacterError");while(e=m(r,a++))l(u,e)&&(n=y%4?64*n+u[e]:u[e],y++%4&&(o+=g(255&n>>(-2*y&6))));return o}})},"81d5":function(t,e,n){"use strict";var r=n("7b0b"),i=n("23cb"),o=n("07fa");t.exports=function(t){var e=r(this),n=o(e),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),l=a>2?arguments[2]:void 0,c=void 0===l?n:i(l,n);while(c>s)e[s++]=t;return e}},"82f8":function(t,e,n){"use strict";var r=n("ebb5"),i=n("4d64").includes,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("includes",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},8384:function(t,e){function n(t,e,n){return t===t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}t.exports=n},"841c":function(t,e,n){"use strict";var r=n("c65b"),i=n("d784"),o=n("825a"),a=n("7234"),s=n("1d80"),l=n("129f"),c=n("577e"),u=n("dc4a"),d=n("14c3");i("search",(function(t,e,n){return[function(e){var n=s(this),i=a(e)?void 0:u(e,t);return i?r(i,e,n):new RegExp(e)[t](c(n))},function(t){var r=o(this),i=c(t),a=n(e,r,i);if(a.done)return a.value;var s=r.lastIndex;l(s,0)||(r.lastIndex=0);var u=d(r,i);return l(r.lastIndex,s)||(r.lastIndex=s),null===u?-1:u.index}]}))},"848f":function(t,e,n){"use strict";e.parseLinkLabel=n("d084"),e.parseLinkDestination=n("c058"),e.parseLinkTitle=n("daf4")},8505:function(t,e,n){"use strict";n("7023")},"85b6":function(t,e,n){"use strict";t.exports=function(t){var e,n,r=0,i=t.tokens,o=t.tokens.length;for(e=n=0;e<o;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,"text"===i[e].type&&e+1<o&&"text"===i[e+1].type?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}},8609:function(t,e,n){},8714:function(t,e,n){"use strict";t.exports=function(t,e){var n,r,i,o,a,s,l=e+1,c=t.md.block.ruler.getRules("paragraph"),u=t.lineMax;for(s=t.parentType,t.parentType="paragraph";l<u&&!t.isEmpty(l);l++)if(!(t.sCount[l]-t.blkIndent>3)&&!(t.sCount[l]<0)){for(r=!1,i=0,o=c.length;i<o;i++)if(c[i](t,l,u,!0)){r=!0;break}if(r)break}return n=t.getLines(e,l,t.blkIndent,!1).trim(),t.line=l,a=t.push("paragraph_open","p",1),a.map=[e,t.line],a=t.push("inline","",0),a.content=n,a.map=[e,t.line],a.children=[],a=t.push("paragraph_close","p",-1),t.parentType=s,!0}},"8a36":function(t,e,n){"use strict";t.exports=function(t,e,n,r){var i,o,a,s,l,c,u,d=!1,h=t.bMarks[e]+t.tShift[e],p=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(h+3>p)return!1;if(i=t.src.charCodeAt(h),126!==i&&96!==i)return!1;if(l=h,h=t.skipChars(h,i),o=h-l,o<3)return!1;if(u=t.src.slice(l,h),a=t.src.slice(h,p),96===i&&a.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(s=e;;){if(s++,s>=n)break;if(h=l=t.bMarks[s]+t.tShift[s],p=t.eMarks[s],h<p&&t.sCount[s]<t.blkIndent)break;if(t.src.charCodeAt(h)===i&&(!(t.sCount[s]-t.blkIndent>=4)&&(h=t.skipChars(h,i),!(h-l<o)&&(h=t.skipSpaces(h),!(h<p))))){d=!0;break}}return o=t.sCount[e],t.line=s+(d?1:0),c=t.push("fence","code",0),c.info=a,c.content=t.getLines(e+1,s,o,!0),c.markup=u,c.map=[e,t.line],!0}},"8a60":function(t,e,n){var r;(function(i,o,a){if(i){for(var s,l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},c={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},u={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},d={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},h=1;h<20;++h)l[111+h]="f"+h;for(h=0;h<=9;++h)l[h+96]=h.toString();S.prototype.bind=function(t,e,n){var r=this;return t=t instanceof Array?t:[t],r._bindMultiple.call(r,t,e,n),r},S.prototype.unbind=function(t,e){var n=this;return n.bind.call(n,t,(function(){}),e)},S.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},S.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},S.prototype.stopCallback=function(t,e){var n=this;if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(A(e,n.target))return!1;if("composedPath"in t&&"function"===typeof t.composedPath){var r=t.composedPath()[0];r!==t.target&&(e=r)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},S.prototype.handleKey=function(){var t=this;return t._handleKey.apply(t,arguments)},S.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(l[e]=t[e]);s=null},S.init=function(){var t=S(o);for(var e in t)"_"!==e.charAt(0)&&(S[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},S.init(),i.Mousetrap=S,t.exports&&(t.exports=S),r=function(){return S}.call(e,n,e,t),r===a||(t.exports=r)}function p(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function f(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return l[t.which]?l[t.which]:c[t.which]?c[t.which]:String.fromCharCode(t.which).toLowerCase()}function g(t,e){return t.sort().join(",")===e.sort().join(",")}function m(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}function v(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function b(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function y(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function w(){if(!s)for(var t in s={},l)t>95&&t<112||l.hasOwnProperty(t)&&(s[l[t]]=t);return s}function x(t,e,n){return n||(n=w()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function C(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus"),t.split("+"))}function k(t,e){var n,r,i,o=[];for(n=C(t),i=0;i<n.length;++i)r=n[i],d[r]&&(r=d[r]),e&&"keypress"!=e&&u[r]&&(r=u[r],o.push("shift")),y(r)&&o.push(r);return e=x(r,o,e),{key:r,modifiers:o,action:e}}function A(t,e){return null!==t&&t!==o&&(t===e||A(t.parentNode,e))}function S(t){var e=this;if(t=t||o,!(e instanceof S))return new S(t);e.target=t,e._callbacks={},e._directMap={};var n,r={},i=!1,a=!1,s=!1;function l(t){t=t||{};var e,n=!1;for(e in r)t[e]?n=!0:r[e]=0;n||(s=!1)}function c(t,n,i,o,a,s){var l,c,u=[],d=i.type;if(!e._callbacks[t])return[];for("keyup"==d&&y(t)&&(n=[t]),l=0;l<e._callbacks[t].length;++l)if(c=e._callbacks[t][l],(o||!c.seq||r[c.seq]==c.level)&&d==c.action&&("keypress"==d&&!i.metaKey&&!i.ctrlKey||g(n,c.modifiers))){var h=!o&&c.combo==a,p=o&&c.seq==o&&c.level==s;(h||p)&&e._callbacks[t].splice(l,1),u.push(c)}return u}function u(t,n,r,i){e.stopCallback(n,n.target||n.srcElement,r,i)||!1===t(n,r)&&(v(n),b(n))}function d(t){"number"!==typeof t.which&&(t.which=t.keyCode);var n=f(t);n&&("keyup"!=t.type||i!==n?e.handleKey(n,m(t),t):i=!1)}function h(){clearTimeout(n),n=setTimeout(l,1e3)}function w(t,e,n,o){function a(e){return function(){s=e,++r[t],h()}}function c(e){u(n,e,t),"keyup"!==o&&(i=f(e)),setTimeout(l,10)}r[t]=0;for(var d=0;d<e.length;++d){var p=d+1===e.length,g=p?c:a(o||k(e[d+1]).action);x(e[d],g,o,t,d)}}function x(t,n,r,i,o){e._directMap[t+":"+r]=n,t=t.replace(/\s+/g," ");var a,s=t.split(" ");s.length>1?w(t,s,n,r):(a=k(t,r),e._callbacks[a.key]=e._callbacks[a.key]||[],c(a.key,a.modifiers,{type:a.action},i,t,o),e._callbacks[a.key][i?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:i,level:o,combo:t}))}e._handleKey=function(t,e,n){var r,i=c(t,e,n),o={},d=0,h=!1;for(r=0;r<i.length;++r)i[r].seq&&(d=Math.max(d,i[r].level));for(r=0;r<i.length;++r)if(i[r].seq){if(i[r].level!=d)continue;h=!0,o[i[r].seq]=1,u(i[r].callback,n,i[r].combo,i[r].seq)}else h||u(i[r].callback,n,i[r].combo);var p="keypress"==n.type&&a;n.type!=s||y(t)||p||l(o),a=h&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var r=0;r<t.length;++r)x(t[r],e,n)},p(t,"keypress",d),p(t,"keydown",d),p(t,"keyup",d)}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null)},"8a794":function(t,e,n){"use strict";var r=n("23e7"),i=n("e330"),o=n("06cf").f,a=n("50c4"),s=n("577e"),l=n("5a34"),c=n("1d80"),u=n("ab13"),d=n("c430"),h=i("".endsWith),p=i("".slice),f=Math.min,g=u("endsWith"),m=!d&&!g&&!!function(){var t=o(String.prototype,"endsWith");return t&&!t.writable}();r({target:"String",proto:!0,forced:!m&&!g},{endsWith:function(t){var e=s(c(this));l(t);var n=arguments.length>1?arguments[1]:void 0,r=e.length,i=void 0===n?r:f(a(n),r),o=s(t);return h?h(e,o,i):p(e,i-o.length,i)===o}})},"8aa7":function(t,e,n){var r=n("da84"),i=n("d039"),o=n("1c7e"),a=n("ebb5").NATIVE_ARRAY_BUFFER_VIEWS,s=r.ArrayBuffer,l=r.Int8Array;t.exports=!a||!i((function(){l(1)}))||!i((function(){new l(-1)}))||!o((function(t){new l,new l(null),new l(1.5),new l(t)}),!0)||i((function(){return 1!==new l(new s(2),1,void 0).length}))},"8b79":function(t,e,n){},"8bd4":function(t,e,n){var r=n("d066"),i=n("d44e"),o="DOMException";i(r(o),o)},"8c2e":function(t,e,n){},"8c33":function(t,e,n){(function(t){t(n("56b3"))})((function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=t.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(t){return t&&t.bracketRegex||/[(){}[\]]/}function o(t,e,o){var s=t.getLineHandle(e.line),l=e.ch-1,c=o&&o.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var u=i(o),d=!c&&l>=0&&u.test(s.text.charAt(l))&&r[s.text.charAt(l)]||u.test(s.text.charAt(l+1))&&r[s.text.charAt(++l)];if(!d)return null;var h=">"==d.charAt(1)?1:-1;if(o&&o.strict&&h>0!=(l==e.ch))return null;var p=t.getTokenTypeAt(n(e.line,l+1)),f=a(t,n(e.line,l+(h>0?1:0)),h,p,o);return null==f?null:{from:n(e.line,l),to:f&&f.pos,match:f&&f.ch==d.charAt(0),forward:h>0}}function a(t,e,o,a,s){for(var l=s&&s.maxScanLineLength||1e4,c=s&&s.maxScanLines||1e3,u=[],d=i(s),h=o>0?Math.min(e.line+c,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-c),p=e.line;p!=h;p+=o){var f=t.getLine(p);if(f){var g=o>0?0:f.length-1,m=o>0?f.length:-1;if(!(f.length>l))for(p==e.line&&(g=e.ch-(o<0?1:0));g!=m;g+=o){var v=f.charAt(g);if(d.test(v)&&(void 0===a||(t.getTokenTypeAt(n(p,g+1))||"")==(a||""))){var b=r[v];if(b&&">"==b.charAt(1)==o>0)u.push(v);else{if(!u.length)return{pos:n(p,g),ch:v};u.pop()}}}}}return p-o!=(o>0?t.lastLine():t.firstLine())&&null}function s(t,r,i){for(var a=t.state.matchBrackets.maxHighlightLineLength||1e3,s=i&&i.highlightNonMatching,l=[],c=t.listSelections(),u=0;u<c.length;u++){var d=c[u].empty()&&o(t,c[u].head,i);if(d&&(d.match||!1!==s)&&t.getLine(d.from.line).length<=a){var h=d.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(t.markText(d.from,n(d.from.line,d.from.ch+1),{className:h})),d.to&&t.getLine(d.to.line).length<=a&&l.push(t.markText(d.to,n(d.to.line,d.to.ch+1),{className:h}))}}if(l.length){e&&t.state.focused&&t.focus();var p=function(){t.operation((function(){for(var t=0;t<l.length;t++)l[t].clear()}))};if(!r)return p;setTimeout(p,800)}}function l(t){t.operation((function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=s(t,!1,t.state.matchBrackets)}))}function c(t){t.state.matchBrackets&&t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null)}t.defineOption("matchBrackets",!1,(function(e,n,r){r&&r!=t.Init&&(e.off("cursorActivity",l),e.off("focus",l),e.off("blur",c),c(e)),n&&(e.state.matchBrackets="object"==typeof n?n:{},e.on("cursorActivity",l),e.on("focus",l),e.on("blur",c))})),t.defineExtension("matchBrackets",(function(){s(this,!0)})),t.defineExtension("findMatchingBracket",(function(t,e,n){return(n||"boolean"==typeof e)&&(n?(n.strict=e,e=n):e=e?{strict:!0}:null),o(this,t,e)})),t.defineExtension("scanForBracket",(function(t,e,n,r){return a(this,t,e,n,r)}))}))},"8d45":function(t,e,n){},"8d70":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";function e(e,n){var r=e.getLine(n),i=r.search(/\S/);return-1==i||/\bcomment\b/.test(e.getTokenTypeAt(t.Pos(n,i+1)))?-1:t.countColumn(r,null,e.getOption("tabSize"))}t.registerHelper("fold","indent",(function(n,r){var i=e(n,r.line);if(!(i<0)){for(var o=null,a=r.line+1,s=n.lastLine();a<=s;++a){var l=e(n,a);if(-1==l);else{if(!(l>i))break;o=a}}return o?{from:t.Pos(r.line,n.getLine(r.line).length),to:t.Pos(o,n.getLine(o).length)}:void 0}}))}))},"8dba":function(t,e,n){},"8f37":function(t,e,n){"use strict";var r={};function i(t){var e,n,i=r[t];if(i)return i;for(i=r[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),i.push(n);for(e=0;e<t.length;e++)n=t.charCodeAt(e),i[n]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return i}function o(t,e){var n;return"string"!==typeof e&&(e=o.defaultChars),n=i(e),t.replace(/(%[a-f0-9]{2})+/gi,(function(t){var e,r,i,o,a,s,l,c="";for(e=0,r=t.length;e<r;e+=3)i=parseInt(t.slice(e+1,e+3),16),i<128?c+=n[i]:192===(224&i)&&e+3<r&&(o=parseInt(t.slice(e+4,e+6),16),128===(192&o))?(l=i<<6&1984|63&o,c+=l<128?"<22><>":String.fromCharCode(l),e+=3):224===(240&i)&&e+6<r&&(o=parseInt(t.slice(e+4,e+6),16),a=parseInt(t.slice(e+7,e+9),16),128===(192&o)&&128===(192&a))?(l=i<<12&61440|o<<6&4032|63&a,c+=l<2048||l>=55296&&l<=57343?"<22><><EFBFBD>":String.fromCharCode(l),e+=6):240===(248&i)&&e+9<r&&(o=parseInt(t.slice(e+4,e+6),16),a=parseInt(t.slice(e+7,e+9),16),s=parseInt(t.slice(e+10,e+12),16),128===(192&o)&&128===(192&a)&&128===(192&s))?(l=i<<18&1835008|o<<12&258048|a<<6&4032|63&s,l<65536||l>1114111?c+="<22><><EFBFBD><EFBFBD>":(l-=65536,c+=String.fromCharCode(55296+(l>>10),56320+(1023&l))),e+=9):c+="<22>";return c}))}o.defaultChars=";/?:@&=+$,#",o.componentChars="",t.exports=o},"8f3c":function(t,e,n){},"8f94":function(t,e,n){!function(e,r){t.exports=r(n("56b3"))}(0,(function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=3)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=function(t){return t&&t.__esModule?t:{default:t}}(r),o=window.CodeMirror||i.default;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i)for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},writable:!0,configurable:!0}),e.default={name:"codemirror",data:function(){return{content:"",codemirror:null,cminstance:null}},props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:"codemirror"},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},events:{type:Array,default:function(){return[]}},globalOptions:{type:Object,default:function(){return{}}},globalEvents:{type:Array,default:function(){return[]}}},watch:{options:{deep:!0,handler:function(t){for(var e in t)this.cminstance.setOption(e,t[e])}},merge:function(){this.$nextTick(this.switchMerge)},code:function(t){this.handerCodeChange(t)},value:function(t){this.handerCodeChange(t)}},methods:{initialize:function(){var t=this,e=Object.assign({},this.globalOptions,this.options);this.merge?(this.codemirror=o.MergeView(this.$refs.mergeview,e),this.cminstance=this.codemirror.edit):(this.codemirror=o.fromTextArea(this.$refs.textarea,e),this.cminstance=this.codemirror,this.cminstance.setValue(this.code||this.value||this.content)),this.cminstance.on("change",(function(e){t.content=e.getValue(),t.$emit&&t.$emit("input",t.content)}));var n={};["scroll","changes","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"].concat(this.events).concat(this.globalEvents).filter((function(t){return!n[t]&&(n[t]=!0)})).forEach((function(e){t.cminstance.on(e,(function(){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];t.$emit.apply(t,[e].concat(r));var o=e.replace(/([A-Z])/g,"-$1").toLowerCase();o!==e&&t.$emit.apply(t,[o].concat(r))}))})),this.$emit("ready",this.codemirror),this.unseenLineMarkers(),this.refresh()},refresh:function(){var t=this;this.$nextTick((function(){t.cminstance.refresh()}))},destroy:function(){var t=this.cminstance.doc.cm.getWrapperElement();t&&t.remove&&t.remove()},handerCodeChange:function(t){if(t!==this.cminstance.getValue()){var e=this.cminstance.getScrollInfo();this.cminstance.setValue(t),this.content=t,this.cminstance.scrollTo(e.left,e.top)}this.unseenLineMarkers()},unseenLineMarkers:function(){var t=this;void 0!==this.unseenLines&&void 0!==this.marker&&this.unseenLines.forEach((function(e){var n=t.cminstance.lineInfo(e);t.cminstance.setGutterMarker(e,"breakpoints",n.gutterMarkers?null:t.marker())}))},switchMerge:function(){var t=this.cminstance.doc.history,e=this.cminstance.doc.cleanGeneration;this.options.value=this.cminstance.getValue(),this.destroy(),this.initialize(),this.cminstance.doc.history=t,this.cminstance.doc.cleanGeneration=e}},mounted:function(){this.initialize()},beforeDestroy:function(){this.destroy()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=n.n(r);for(var o in r)["default","default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);var a=n(5),s=n(4),l=s(i.a,a.a,!1,null,null,null);e.default=l.exports},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.install=e.codemirror=e.CodeMirror=void 0;var i=n(0),o=r(i),a=n(2),s=r(a),l=window.CodeMirror||o.default,c=function(t,e){e&&(e.options&&(s.default.props.globalOptions.default=function(){return e.options}),e.events&&(s.default.props.globalEvents.default=function(){return e.events})),t.component(s.default.name,s.default)},u={CodeMirror:l,codemirror:s.default,install:c};e.default=u,e.CodeMirror=l,e.codemirror=s.default,e.install=c},function(t,e){t.exports=function(t,e,n,r,i,o){var a,s=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(a=t,s=t.default);var c,u="function"==typeof s?s.options:s;if(e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),i&&(u._scopeId=i),o?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},u._ssrRegister=c):r&&(c=r),c){var d=u.functional,h=d?u.render:u.beforeCreate;d?(u._injectStyles=c,u.render=function(t,e){return c.call(e),h(t,e)}):u.beforeCreate=h?[].concat(h,c):[c]}return{esModule:a,exports:s,options:u}}},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vue-codemirror",class:{merge:t.merge}},[t.merge?n("div",{ref:"mergeview"}):n("textarea",{ref:"textarea",attrs:{name:t.name,placeholder:t.placeholder}})])},i=[],o={render:r,staticRenderFns:i};e.a=o}])}))},"907a":function(t,e,n){"use strict";var r=n("ebb5"),i=n("07fa"),o=n("5926"),a=r.aTypedArray,s=r.exportTypedArrayMethod;s("at",(function(t){var e=a(this),n=i(e),r=o(t),s=r>=0?r:n+r;return s<0||s>=n?void 0:e[s]}))},9145:function(t,e,n){"use strict";var r=n("ebfb"),i=[["normalize",n("f7ca")],["block",n("227c")],["inline",n("5c95")],["linkify",n("42c4")],["replacements",n("479d")],["smartquotes",n("9ba2")],["text_join",n("9f5c")]];function o(){this.ruler=new r;for(var t=0;t<i.length;t++)this.ruler.push(i[t][0],i[t][1])}o.prototype.process=function(t){var e,n,r;for(r=this.ruler.getRules(""),e=0,n=r.length;e<n;e++)r[e](t)},o.prototype.State=n("df6c"),t.exports=o},"948e":function(t,e,n){},9698:function(t,e,n){},9767:function(t,e,n){"use strict";var r=n("23e7"),i=n("857a"),o=n("af03");r({target:"String",proto:!0,forced:o("fontcolor")},{fontcolor:function(t){return i(this,"font","color",t)}})},"986a":function(t,e,n){"use strict";var r=n("ebb5"),i=n("a258").findLast,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("findLast",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},"98ba":function(t,e,n){"use strict";n("d746")},9948:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";function e(t){t.state.markedSelection&&t.operation((function(){c(t)}))}function n(t){t.state.markedSelection&&t.state.markedSelection.length&&t.operation((function(){s(t)}))}t.defineOption("styleSelectedText",!1,(function(r,i,o){var a=o&&o!=t.Init;i&&!a?(r.state.markedSelection=[],r.state.markedSelectionStyle="string"==typeof i?i:"CodeMirror-selectedtext",l(r),r.on("cursorActivity",e),r.on("change",n)):!i&&a&&(r.off("cursorActivity",e),r.off("change",n),s(r),r.state.markedSelection=r.state.markedSelectionStyle=null)}));var r=8,i=t.Pos,o=t.cmpPos;function a(t,e,n,a){if(0!=o(e,n))for(var s=t.state.markedSelection,l=t.state.markedSelectionStyle,c=e.line;;){var u=c==e.line?e:i(c,0),d=c+r,h=d>=n.line,p=h?n:i(d,0),f=t.markText(u,p,{className:l});if(null==a?s.push(f):s.splice(a++,0,f),h)break;c=d}}function s(t){for(var e=t.state.markedSelection,n=0;n<e.length;++n)e[n].clear();e.length=0}function l(t){s(t);for(var e=t.listSelections(),n=0;n<e.length;n++)a(t,e[n].from(),e[n].to())}function c(t){if(!t.somethingSelected())return s(t);if(t.listSelections().length>1)return l(t);var e=t.getCursor("start"),n=t.getCursor("end"),i=t.state.markedSelection;if(!i.length)return a(t,e,n);var c=i[0].find(),u=i[i.length-1].find();if(!c||!u||n.line-e.line<=r||o(e,u.to)>=0||o(n,c.from)<=0)return l(t);while(o(e,c.from)>0)i.shift().clear(),c=i[0].find();o(e,c.from)<0&&(c.to.line-e.line<r?(i.shift().clear(),a(t,e,c.to,0)):a(t,e,c.from,0));while(o(n,u.to)<0)i.pop().clear(),u=i[i.length-1].find();o(n,u.to)>0&&(n.line-u.from.line<r?(i.pop().clear(),a(t,u.from,n)):a(t,u.to,n))}}))},"9a33":function(t,e,n){"use strict";n.r(e);n("b2a3"),n("b8e7")},"9a48":function(t,e,n){(function(t){t(n("56b3"),n("b933"),n("8c33"))})((function(t){"use strict";var e=t.commands,n=t.Pos;function r(e,r,i){if(i<0&&0==r.ch)return e.clipPos(n(r.line-1));var o=e.getLine(r.line);if(i>0&&r.ch>=o.length)return e.clipPos(n(r.line+1,0));for(var a,s="start",l=r.ch,c=l,u=i<0?0:o.length,d=0;c!=u;c+=i,d++){var h=o.charAt(i<0?c-1:c),p="_"!=h&&t.isWordChar(h)?"w":"o";if("w"==p&&h.toUpperCase()==h&&(p="W"),"start"==s)"o"!=p?(s="in",a=p):l=c+i;else if("in"==s&&a!=p){if("w"==a&&"W"==p&&i<0&&c--,"W"==a&&"w"==p&&i>0){if(c==l+1){a="w";continue}c--}break}}return n(r.line,c)}function i(t,e){t.extendSelectionsBy((function(n){return t.display.shift||t.doc.extend||n.empty()?r(t.doc,n.head,e):e<0?n.from():n.to()}))}function o(e,r){if(e.isReadOnly())return t.Pass;e.operation((function(){for(var t=e.listSelections().length,i=[],o=-1,a=0;a<t;a++){var s=e.listSelections()[a].head;if(!(s.line<=o)){var l=n(s.line+(r?0:1),0);e.replaceRange("\n",l,null,"+insertLine"),e.indentLine(l.line,null,!0),i.push({head:l,anchor:l}),o=s.line+1}}e.setSelections(i)})),e.execCommand("indentAuto")}function a(e,r){var i=r.ch,o=i,a=e.getLine(r.line);while(i&&t.isWordChar(a.charAt(i-1)))--i;while(o<a.length&&t.isWordChar(a.charAt(o)))++o;return{from:n(r.line,i),to:n(r.line,o),word:a.slice(i,o)}}function s(t,e){for(var n=t.listSelections(),r=[],i=0;i<n.length;i++){var o=n[i],a=t.findPosV(o.anchor,e,"line",o.anchor.goalColumn),s=t.findPosV(o.head,e,"line",o.head.goalColumn);a.goalColumn=null!=o.anchor.goalColumn?o.anchor.goalColumn:t.cursorCoords(o.anchor,"div").left,s.goalColumn=null!=o.head.goalColumn?o.head.goalColumn:t.cursorCoords(o.head,"div").left;var l={anchor:a,head:s};r.push(o),r.push(l)}t.setSelections(r)}function l(e,n,r){for(var i=0;i<e.length;i++)if(0==t.cmpPos(e[i].from(),n)&&0==t.cmpPos(e[i].to(),r))return!0;return!1}e.goSubwordLeft=function(t){i(t,-1)},e.goSubwordRight=function(t){i(t,1)},e.scrollLineUp=function(t){var e=t.getScrollInfo();if(!t.somethingSelected()){var n=t.lineAtHeight(e.top+e.clientHeight,"local");t.getCursor().line>=n&&t.execCommand("goLineUp")}t.scrollTo(null,e.top-t.defaultTextHeight())},e.scrollLineDown=function(t){var e=t.getScrollInfo();if(!t.somethingSelected()){var n=t.lineAtHeight(e.top,"local")+1;t.getCursor().line<=n&&t.execCommand("goLineDown")}t.scrollTo(null,e.top+t.defaultTextHeight())},e.splitSelectionByLine=function(t){for(var e=t.listSelections(),r=[],i=0;i<e.length;i++)for(var o=e[i].from(),a=e[i].to(),s=o.line;s<=a.line;++s)a.line>o.line&&s==a.line&&0==a.ch||r.push({anchor:s==o.line?o:n(s,0),head:s==a.line?a:n(s)});t.setSelections(r,0)},e.singleSelectionTop=function(t){var e=t.listSelections()[0];t.setSelection(e.anchor,e.head,{scroll:!1})},e.selectLine=function(t){for(var e=t.listSelections(),r=[],i=0;i<e.length;i++){var o=e[i];r.push({anchor:n(o.from().line,0),head:n(o.to().line+1,0)})}t.setSelections(r)},e.insertLineAfter=function(t){return o(t,!1)},e.insertLineBefore=function(t){return o(t,!0)},e.selectNextOccurrence=function(e){var r=e.getCursor("from"),i=e.getCursor("to"),o=e.state.sublimeFindFullWord==e.doc.sel;if(0==t.cmpPos(r,i)){var s=a(e,r);if(!s.word)return;e.setSelection(s.from,s.to),o=!0}else{var c=e.getRange(r,i),u=o?new RegExp("\\b"+c+"\\b"):c,d=e.getSearchCursor(u,i),h=d.findNext();if(h||(d=e.getSearchCursor(u,n(e.firstLine(),0)),h=d.findNext()),!h||l(e.listSelections(),d.from(),d.to()))return;e.addSelection(d.from(),d.to())}o&&(e.state.sublimeFindFullWord=e.doc.sel)},e.skipAndSelectNextOccurrence=function(n){var r=n.getCursor("anchor"),i=n.getCursor("head");e.selectNextOccurrence(n),0!=t.cmpPos(r,i)&&n.doc.setSelections(n.doc.listSelections().filter((function(t){return t.anchor!=r||t.head!=i})))},e.addCursorToPrevLine=function(t){s(t,-1)},e.addCursorToNextLine=function(t){s(t,1)};var c="(){}[]";function u(e){for(var r=e.listSelections(),i=[],o=0;o<r.length;o++){var a=r[o],s=a.head,l=e.scanForBracket(s,-1);if(!l)return!1;for(;;){var u=e.scanForBracket(s,1);if(!u)return!1;if(u.ch==c.charAt(c.indexOf(l.ch)+1)){var d=n(l.pos.line,l.pos.ch+1);if(0!=t.cmpPos(d,a.from())||0!=t.cmpPos(u.pos,a.to())){i.push({anchor:d,head:u.pos});break}if(l=e.scanForBracket(l.pos,-1),!l)return!1}s=n(u.pos.line,u.pos.ch+1)}}return e.setSelections(i),!0}function d(t){return t?/\bpunctuation\b/.test(t)?t:void 0:null}function h(e,r,i){if(e.isReadOnly())return t.Pass;for(var o,a=e.listSelections(),s=[],l=0;l<a.length;l++){var c=a[l];if(!c.empty()){var u=c.from().line,d=c.to().line;while(l<a.length-1&&a[l+1].from().line==d)d=a[++l].to().line;a[l].to().ch||d--,s.push(u,d)}}s.length?o=!0:s.push(e.firstLine(),e.lastLine()),e.operation((function(){for(var t=[],a=0;a<s.length;a+=2){var l=s[a],c=s[a+1],u=n(l,0),d=n(c),h=e.getRange(u,d,!1);r?h.sort((function(t,e){return t<e?-i:t==e?0:i})):h.sort((function(t,e){var n=t.toUpperCase(),r=e.toUpperCase();return n!=r&&(t=n,e=r),t<e?-i:t==e?0:i})),e.replaceRange(h,u,d),o&&t.push({anchor:u,head:n(c+1,0)})}o&&e.setSelections(t,0)}))}function p(e,n){e.operation((function(){for(var r=e.listSelections(),i=[],o=[],s=0;s<r.length;s++){var l=r[s];l.empty()?(i.push(s),o.push("")):o.push(n(e.getRange(l.from(),l.to())))}e.replaceSelections(o,"around","case");var c;for(s=i.length-1;s>=0;s--){l=r[i[s]];if(!(c&&t.cmpPos(l.head,c)>0)){var u=a(e,l.head);c=u.from,e.replaceRange(n(u.word),u.from,u.to)}}}))}function f(e){var n=e.getCursor("from"),r=e.getCursor("to");if(0==t.cmpPos(n,r)){var i=a(e,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:e.getRange(n,r),word:i}}function g(t,e){var r=f(t);if(r){var i=r.query,o=t.getSearchCursor(i,e?r.to:r.from);(e?o.findNext():o.findPrevious())?t.setSelection(o.from(),o.to()):(o=t.getSearchCursor(i,e?n(t.firstLine(),0):t.clipPos(n(t.lastLine()))),(e?o.findNext():o.findPrevious())?t.setSelection(o.from(),o.to()):r.word&&t.setSelection(r.from,r.to))}}e.selectScope=function(t){u(t)||t.execCommand("selectAll")},e.selectBetweenBrackets=function(e){if(!u(e))return t.Pass},e.goToBracket=function(e){e.extendSelectionsBy((function(r){var i=e.scanForBracket(r.head,1,d(e.getTokenTypeAt(r.head)));if(i&&0!=t.cmpPos(i.pos,r.head))return i.pos;var o=e.scanForBracket(r.head,-1,d(e.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||r.head}))},e.swapLineUp=function(e){if(e.isReadOnly())return t.Pass;for(var r=e.listSelections(),i=[],o=e.firstLine()-1,a=[],s=0;s<r.length;s++){var l=r[s],c=l.from().line-1,u=l.to().line;a.push({anchor:n(l.anchor.line-1,l.anchor.ch),head:n(l.head.line-1,l.head.ch)}),0!=l.to().ch||l.empty()||--u,c>o?i.push(c,u):i.length&&(i[i.length-1]=u),o=u}e.operation((function(){for(var t=0;t<i.length;t+=2){var r=i[t],o=i[t+1],s=e.getLine(r);e.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),o>e.lastLine()?e.replaceRange("\n"+s,n(e.lastLine()),null,"+swapLine"):e.replaceRange(s+"\n",n(o,0),null,"+swapLine")}e.setSelections(a),e.scrollIntoView()}))},e.swapLineDown=function(e){if(e.isReadOnly())return t.Pass;for(var r=e.listSelections(),i=[],o=e.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],l=s.to().line+1,c=s.from().line;0!=s.to().ch||s.empty()||l--,l<o?i.push(l,c):i.length&&(i[i.length-1]=c),o=c}e.operation((function(){for(var t=i.length-2;t>=0;t-=2){var r=i[t],o=i[t+1],a=e.getLine(r);r==e.lastLine()?e.replaceRange("",n(r-1),n(r),"+swapLine"):e.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),e.replaceRange(a+"\n",n(o,0),null,"+swapLine")}e.scrollIntoView()}))},e.toggleCommentIndented=function(t){t.toggleComment({indent:!0})},e.joinLines=function(t){for(var e=t.listSelections(),r=[],i=0;i<e.length;i++){var o=e[i],a=o.from(),s=a.line,l=o.to().line;while(i<e.length-1&&e[i+1].from().line==l)l=e[++i].to().line;r.push({start:s,end:l,anchor:!o.empty()&&a})}t.operation((function(){for(var e=0,i=[],o=0;o<r.length;o++){for(var a,s=r[o],l=s.anchor&&n(s.anchor.line-e,s.anchor.ch),c=s.start;c<=s.end;c++){var u=c-e;c==s.end&&(a=n(u,t.getLine(u).length+1)),u<t.lastLine()&&(t.replaceRange(" ",n(u),n(u+1,/^\s*/.exec(t.getLine(u+1))[0].length)),++e)}i.push({anchor:l||a,head:a})}t.setSelections(i,0)}))},e.duplicateLine=function(t){t.operation((function(){for(var e=t.listSelections().length,r=0;r<e;r++){var i=t.listSelections()[r];i.empty()?t.replaceRange(t.getLine(i.head.line)+"\n",n(i.head.line,0)):t.replaceRange(t.getRange(i.from(),i.to()),i.from())}t.scrollIntoView()}))},e.sortLines=function(t){h(t,!0,1)},e.reverseSortLines=function(t){h(t,!0,-1)},e.sortLinesInsensitive=function(t){h(t,!1,1)},e.reverseSortLinesInsensitive=function(t){h(t,!1,-1)},e.nextBookmark=function(t){var e=t.state.sublimeBookmarks;if(e)while(e.length){var n=e.shift(),r=n.find();if(r)return e.push(n),t.setSelection(r.from,r.to)}},e.prevBookmark=function(t){var e=t.state.sublimeBookmarks;if(e)while(e.length){e.unshift(e.pop());var n=e[e.length-1].find();if(n)return t.setSelection(n.from,n.to);e.pop()}},e.toggleBookmark=function(t){for(var e=t.listSelections(),n=t.state.sublimeBookmarks||(t.state.sublimeBookmarks=[]),r=0;r<e.length;r++){for(var i=e[r].from(),o=e[r].to(),a=e[r].empty()?t.findMarksAt(i):t.findMarks(i,o),s=0;s<a.length;s++)if(a[s].sublimeBookmark){a[s].clear();for(var l=0;l<n.length;l++)n[l]==a[s]&&n.splice(l--,1);break}s==a.length&&n.push(t.markText(i,o,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},e.clearBookmarks=function(t){var e=t.state.sublimeBookmarks;if(e)for(var n=0;n<e.length;n++)e[n].clear();e.length=0},e.selectBookmarks=function(t){var e=t.state.sublimeBookmarks,n=[];if(e)for(var r=0;r<e.length;r++){var i=e[r].find();i?n.push({anchor:i.from,head:i.to}):e.splice(r--,0)}n.length&&t.setSelections(n,0)},e.smartBackspace=function(e){if(e.somethingSelected())return t.Pass;e.operation((function(){for(var r=e.listSelections(),i=e.getOption("indentUnit"),o=r.length-1;o>=0;o--){var a=r[o].head,s=e.getRange({line:a.line,ch:0},a),l=t.countColumn(s,null,e.getOption("tabSize")),c=e.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&l%i==0){var u=new n(a.line,t.findColumn(s,l-i,i));u.ch!=a.ch&&(c=u)}e.replaceRange("",c,a,"+delete")}}))},e.delLineRight=function(t){t.operation((function(){for(var e=t.listSelections(),r=e.length-1;r>=0;r--)t.replaceRange("",e[r].anchor,n(e[r].to().line),"+delete");t.scrollIntoView()}))},e.upcaseAtCursor=function(t){p(t,(function(t){return t.toUpperCase()}))},e.downcaseAtCursor=function(t){p(t,(function(t){return t.toLowerCase()}))},e.setSublimeMark=function(t){t.state.sublimeMark&&t.state.sublimeMark.clear(),t.state.sublimeMark=t.setBookmark(t.getCursor())},e.selectToSublimeMark=function(t){var e=t.state.sublimeMark&&t.state.sublimeMark.find();e&&t.setSelection(t.getCursor(),e)},e.deleteToSublimeMark=function(e){var n=e.state.sublimeMark&&e.state.sublimeMark.find();if(n){var r=e.getCursor(),i=n;if(t.cmpPos(r,i)>0){var o=i;i=r,r=o}e.state.sublimeKilled=e.getRange(r,i),e.replaceRange("",r,i)}},e.swapWithSublimeMark=function(t){var e=t.state.sublimeMark&&t.state.sublimeMark.find();e&&(t.state.sublimeMark.clear(),t.state.sublimeMark=t.setBookmark(t.getCursor()),t.setCursor(e))},e.sublimeYank=function(t){null!=t.state.sublimeKilled&&t.replaceSelection(t.state.sublimeKilled,null,"paste")},e.showInCenter=function(t){var e=t.cursorCoords(null,"local");t.scrollTo(null,(e.top+e.bottom)/2-t.getScrollInfo().clientHeight/2)},e.findUnder=function(t){g(t,!0)},e.findUnderPrevious=function(t){g(t,!1)},e.findAllUnder=function(t){var e=f(t);if(e){var n=t.getSearchCursor(e.query),r=[],i=-1;while(n.findNext())r.push({anchor:n.from(),head:n.to()}),n.from().line<=e.from.line&&n.from().ch<=e.from.ch&&i++;t.setSelections(r,i)}};var m=t.keyMap;m.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},t.normalizeKeyMap(m.macSublime),m.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},t.normalizeKeyMap(m.pcSublime);var v=m.default==m.macDefault;m.sublime=v?m.macSublime:m.pcSublime}))},"9a8c":function(t,e,n){"use strict";var r=n("e330"),i=n("ebb5"),o=n("145e"),a=r(o),s=i.aTypedArray,l=i.exportTypedArrayMethod;l("copyWithin",(function(t,e){return a(s(this),t,e,arguments.length>2?arguments[2]:void 0)}))},"9ba2":function(t,e,n){"use strict";var r=n("55be").isWhiteSpace,i=n("55be").isPunctChar,o=n("55be").isMdAsciiPunct,a=/['"]/,s=/['"]/g,l="";function c(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function u(t,e){var n,a,u,d,h,p,f,g,m,v,b,y,w,x,C,k,A,S,E,O,T;for(E=[],n=0;n<t.length;n++){for(a=t[n],f=t[n].level,A=E.length-1;A>=0;A--)if(E[A].level<=f)break;if(E.length=A+1,"text"===a.type){u=a.content,h=0,p=u.length;t:while(h<p){if(s.lastIndex=h,d=s.exec(u),!d)break;if(C=k=!0,h=d.index+1,S="'"===d[0],m=32,d.index-1>=0)m=u.charCodeAt(d.index-1);else for(A=n-1;A>=0;A--){if("softbreak"===t[A].type||"hardbreak"===t[A].type)break;if(t[A].content){m=t[A].content.charCodeAt(t[A].content.length-1);break}}if(v=32,h<p)v=u.charCodeAt(h);else for(A=n+1;A<t.length;A++){if("softbreak"===t[A].type||"hardbreak"===t[A].type)break;if(t[A].content){v=t[A].content.charCodeAt(0);break}}if(b=o(m)||i(String.fromCharCode(m)),y=o(v)||i(String.fromCharCode(v)),w=r(m),x=r(v),x?C=!1:y&&(w||b||(C=!1)),w?k=!1:b&&(x||y||(k=!1)),34===v&&'"'===d[0]&&m>=48&&m<=57&&(k=C=!1),C&&k&&(C=b,k=y),C||k){if(k)for(A=E.length-1;A>=0;A--){if(g=E[A],E[A].level<f)break;if(g.single===S&&E[A].level===f){g=E[A],S?(O=e.md.options.quotes[2],T=e.md.options.quotes[3]):(O=e.md.options.quotes[0],T=e.md.options.quotes[1]),a.content=c(a.content,d.index,T),t[g.token].content=c(t[g.token].content,g.pos,O),h+=T.length-1,g.token===n&&(h+=O.length-1),u=a.content,p=u.length,E.length=A;continue t}}C?E.push({token:n,pos:d.index,single:S,level:f}):k&&S&&(a.content=c(a.content,d.index,l))}else S&&(a.content=c(a.content,d.index,l))}}}}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&a.test(t.tokens[e].content)&&u(t.tokens[e].children,t)}},"9c7b":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";function e(t,e){function n(t){clearTimeout(r.doRedraw),r.doRedraw=setTimeout((function(){r.redraw()}),t)}this.cm=t,this.options=e,this.buttonHeight=e.scrollButtonHeight||t.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=t.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var r=this;t.on("refresh",this.resizeHandler=function(){clearTimeout(r.doUpdate),r.doUpdate=setTimeout((function(){r.computeScale()&&n(20)}),100)}),t.on("markerAdded",this.resizeHandler),t.on("markerCleared",this.resizeHandler),!1!==e.listenForChanges&&t.on("changes",this.changeHandler=function(){n(250)})}t.defineExtension("annotateScrollbar",(function(t){return"string"==typeof t&&(t={className:t}),new e(this,t)})),t.defineOption("scrollButtonHeight",0),e.prototype.computeScale=function(){var t=this.cm,e=(t.getWrapperElement().clientHeight-t.display.barHeight-2*this.buttonHeight)/t.getScrollerElement().scrollHeight;if(e!=this.hScale)return this.hScale=e,!0},e.prototype.update=function(t){this.annotations=t,this.redraw()},e.prototype.redraw=function(t){!1!==t&&this.computeScale();var e=this.cm,n=this.hScale,r=document.createDocumentFragment(),i=this.annotations,o=e.getOption("lineWrapping"),a=o&&1.5*e.defaultTextHeight(),s=null,l=null;function c(t,n){if(s!=t.line){s=t.line,l=e.getLineHandle(t.line);var r=e.getLineHandleVisualStart(l);r!=l&&(s=e.getLineNumber(r),l=r)}if(l.widgets&&l.widgets.length||o&&l.height>a)return e.charCoords(t,"local")[n?"top":"bottom"];var i=e.heightAtLine(l,"local");return i+(n?0:l.height)}var u=e.lastLine();if(e.display.barWidth)for(var d,h=0;h<i.length;h++){var p=i[h];if(!(p.to.line>u)){var f=d||c(p.from,!0)*n,g=c(p.to,!1)*n;while(h<i.length-1){if(i[h+1].to.line>u)break;if(d=c(i[h+1].from,!0)*n,d>g+.9)break;p=i[++h],g=c(p.to,!1)*n}if(g!=f){var m=Math.max(g-f,3),v=r.appendChild(document.createElement("div"));v.style.cssText="position: absolute; right: 0px; width: "+Math.max(e.display.barWidth-1,2)+"px; top: "+(f+this.buttonHeight)+"px; height: "+m+"px",v.className=this.options.className,p.id&&v.setAttribute("annotation-id",p.id)}}}this.div.textContent="",this.div.appendChild(r)},e.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}}))},"9eb9":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";t.overlayMode=function(e,n,r){return{startState:function(){return{base:t.startState(e),overlay:t.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:t.copyState(e,r.base),overlay:t.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(t,i){return(t!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<t.start)&&(i.streamSeen=t,i.basePos=i.overlayPos=t.start),t.start==i.basePos&&(i.baseCur=e.token(t,i.base),i.basePos=t.pos),t.start==i.overlayPos&&(t.pos=t.start,i.overlayCur=n.token(t,i.overlay),i.overlayPos=t.pos),t.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:e.indent&&function(t,n,r){return e.indent(t.base,n,r)},electricChars:e.electricChars,innerMode:function(t){return{state:t.base,mode:e}},blankLine:function(t){var i,o;return e.blankLine&&(i=e.blankLine(t.base)),n.blankLine&&(o=n.blankLine(t.overlay)),null==o?i:r&&null!=i?i+" "+o:o}}}}))},"9f09":function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";t.registerHelper("fold","markdown",(function(e,n){var r=100;function i(n){var r=e.getTokenTypeAt(t.Pos(n,0));return r&&/\bheader\b/.test(r)}function o(t,e,n){var o=e&&e.match(/^#+/);return o&&i(t)?o[0].length:(o=n&&n.match(/^[=\-]+\s*$/),o&&i(t+1)?"="==n[0]?1:2:r)}var a=e.getLine(n.line),s=e.getLine(n.line+1),l=o(n.line,a,s);if(l!==r){var c=e.lastLine(),u=n.line,d=e.getLine(u+2);while(u<c){if(o(u+1,s,d)<=l)break;++u,s=d,d=e.getLine(u+2)}return{from:t.Pos(n.line,a.length),to:t.Pos(u,e.getLine(u).length)}}}))}))},"9f5c":function(t,e,n){"use strict";t.exports=function(t){var e,n,r,i,o,a,s=t.tokens;for(e=0,n=s.length;e<n;e++)if("inline"===s[e].type){for(r=s[e].children,o=r.length,i=0;i<o;i++)"text_special"===r[i].type&&(r[i].type="text");for(i=a=0;i<o;i++)"text"===r[i].type&&i+1<o&&"text"===r[i+1].type?r[i+1].content=r[i].content+r[i+1].content:(i!==a&&(r[a]=r[i]),a++);i!==a&&(r.length=a)}}},a068:function(t,e,n){"use strict";n.r(e);var r=n("f8db"),i=Promise.resolve();e["default"]=function(t){function e(t){return"object"===typeof t&&null!==t&&!0===t.__PDFDocumentLoadingTask}function n(e,n){var r;if("string"===typeof e)r={url:e};else if(e instanceof Uint8Array)r={data:e};else{if("object"!==typeof e||null===e)throw new TypeError("invalid src type");r=Object.assign({},e)}n&&n.withCredentials&&(r.withCredentials=n.withCredentials);var i=t.getDocument(r);return i.__PDFDocumentLoadingTask=!0,n&&n.onPassword&&(i.onPassword=n.onPassword),n&&n.onProgress&&(i.onProgress=n.onProgress),i}function o(o,a,s){var l=null,c=null,u=null,d=!1;function h(){o.getContext("2d").clearRect(0,0,o.width,o.height)}function p(){while(a.firstChild)a.removeChild(a.firstChild)}o.getContext("2d").save(),this.destroy=function(){null!==l&&(i=l.destroy(),l=null)},this.getResolutionScale=function(){return o.offsetWidth/o.width},this.printPage=function(t,e){if(null!==c){var n=void 0===t?150:t,r=n/72,i=96/72,o=document.createElement("iframe");new Promise((function(t,e){o.frameBorder="0",o.scrolling="no",o.width="0px;",o.height="0px;",o.style.cssText="position: absolute; top: 0; left: 0",o.onload=function(){t(this.contentWindow)},window.document.body.appendChild(o)})).then((function(t){return t.document.title="",l.getPage(1).then((function(e){var n=e.getViewport({scale:1});return t.document.head.appendChild(t.document.createElement("style")).textContent="@supports ((size:A4) and (size:1pt 1pt)) {@page { margin: 1pt; size: "+n.width*r/i+"pt "+n.height*r/i+"pt; }}@media print {body { margin: 0 }canvas { page-break-before: avoid; page-break-after: always; page-break-inside: avoid }}@media screen {body { margin: 0 }}",t}))})).then((function(t){for(var n=[],i=1;i<=l.numPages;++i)void 0!==e&&-1===e.indexOf(i)||n.push(l.getPage(i).then((function(e){var n=e.getViewport({scale:1}),i=t.document.body.appendChild(t.document.createElement("canvas"));return i.width=n.width*r,i.height=n.height*r,e.render({canvasContext:i.getContext("2d"),transform:[r,0,0,r,0,0],viewport:n,intent:"print"}).promise})));Promise.all(n).then((function(){t.focus(),t.document.queryCommandSupported("print")?t.document.execCommand("print",!1,null):t.print(),a()})).catch((function(t){a(),s("error",t)}))}))}function a(){o.parentNode.removeChild(o)}},this.renderPage=function(e){if(null!==u){if(d)return;return d=!0,void u.cancel().catch((function(t){s("error",t)}))}if(null!==c){var n=(void 0===c.rotate?0:c.rotate)+(void 0===e?0:e),h=o.offsetWidth/c.getViewport({scale:1}).width*(window.devicePixelRatio||1),f=c.getViewport({scale:h,rotation:n});s("page-size",f.width,f.height,h),o.width=f.width,o.height=f.height,u=c.render({canvasContext:o.getContext("2d"),viewport:f}),a.style.visibility="hidden",p();var g={scrollPageIntoView:function(t){s("link-clicked",t.pageNumber)}},m=new r["PDFLinkService"];m.setDocument(l),m.setViewer(g),i=i.then(function(){var n=c.getAnnotations({intent:"display"}).then((function(e){t.AnnotationLayer.render({viewport:f.clone({dontFlip:!0}),div:a,annotations:e,page:c,linkService:m,renderInteractiveForms:!1})})),r=u.promise.then((function(){a.style.visibility="",d=!1,u=null})).catch(function(n){if(u=null,n instanceof t.RenderingCancelledException)return d=!1,void this.renderPage(e);s("error",n)}.bind(this));return Promise.all([n,r])}.bind(this))}},this.forEachPage=function(t){var e=l.numPages;(function n(r){l.getPage(r).then(t).then((function(){++r<=e&&n(r)}))})(1)},this.loadPage=function(t,e){c=null,null!==l&&(i=i.then((function(){return l.getPage(t)})).then(function(t){c=t,this.renderPage(e),s("page-loaded",t.pageNumber)}.bind(this)).catch((function(t){h(),p(),s("error",t)})))},this.loadDocument=function(r){if(l=null,c=null,s("num-pages",void 0),!r)return o.removeAttribute("width"),o.removeAttribute("height"),void p();i=i.then((function(){var i;if(e(r)){if(r.destroyed)return void s("error",new Error("loadingTask has been destroyed"));i=r}else i=n(r,{onPassword:function(e,n){var r;switch(n){case t.PasswordResponses.NEED_PASSWORD:r="NEED_PASSWORD";break;case t.PasswordResponses.INCORRECT_PASSWORD:r="INCORRECT_PASSWORD";break}s("password",e,r)},onProgress:function(t){var e=t.loaded/t.total;s("progress",Math.min(e,1))}});return i.promise})).then((function(t){l=t,s("num-pages",t.numPages),s("loaded")})).catch((function(t){h(),p(),s("error",t)}))},a.style.transformOrigin="0 0"}return{createLoadingTask:n,PDFJSWrapper:o}}},a073:function(t,e,n){"use strict";n("dac9")},a078b:function(t,e,n){var r=n("0366"),i=n("c65b"),o=n("5087"),a=n("7b0b"),s=n("07fa"),l=n("9a1f"),c=n("35a1"),u=n("e95a"),d=n("ebb5").aTypedArrayConstructor;t.exports=function(t){var e,n,h,p,f,g,m=o(this),v=a(t),b=arguments.length,y=b>1?arguments[1]:void 0,w=void 0!==y,x=c(v);if(x&&!u(x)){f=l(v,x),g=f.next,v=[];while(!(p=i(g,f)).done)v.push(p.value)}for(w&&b>2&&(y=r(y,arguments[2])),n=s(v),h=new(d(m))(n),e=0;n>e;e++)h[e]=w?y(v[e],e):v[e];return h}},a0bd:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";t.defineMode("coffeescript",(function(t,e){var n="error";function r(t){return new RegExp("^(("+t.join(")|(")+"))\\b")}var i=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,o=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,a=/^[_A-Za-z$][_A-Za-z$0-9]*/,s=/^@[_A-Za-z$][_A-Za-z$0-9]*/,l=r(["and","or","not","is","isnt","in","instanceof","typeof"]),c=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],u=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],d=r(c.concat(u));c=r(c);var h=/^('{3}|\"{3}|['\"])/,p=/^(\/{3}|\/)/,f=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],g=r(f);function m(t,e){if(t.sol()){null===e.scope.align&&(e.scope.align=!1);var r=e.scope.offset;if(t.eatSpace()){var c=t.indentation();return c>r&&"coffee"==e.scope.type?"indent":c<r?"dedent":null}r>0&&w(t,e)}if(t.eatSpace())return null;var u=t.peek();if(t.match("####"))return t.skipToEnd(),"comment";if(t.match("###"))return e.tokenize=b,e.tokenize(t,e);if("#"===u)return t.skipToEnd(),"comment";if(t.match(/^-?[0-9\.]/,!1)){var f=!1;if(t.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(f=!0),t.match(/^-?\d+\.\d*/)&&(f=!0),t.match(/^-?\.\d+/)&&(f=!0),f)return"."==t.peek()&&t.backUp(1),"number";var m=!1;if(t.match(/^-?0x[0-9a-f]+/i)&&(m=!0),t.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),t.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(t.match(h))return e.tokenize=v(t.current(),!1,"string"),e.tokenize(t,e);if(t.match(p)){if("/"!=t.current()||t.match(/^.*\//,!1))return e.tokenize=v(t.current(),!0,"string-2"),e.tokenize(t,e);t.backUp(1)}return t.match(i)||t.match(l)?"operator":t.match(o)?"punctuation":t.match(g)?"atom":t.match(s)||e.prop&&t.match(a)?"property":t.match(d)?"keyword":t.match(a)?"variable":(t.next(),n)}function v(t,r,i){return function(o,a){while(!o.eol())if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),r&&o.eol())return i}else{if(o.match(t))return a.tokenize=m,i;o.eat(/['"\/]/)}return r&&(e.singleLineStringErrors?i=n:a.tokenize=m),i}}function b(t,e){while(!t.eol()){if(t.eatWhile(/[^#]/),t.match("###")){e.tokenize=m;break}t.eatWhile("#")}return"comment"}function y(e,n,r){r=r||"coffee";for(var i=0,o=!1,a=null,s=n.scope;s;s=s.prev)if("coffee"===s.type||"}"==s.type){i=s.offset+t.indentUnit;break}"coffee"!==r?(o=null,a=e.column()+e.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:i,type:r,prev:n.scope,align:o,alignOffset:a}}function w(t,e){if(e.scope.prev){if("coffee"===e.scope.type){for(var n=t.indentation(),r=!1,i=e.scope;i;i=i.prev)if(n===i.offset){r=!0;break}if(!r)return!0;while(e.scope.prev&&e.scope.offset!==n)e.scope=e.scope.prev;return!1}return e.scope=e.scope.prev,!1}}function x(t,e){var r=e.tokenize(t,e),i=t.current();"return"===i&&(e.dedent=!0),(("->"===i||"=>"===i)&&t.eol()||"indent"===r)&&y(t,e);var o="[({".indexOf(i);if(-1!==o&&y(t,e,"])}".slice(o,o+1)),c.exec(i)&&y(t,e),"then"==i&&w(t,e),"dedent"===r&&w(t,e))return n;if(o="])}".indexOf(i),-1!==o){while("coffee"==e.scope.type&&e.scope.prev)e.scope=e.scope.prev;e.scope.type==i&&(e.scope=e.scope.prev)}return e.dedent&&t.eol()&&("coffee"==e.scope.type&&e.scope.prev&&(e.scope=e.scope.prev),e.dedent=!1),r}var C={startState:function(t){return{tokenize:m,scope:{offset:t||0,type:"coffee",prev:null,align:!1},prop:!1,dedent:0}},token:function(t,e){var n=null===e.scope.align&&e.scope;n&&t.sol()&&(n.align=!1);var r=x(t,e);return r&&"comment"!=r&&(n&&(n.align=!0),e.prop="punctuation"==r&&"."==t.current()),r},indent:function(t,e){if(t.tokenize!=m)return 0;var n=t.scope,r=e&&"])}".indexOf(e.charAt(0))>-1;if(r)while("coffee"==n.type&&n.prev)n=n.prev;var i=r&&n.type===e.charAt(0);return n.align?n.alignOffset-(i?1:0):(i?n.prev:n).offset},lineComment:"#",fold:"indent"};return C})),t.defineMIME("application/vnd.coffeescript","coffeescript"),t.defineMIME("text/x-coffeescript","coffeescript"),t.defineMIME("text/coffeescript","coffeescript")}))},a157:function(t,e,n){"use strict";t.exports=n("8097")},a258:function(t,e,n){var r=n("0366"),i=n("44ad"),o=n("7b0b"),a=n("07fa"),s=function(t){var e=1==t;return function(n,s,l){var c,u,d=o(n),h=i(d),p=r(s,l),f=a(h);while(f-- >0)if(c=h[f],u=p(c,f,d),u)switch(t){case 0:return c;case 1:return f}return e?-1:void 0}};t.exports={findLast:s(0),findLastIndex:s(1)}},a280:function(t,e,n){"use strict";n("9698")},a2c1:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";var e=t.Pos;function n(t,e){return t.line-e.line||t.ch-e.ch}var r="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=r+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",o=new RegExp("<(/?)(["+r+"]["+i+"]*)","g");function a(t,e,n,r){this.line=e,this.ch=n,this.cm=t,this.text=t.getLine(e),this.min=r?Math.max(r.from,t.firstLine()):t.firstLine(),this.max=r?Math.min(r.to-1,t.lastLine()):t.lastLine()}function s(t,n){var r=t.cm.getTokenTypeAt(e(t.line,n));return r&&/\btag\b/.test(r)}function l(t){if(!(t.line>=t.max))return t.ch=0,t.text=t.cm.getLine(++t.line),!0}function c(t){if(!(t.line<=t.min))return t.text=t.cm.getLine(--t.line),t.ch=t.text.length,!0}function u(t){for(;;){var e=t.text.indexOf(">",t.ch);if(-1==e){if(l(t))continue;return}if(s(t,e+1)){var n=t.text.lastIndexOf("/",e),r=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,r?"selfClose":"regular"}t.ch=e+1}}function d(t){for(;;){var e=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(-1==e){if(c(t))continue;return}if(s(t,e+1)){o.lastIndex=e,t.ch=e;var n=o.exec(t.text);if(n&&n.index==e)return n}else t.ch=e}}function h(t){for(;;){o.lastIndex=t.ch;var e=o.exec(t.text);if(!e){if(l(t))continue;return}if(s(t,e.index+1))return t.ch=e.index+e[0].length,e;t.ch=e.index+1}}function p(t){for(;;){var e=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(-1==e){if(c(t))continue;return}if(s(t,e+1)){var n=t.text.lastIndexOf("/",e),r=n>-1&&!/\S/.test(t.text.slice(n+1,e));return t.ch=e+1,r?"selfClose":"regular"}t.ch=e}}function f(t,n){for(var r=[];;){var i,o=h(t),a=t.line,s=t.ch-(o?o[0].length:0);if(!o||!(i=u(t)))return;if("selfClose"!=i)if(o[1]){for(var l=r.length-1;l>=0;--l)if(r[l]==o[2]){r.length=l;break}if(l<0&&(!n||n==o[2]))return{tag:o[2],from:e(a,s),to:e(t.line,t.ch)}}else r.push(o[2])}}function g(t,n){for(var r=[];;){var i=p(t);if(!i)return;if("selfClose"!=i){var o=t.line,a=t.ch,s=d(t);if(!s)return;if(s[1])r.push(s[2]);else{for(var l=r.length-1;l>=0;--l)if(r[l]==s[2]){r.length=l;break}if(l<0&&(!n||n==s[2]))return{tag:s[2],from:e(t.line,t.ch),to:e(o,a)}}}else d(t)}}t.registerHelper("fold","xml",(function(t,r){for(var i=new a(t,r.line,0);;){var o=h(i);if(!o||i.line!=r.line)return;var s=u(i);if(!s)return;if(!o[1]&&"selfClose"!=s){var l=e(i.line,i.ch),c=f(i,o[2]);return c&&n(c.from,l)>0?{from:l,to:c.from}:null}}})),t.findMatchingTag=function(t,r,i){var o=new a(t,r.line,r.ch,i);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=u(o),l=s&&e(o.line,o.ch),c=s&&d(o);if(s&&c&&!(n(o,r)>0)){var h={from:e(o.line,o.ch),to:l,tag:c[2]};return"selfClose"==s?{open:h,close:null,at:"open"}:c[1]?{open:g(o,c[2]),close:h,at:"close"}:(o=new a(t,l.line,l.ch,i),{open:h,close:f(o,c[2]),at:"open"})}}},t.findEnclosingTag=function(t,e,n,r){for(var i=new a(t,e.line,e.ch,n);;){var o=g(i,r);if(!o)break;var s=new a(t,e.line,e.ch,n),l=f(s,o.tag);if(l)return{open:o,close:l}}},t.scanForClosingTag=function(t,e,n,r){var i=new a(t,e.line,e.ch,r?{from:0,to:r}:null);return f(i,n)}}))},a34a:function(t,e,n){function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n("6c57"),n("a4d3"),n("e01a"),n("d3b7"),n("d28b"),n("3ca3"),n("ddb0");var i=n("7ec2")();t.exports=i;try{regeneratorRuntime=i}catch(o){"object"===("undefined"===typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}},a3c3:function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}}},a57f:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"$",(function(){return He})),n.d(e,"ANCHOR",(function(){return dt})),n.d(e,"ANCHOR_SELECTOR",(function(){return ft})),n.d(e,"Ajax",(function(){return Hi})),n.d(e,"BlockPlugin",(function(){return ti})),n.d(e,"CARD_CENTER_SELECTOR",(function(){return Tt})),n.d(e,"CARD_EDITABLE_KEY",(function(){return At})),n.d(e,"CARD_ELEMENT_KEY",(function(){return Ct})),n.d(e,"CARD_KEY",(function(){return bt})),n.d(e,"CARD_LEFT_SELECTOR",(function(){return Ot})),n.d(e,"CARD_LOADING_KEY",(function(){return kt})),n.d(e,"CARD_RIGHT_SELECTOR",(function(){return _t})),n.d(e,"CARD_SELECTOR",(function(){return St})),n.d(e,"CARD_TAG",(function(){return vt})),n.d(e,"CARD_TYPE_KEY",(function(){return wt})),n.d(e,"CARD_VALUE_KEY",(function(){return xt})),n.d(e,"CURSOR",(function(){return pt})),n.d(e,"CURSOR_SELECTOR",(function(){return mt})),n.d(e,"CamelCaseType",(function(){return o})),n.d(e,"Card",(function(){return No})),n.d(e,"CardActiveTrigger",(function(){return mn})),n.d(e,"CardType",(function(){return gn})),n.d(e,"Conversion",(function(){return Ve})),n.d(e,"DATA_COLOR",(function(){return ye})),n.d(e,"DATA_CONTENTEDITABLE_KEY",(function(){return Ue})),n.d(e,"DATA_ELEMENT",(function(){return J})),n.d(e,"DATA_ID",(function(){return Q})),n.d(e,"DATA_TRANSIENT_ATTRIBUTES",(function(){return at})),n.d(e,"DATA_TRANSIENT_ELEMENT",(function(){return st})),n.d(e,"DATA_UUID",(function(){return be})),n.d(e,"EDITABLE",(function(){return it})),n.d(e,"EDITABLE_SELECTOR",(function(){return ot})),n.d(e,"ENGINE_CLASS_NAME",(function(){return lt})),n.d(e,"ENGINE_MOBILE_CLASS_NAME",(function(){return ct})),n.d(e,"ElementPlugin",(function(){return Jr})),n.d(e,"FOCUS",(function(){return ht})),n.d(e,"FOCUS_SELECTOR",(function(){return gt})),n.d(e,"InlinePlugin",(function(){return ni})),n.d(e,"JSON0_INDEX",(function(){return ve})),n.d(e,"ListPlugin",(function(){return oi})),n.d(e,"MarkPlugin",(function(){return ai})),n.d(e,"Parser",(function(){return kn})),n.d(e,"Plugin",(function(){return Zr})),n.d(e,"Position",(function(){return ko})),n.d(e,"READY_CARD_KEY",(function(){return yt})),n.d(e,"READY_CARD_SELECTOR",(function(){return Et})),n.d(e,"ROOT",(function(){return tt})),n.d(e,"ROOT_SELECTOR",(function(){return et})),n.d(e,"Range",(function(){return cn})),n.d(e,"Request",(function(){return $i})),n.d(e,"Resizer",(function(){return Vo})),n.d(e,"Schema",(function(){return qe})),n.d(e,"Scrollbar",(function(){return zo})),n.d(e,"SelectStyleType",(function(){return vn})),n.d(e,"Selection",(function(){return Ke})),n.d(e,"TRIGGER_CARD_ID",(function(){return Mt})),n.d(e,"TinyCanvas",(function(){return Z})),n.d(e,"Toolbar",(function(){return Qn})),n.d(e,"Tooltip",(function(){return Fn})),n.d(e,"UI",(function(){return nt})),n.d(e,"UI_SELECTOR",(function(){return rt})),n.d(e,"Uploader",(function(){return Wi})),n.d(e,"VIEW_CLASS_NAME",(function(){return ut})),n.d(e,"View",(function(){return Po})),n.d(e,"addUnit",(function(){return Qt})),n.d(e,"closest",(function(){return Le})),n.d(e,"combinText",(function(){return ue})),n.d(e,"convertMarkdown",(function(){return me})),n.d(e,"createMarkdownIt",(function(){return ge})),n.d(e,"decodeCardValue",(function(){return ne})),n.d(e,"encodeCardValue",(function(){return ee})),n.d(e,"escape",(function(){return Xt})),n.d(e,"escapeDots",(function(){return Zt})),n.d(e,"filterOperations",(function(){return Qe})),n.d(e,"findCardForDoc",(function(){return ln})),n.d(e,"findFromDoc",(function(){return sn})),n.d(e,"formatEngineValue",(function(){return ae})),n.d(e,"formatHotkey",(function(){return se})),n.d(e,"getAttrMap",(function(){return Wt})),n.d(e,"getComputedStyle",(function(){return Yt})),n.d(e,"getDocument",(function(){return ce})),n.d(e,"getExtensionName",(function(){return qi})),n.d(e,"getFileSize",(function(){return Ui})),n.d(e,"getHashId",(function(){return Ye})),n.d(e,"getListStyle",(function(){return le})),n.d(e,"getParentInRoot",(function(){return he})),n.d(e,"getStyleMap",(function(){return Gt})),n.d(e,"getTextNodes",(function(){return de})),n.d(e,"getValue",(function(){return an})),n.d(e,"inEditor",(function(){return Ne})),n.d(e,"isAndroid",(function(){return Bt})),n.d(e,"isBlockCard",(function(){return Ee})),n.d(e,"isBlockPlugin",(function(){return ei})),n.d(e,"isCard",(function(){return Se})),n.d(e,"isChrome",(function(){return Dt})),n.d(e,"isCursor",(function(){return Pe})),n.d(e,"isEdge",(function(){return Lt})),n.d(e,"isEditable",(function(){return Me})),n.d(e,"isEditableCard",(function(){return Te})),n.d(e,"isEngine",(function(){return pe})),n.d(e,"isFirefox",(function(){return jt})),n.d(e,"isInlineCard",(function(){return Oe})),n.d(e,"isInlinePlugin",(function(){return ri})),n.d(e,"isIos",(function(){return Ft})),n.d(e,"isMacos",(function(){return zt})),n.d(e,"isMarkPlugin",(function(){return si})),n.d(e,"isMatchesSelector",(function(){return Ae})),n.d(e,"isMobile",(function(){return Rt})),n.d(e,"isNode",(function(){return ke})),n.d(e,"isNodeEntry",(function(){return xe})),n.d(e,"isNodeList",(function(){return Ce})),n.d(e,"isRange",(function(){return dn})),n.d(e,"isRangeInterface",(function(){return hn})),n.d(e,"isReverseOp",(function(){return tn})),n.d(e,"isRoot",(function(){return _e})),n.d(e,"isSafari",(function(){return It})),n.d(e,"isSelection",(function(){return un})),n.d(e,"isServer",(function(){return Pt})),n.d(e,"isTransientAttribute",(function(){return Je})),n.d(e,"isTransientElement",(function(){return Ze})),n.d(e,"isView",(function(){return fe})),n.d(e,"isWindows",(function(){return Ht})),n.d(e,"random",(function(){return Vt})),n.d(e,"removeUnit",(function(){return te})),n.d(e,"sanitizeUrl",(function(){return oe})),n.d(e,"toCamelCase",(function(){return qt})),n.d(e,"toDOM",(function(){return nn})),n.d(e,"toHex",(function(){return Ut})),n.d(e,"toJSON0",(function(){return on})),n.d(e,"transformCustomTags",(function(){return re})),n.d(e,"unescape",(function(){return Kt})),n.d(e,"unescapeDots",(function(){return Jt})),n.d(e,"uuid",(function(){return $e})),n.d(e,"validUrl",(function(){return ie}));var r=n("51ac"),i=n.n(r);n.d(e,"isHotkey",(function(){return i.a}));var o,a=n("53ca"),s=n("1da1"),l=n("5530"),c=n("d4ec"),u=n("bee2"),d=n("257e"),h=n("45eb"),p=n("7e84"),f=n("262e"),g=n("2caf"),m=n("a34a"),v=n.n(m),b=n("a157"),y=n.n(b),w=n("3835"),x=n("ade3"),C=n("b85c"),k=n("63ea"),A=n.n(k),S=n("2909"),E=n("66cb"),O=n.n(E),T=n("5122"),_=n("5cf7"),M=n("b047"),N=n.n(M),P=n("0644"),L=n.n(P),D=n("7232"),j=n("91a5"),I=n("dd71"),R=n.n(I),F=n("641c"),B=n("2442"),z=n.n(B),H=n("42454"),V=n.n(H),q=n("f904"),U=n.n(q),W=n("5ddc"),$=n.n(W),G=n("cee5"),Y=n.n(G),X=n("0f32"),K=n.n(X),Z=function(){function t(e){if(Object(c["a"])(this,t),this.options={limitHeight:5e3,canvasCache:[],canvasCount:0},this.width=0,this.height=0,this.handleClear=function(t){var e=t.context,n=t.x,r=t.y,i=t.width,o=t.height;null===e||void 0===e||e.clearRect(n,r,i,o)},!e.container)throw new Error("need a cantainer!");this.options=Object(l["a"])(Object(l["a"])({},this.options),e),e.container.style["line-height"]="0px"}return Object(u["a"])(t,[{key:"removeCanvas",value:function(){var t=this.options.canvasCache;null===t||void 0===t||t.forEach((function(t){var e;null===t||void 0===t||null===(e=t.parentElement)||void 0===e||e.removeChild(t)})),this.options.canvasCache=[],this.options.canvasCount=0}},{key:"getCanvas",value:function(t){var e=this.options.canvasCache;return t=t>0?t-1:t,e?e[t]:void 0}},{key:"resize",value:function(t,e){if(this.width!==t||this.height!==e){this.width=t,this.height=e;var n=this.options,r=n.limitHeight,i=n.canvasCount,o=n.container,a=this.options.canvasCache,s=Math.ceil(e/(r||0));if(s!==i){this.removeCanvas(),a=[];for(var l=0;l<s;l++){var c=document.createElement("canvas");c.style["vertical-align"]="bottom",c.setAttribute("width",t.toString()),l===s-1?c.setAttribute("height",(e%(r||0)).toString()):c.setAttribute("height",(r||0).toString()),null===o||void 0===o||o.appendChild(c),a.push(c)}this.options.canvasCache=a,this.options.canvasCount=a.length}else{var u,d=this.getCanvas(s);if(null===(u=a)||void 0===u||u.forEach((function(e){var n=e.getAttribute("width");n&&parseInt(n)===t||e.setAttribute("width",t.toString())})),d){var h=d.getAttribute("height"),p=e%(r||0);h&&parseInt(h)===p||d.setAttribute("height",p.toString())}}}}},{key:"handleSingleRect",value:function(t){var e=t.x,n=t.y,r=t.index,i=t.width,o=t.height,a=t.callback,s=this.options.limitHeight,l=this.getCanvas(r);if(l){var c=l.getContext("2d"),u=new DOMRect(e,n-(s||0)*(r-1),i,o);a(Object.assign({},u.toJSON(),{context:c}))}}},{key:"handleFillRect",value:function(t){var e=t.context,n=t.x,r=t.y,i=t.width,o=t.height,a=t.fill,s=t.stroke;e&&(e.fillStyle=void 0===a?"#FFEC3D":a,e.strokeStyle=void 0===s?"#FFEC3D":s,e.fillRect(n,r,i,o))}},{key:"drawRect",value:function(t){var e=this,n=t.x,r=t.y,i=t.width,o=t.height,a=t.fill,s=t.stroke,l=new DOMRect(n,r,i,o);this.handleRect(Object.assign({},l.toJSON(),{callback:function(t){e.handleFillRect(Object.assign({},t,{fill:a,stroke:s}))}}))}},{key:"handleRect",value:function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.callback,a=this.options.limitHeight,s={x:e+r,y:n+i},l=Math.ceil(n/(a||0)),c=Math.ceil(s.y/(a||0)),u=new DOMRect(e,n,r,i),d=u.toJSON();this.handleSingleRect(Object.assign({},d,{index:l,callback:o})),l!==c&&this.handleSingleRect(Object.assign({},d,{index:c,callback:o}))}},{key:"getImageData",value:function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=this.options.limitHeight,a=Math.ceil(n/(o||0)),s=this.getCanvas(a),l=null===s||void 0===s?void 0:s.getContext("2d");return null===l||void 0===l?void 0:l.getImageData(e,n,r,i)}},{key:"clearRect",value:function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=new DOMRect(e,n,r,i);this.handleRect(Object.assign({},o.toJSON(),{callback:this.handleClear}))}},{key:"clear",value:function(){var t=this.options.canvasCache;null===t||void 0===t||t.forEach((function(t){var e=t.getContext("2d"),n=Number(t.getAttribute("width")),r=Number(t.getAttribute("height"));null===e||void 0===e||e.clearRect(0,0,n,r)}))}},{key:"destroy",value:function(){this.removeCanvas()}}]),t}(),J="data-element",Q="data-id",tt="root",et="[".concat(J,'="').concat(tt,'"]'),nt="ui",rt="[".concat(J,'="').concat(nt,'"]'),it="editable",ot="[".concat(J,'="').concat(it,'"]'),at="data-transient-attributes",st="data-transient-element",lt="am-engine",ct="am-engine-mobile",ut="am-engine-view",dt="anchor",ht="focus",pt="cursor",ft="span[".concat(J,"=").concat(dt,"],anchor"),gt="span[".concat(J,"=").concat(ht,"],focus"),mt="span[".concat(J,"=").concat(pt,"],cursor"),vt="card",bt="data-card-key",yt="data-ready-card",wt="data-card-type",xt="data-card-value",Ct="data-card-element",kt="data-card-loading",At="data-card-editable",St="div[".concat(bt,"],span[").concat(bt,"]"),Et="div[".concat(yt,"],span[").concat(yt,"]"),Ot="span[".concat(Ct,"=left]"),Tt="div[".concat(Ct,"=center],span[").concat(Ct,"=center]"),_t="span[".concat(Ct,"=right]"),Mt="trigger-card-id",Nt=("undefined"!==typeof navigator?navigator:window.navigator).userAgent.toLowerCase(),Pt="undefined"===typeof navigator,Lt=/edge/i.test(Nt),Dt=!Lt&&/chrome/i.test(Nt),jt=/firefox/i.test(Nt),It=!Lt&&!Dt&&/safari/i.test(Nt),Rt=/mobile/i.test(Nt),Ft=/os [\.\_\d]+ like mac os/i.test(Nt),Bt=/android/i.test(Nt),zt=!Ft&&/mac os x/i.test(Nt),Ht=/windows\s*(?:nt)?\s*[\.\_\d]+/i.test(Nt),Vt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;t<5&&(t=5);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;r<t;r++)n+=e.charAt(Math.floor(Math.random()*e.length));return n};(function(t){t["UPPER"]="upper",t["LOWER"]="lower"})(o||(o={}));var qt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.LOWER;return~t.indexOf("-")?t.split("-").map((function(t,n){return"upper"===e||n>0?t.charAt(0).toUpperCase()+t.substr(1):"lower"===e&&0===n?t.charAt(0).toLowerCase()+t.substr(1):t})).join(""):t},Ut=function(t){var e=function(t){var e=parseInt(t,10).toString(16).toUpperCase();return e.length>1?e:"0"+e},n=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/gi;return t.replace(n,(function(t,n,r,i){return"#"+e(n)+e(r)+e(i)}))},Wt=function(t){var e,n={},r=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g;while(e=r.exec(t)){var i=(e[1]||e[2]||e[4]||e[6]).toLowerCase(),o=(e[2]?e[3]:e[4]?e[5]:e[7])||"";n[i]=o}return n},$t=new Map,Gt=function(t){var e=t.replace(/\s+/g,""),n={};if(!e)return n;var r=$t.get(e);if(r)return Object.assign({},r);var i,o=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g;t=t.toLowerCase();while(i=o.exec(t)){var a=i,s=Object(w["a"])(a,3),l=(s[0],s[1]),c=s[2];(l.endsWith("color")||c.includes("rgb"))&&(c=Ut(c)),n[l.trim()]=c.trim()}return $t.set(e,n),Object.assign({},n)},Yt=function(t,e){var n=qt(e),r=window.getComputedStyle(t,null);return r?r[n]:""},Xt=function(t){return(t||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},Kt=function(t){return(t||"").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&")},Zt=function(t){return t.replace(/\./g,"&dot;")},Jt=function(t){return t.replace(/&dot;/g,".")},Qt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px";return t&&/^-?\d+(?:\.\d+)?$/.test(t.toString())?t+e:t},te=function(t){var e;return t&&(e=/^((-?\d+)(\.\d+)?)/.exec(t))?Math.floor(1e4*parseFloat(e[1]))/1e4:0},ee=function(t){var e="";try{e=encodeURIComponent(JSON.stringify(t||""))}catch(n){}return"data:".concat(e)},ne=function(t){try{return t=t.substr(5),JSON.parse(decodeURIComponent(t))}catch(e){return{}}},re=function(t){return t.replace(/<anchor\s*\/>/gi,"<span ".concat(J,'="').concat(dt,'"></span>')).replace(/<focus\s*\/>/gi,"<span ".concat(J,'="').concat(ht,'"></span>')).replace(/<cursor\s*\/>/gi,"<span ".concat(J,'="').concat(pt,'"></span>')).replace(/(<card\s+[^>]+>).*?<\/card>/gi,(function(t,e){var n=Wt(e),r=n.type,i=n.name,o=n.value,a=n.editable,s="inline"===r,l=s?"span":"div",c=["<".concat(l)];return c.push(" ".concat(wt,'="').concat(r||"",'"')),c.push(" ".concat(yt,'="').concat(i||"",'"')),""!==a&&c.push(" ".concat(At,'="').concat(a||"false",'"')),Object.keys(n).forEach((function(t){0===t.indexOf("data-")&&0!==t.indexOf("data-card")&&c.push(" ".concat(t,'="').concat(n[t]||"",'"'))})),void 0!==o&&c.push(" ".concat(xt,'="').concat(o,'"')),c.push("></".concat(l,">")),c.join("")}))},ie=function(t){return"string"===typeof t&&(t=t.toLowerCase(),!t.startsWith("data:text/html")&&(!!t.match(/^\S*$/)&&(!!["http:","https:","data:","ftp:"].some((function(e){return t.startsWith(e)}))||(!(!t.startsWith("./")&&!t.startsWith("/"))||t.indexOf(":")<0))))},oe=function(t){return ie(t)?t:""},ae=function(t){if(!t)return t;var e=t.replace(/<(anchor|focus|cursor)[^>]*?\/>/gi,"");return/^<p(\s[^>]*?)><br \/><\/p>$/i.test(e)?t.replace(RegExp.$1,""):t},se=function(t){var e=t.toLowerCase().split("+");return e=e.map((function(t){return"mod"===t?zt?"⌘":"Ctrl":"opt"===t?zt?"Option":"Alt":t.length>1?t.substr(0,1).toUpperCase()+t.substr(1).toLowerCase():t.toUpperCase()})),e.join("+")},le=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(e=+e))return"•";switch(null===t||void 0===t?void 0:t.toLowerCase()){case"disc":return"•";case"circle":return"◦";case"square":return"◼";case"lower-alpha":return String.fromCharCode("a".charCodeAt(0)+e);case"lower-roman":return String.fromCharCode(8559+e);case"decimal":default:return e}},ce=function(e){if("undefined"===typeof document&&"undefined"===typeof t["__amWindow"])throw"document is not defined,If you are using ssr, you can assign a value to the `__amWindow` global variable.";return e?e.ownerDocument||e["document"]||e:"undefined"===typeof document?t["__amWindow"].document:document},ue=function(t){t instanceof Node||(t=t[0]),t.normalize()},de=function t(e,n){var r=[];if(n&&!n(e))return r;for(var i=e.childNodes,o=0;o<i.length;o++){var a=i[o],s=a.nodeType;3===s?r.push(a):1!==s&&9!==s&&11!==s||(r=r.concat(t(a,n)))}return r},he=function(t){var e;return t.nodeType===ce().ELEMENT_NODE&&t.getAttribute(J)===tt?void 0:(null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode)||void 0},pe=function(t){return"engine"===t.kind},fe=function(t){return"view"===t.kind},ge=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=new y.a(e,{html:!0,typographer:!0,linkify:!0});return t.trigger("markdown-it",n),n},me=function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=e.renderer,o=e.options,a=!1,s=t.schema.getTags("blocks"),l="",c=[];return n.forEach((function(u,d){var h=u.type,p=u.tag,f=u.children,g=u.nesting,m=t.trigger("markdown-it-token",{token:u,markdown:e,callback:function(t){l+=t}});if(!1!==m){var v="";if("inline"===h&&f?(v=i.renderInline(f,o,{}),r&&f.find((function(t){return"image"===t.type||t.type.endsWith("_inline")||t.type.endsWith("_open")}))&&(a=!0)):v="undefined"!==typeof i.rules[h]?i.rules[h](n,d,o,{},i):i.renderToken(n,d,o),1===g)c.push(""),l+=v;else if(0===g)0===c.length?(l+=v,p&&!a&&(a=!0)):v&&(c[c.length-1]+=v);else if(-1===g){var b;c.length>0&&!c[c.length-1]&&s.includes(p)&&(c[c.length-1]+="<br />"),l+=null!==(b=c[c.length-1])&&void 0!==b?b:"",c.pop(),c.every((function(t){return!t}))&&(c=[]),l+=v,a||"p"===p||(a=!0)}}else a=!0})),a&&l?l:null},ve={TAG_NAME:0,ATTRIBUTE:1,ELEMENT:2},be="data-uuid",ye="data-color",we=function(){function t(){Object(c["a"])(this,t),this.listeners={}}return Object(u["a"])(t,[{key:"on",value:function(t,e,n){this.listeners[t]||(this.listeners[t]=[]),"object"===Object(a["a"])(n)&&n.once||this.listeners[t].push(e)}},{key:"off",value:function(t,e){var n=this.listeners[t];if(n)for(var r=0;r<n.length;r++)if(n[r]===e){n.splice(r,1);break}}},{key:"trigger",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=this.listeners[t];if(i){var o=void 0;return i.every((function(t){return o=t.apply(void 0,n),"boolean"!==typeof o||!1!==o})),o}}},{key:"destroy",value:function(){var t=this;Object.keys(this.listeners).forEach((function(e){t.listeners[e].forEach((function(n){t.off(e,n)}))}))}}]),t}(),xe=function(t){return!!t&&void 0!==t.get},Ce=function(t){return!!t&&void 0!==t.entries},ke=function(t){return!!t&&void 0!==t.nodeType},Ae=function(t,e){if(t.nodeType!==Node.ELEMENT_NODE||!e)return!1;var n=function(t,e){var n,r=null===(n=ce(t))||void 0===n?void 0:n.querySelectorAll(e),i=r?r.length:0;while(--i>=0&&(null===r||void 0===r?void 0:r.item(i))!==t);return i>-1},r=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.matchesSelector||n;return r.call(t,e)},Se=function(t){return t.nodeName===vt||!!t.getAttribute(wt)},Ee=function(t){return"block"===t.getAttribute(wt)},Oe=function(t){return"inline"===t.getAttribute(wt)},Te=function(t){return t.getAttribute(J)===it||"true"===t.getAttribute(At)||!!(null===t||void 0===t?void 0:t.querySelector(ot))},_e=function(t,e){return t.getAttribute(J)===tt&&(!e||t===e)},Me=function(t){return _e(t)||t.getAttribute(J)===it},Ne=function(t,e){if(t.nodeType===Node.ELEMENT_NODE&&_e(t,e))return!1;var n=Le(t,et);return!!n&&(!e||n===e)},Pe=function(t){var e=t.getAttribute(J);return!!e&&[dt,ht,pt].indexOf(e)>-1},Le=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t){return t.parentElement||void 0},r=t||void 0;while(r){if(Ae(r,e))return r;r=n(r)}return r},De=new Map;function je(t,e){if(!t)return[];if("string"===typeof t){var n=!1;if(!e||(n=/<[^>]+>/g.test(t))){var r=0===t.indexOf("<tr"),i=0===t.indexOf("<td");t=(n?t.trim():t).replace(/<!--[^>]*-->/g,"");var o=De.get(t);if(o){if(r){var a=o.querySelector("tbody");return a?a.cloneNode(!0).childNodes:[]}if(i){var s=o.querySelector("tr");return s?s.cloneNode(!0).childNodes:[]}return o.cloneNode(!0).childNodes}r&&(t="<table><tbody>".concat(t,"</tbody></table>")),i&&(t="<table><tbody><tr>".concat(t,"</tr></tbody></table>"));var l=ce().createElement("div");if(l.innerHTML=t,De.set(t,l.cloneNode(!0)),r){var c=l.querySelector("tbody");return c?c.childNodes:[]}if(i){var u=l.querySelector("tr");return u?u.childNodes:[]}return l.childNodes}return e.querySelectorAll(t)}if(Ce(t)||Array.isArray(t))return t;if(xe(t)){var d=[];return t.each((function(t){d.push(t)})),d}if(ke(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var h,p=[],f=Object(C["a"])(t.childNodes);try{for(f.s();!(h=f.n()).done;){var g=h.value;p.push(g)}}catch(m){f.e(m)}finally{f.f()}return p}return[t]}var Ie,Re,Fe,Be,ze=function(){function t(e,n){var r=this;Object(c["a"])(this,t),this.events=[],this.document=null,this.context=void 0,this.name="",this.type=void 0,this.window=null,this.display=void 0,this.fragment=void 0,ke(e)&&(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(this.fragment=e),e=[e]),e.forEach((function(t,e){r[e]=t,r.events[e]=new we}));var i=this[0];if(i){this.document=ce(n),this.context=n;var o=i.nodeName,a=i.nodeType;this.name=o.toLowerCase(),this.type=a,this.window=this.document.defaultView||window}}return Object(u["a"])(t,[{key:"length",get:function(){var t=0;while(this[t])t++;return t}},{key:"each",value:function(t){var e,n=0;while(e=this[n]){if(!1===t(e,n))break;n++}return this}},{key:"toArray",value:function(){var e=[];return this.each((function(n){e.push(new t(n))})),e}},{key:"isElement",value:function(){return this.type===Node.ELEMENT_NODE}},{key:"isText",value:function(){return this.type===Node.TEXT_NODE}},{key:"isCard",value:function(){var t=this.get();return(null===t||void 0===t?void 0:t.nodeType)===Node.ELEMENT_NODE&&Se(t)}},{key:"isBlockCard",value:function(){var t=this.get();return(null===t||void 0===t?void 0:t.nodeType)===Node.ELEMENT_NODE&&Ee(t)}},{key:"isInlineCard",value:function(){var t=this.get();return(null===t||void 0===t?void 0:t.nodeType)===Node.ELEMENT_NODE&&Oe(t)}},{key:"isEditableCard",value:function(){var t=this.get();return(null===t||void 0===t?void 0:t.nodeType)===Node.ELEMENT_NODE&&Te(t)}},{key:"isRoot",value:function(t){var e,n=this.get();return(null===n||void 0===n?void 0:n.nodeType)===Node.ELEMENT_NODE&&_e(n,t?null!==(e=t[0])&&void 0!==e?e:t:void 0)}},{key:"isEditable",value:function(){var t=this.get();return(null===t||void 0===t?void 0:t.nodeType)===Node.ELEMENT_NODE&&Me(t)}},{key:"inEditor",value:function(t){var e,n=this.get();return!!n&&Ne(n,t?null!==(e=t[0])&&void 0!==e?e:t:void 0)}},{key:"isCursor",value:function(){var t=this.get();return(null===t||void 0===t?void 0:t.nodeType)===Node.ELEMENT_NODE&&Pe(t)}},{key:"get",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return 0===this.length?null:this[t]}},{key:"eq",value:function(e){return e>-1&&e<this.length?new t(this[e]):void 0}},{key:"index",value:function(){var t,e=null===(t=this.get())||void 0===t?void 0:t.previousSibling,n=0;while(e&&e.nodeType===Node.ELEMENT_NODE)n++,e=e.previousSibling;return n}},{key:"parent",value:function(){var e,n=this.get(),r=null!==(e=null===n||void 0===n?void 0:n.parentElement)&&void 0!==e?e:null===n||void 0===n?void 0:n.parentNode;return r?new t(r):void 0}},{key:"children",value:function(e){if(0===this.length)return new t([]);var n=this.get().childNodes;if(e){for(var r=[],i=0;i<n.length;i++){var o=n[i];Ae(o,e)&&r.push(o)}return new t(r)}return new t(n)}},{key:"first",value:function(){var e;if(this.fragment)return this.eq(0)||null;var n=0===this.length?null:null===(e=this.get())||void 0===e?void 0:e.firstChild;return n?new t(n):null}},{key:"last",value:function(){var e;if(this.fragment)return this.eq(this.length-1)||null;var n=0===this.length?null:null===(e=this.get())||void 0===e?void 0:e.lastChild;return n?new t(n):null}},{key:"prev",value:function(){var e,n=0===this.length?null:null===(e=this.get())||void 0===e?void 0:e.previousSibling;return n?new t(n):null}},{key:"next",value:function(){var e,n=0===this.length?null:null===(e=this.get())||void 0===e?void 0:e.nextSibling;return n?new t(n):null}},{key:"prevElement",value:function(){var e=0===this.length?null:this.get().previousElementSibling;return e?new t(e):null}},{key:"nextElement",value:function(){var e=0===this.length?null:this.get().nextElementSibling;return e?new t(e):null}},{key:"getPath",value:function(t,e,n){t=t||document.body;var r=[];if(this.length>0){var i=this.getIndex(e);if(n){var o=n(i,r,this);o&&(r=o)}else r.unshift(i)}if(this.equal(t))return r;var a=this.parent();while(a&&!a.equal(t)){var s=a.getIndex(e);if(n){var l=n(s,r,a);l&&(r=l)}else r.unshift(s);a=a.parent()}return r}},{key:"contains",value:function(t){var e,n=ke(t)?t:t.get();if(0===this.length)return!1;if(this.get().nodeType===Node.DOCUMENT_NODE&&(null===(e=n)||void 0===e?void 0:e.nodeType)!==Node.DOCUMENT_NODE)return!0;if(n===this[0])return!0;while(n=(null!==(r=null===(i=n)||void 0===i?void 0:i.parentElement)&&void 0!==r?r:null===(o=n)||void 0===o?void 0:o.parentNode)||null){var r,i,o;if(n===this[0])return!0}return!1}},{key:"find",value:function(e){if(this.length>0&&(this.isElement()||this.fragment)){var n,r=null===(n=this.fragment?this.fragment:this.get())||void 0===n?void 0:n.querySelectorAll(e);return new t(r||[])}return new t([])}},{key:"closest",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){var e;return null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode||void 0},r=[],i=this.get()||void 0;while(i){if(Ae(i,e))return r.push(i),new t(r);i=n(i)}return new t(r)}},{key:"on",value:function(t,e,n){var r=this;return this.each((function(i,o){i.addEventListener(t,e,n),r.events[o]&&r.events[o].on(t,e,n)})),this}},{key:"off",value:function(t,e,n){var r=this;return this.each((function(i,o){i.removeEventListener(t,e,n),r.events[o]&&r.events[o].off(t,e,n)})),this}},{key:"getBoundingClientRect",value:function(t){if(0!==this.length){try{var e=this.get(),n=e.getBoundingClientRect(),r=document.documentElement.clientTop,i=document.documentElement.clientLeft;return{top:n.top-r,bottom:n.bottom-r,left:n.left-i,right:n.right-i}}catch(o){console.error(o)}return t}}},{key:"removeAllEvents",value:function(){var t=this;return this.each((function(e,n){t.events[n]&&Object.keys(t.events[n].listeners).forEach((function(r){for(var i=t.events[n].listeners[r],o=0;o<i.length;o++)t.off(r,i[o]),t.events[n].off(r,i[o]),e.removeEventListener(r,i[o],!1)}))})),this}},{key:"attributes",value:function(t,e){if(void 0===t){var n=this.get();if(!n)return{};for(var r={},i=n.attributes,o=i.length;o--;){var s=i[o];r[s.name]=s.value}return r}if("object"===Object(a["a"])(t)){for(var l in t){var c=t[l];this.attributes(l,c)}return this}if(void 0===e){var u=this.get();return this.length>0&&this.isElement()&&(null===u||void 0===u?void 0:u.getAttribute(t))||""}var d="style"===t&&""===e;return this.each((function(n){n instanceof Element&&(d?n.removeAttribute("style"):n.setAttribute(t,e.toString()))})),this}},{key:"removeAttributes",value:function(t){return this.each((function(e){e instanceof Element&&e.removeAttribute(t)})),this}},{key:"hasClass",value:function(t){if(0===this.length)return!1;var e=this.get();if(!e)return!1;var n=0,r=null,i=e.classList||{};while(r=i[n]){if(r===t)return!0;n++}return!1}},{key:"addClass",value:function(t){return this.each((function(e){e instanceof Element&&e.classList.add(t)})),this}},{key:"removeClass",value:function(t){return this.each((function(e){e instanceof Element&&e.classList.remove(t)})),this}},{key:"css",value:function(t,e){if(void 0===t)return Gt(this.attributes("style")||"");if("object"===Object(a["a"])(t)){for(var n in t){var r=t[n];this.css(n,r)}return this}if(void 0===e){if(0===this.length||this.isText())return"";var i=this.get();return i&&(i.style[qt(t)]||Yt(this[0],t))||""}return this.each((function(n){var r=n;r.style[qt(t)]=e.toString(),0===r.style.length&&r.removeAttribute("style")})),this}},{key:"width",value:function(){var t=this.css("width");if("auto"===t){var e=this.get();t=e.offsetWidth.toString()}return t&&te(t)||0}},{key:"height",value:function(){var t=this.css("height");if("auto"===t){var e=this.get();t=e.offsetHeight.toString()}return t&&parseFloat(t)||0}},{key:"html",value:function(t){if(void 0!==t){var e=je(t);return this.each((function(t){if(t.nodeType===Node.ELEMENT_NODE){var n=t.firstChild;while(n){var r=n.nextSibling;t.removeChild(n),n=r}e.forEach((function(e){t.appendChild(e.cloneNode(!0))}))}})),this}return this.length>0&&this[0]instanceof Element?this[0].innerHTML:""}},{key:"text",value:function(t){var e;return void 0!==t?(this.each((function(e){e.textContent=t})),this):0===this.length?"":(null===(e=this.get())||void 0===e?void 0:e.textContent)||""}},{key:"show",value:function(t){return void 0===t&&(t=this.display||""),"none"===t&&(t=""),"none"!==this.css("display")?this:this.css("display",t)}},{key:"hide",value:function(){var t;return 0===this.length?this:(this.display=null===(t=this.get())||void 0===t?void 0:t.style.display,this.css("display","none"))}},{key:"remove",value:function(){var t=this;return this.each((function(e,n){var r,i=null!==(r=e.parentElement)&&void 0!==r?r:e.parentNode;i&&(i.removeChild(e),delete t[n])})),this}},{key:"empty",value:function(){return this.each((function(t){var e=t.firstChild;while(e){var n=e.nextSibling;t.removeChild(e),e=n}})),this}},{key:"equal",value:function(t){return ke(t)?this.get()===t:!!xe(t)&&this.get()===t.get()}},{key:"clone",value:function(e){var n=[];return this.each((function(t){n.push(t.cloneNode(e))})),new t(n)}},{key:"prepend",value:function(t){var e=je(t,this.context),n="string"===typeof t&&/<.+>/.test(t);return this.each((function(t){for(var r=e.length-1;r>=0;r--){var i=n?e[r].cloneNode(!0):e[r];t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)}})),this}},{key:"append",value:function(t){var e=je(t,this.context),n="string"===typeof t&&/<.+>/.test(t);return this.each((function(r){for(var i=0;i<e.length;i++){var o=n?e[i].cloneNode(!0):e[i];"string"===typeof t?r instanceof Element&&r.append(o):r.appendChild(o)}})),this}},{key:"before",value:function(t){var e=je(t,this.context),n="string"===typeof t&&/<.+>/.test(t);return this.each((function(t){var r,i=null!==(r=t.parentElement)&&void 0!==r?r:t.parentNode;i&&e.forEach((function(e){n&&(e=e.cloneNode(!0)),i.insertBefore(e,t),t=e}))})),this}},{key:"after",value:function(t){var e=je(t,this.context),n="string"===typeof t&&/<.+>/.test(t);return this.each((function(t){var r,i=null!==(r=t.parentElement)&&void 0!==r?r:t.parentNode;i&&e.forEach((function(e){n&&(e=e.cloneNode(!0)),t.nextSibling?(i.insertBefore(e,t.nextSibling),t=e):i.appendChild(e)}))})),this}},{key:"replaceWith",value:function(e){var n=[],r=je(e,this.context),i="string"===typeof e&&/<.+>/.test(e);return this.each((function(t){var e,o=null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode;if(o){var a=i?r[0].cloneNode(!0):r[0];try{o.replaceChild(a,t),n.push(a)}catch(s){}}})),new t(n)}},{key:"getRoot",value:function(){return this.closest(et)}},{key:"traverse",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=function o(a){var s=a.isCard();if(!s||a.fragment&&1!==a.fragment.childNodes.length||n&&("editable"!==n||a.isEditableCard())){var l=e?a.first():a.last();while(l){var c=e?l.next():l.prev();r&&r(l);var u=t(l);if(!1===u)return void(i&&i(l,c));if(!0!==u){var d=u&&"boolean"!==typeof u;d&&(i&&i(l,u),l=u),s=l.isCard(),s?!0===n?(d&&t(l),o(l)):"editable"===n&&l.isEditableCard()&&function(){var t=l.find(ot);t.each((function(e,n){var r=t.eq(n);r&&o(r)}))}():(d&&t(l),o(l))}i&&i(l,c),l=c}}};t(this),o(this)}},{key:"getChildByPath",value:function(t,e){var n=this.get();if(0===t.length)return n;for(var r=function(t){var r,i=0,o=Object(C["a"])(n.childNodes);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(!e||e(a)){if(i==t)return a;i++}}}catch(s){o.e(s)}finally{o.f()}},i=0;void 0!==t[i];){var o=r(t[i]);if(!o)break;n=o,i++}return n}},{key:"getIndex",value:function(t){var e,n=this[0],r=null!==(e=n.parentElement)&&void 0!==e?e:n.parentNode;if(!r)return 0;var i,o=0,a=Object(C["a"])(r.childNodes);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(!t||t(s)){if(s===this[0])return o;o++}}}catch(l){a.e(l)}finally{a.f()}return-1}},{key:"findParent",value:function(){var e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.closest(et),i=null!==(e=r[0])&&void 0!==e?e:r,o=null!==(n=i.parentElement)&&void 0!==n?n:i.parentNode;if(0===this.length||!o)return null;var a=this[0];while((o=null!==(s=a.parentElement)&&void 0!==s?s:a.parentNode)&&o!==i){var s;a=o}return o?new t(a):null}},{key:"allChildren",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=[];return this.traverse((function(t){e.push(t)}),void 0,t),e.shift(),e}},{key:"getViewport",value:function(){var t,e=this.window||{innerHeight:0,innerWidth:0},n=e.innerHeight,r=e.innerWidth,i=this.isText()?null===(t=this.parent())||void 0===t?void 0:t.get():this.get();if(!i)return{top:0,left:0,bottom:0,right:0};var o=i.getBoundingClientRect(),a=o.top,s=o.left,l=o.bottom,c=o.right;return{top:a,left:s,bottom:Math.min(l,n),right:Math.min(c,r)}}},{key:"inViewport",value:function(e){var n,r,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=null;if(e.type!==Node.ELEMENT_NODE){var a;if(!e.document)return!1;o=e.document.createElement("span");var s=null!==(a=e[0].parentElement)&&void 0!==a?a:e[0].parentNode;e.next()?null===s||void 0===s||s.insertBefore(o,e[0].nextSibling):null===s||void 0===s||s.appendChild(o),e=new t(o)}var l=e.get();if(!l)return!0;var c=l.getBoundingClientRect(),u=c.top,d=c.left,h=c.right,p=c.bottom,f=this.getViewport();return o&&(null===(n=null!==(r=o.parentElement)&&void 0!==r?r:o.parentNode)||void 0===n||n.removeChild(o)),i?u>0&&u<=f.bottom||p>0&&p<=f.bottom:u>0&&u>=f.top&&d>0&&d>=f.left&&p<=f.bottom&&h<=f.right}},{key:"scrollIntoView",value:function(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"nearest";if("function"===typeof(null===(n=e.document)||void 0===n?void 0:n.body.scrollIntoView)){var i,o,a,s,l,c=null;if(e.type!==Node.ELEMENT_NODE||"br"===e.name.toLowerCase())c=e.document.createElement("span"),c.innerHTML="&nbsp;",null===(a=null!==(s=e[0].parentElement)&&void 0!==s?s:e[0].parentNode)||void 0===a||a.insertBefore(c,e[0]),e=new t(c);if(!this.inViewport(e))null===(l=e.get())||void 0===l||l.scrollIntoView({block:r,inline:r});c&&(null===(i=null!==(o=c.parentElement)&&void 0!==o?o:c.parentNode)||void 0===i||i.removeChild(c))}}}]),t}(),He=function(t,e,n){void 0===e&&(e=ce());var r=je(t,e),i=new(n||ze)(r,e||void 0);return ke(t)&&t.nodeType===window.Node.DOCUMENT_FRAGMENT_NODE&&(i.fragment=t),i},Ve=[{from:function(t,e,n){return!!n[bt]||!!n[yt]},to:function(t,e,n){var r=n[xt],i=Object(l["a"])({},n);for(var o in n=Object(x["a"])({type:n[wt],name:(n[bt]||n[yt]).toLowerCase(),editable:n[At]},Q,n[Q]),i)o!==yt&&0===o.indexOf("data-")&&0!==o.indexOf("data-card")&&(n[o]=i[o]);void 0!==r&&(n.value=r);var a=He("<card />");for(var s in n)a.attributes(s,n[s]);return a}},{from:function(t,e,n){return("div"===t||"section"===t)&&(!n[bt]||!n[yt])&&n[J]!==tt},to:function(t,e,n){var r=He("<p />");for(var i in r.css(e),n)r.attributes(i,n[i]);return r}},{from:function(t){return[pt,dt,ht].includes(t)},to:function(t){return{node:He("<".concat(t," />")),replace:!0}}}],qe=[{type:"block",attributes:Object(x["a"])({},Q,"*")},{name:"p",type:"block",allowIn:["$root"]},{name:"br",type:"inline",isVoid:!0},{name:dt,type:"inline",isVoid:!0},{name:ht,type:"inline",isVoid:!0},{name:pt,type:"inline",isVoid:!0},{name:"span",type:"mark",attributes:Object(x["a"])({},J,{required:!0,value:["anchor","cursor","focus"]})},{name:"card",type:"inline",attributes:{name:{required:!0,value:/\w+/},type:{required:!0,value:"inline"},editable:"*",value:"*"}},{name:"span",type:"inline",attributes:(Ie={},Object(x["a"])(Ie,bt,{required:!0,value:/\w+/}),Object(x["a"])(Ie,wt,{required:!0,value:"inline"}),Object(x["a"])(Ie,xt,"*"),Object(x["a"])(Ie,At,"*"),Object(x["a"])(Ie,"class","*"),Object(x["a"])(Ie,"contenteditable","*"),Ie)},{name:"span",type:"inline",attributes:(Re={},Object(x["a"])(Re,yt,{required:!0,value:/\w+/}),Object(x["a"])(Re,wt,{required:!0,value:"inline"}),Object(x["a"])(Re,xt,"*"),Object(x["a"])(Re,At,"*"),Object(x["a"])(Re,"class","*"),Object(x["a"])(Re,"contenteditable","*"),Re)},{name:"card",type:"block",attributes:{name:{required:!0,value:/\w+/},type:{required:!0,value:"block"},editable:"*",value:"*"}},{name:"div",type:"block",attributes:(Fe={},Object(x["a"])(Fe,bt,{required:!0,value:/\w+/}),Object(x["a"])(Fe,wt,{required:!0,value:"block"}),Object(x["a"])(Fe,xt,"*"),Object(x["a"])(Fe,At,"*"),Object(x["a"])(Fe,"class","*"),Object(x["a"])(Fe,"contenteditable","*"),Fe)},{name:"div",type:"block",attributes:(Be={},Object(x["a"])(Be,yt,{required:!0,value:/\w+/}),Object(x["a"])(Be,wt,{required:!0,value:"block"}),Object(x["a"])(Be,xt,"*"),Object(x["a"])(Be,At,"*"),Object(x["a"])(Be,"class","*"),Object(x["a"])(Be,"contenteditable","*"),Be)}],Ue="contenteditable",We=0,$e=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Number(Math.random().toString().substring(2,7)+t+Date.now()).toString(36)},Ge=new Map,Ye=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";if("string"!==typeof t){var r,i=null!==(r=t[0])&&void 0!==r?r:t;if(i.nodeType===Node.ELEMENT_NODE){var o=i,a=o.localName;n=a.substring(0,1),t=a;for(var s=o.attributes,l=s.length;l--;){var c=s[l];~~[Q,"id"].indexOf(c.name)&&(t+="".concat(c.name,'="').concat(c.value,'"'))}}else{var u;t=null!==(u=i.textContent)&&void 0!==u?u:""}}var d=Ge.get(t);if(d)n=d;else{var h=window.btoa(encodeURIComponent(t)).replace(/=/g,""),p=[];["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"].forEach((function(t,e){var n=h.indexOf(t);p.push(~n?n:h.length%e?0:1)}));var f=Number(p.join("")).toString(36).replace(/0/g,"");n=n+f.substr(0,4)+f.substr(-4),Ge.set(t,n)}var g=n;if(e){var m="".concat(g,"-").concat($e(We));return We++,m}return g},Xe=function(){function t(e){var n=this;Object(c["a"])(this,t),this.editor=void 0,this.addBrForBlock=function(t){if(!t.isText()){var e,r=t.get().childNodes,i=0,o=!0,a=!1,s="p"===t.name,l=Object(C["a"])(r);try{for(l.s();!(e=l.n()).done;){var c=e.value;if(o&&c.nodeType===Node.TEXT_NODE?o=!1:s||a||c.nodeType!==Node.ELEMENT_NODE||!n.isBlock(c)||(a=!0),c.nodeType===Node.ELEMENT_NODE&&[dt,ht,pt].indexOf(c.getAttribute(J)||"")<1&&i++,!o&&i>1)break}}catch(d){l.e(d)}finally{l.f()}if(s&&0===i){var u=document.createElement("br");t.each((function(t){t.appendChild(u.cloneNode())}))}!a&&o&&n.isBlock(t)&&(1!==r.length||"BR"!==r[0].nodeName)&&n.isEmptyWithTrim(t)&&(t.empty(),t.append(document.createElement("br")))}},this.editor=e}return Object(u["a"])(t,[{key:"isVoid",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.schema,n="string"===typeof t?t:"";return ke(t)?n=t.nodeName.toLowerCase():xe(t)&&(n=t.name),e.find((function(t){return t.name===n&&!0===t.isVoid})).length>0}},{key:"isMark",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.schema;return r.getTags("marks").includes((null!==(e=null===(n=t.nodeName)||void 0===n?void 0:n.toLowerCase())&&void 0!==e?e:t.name).toLowerCase())&&"mark"===r.getType(t)}},{key:"isInline",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.schema;return r.getTags("inlines").includes(null!==(e=null===(n=t.nodeName)||void 0===n?void 0:n.toLowerCase())&&void 0!==e?e:t.name)&&"inline"===r.getType(t)}},{key:"isBlock",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.schema;return r.getTags("blocks").includes((null!==(e=null===(n=t.nodeName)||void 0===n?void 0:n.toLowerCase())&&void 0!==e?e:t.name).toLowerCase())&&"block"===r.getType(t)}},{key:"isNestedBlock",value:function(t){if(!this.isBlock(t))return!1;var e=t.length?t[0]:t;if(!e)return!1;var n=e.firstChild;while(n){if(this.isBlock(n))return!1;n=n.nextSibling}return!0}},{key:"isRootBlock",value:function(t,e){var n;return!!(null===(n=t.parent())||void 0===n?void 0:n.isEditable())&&(!!this.isNestedBlock(t)&&(e||this.editor.schema).find((function(e){return e.name===t.name})).every((function(t){if("block"!==t.type)return!1;var e=t.allowIn;return!e||e.indexOf("$root")>-1})))}},{key:"isEmpty",value:function(t,e){var n,r;if(t.length>0&&t.isElement()){var i,o=t.attributes(),a=null!==(i=t.fragment)&&void 0!==i?i:t.get(),s=Array.from(a.querySelectorAll("".concat(St,",").concat(Et,",").concat(ot,",br")));if(o[bt]||o[yt]||s.some((function(t){return t.hasAttribute(bt)||t.hasAttribute(yt)}))&&!s.some((function(t){return t.getAttribute(J)===it})))return!1;if("br"!==t.name&&this.isVoid(t))return!1;if(s.filter((function(t){return"br"===t.localName})).length>1)return!1}var l=t.isText()?t[0].nodeValue||"":t.text();return l=null===(n=l)||void 0===n?void 0:n.replace(/\u200B/g,""),l=null===(r=l)||void 0===r?void 0:r.replace(/\r\n|\n/,""),l&&e&&(l=l.trim()),""===l}},{key:"isEmptyWithTrim",value:function(t){return this.isEmpty(t,!0)}},{key:"isEmptyWidthChild",value:function(t){if(0===t.length)return!0;if(t.isCard())return!1;if(t.isText())return this.isEmpty(t);var e=t[0].childNodes;if(0===e.length)return!0;for(var n=0;n<e.length;n++){var r=e[n];if(r.nodeType===Node.TEXT_NODE){if(""!==r["data"].replace(/\u200b/g,""))return!1}else if(r.nodeType===Node.ELEMENT_NODE){if("li"===r.nodeName.toLowerCase()&&!this.editor.list.isEmptyItem(He(r)))return!1;if(r.hasAttribute(bt))return!1;if(!this.isEmptyWidthChild(He(r)))return!1}}return!0}},{key:"isList",value:function(t){var e="string"===typeof t?t:"";return ke(t)?e=t.nodeName.toLowerCase():xe(t)&&(e=t.name),["ul","ol"].indexOf(e)>-1}},{key:"isCustomize",value:function(t){var e=this.editor.list;switch(t.name){case"li":return t.hasClass(e.CUSTOMZIE_LI_CLASS);case"ul":return t.hasClass(e.CUSTOMZIE_UL_CLASS);default:return!1}}},{key:"unwrap",value:function(t){var e=t.first(),n=[];while(e){var r=e.next();t.before(e),n.push(e),e=r}return t.remove(),n}},{key:"wrap",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.editor.mark;if(ke(t)&&(t=He(t)),e=this.clone(e,!1),t.isText())return e.append(this.clone(t,!1)),t.replaceWith(e);if(r&&this.isMark(e)){var o=this.clone(e,!1,!1);if(t.name===e.name){var a=t.attributes();delete a.style,delete a[Q],Object.keys(a).forEach((function(t){if(e.attributes(t)){var n=e.attributes(t).split(",");void 0!==n[t]&&n.indexOf(n[t])<0&&n.push(n[t]),e.attributes(t,n.join(","))}else e.attributes(t,a[t])}));var s=t.css();Object.keys(s).forEach((function(t){e.css(t)||e.css(t,s[t])})),e.append(this.clone(t,!0,!1).children())}else e.append(this.clone(t,!0,!1));var l=e.allChildren();return l.forEach((function(t){!t.isText()&&n.isMark(t)&&i.compare(t,o)&&n.unwrap(t)})),t.replaceWith(e)}var c=t.parent(),u=this.clone(t,!1,!1);return t.after(u),e.append(t),c?u.replaceWith(e):e}},{key:"merge",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t.equal(e)){if(e.isText())return t.append(e),void this.removeSide(t);var r=this.editor,i=r.block,o=r.mark,a=r.list,s=e,l=this.isList(t),c=this.isList(e.name);if(l&&!c){var u=t.find("li");if(0===u.length)return;t=He(u[u.length-1])}if(!l&&c){var d=e.find("li");d.length>0&&(e=He(d[0])),d[1]&&(s=He(d[0]))}if(this.isCustomize(t)){var h,p,f=t.first();if(!(null===(h=f)||void 0===h?void 0:h.isCard())){var g=a.getPlugins(),m=a.getPluginNameByNode(t),v=g.find((function(t){return t.constructor.pluginName===m}));(null===v||void 0===v?void 0:v.cardName)&&(a.addCardToCustomize(t,v.cardName),f=t.first())}if(this.isCustomize(e)&&!(null===(p=f)||void 0===p?void 0:p.equal(e))){var b=e.first();(null===b||void 0===b?void 0:b.isCard())&&f.attributes(bt)===b.attributes(bt)&&b.remove()}}var y=t.last(),w=e.first(),x=i.findPlugin(t);while(w){var C,k,A=w.next(),S=o.findPlugin(w);if(x&&S&&x.disableMark&&x.disableMark.indexOf(S.constructor.pluginName)>-1){var E=this.unwrap(w);E.forEach((function(e){t.append(e)}))}else if(w.isText()&&/\u200b/.test(w.text())){var O=w.parent(),T=w.prev(),_=w.next();if(!O||!this.isMark(O)&&(T&&!this.isInline(T)||_&&!this.isInline(_))){w.remove(),w=_;continue}}else if(S&&1===(null===(C=w.get())||void 0===C?void 0:C.childNodes.length)){var M=w.prev();M&&!M.isText()||w.allChildren().forEach((function(t){var e,n=t.text();t.type===ce().TEXT_NODE&&n&&!(null===(e=t.next())||void 0===e?void 0:e.isCursor())&&t.text(n.replace(/\u200b/,""))}))}w.length>0&&!w.equal(t)&&!(null===(k=w.parent())||void 0===k?void 0:k.equal(t))&&t.append(w),w=A}if(n&&s.remove(),y&&"br"===y.name){var N=y.next();while(N){if(N.isCursor()){y.remove();break}N=N.next()}}this.removeSide(t)}}},{key:"replace",value:function(t,e){var n,r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.clone(e,!1,i),a=this.isCustomize(t)&&"li"===t.name&&(null===(n=t.first())||void 0===n?void 0:n.isCard())?null===(r=t.first())||void 0===r?void 0:r.next():t.first();while(a){var s=a.next();o.append(a),a=s}return t.isText()&&o.append(t.clone()),t.replaceWith(o)}},{key:"insertText",value:function(t,e){var n,r=this.editor;if(pe(r)){var i=r.change,o=e||i.range.toTrusty(),a=ce(o.startContainer);o.collapsed||i.delete(e);var s=a.createTextNode(t);return null===(n=this.insert(s,o))||void 0===n||n.handleBr(),e||i.apply(o),o}}},{key:"insert",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(xe(t)){if(0===t.length)throw"Not found node";t=t[0]}var i=this.editor;if(pe(i)){var o=i.change,a=i.block,s=i.schema,l=i.mark;e=e||o.range.get();var c=e.cloneRange().shrinkToTextNode(),u=c.startNode,d=c.startOffset,h=u.prev(),p=u.parent(),f=u.text()||"",g=f.substr(0,d);if(u.isText()&&/\u200b$/.test(g)&&f.length>1&&(h&&!this.isInline(h)||!h&&p&&!this.isInline(p))){var m=u.get(),v=m.splitText(d-1),b=v.textContent;b&&b.length>0&&v.splitText(1),v.remove()}var y=null===p||void 0===p?void 0:p.attributes(Ct);if(!y&&u.isCard()&&e.setStartAfter(u),y&&p&&["left","right"].includes(y)){var w=i.card.find(p);w&&("left"===y?e.setStartBefore(w.root):e.setStartAfter(w.root))}if(this.isBlock(t)){var x=e,C=x.commonAncestorNode;C.isText()&&(C=i.block.closest(C));var k=null;if(this.isBlock(C)&&this.isEmpty(C))k=r?C:void 0;else{var A,S=!1;if(a.isFirstOffset(e,"start")&&(S=!0),k=a.split(e),S)k=null===(A=k)||void 0===A?void 0:A.prev()}var E=a.closest(e.startNode.isEditable()?e.cloneRange().shrinkToElementNode().shrinkToTextNode().startNode:e.startNode);if(E.isRoot()&&!e.startNode.next())E.append(t);else if(!E.isCard()&&s.isAllowIn(E.name,t.nodeName.toLowerCase()))E.find("br").remove(),E.append(t);else{var O,T=E.parent();while(T&&this.isBlock(T)&&!E.isEditable()&&!s.isAllowIn(T.name,t.nodeName.toLowerCase()))E=T,T=E.parent();var _=s.getCanMergeTags(),M=t.nodeName.toLowerCase(),N=null;if(k&&E.name===M&&_.includes(E.name)){var P;E=k;var L=document.createDocumentFragment(),D=[],j=null===(P=E.get())||void 0===P?void 0:P.nextSibling;t.childNodes.forEach((function(t){j?D.push(t):D.unshift(t)})),L.append.apply(L,D),t=L,N=L.lastChild}E.isEditable()&&0===(null===(O=E.get())||void 0===O?void 0:O.childNodes.length)?E.append(t):(this.isEmptyWidthChild(E)||a.isLastOffset(e,"start")?(E.after(t),this.isEmptyWidthChild(E)&&k&&E.remove()):(E.before(t),k&&this.isEmptyWidthChild(k)&&k.remove()),N&&(t=N))}(t instanceof Element||t instanceof DocumentFragment)&&i.nodeId.generate(t)}else{var I=a.closest(e.startNode.isEditable()?e.cloneRange().shrinkToElementNode().shrinkToTextNode().startNode:e.startNode),R=I?a.findPlugin(I):void 0;if(R){var F=He(t),B=function(t){if(n.isMark(t)){var e=l.findPlugin(t);if(!e)return;if(R.disableMark&&R.disableMark.indexOf(e.constructor.pluginName)>-1)return!0}return!1};if(F.allChildren().forEach((function(t){B(t)&&n.unwrap(t)})),B(F)){var z=F.document.createDocumentFragment();F.children().each((function(t){z.appendChild(t)})),F.remove(),t=z.childNodes[z.childNodes.length-1],e.insertNode(z)}else e.insertNode(t);if(0===F.length)return e}else e.insertNode(t)}return t.nodeType===Node.ELEMENT_NODE&&(t.hasAttribute(yt)||t.hasAttribute(bt))?e.collapse(!1):e.select(t,!this.isVoid(t)&&t.nodeType!==Node.TEXT_NODE).shrinkToElementNode().collapse(!1)}}},{key:"setAttributes",value:function(t,e){var n=e.style;for(var r in e)if("style"!==r)if("className"===r){var i=e[r];Array.isArray(i)?i.forEach((function(e){return t.addClass(e)})):t.addClass(i)}else t.attributes(r,e[r].toString());"number"===typeof n?n={}:"string"===typeof n&&(n=Gt(n)),n=n||{};var o=Object.keys(n);for(var a in n){var s=n[a];/^0(px|em)?$/.test(s.toString())&&(s=""),t.css(a,s.toString())}return 0!==o.length&&0!==Object.keys(t.attributes("style")).length||t.removeAttributes("style"),t}},{key:"removeMinusStyle",value:function(t,e){if(t.isElement()){var n=t.css();if(n[e]){var r=parseInt(n[e]||"0",10)||0;r<0&&t.css(e,"")}}}},{key:"mergeChild",value:function(t){var e=this.editor,n=e.schema,r=e.list,i=n.getAllowInTags(),o=t.first();while(o){var a=o.next();while(a&&o.name===a.name&&(i.indexOf(o.name)>-1&&!this.isList(o)||this.isList(o)&&r.isSame(o,a))){var s=a.next(),l=a.first();while(l){var c=l.next();o.append(l),l=c}a.remove(),this.mergeChild(o),a=s}o=a}}},{key:"removeSide",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"br",n=t.first();(null===n||void 0===n?void 0:n.name)===e&&t.children().toArray().filter((function(t){return!t.isCursor()})).length>1&&n.remove();var r=t.last();(null===r||void 0===r?void 0:r.name)===e&&t.children().toArray().filter((function(t){return!t.isCursor()})).length>1&&r.remove()}},{key:"flat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.editor.block,r=t.first(),i=t.fragment?He("<p />"):this.clone(t,!1);while(r){var o=r.next();if(r.isBlockCard()||this.isNestedBlock(r))n.flat(r,e);else if(this.isBlock(r))r=this.flat(r,e);else{var a=this.clone(i,!1),s="li"===a.name;r.before(a);while(r){var l,c;o=r.next();var u="br"===r.name&&!s;if(u&&(null===(l=r.parent())||void 0===l?void 0:l.isRoot())&&a.append(r),r.isText()){var d=r.text(),h=/^((\n|\r)+)/.exec(d),p=!1;if(h&&(d=d.substring(h[1].length),p=!0,0===d.length&&r.remove()),h=/((\n|\r)+)$/.exec(d),h){r.text(d.substr(0,h.index)),a.append(r);break}p&&r.length>0&&r.text(d)}if(r.length>0&&a.append(r),null===(c=o)||void 0===c?void 0:c.isText()){var f=o.text(),g=/^(\n|\r)+/.exec(f);if(g)break}if(u||!o||this.isBlock(o)||o.isBlockCard())break;r=o}this.removeSide(a),n.flat(a,e),this.addBrForBlock(a)}this.addBrForBlock(r),this.removeSide(r),r=o}return t.fragment&&(t=He(t.fragment)),r=t.first(),r||t.remove(),t}},{key:"normalize",value:function(t){return t=this.flat(t),this.mergeChild(t),t}},{key:"html",value:function(t,e){var n,r=this;return void 0===e?t.length>0&&(null===(n=t.get())||void 0===n?void 0:n.innerHTML)||"":(t.each((function(t){t instanceof Element&&(t.innerHTML=e,r.editor.nodeId.generateAll(t))})),t)}},{key:"clone",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.editor.nodeId,i=[];return t.each((function(t){var o=t.cloneNode(e),a=He(o);n||(r.generateAll(a,!0),r.isNeed(a)&&r.generate(a,!0)),i.push(o)})),He(i)}},{key:"getBatchAppendHTML",value:function(t,e){var n;if(0===t.length)return e;var r=e.startsWith("\\u")||e.startsWith("&#")?He(e,null):He(e);return t.forEach((function(t){t=t.clone(!1),t.append(r),r=t})),(null===(n=r.get())||void 0===n?void 0:n.outerHTML)||""}},{key:"removeZeroWidthSpace",value:function(t){var e=this;t.traverse((function(t){var n=t[0];if(n.nodeType===Node.TEXT_NODE){var r=n.nodeValue;if(2===(null===r||void 0===r?void 0:r.length)){var i=n.nextSibling,o=n.previousSibling;if(!(8203===r.charCodeAt(1)&&i&&i instanceof Element&&[dt,ht,pt].indexOf(i.getAttribute(J)||"")>=0)){var a=t.parent();if((8203!==r.charCodeAt(1)||!(!i&&a&&e.isInline(a)||i&&e.isInline(i)))&&(8203!==r.charCodeAt(0)||!(!o&&a&&e.isInline(a)||o&&e.isInline(o)))&&8203===r.charCodeAt(0)){var s,l,c=n.splitText(1);c.previousSibling&&(null===(s=null!==(l=c.parentElement)&&void 0!==l?l:c.parentNode)||void 0===s||s.removeChild(c.previousSibling))}}}}}))}}]),t}(),Ke=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Object(c["a"])(this,t),this.range=void 0,this.editor=void 0,this.key="",this.anchor=null,this.focus=null,this.editor=e,this.range=n,this.key=r}return Object(u["a"])(t,[{key:"has",value:function(){return!!this.focus&&!!this.anchor}},{key:"create",value:function(){var t=this.range,e=t.commonAncestorNode,n=t.startNode,r=t.endNode;if(e.isEditable()||e.inEditor()){var i=e.document;if(i){var o=e.closest(et);if(this.key)o.find('[data-anchor-id="'.concat(this.key,'"]')).remove(),o.find('[data-focus-id="'.concat(this.key,'"]')).remove(),o.find('[data-cursor-id="'.concat(this.key,'"]')).remove();else{var a=o.find(ft);a.each((function(t,e){var n=a.eq(e);n&&!n.attributes("data-anchor-id")&&n.remove()}));var s=o.find(gt);s.each((function(t,e){var n=s.eq(e);n&&!n.attributes("data-focus-id")&&n.remove()}));var l=o.find(mt);l.each((function(t,e){var n=l.eq(e);n&&!n.attributes("data-cursor-id")&&n.remove()}))}var c=n.closest(St);if(c.length>0){var u=n.closest(Ot);u.length>0&&this.range.setStartBefore(c);var d=n.closest(_t);d.length>0&&this.range.setStartAfter(c)}if(!n.equal(r)){var h=r.closest(St);if(h.length>0){var p=r.closest(Ot);p.length>0&&this.range.setEndBefore(h);var f=r.closest(_t);f.length>0&&this.range.setEndAfter(h)}}if(this.range.collapsed){var g=He(i.createElement("span"));return g.attributes(J,pt),this.key&&g.attributes("data-cursor-id",this.key),this.range.insertNode(g),this.anchor=g,void(this.focus=g)}var m=this.range.cloneRange();m.collapse(!0);var v=He(i.createElement("span"));v.attributes(J,dt),this.key&&v.attributes("data-anchor-id",this.key),m.insertNode(v),this.range.setStartAfter(v);var b=this.range.cloneRange();b.collapse(!1);var y=He(i.createElement("span"));y.attributes(J,ht),this.key&&y.attributes("data-focus-id",this.key),b.insertNode(y),this.anchor=v,this.focus=y}}}},{key:"move",value:function(){var t,e;if(this.focus&&this.anchor){if(this.key){var n,r,i=this.range.commonAncestorNode,o=i.closest(et);this.focus.inEditor()&&(null===(n=this.focus.get())||void 0===n?void 0:n.isConnected)||(this.focus=o.find("[data-".concat(this.focus.attributes(J),'-id="').concat(this.key,'"]'))),this.anchor.inEditor()&&(null===(r=this.anchor.get())||void 0===r?void 0:r.isConnected)||(this.anchor=o.find("[data-".concat(this.anchor.attributes(J),'-id="').concat(this.key,'"]')))}var a=this.editor.node;if((null===(t=this.anchor.get())||void 0===t?void 0:t.isConnected)||(this.anchor=this.range.commonAncestorNode.find("[".concat(J,'="anchor"]'))),(null===(e=this.focus.get())||void 0===e?void 0:e.isConnected)||(this.focus=this.range.commonAncestorNode.find("[".concat(J,'="focus"]'))),this.anchor.equal(this.focus)){var s,l=this.anchor,c=l.parent();if(!c)return;a.removeZeroWidthSpace(c),c[0].normalize();var u=!1,d=l.prev(),h=l.next();if(d&&d.isCard()){var p=d.find(_t);p.length>0&&(this.range.select(p,!0),this.range.collapse(!1),u=!0)}else if(h&&h.isCard()){var f=h.find(Ot);f.length>0&&(this.range.select(f,!0),this.range.collapse(!1),u=!0)}return u||(this.range.setStartBefore(l[0]),this.range.collapse(!0)),Lt?(c[0].normalize(),l.remove()):(l.remove(),c[0].normalize()),void("p"===c.name&&0===(null===(s=c.get())||void 0===s?void 0:s.childNodes.length)&&c.append(He("<br />")))}var g,m=this.anchor.parent();if(m&&(a.removeZeroWidthSpace(m),this.anchor.length>0&&this.range.setStartBefore(this.anchor),this.anchor.remove(),m[0].normalize()),m=this.focus.parent(),m)if(a.removeZeroWidthSpace(m),this.focus.length>0&&this.range.setEndBefore(this.focus),this.focus.remove(),m[0].normalize(),"p"===m.name&&0===(null===(g=m.get())||void 0===g?void 0:g.childNodes.length)&&m.append(He("<br />")),It){var v=window.getSelection();null===v||void 0===v||v.removeAllRanges(),null===v||void 0===v||v.addRange(this.range.base)}}}},{key:"getNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"center",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0},i=n?t.clone(!0):t;if(!this.focus||!this.anchor)return i;if("left"===e||"center"===e){var o="center"!==e?this.anchor:this.focus,a=He(this.key?"[data-".concat(o.attributes(J),'-id="').concat(this.key,'"]'):"[".concat(J,"=").concat(o.attributes(J),"]"),i.get());this.key||(a=a.toArray().find((function(t){return!t.attributes("data-".concat(o.attributes(J),"-id"))})));var s=!1;i.traverse((function(t){if(a&&t.equal(a)){var e,n=t.parent();return a.remove(),"p"===(null===n||void 0===n?void 0:n.name)&&0===(null===(e=n.get())||void 0===e?void 0:e.childNodes.length)&&n.append(He("<br />")),void(s=!0)}s&&r(t)&&(t.attributes(J)!==o.attributes(J)||"cursor"===o.attributes(J))&&t.remove()}),!0)}if("right"===e||"center"===e){var l="center"!==e?this.focus:this.anchor,c=He(this.key?"[data-".concat(l.attributes(J),'-id="').concat(this.key,'"]'):"[".concat(J,"=").concat(l.attributes(J),"]"),i.get());this.key||(c=c.toArray().find((function(t){return!t.attributes("data-".concat(l.attributes(J),"-id"))})));var u=!1;i.traverse((function(t){if(c&&t.equal(c)){var e,n=t.parent();return c.remove(),"p"===(null===n||void 0===n?void 0:n.name)&&0===(null===(e=n.get())||void 0===e?void 0:e.childNodes.length)&&n.append(He("<br />")),void(u=!0)}u&&r(t)&&(t.attributes(J)!==l.attributes(J)||"cursor"===l.attributes(J))&&t.remove()}),!1)}return i}}]),t}();Ke.removeTags=function(t){return t.replace(/<anchor\s*\/>/gi,"").replace(/<focus\s*\/>/gi,"").replace(/<cursor\s*\/>/gi,"")};var Ze=function(t,e,n){var r=ke(t)?t:t[0];if(r.nodeType===Node.ELEMENT_NODE){var i=r.getAttribute(J)||"";if([pt,dt,ht].indexOf(i)>-1)return!0;if(r.getAttribute(st)||i===nt)return!0;var o=r.parentElement,a=(null===o||void 0===o?void 0:o.getAttribute(J))||"";if(i===tt||a===tt)return!1;var s=Se(r),l=null===o||void 0===o?void 0:o.getAttribute(kt);if(l&&o&&(null===n||void 0===n||n.push(He(o))),!s&&o&&Se(o)&&!Te(o))return!0;if(e){if(s)return!1;var c=e.find((function(e){return e===t[0]}));if(c)return c["__card_root"]&&(null===n||void 0===n||n.push(c["__card_root"])),!0}var u=Le(r,"".concat(St,",").concat(rt),he);if(!u||!(u instanceof Element))return!1;if(u.getAttribute(J)===nt)return!0;if(u.getAttribute(kt)&&(null===n||void 0===n||n.push(He(u))),!s&&Se(u)&&!Te(u))return!0;if(!s||Te(r)||!o)return!1;var d=Le(o,St,he);if(!d||!(d instanceof Element))return!1;var h=d.getAttribute(kt);if(h&&d&&(null===n||void 0===n||n.push(He(d))),d&&Se(d)&&!Te(d))return!0}return!1},Je=function(t,e){var n=ke(t)?t:t[0];if(_e(n))return!0;if(Se(n)&&["id","class","style",kt,At].includes(e))return!0;var r=n.getAttribute(at);return!!("*"===r||r&&r.split(",").some((function(t){return t.trim().toLowerCase()===e.toLowerCase()})))},Qe=function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i=t[n+1];tn(r,i)?n++:e.push(r)}return e},tn=function(t,e){var n=t,r=t,i=e,o=e,a=t,s=t,l=e,c=e;return!(!t||!e)&&(n.li&&o.ld?A()(n.li,o.ld)&&A()(t.p,e.p):r.ld&&i.li?A()(r.ld,i.li)&&A()(t.p,e.p):a.si&&c.sd?A()(a.si,c.sd)&&(A()(t.p,e.p)||en(t.p,e.p,a.si.length)||en(e.p,t.p,a.si.length)):!(!s.sd||!l.si)&&(A()(s.sd,l.si)&&A()(t.p,e.p)))},en=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t.length!==e.length)return!1;var r=e.slice();return r[r.length-1]=r[r.length-1]-n,A()(t.slice(),r)},nn=function t(e){var n=document.createDocumentFragment(),r=null,i=0,o=null;for("string"===typeof e[0]&&(r=e[0],i=1);i<e.length;i++)if(Array.isArray(e[i])){var a=e[i-1];if(a&&"[object Object]"===a.toString()&&Object.keys(a).includes(yt))continue;var s=t(e[i]);s&&n.appendChild(s)}else if("[object Object]"===e[i].toString()){if(r){for(var l in o=document.createElement(r),e[i]){var c;null===(c=o)||void 0===c||c.setAttribute(Jt(l),Kt(e[i][l]))}var u,d,h=Object.keys(e[i]);if(h.indexOf(bt)>-1&&h.indexOf(yt)<0)null===(u=o)||void 0===u||u.setAttribute(yt,e[i][bt]),null===(d=o)||void 0===d||d.removeAttribute(bt)}}else if("number"===typeof e[i]||"string"===typeof e[i]){var p=document.createTextNode(e[i].toString());n.appendChild(p)}return!o&&r&&(o=document.createElement(r)),o?(o.appendChild(n),o):n.childNodes[0]},rn=function(t,e){t instanceof Node||(t=t[0]);var n=t.childNodes;if(0!==n.length)for(var r=0;r<n.length;r++){var i=n.item(r);if(i){var o=on(i);o&&e.push(o)}}},on=function(t){var e;if(t instanceof Node||(t=t[0]),!Ze(t)){var n=t,r=n.nodeValue;if(t instanceof Element){var i=t.attributes;e=[t.nodeName.toLowerCase()];for(var o={},a=0;i&&a<i.length;a++){var s=i[a],l=s.name,c=s.specified,u=s.value;c&&!Je(t,l)&&("style"===l&&t instanceof HTMLElement?o["style"]=Ut(t.style.cssText||u):"string"===typeof u&&(o[l]=u))}return e.push(o),rn(t,e),e}if(t instanceof Text)return String(r)}},an=function(t,e,n){if(0===e.length)return t;for(var r=t,i=!n,o=0;o<e.length&&void 0!==r;o++)r=r[e[o]],!i&&n&&Array.isArray(r)&&r.length>0&&r[1][Q]===n&&(i=!0);return i?r:void 0},sn=function t(e,n){if(!Array.isArray(e)||e.length<1)return null;for(var r=1;r<e.length;r++)if(1===r){var i=e[r];if("object"===Object(a["a"])(i)&&n&&n(i))return{path:[],name:e[0],attributes:i,children:e.slice(r+1)}}else if(Array.isArray(e[r])){var o=t(e[r],n);if(o)return o.path.unshift(r),o}return null},ln=function(t,e){var n=sn(t,(function(t){return!!t["data-card-key"]&&(!e||e(t))}));if(n){var r=n.attributes,i=n.children;return{attributes:r,rendered:Array.isArray(i)&&Array.isArray(i[2])&&Array.isArray(i[2][2])}}},cn=function(){function t(e,n){var r=this;Object(c["a"])(this,t),this.editor=void 0,this.base=void 0,this.toRange=function(){return r.base},this.collapse=function(t){return r.base.collapse(t),r},this.cloneRange=function(){return t.from(r.editor,r.base.cloneRange())},this.select=function(t,e){return e?r.base.selectNodeContents(xe(t)?t[0]:t):r.base.selectNode(xe(t)?t[0]:t),r},this.getText=function(){var t=r.cloneContents();return t.textContent},this.getClientRect=function(){var t=r.getClientRects().item(0);return t||(t=r.getBoundingClientRect()),t},this.enlargeFromTextNode=function(){var t=function(t,e,n){var i;if(t.nodeType===Node.TEXT_NODE)if(0===e)switch(n){case"start":r.setStartBefore(t);break;case"end":r.setEndBefore(t);break}else if(e===(null===(i=t.nodeValue)||void 0===i?void 0:i.length))switch(n){case"start":r.setStartAfter(t);break;case"end":r.setEndAfter(t);break}};return t(r.startContainer,r.startOffset,"start"),t(r.endContainer,r.endOffset,"end"),r},this.shrinkToTextNode=function(){var t=function(t,e,n){if(t.nodeType===Node.ELEMENT_NODE){var i=t.childNodes;if(0!==i.length){var o,a,s,l;if(e>0&&(o=i[e-1]),e<i.length&&(a=i[e]),o&&o.nodeType===Node.TEXT_NODE)s=o,e=(null===(l=s.nodeValue)||void 0===l?void 0:l.length)||0;if(a&&a.nodeType===Node.TEXT_NODE&&(s=a,e=0),s)switch(n){case"start":r.setStart(s,e);break;case"end":r.setEnd(s,e);break}}}};return t(r.startContainer,r.startOffset,"start"),t(r.endContainer,r.endOffset,"end"),r},this.enlargeToElementNode=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=r.enlargeFromTextNode(),i=r.editor.node,o=function(r,o,a){var s,l,c=He(r);if(!(c.type===Node.TEXT_NODE||!t&&i.isBlock(c)||c.isEditable()))if(0===o){while(!c.prev()){if(l=c.parent(),!l||!t&&i.isBlock(l))break;if(!l.inEditor()||l.isEditable())break;if(!e){if(!t&&l.isElement())break;if(t&&i.isBlock(l))break}c=l}a?n.setStartBefore(c[0]):n.setEndBefore(c[0])}else if(o===(null===(s=c.get())||void 0===s?void 0:s.childNodes.length)){while(!c.next()){if(l=c.parent(),!l||!t&&i.isBlock(l))break;if(!l.inEditor()||l.isEditable())break;if(!e){if(!t&&l.isElement())break;if(t&&i.isBlock(l))break}c=l}a?n.setStartAfter(c[0]):n.setEndAfter(c[0])}};return o(n.startContainer,n.startOffset,!0),o(n.endContainer,n.endOffset,!1),r},this.shrinkToElementNode=function(){var t,e,n=r.editor.node;while(r.startContainer.nodeType===Node.ELEMENT_NODE&&(t=r.startContainer.childNodes[r.startOffset])&&(e=He(t))&&t.nodeType===Node.ELEMENT_NODE&&!e.isCursor()&&!n.isVoid(t)&&(!e.isCard()||e.isEditableCard()||e.find(Ot).length>0))r.setStart(t,0);while(r.endContainer.nodeType===Node.ELEMENT_NODE&&r.endOffset>0&&(t=r.endContainer.childNodes[r.endOffset-1])&&(e=He(t))&&t.nodeType===Node.ELEMENT_NODE&&!n.isVoid(t)&&!e.isCursor()&&(!e.isCard()||e.isEditableCard()||e.find(_t).length>0))r.setEnd(t,t.childNodes.length);return r},this.createSelection=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=new Ke(r.editor,r,t);return e.create(),e},this.getSubRanges=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=[];return r.commonAncestorNode.traverse((function(o){if(o.isText()){var a,s=0,l=o.get(),c=(null===(a=l.nodeValue)||void 0===a?void 0:a.length)||0,u=r.comparePoint(l,s),d=r.comparePoint(l,c),h=t.create(r.editor);if(u<0){if(d<0)return;0===d?h.setOffset(l,r.startOffset,c):h.setOffset(l,r.startOffset,r.endOffset)}else{if(0!==u)return;if(d<0)return;0===d?h.setOffset(l,s,c):h.setOffset(l,s,r.endOffset)}i.push(h)}else if(e&&o.isCard()&&!o.isEditableCard()){var p,f=r.editor.card.find(o);if(!f||n&&!1===f.constructor.singleSelectable)return;var g=f.getCenter(),m=g.get(),v=null!==(p=null===m||void 0===m?void 0:m.parentElement)&&void 0!==p?p:null===m||void 0===m?void 0:m.parentNode;if(!v||!g.inEditor())return;var b=g.index(),y=o.get(),w=r.comparePoint(v,b),x=r.comparePoint(v,b+1),C=t.create(r.editor);if(w<0){if(x<0)return;0===x?C.setOffset(y,r.startOffset,b+1):C.setOffset(y,r.startOffset,r.endOffset)}else{if(0!==w)return;if(x<0)return;0===x?C.setOffset(v,b,b+1):C.setOffset(v,b,r.endOffset)}i.push(C)}})),0===i.length&&i.push(r),i},this.setOffset=function(t,e,n){return xe(t)&&(t=t[0]),r.setStart(t,e),r.setEnd(t,n),r},this.findElements=function(){var t=r.startContainer,e=r.endContainer,n=r.startOffset,i=r.endOffset,o=r.collapsed,a=[];if(t!==e||!0===o||t.nodeType===Node.TEXT_NODE)return a;for(var s=t.childNodes,l=n;l<i;l++)a.push(s[l]);return a},this.inCard=function(){var t=r.startNode.closest(St);return t&&t.length>0},this.getStartOffsetNode=function(){var t=r.startContainer,e=r.startOffset;return(t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE)&&(t.childNodes[e]||t.childNodes[e-1])||t},this.getEndOffsetNode=function(){var t=r.endContainer,e=r.endOffset;return(t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE)&&(t.childNodes[e]||t.childNodes[e-1])||t},this.scrollIntoView=function(){var t=r.endNode.get();Rt&&t&&t.scrollIntoView&&t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},this.scrollRangeIntoView=function(){var t,e=r.getEndOffsetNode(),n=e.nodeType===Node.TEXT_NODE?null!==(t=e.parentElement)&&void 0!==t?t:e.parentNode:e,i=r.collapsed?n.getBoundingClientRect():r.getClientRect(),o=window.innerHeight;(i.bottom>=o||i.bottom<=0)&&n.scrollIntoView({block:"center"})},this.scrollIntoViewIfNeeded=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.editor.container,e=arguments.length>1?arguments[1]:void 0;if(r.collapsed)t.scrollIntoView(He(r.getEndOffsetNode()));else{var n=r.getStartOffsetNode(),i=r.getEndOffsetNode();He(n).scrollIntoView(e),He(i).scrollIntoView(e)}},this.containsCard=function(){var t=r.collapsed,e=r.commonAncestorNode;return!t&&(3!==e.type&&e.find(St).length>0||e.closest(St).length>0)},this.handleBr=function(t){var e,n=r.editor,i=n.list,o=n.block.closest(r.commonAncestorNode);o.find("br").each((function(e){var n,r=He(e),o=r.prev(),a=r.next(),s=r.parent();if((!o||(null===s||void 0===s?void 0:s.hasClass(i.CUSTOMZIE_LI_CLASS))&&(null===s||void 0===s||null===(n=s.first())||void 0===n?void 0:n.equal(o)))&&a&&"br"!==a.name&&!a.isCursor()||!a&&o&&"br"!==o.name){var l;if(t&&o&&(!(null===s||void 0===s?void 0:s.hasClass(i.CUSTOMZIE_LI_CLASS))||!(null===s||void 0===s||null===(l=s.first())||void 0===l?void 0:l.equal(r.prev()))))return;r.remove()}}));var a,s=o.first(),l=o.children();if(!s||1===l.length&&o.hasClass(i.CUSTOMZIE_LI_CLASS)&&(null===s||void 0===s?void 0:s.isCard()))return o.append(He("<br />")),r;if(1===l.length&&s.isText()&&0===s.text().replace(/\r\n|\n|\t|\u200b/g,"").length)return o.html("<br />"),r;2===l.length&&o.hasClass(i.CUSTOMZIE_LI_CLASS)&&(null===s||void 0===s?void 0:s.isCard())&&["cursor","anchor","focus"].includes((null===(e=o.last())||void 0===e?void 0:e.attributes(J))||"")&&(null===(a=o.first())||void 0===a||a.after("<br />"));return r},this.getPrevNode=function(){r.enlargeFromTextNode();var t=r.startNode,e=r.startOffset;if(!t.isText()){var n=t.children();if(0!==n.length)return n.eq(e-1)}},this.getNextNode=function(){r.enlargeFromTextNode();var t=r.endNode,e=r.endOffset;if(!t.isText()){var n=t.children();if(0!==n.length)return n.eq(e)}},this.editor=e,this.base=n}return Object(u["a"])(t,[{key:"collapsed",get:function(){return this.base.collapsed}},{key:"endOffset",get:function(){return this.base.endOffset}},{key:"startOffset",get:function(){return this.base.startOffset}},{key:"startContainer",get:function(){return this.base.startContainer}},{key:"endContainer",get:function(){return this.base.endContainer}},{key:"commonAncestorContainer",get:function(){return this.base.commonAncestorContainer}},{key:"cloneContents",value:function(){return this.base.cloneContents()}},{key:"deleteContents",value:function(){return this.base.deleteContents()}},{key:"extractContents",value:function(){return this.base.extractContents()}},{key:"getBoundingClientRect",value:function(){return this.base.getBoundingClientRect()}},{key:"getClientRects",value:function(){return this.base.getClientRects()}},{key:"insertNode",value:function(t){var e,n;xe(t)&&(t=t[0]);var r,i=this.startNode;He(t).isCursor()||1!==(null===(e=i.get())||void 0===e?void 0:e.childNodes.length)||"br"!==(null===(n=i.first())||void 0===n?void 0:n.name)?"br"===i.name&&i.remove():null===(r=i.first())||void 0===r||r.remove();t.nodeType!==Node.TEXT_NODE&&"BR"!==t.nodeName||!i.isEditable()||this.shrinkToElementNode().shrinkToTextNode(),(t instanceof Element||t instanceof DocumentFragment)&&this.editor.nodeId.generate(t),this.base.insertNode(t)}},{key:"isPointInRange",value:function(t,e){return xe(t)&&(t=t[0]),this.base.isPointInRange(t,e)}},{key:"comparePoint",value:function(t,e){return xe(t)&&(t=t[0]),this.base.comparePoint(t,e)}},{key:"setEnd",value:function(t,e){return xe(t)&&(t=t[0]),this.base.setEnd(t,e)}},{key:"setEndAfter",value:function(t){if(xe(t)&&(t=t[0]),t.parentNode)return this.base.setEndAfter(t)}},{key:"setEndBefore",value:function(t){if(xe(t)&&(t=t[0]),t.parentNode)return this.base.setEndBefore(t)}},{key:"setStart",value:function(t,e){return xe(t)&&(t=t[0]),this.base.setStart(t,e)}},{key:"setStartAfter",value:function(t){if(xe(t)&&(t=t[0]),t.parentNode)return this.base.setStartAfter(t)}},{key:"setStartBefore",value:function(t){if(xe(t)&&(t=t[0]),t.parentNode)return this.base.setStartBefore(t)}},{key:"toString",value:function(){return this.base.toString()}},{key:"startNode",get:function(){return He(this.base.startContainer)}},{key:"endNode",get:function(){return He(this.base.endContainer)}},{key:"commonAncestorNode",get:function(){return He(this.base.commonAncestorContainer)}},{key:"deepCut",value:function(){this.collapsed||this.extractContents();var t=this.startNode;if(!t.isEditable()){var e=t;if(e&&!e.isEditable()){var n=e.parent();while(n&&!n.isEditable())e=n,n=n.parent();this.setEndAfter(e[0]);var r=this.extractContents();this.insertNode(r),this.collapse(!0)}}}},{key:"equal",value:function(t){return this.startContainer===t.startContainer&&this.startOffset===t.startOffset&&this.endContainer===t.endContainer&&this.endOffset===t.endOffset}},{key:"getRootBlock",value:function(){if(this.startNode.isEditable())return this.startNode.children().eq(this.startOffset);var t=this.startNode;while((null===(e=t)||void 0===e?void 0:e.parent())&&!t.parent().isEditable()){var e;t=t.parent()}return t}},{key:"filterPath",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=[];return function(r){var i=He(r);if(e&&r instanceof HTMLElement&&~["left","right","center","body"].indexOf(r.getAttribute("data-element")||"")){var o=t.editor.card.closest(i);return o&&o.length>0&&n.push(o),!0}return!!(e&&i.isCard()&&n.includes(i))||!Ze(i)}}},{key:"toPath",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.editor.container,r=this.cloneRange(),i=r.commonAncestorNode;if(i.isRoot()||i.inEditor()){r.shrinkToElementNode().shrinkToTextNode();var o=function(r,i){var o,a=r.attributes(Q),s=a?0:-1,l=r.getPath(n,(null===(o=r.parent())||void 0===o?void 0:o.isRoot())?void 0:t.filterPath(e),(function(t,e,n){if(-1===t)return a="",s=-1,[];a||(a=n.attributes(Q),s=e.length),e.unshift(t)}));return s=l.length-s,l.push(i),{path:l,id:a,bi:s}};return{start:o(r.startNode,r.startOffset),end:o(r.endNode,r.endOffset)}}}}]),t}();cn.create=void 0,cn.from=void 0,cn.fromPath=void 0,cn.create=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,r=arguments.length>2?arguments[2]:void 0;return e=r?n.caretRangeFromPoint(r.x,r.y):n.createRange(),cn.from(t,e)},cn.from=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;if(!dn(e)){var n=un(e)?e:e.getSelection();if(!(n&&n.rangeCount>0))return null;e=n.getRangeAt(0)}return new cn(t,e)},cn.fromPath=function(t,e){var n,r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.container,a=e.start.path.slice(),s=e.end.path.slice(),l=a.pop(),c=s.pop(),u=function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.container.get(),r=n,o=0;o<e.length;o++){var a=e[o];a<0&&(a=0);var s=void 0,l=r.firstChild,c=0;while(l)if(!(l instanceof Element)||!l.getAttribute(st)&&l.getAttribute(J)!==nt||i&&["left","right"].includes(l.getAttribute(Ct)||"")){if(c===a||!l.nextSibling){s=l;break}c++,l=l.nextSibling}else l=l.nextSibling;if(!s)break;r=s}return r},d=function(t,e,n,r){if(null!==n){var i,o;if(r<0&&(r=0),n.nodeType===Node.ELEMENT_NODE&&r>n.childNodes.length&&(r=n.childNodes.length),n.nodeType===Node.TEXT_NODE&&r>((null===(i=n.nodeValue)||void 0===i?void 0:i.length)||0))r=(null===(o=n.nodeValue)||void 0===o?void 0:o.length)||0;e[t](n,r)}},h=e.start.id?null===(n=o.get())||void 0===n?void 0:n.querySelector("[".concat(Q,'="').concat(e.start.id,'"]')):o.get(),p=u(e.start.bi>-1&&h instanceof Element?a.slice(e.start.bi):a,h instanceof Element?h:void 0),f=e.end.id?null===(r=o.get())||void 0===r?void 0:r.querySelector("[".concat(Q,'="').concat(e.end.id,'"]')):o,g=u(e.end.bi>-1&&f instanceof Element?s.slice(e.end.bi):s,f instanceof Element?f:void 0),m=cn.create(t,document);return d("setStart",m,p,void 0===l?0:l),d("setEnd",m,g,void 0===c?0:c),m};var un=function(t){return void 0!==t.getRangeAt},dn=function(t){return void 0!==t.collapsed},hn=function(t){return!!t&&void 0!==t.base};function pn(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var fn=".data-drop-cursor {\n\tposition: absolute;\n\twidth: 2px;\n\tbackground-color: #347EFF;\n}\n\ndiv.data-drag-image {\n\tbackground-color: #f9f9f9;\n}";pn(fn);var gn,mn,vn,bn=function(){function t(e,n){Object(c["a"])(this,t),this.x=0,this.y=0,this.doc=document,this.range=void 0,this.caretRange=void 0,this.targetCard=void 0,this.caretCard=void 0,this.isCardLeftRange=!1,this.engine=void 0,this.options={className:"data-drop-cursor"},this.engine=e,this.options=Object(l["a"])(Object(l["a"])({},this.options),n)}return Object(u["a"])(t,[{key:"getRangeForPoint",value:function(){var t=this.doc,e=this.x,n=this.y;if(void 0!==t.caretRangeFromPoint){var r=cn.create(this.engine,t,{x:e,y:n});if(r)return r}if(event&&void 0!==event["rangeParent"]){var i=cn.create(this.engine,t);return i.setStart(event["rangeParent"],event["rangeOffset"]),i.collapse(!0),i}}},{key:"getCard",value:function(){return this.targetCard||this.caretCard}},{key:"parseEvent",value:function(t){t.preventDefault(),t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.dropEffect="move");var e=this.engine.card;this.x=t.clientX,this.y=t.clientY;var n=He(t.target||[]);this.doc=n.document||document,this.targetCard=e.find(n),this.caretRange=this.getRangeForPoint(),this.caretCard=this.caretRange?e.find(this.caretRange.commonAncestorContainer):void 0}},{key:"getRange",value:function(){var t,e=this.caretRange,n=this.doc,r=this.x,i=this.getCard();if(i&&i.root.length>0){t=cn.create(this.engine,n);var o=i.root.getBoundingClientRect()||{left:0,right:0},a=o.left,s=o.right,l=(a+s)/2;t.select(i.root.get()),l<r?(t.collapse(!1),this.isCardLeftRange=!1):(t.collapse(!0),this.isCardLeftRange=!0)}return this.range=t||e,this.range}},{key:"getRect",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,r=this.isCardLeftRange,i=this.range,o=this.getCard();if(o&&o.root.length>0&&i){if(r){i.setEnd(i.commonAncestorContainer,i.endOffset+1);var a=i.getBoundingClientRect(),s=a.left,l=a.bottom,c=a.top;return i.setEnd(i.commonAncestorContainer,i.endOffset-1),{x:s-n,y:c,height:l-c}}i.setStart(i.commonAncestorContainer,i.startOffset-1);var u=i.getBoundingClientRect(),d=u.right,h=u.top,p=u.bottom;return i.setStart(i.commonAncestorContainer,i.startOffset+1),{x:d-n,y:h,height:p-h}}var f=null===(t=this.range)||void 0===t?void 0:t.getBoundingClientRect();if(0===(null===(e=f)||void 0===e?void 0:e.height)){var g,m=null===(g=this.range)||void 0===g?void 0:g.startContainer;f=m.getBoundingClientRect()}var v=f||{},b=v.left,y=v.top,w=v.bottom;return{x:b,y:y,height:(w||0)-(y||0)}}},{key:"getCursor",value:function(){var t=this.options.className;return He("body > div.".concat(t))}},{key:"removeCursor",value:function(){this.getCursor().remove()}},{key:"setCursor",value:function(){this.removeCursor();var t=this.options.className,e=He('<div class="'.concat(t,'" />'));He(document.body).append(e)}}]),t}(),yn=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(c["a"])(this,t),this.events={},this.globalEvents={},this.engine=void 0,this.isComposing=void 0,this.isSelecting=void 0,this.dragoverHelper=void 0,this.options=void 0,this.keydownRange=null,this.engine=e,this.isComposing=!1,this.isSelecting=!1,this.dragoverHelper=new bn(e),this.options=n}return Object(u["a"])(t,[{key:"isCardInput",value:function(t){var e=t.target?He(t.target):null;while(e){if(e.isEditable())return!1;if("center"===e.attributes(Ct))return!0;if(e.attributes(J)===nt)return!0;var n=e.parent();if(!n)break;e=n}return!1}},{key:"onInput",value:function(t){var e=this,n=this.options.bindInput;if(!n||n()){var r=null;this.onContainer("compositionstart",(function(t){if(!e.engine.readonly){e.isCardInput(t)||e.engine.ot.startMutationCache();var n=e.engine,r=n.change,i=n.node,o=n.block,a=n.list,s=r.range.get().cloneRange().shrinkToTextNode().enlargeToElementNode();if(!s.collapsed){var l,c=o.closest(s.startNode),u=o.closest(s.endNode);if((i.isCustomize(c)||i.isCustomize(u))&&!c.equal(u))null===(l=a.backspaceEvent)||void 0===l||l.trigger(new KeyboardEvent(""))}e.isComposing=!0}}));var i=function(n){if(!e.isComposing){if(Bt&&r){var i=r.first(),o=null===i||void 0===i?void 0:i.next();if(null===o||void 0===o?void 0:o.isText()){var a=o.text();if(/^\u200b/.test(a)){var s=o.get();null===s||void 0===s||s.splitText(1),null===s||void 0===s||s.remove()}}var l=e.engine.change.range.get(),c=l.startNode,u=l.startOffset;if(l.collapsed&&(null===c||void 0===c?void 0:c.isText())){var d=c.text(),h=d.substring(u);/^\u200b/.test(h)&&(c.text(d.substring(0,u)+h.substring(1)),l.setOffset(c,u,u),e.engine.change.range.select(l))}r=null}t(n),e.engine.ot.submitMutationCache()}};this.onContainer("compositionend",(function(t){e.engine.readonly||(e.isComposing=!1,setTimeout((function(){e.engine.ot.isCache&&i(t)}),40))})),this.onContainer("beforeinput",(function(t){if(!e.engine.readonly){var n=e.engine,i=n.change,o=n.card,a=n.node,s=n.block,l=n.list;if("@"===t.data&&!e.isCardInput(t)){var c=e.engine.trigger("keydown:at",t);!1===c&&(e.engine.ot.submitMutationCache(),t.preventDefault())}i.rangePathBeforeCommand||i.cacheRangeBeforeCommand();var u=i.range.get(),d=u.cloneRange().shrinkToTextNode().enlargeToElementNode(),h=d.startNode;if(It&&"deleteCompositionText"===t.inputType&&"li"===h.name&&h.length>0&&!a.isCustomize(h)){var p=h[0].childNodes;1===p.length&&"BR"!==p[0].nodeName&&(h.prepend("<br />"),setTimeout((function(){var t=h[0].childNodes;2===t.length&&"BR"===t[0].nodeName&&"BR"===t[1].nodeName&&t[0].remove()}),0))}if(Bt&&"li"===h.name&&1===d.startOffset&&a.isCustomize(h)&&e.isComposing){var f=h.first(),g=null===f||void 0===f?void 0:f.next(),m=function(){var t=He("",null);null===f||void 0===f||f.after(t),d.setOffset(t,1,1),i.range.select(d),r=h};if(null===g||void 0===g?void 0:g.isText()){var v=g.text();/^\u200b/.test(v)||m()}else"br"===(null===g||void 0===g?void 0:g.name)&&g.remove(),m()}if(d.collapsed||("body"===d.commonAncestorNode.attributes(Ct)?o.remove(d.commonAncestorNode):("body"===d.startNode.attributes(Ct)&&o.remove(d.startNode),"body"===d.endNode.attributes(Ct)&&o.remove(d.endNode))),d.startNode.isRoot()){var b=d.getStartOffsetNode();if(b instanceof Element&&Se(b)&&!b.querySelector(Tt)&&o.remove(b),!d.collapsed&&d.endNode.isRoot()){var y=d.getEndOffsetNode();y instanceof Element&&Se(y)&&!y.querySelector(Tt)&&o.remove(y)}}if(!d.collapsed&&!e.isComposing){var w,x=s.closest(d.startNode),C=s.closest(d.endNode);if((a.isCustomize(x)||a.isCustomize(C))&&!x.equal(C))null===(w=l.backspaceEvent)||void 0===w||w.trigger(new KeyboardEvent("")),a.insertText(t.data||"")}var k=t.inputType;!e.isComposing||k&&k.includes("Composition")||e.engine.ot.submitMutationCache();var A=["format","history"];k&&A.forEach((function(n){if(0===k.indexOf(n)){t.preventDefault();var r=k.substring(n.length).toLowerCase();e.engine.command.queryEnabled(r)&&e.engine.command.execute(r)}}))}}));var o=null;this.onContainer("input",(function(t){var n;if(!e.engine.readonly&&!e.isCardInput(t)){e.engine.isEmpty()?e.engine.showPlaceholder():e.engine.hidePlaceholder();var r=e.engine,a=r.change,s=r.card;if(t.target instanceof Element&&Me(t.target)&&s.active&&s.active.root.isBlockCard()&&!s.active.isEditable&&(null===(n=s.active.root.get())||void 0===n?void 0:n.isContentEditable)){var l=a.range.get(),c=He("<p><br /></p>");return s.active.root.before(c),s.remove(s.active.root),l.select(c,!0),void a.range.select(l)}o&&clearTimeout(o),o=setTimeout((function(){i(t)}),10)}}))}}},{key:"onSelect",value:function(t,e,n){var r=this,o=this.options.bindSelect;o&&!o()||(this.onContainer(Rt?"touchstart":"mousedown",(function(t){r.isCardInput(t)||(r.isSelecting=!0,e&&e(t))})),this.onDocument(Rt?"touchend":"mouseup",(function(e){r.isSelecting&&(r.isSelecting=!1,window.setTimeout((function(){t(e),n&&n(e)}),10))})),this.onContainer("keydown",(function(){var t=cn.from(r.engine);r.keydownRange=t})),this.onContainer("keyup",(function(e){if(!r.engine.readonly&&!r.isCardInput(e)&&(i()("left",e)||i()("right",e)||i()("up",e)||i()("down",e)||"Meta"===e.key||i()("shift+left",e)||i()("shift+right",e)||i()("shift+up",e)||i()("shift+down",e)||i()("ctrl+b",e)||i()("ctrl+f",e)||i()("ctrl+n",e)||i()("ctrl+p",e)||i()("ctrl+a",e)||i()("ctrl+e",e)||i()("home",e)||i()("end",e))){var n=cn.from(r.engine);if(r.keydownRange&&n&&n.equal(r.keydownRange))return;r.isComposing||t(e)}})))}},{key:"onPaste",value:function(t){var e=this,n=this.options.bindPaste;if(!n||n()){var r=!1;this.onContainer("keydown",(function(t){e.engine.readonly||(i()("mod",t)&&i()("shift",t)&&i()("v",t)||(r=!1),(i()("mod+shift+v",t)||i()("mod+alt+shift+v",t))&&(r=!0))})),this.onDocument("paste",(function(n){var i=e.engine.change.range.get();if(e.engine.container.contains(i.commonAncestorNode)&&!e.engine.readonly&&!e.isCardInput(n)){n.preventDefault();var o=e.engine.clipboard.getData(n),a=r;r=!1,t(Object(l["a"])(Object(l["a"])({},o),{},{isPasteText:a}))}}))}}},{key:"onDrop",value:function(t){var e=this,n=this.options.bindDrop;if(!n||n()){var r,i,o,a=function(t){if(t.target&&!e.engine.readonly){t.stopPropagation(),e.dragoverHelper.setCursor();var n=He(t.target),o=n.attributes("drag-card-trigger");if(r=e.engine.card.find(o||n),r){var a,s;if(null===(a=r.toolbarModel)||void 0===a||a.hideCardToolbar(),i=r.find("img.data-drag-image"),i.length>0)i=e.engine.node.clone(i);else{i=He('<div class="data-drag-image" />');var l=r.root.get();l&&i.css({width:l.clientWidth+"px",height:l.clientHeight+"px"})}i.css({position:"absolute",top:"-99999px",right:"-99999px"}),He(document.body).append(i),null===(s=t.dataTransfer)||void 0===s||s.setDragImage(i[0],0,0)}}};this.onRoot("dragstart",a),this.onContainer("dragstart",a),this.onContainer("dragover",(function(t){if(!e.engine.readonly){var n=e.dragoverHelper,r=n.getCursor();if(0!==r.length){n.parseEvent(t),o=n.getRange();var i=n.getRect();r.css({height:i.height+"px",top:Math.round(window.pageYOffset+(i.y||0))+"px",left:Math.round(window.pageXOffset+(i.x||0))+"px"})}else e.dragoverHelper.setCursor()}})),this.onContainer("dragleave",(function(){e.dragoverHelper.removeCursor()})),this.onContainer("dragend",(function(){e.dragoverHelper.removeCursor(),i&&(i.remove(),i=void 0)})),this.onContainer("drop",(function(n){if(!e.engine.readonly){n.preventDefault(),e.dragoverHelper.removeCursor(),i&&(i.remove(),i=void 0);var a=n.dataTransfer,s=[];try{a&&a.items&&a.items.length>0?Array.from(a.items).forEach((function(t){if("file"===t.kind){var e=t.getAsFile();e&&s.push(e)}})):a&&a.files&&a.files.length>0&&(s=Array.from(a.files))}catch(c){a&&a.files&&a.files.length>0&&(s=Array.from(a.files))}var l={event:n,range:o,card:r,files:s};t(l),r=void 0}}))}}},{key:"onDocument",value:function(t,e,n){this.addEvent("document",t,e,n)}},{key:"onWindow",value:function(t,e,n){this.addEvent("window",t,e,n)}},{key:"onContainer",value:function(t,e,n){this.addEvent("container",t,e,n)}},{key:"onRoot",value:function(t,e,n){this.addEvent("root",t,e,n)}},{key:"addEvent",value:function(t,e,n,r){var i=this;if(this.globalEvents[t]||(this.globalEvents[t]=[]),!this.globalEvents[t].find((function(t){return t.type===e}))){var o=function(){for(var n,r=i.events[t].filter((function(t){return t.type===e})),o=0;o<r.length;o++){var a;if(n=(a=r[o]).listener.apply(a,arguments),!1===n)break}return n};switch(t){case"container":this.engine.container.on(e,o);break;case"root":this.engine.root.on(e,o);break;case"document":document.addEventListener(e,o);break;case"window":window.addEventListener(e,o);break}this.globalEvents[t].push({type:e,listener:o})}this.events[t]||(this.events[t]=[]),void 0!==r?this.events[t].splice(r,0,{type:e,listener:n}):this.events[t].push({type:e,listener:n})}},{key:"destroy",value:function(){var t=this;Object.keys(this.globalEvents).forEach((function(e){var n=t.globalEvents[e];n.forEach((function(n){"window"===e?window.removeEventListener(n.type,n.listener):"document"===e?document.removeEventListener(n.type,n.listener):"container"===e?t.engine.container.off(n.type,n.listener):"root"===e&&t.engine.root.off(n.type,n.listener)}))}))}}]),t}(),wn=function(){function t(e){Object(c["a"])(this,t),this.source=void 0,this.source=e}return Object(u["a"])(t,[{key:"toHTML",value:function(){var t=Xt(this.source);return t=t.replace(/\n/g,"</p><p>").replace(/<p><\/p>/g,"<p><br /></p>").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;"),t.indexOf("</p><p>")>=0&&(t="<p>".concat(t,"</p>")),t}}]),t}(),xn=function(t){var e="";for(var n in t)if("style"!==n){var r=Xt(t[n]);e+=" ".concat(n,'="').concat(r,'"')}return e.trim()},Cn=function(t){var e="";for(var n in t){n=n.toLowerCase();var r=Xt(t[n]);/^(padding|margin|text-indent)/.test(n)&&0===te(r)||(n.endsWith("color")&&(r=O()(r).toHexString()),e+=" ".concat(n,": ").concat(r,";"))}return e.trim()},kn=function(){function t(e,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(Object(c["a"])(this,t),this.root=void 0,this.editor=void 0,this.isNormalize=!0,this.editor=n,this.isNormalize=i,"string"===typeof e){var o;e=e.replace(/<a\s{0,1000}\/>/gi,"<a></a>"),e=e.replace(/<a(\s[^>]+?)\/>/gi,(function(t,e){return"<a".concat(e,"></a>")})),e=null===(o=e)||void 0===o?void 0:o.replace(/<img .*>/gi,(function(t){return t.replace(/\son[a-zA-Z]{1,20}=/g,"notallow=")})),e=e.replace(/<p(>|\s+[^>]*>)/gi,"<paragraph$1").replace(/<\/p(>|\s+[^>]*>)/gi,"</paragraph$1"),e=re(e);var a=(new DOMParser).parseFromString(e,"text/html"),s=a.body.innerHTML.replace(/<paragraph(>|\s+[^>]*>)/gi,"<p$1").replace(/<\/paragraph(>|\s+[^>]*>)/gi,"</p$1");this.root=He("<div>".concat(s,"</div>"))}else xe(e)?this.root=e:this.root=He(e);r&&r(this.root)}return Object(u["a"])(t,[{key:"convert",value:function(t,e,n){var r=t.transform(e),i=[],o=this.editor.node,a=null;while(r){var s,c=r,u=c.rule;i.push(u);var d=r.node,h=d.name,p=d.attributes,f=d.style;"card"!==h&&delete p[Q],delete p["id"];var g=He("<".concat(h," />"));if(o.setAttributes(g,Object(l["a"])(Object(l["a"])({},p),{},{style:f})),null===(s=g.get())||void 0===s||s.append.apply(s,Object(S["a"])(e.get().childNodes)),e.isCard())return e.replaceWith(g),g;(r.replace?(e.replaceWith(g),e=g):g.each((function(t){var n=e.get();n&&n instanceof Element&&n.append(t)})),a&&0!==a.length||(a=g),o.isBlock(g,n))?r=t.transform(g,(function(t){return i.indexOf(t)<0})):r=t.transform(e,(function(t){return i.indexOf(t)<0}))}return a}},{key:"normalize",value:function(t,e,n){var r=this,i=this.editor,o=i.node,s=i.inline;if(this.isNormalize){var l=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mark",r=t.attributes(),i=Gt(r.style||"");if(delete r.style,0!==Object.keys(r).length||0!==Object.keys(i).length){var o=Object.keys(r).length,a=Object.keys(i).length,s=t.clone();e.filter(t,r,i,!0),s.removeAttributes(Q);var l=Object.keys(r),c=0;l.forEach((function(t){r[t]&&(c++,s.removeAttributes(t))}));var u=0,d=Object.keys(i);if(d.forEach((function(t){i[t]&&(u++,s.css(t,""))})),(c===o&&u===a||0===c&&0===u)&&e.getType(s)===n){t.before(s);var h=t.children();return s.append(h.length>0?h:"block"===n?"<br />":He("",null)),t.remove(),void(t=s)}return""===s.attributes("style").trim()&&s.removeAttributes("style"),s}};t.traverse((function(c){if(c[0]!==t[0]&&!["style","script","meta"].includes(c.name))if(c.isElement()){var u=c.isCard();if(n&&(!e.getType(c)||u)){var d=r.convert(n,c,e);if(d)return!!u||d}if(u)return;if(o.isMark(c,e)){var h=function(){var t=[],o=e.getRule(c);if(o){var s=function(){var a;t.push(o),0===(null===(a=c.get())||void 0===a?void 0:a.childNodes.length)&&i.mark.repairCursor(c);var s=l(c);if(!s)return{v:{v:void 0}};var u=e.getType(s,(function(e){return e.name===s.name&&"mark"===e.type&&t.indexOf(e)<0}));if(!u&&n){var d=r.convert(n,s,e);if(d&&d.length>0){var h=c.children();return d.append(h.length>0?h:He("",null)),c.append(0===s.length?d:s.children()),{v:{v:void 0}}}}var p=c;while("mark"===u){var f=p.children(),g=s;while(1){var m=g.children();if(!(m.length>0))break;g=m}if(g.append(f.length>0?f:He("",null)),p.append(s),p=s,s=l(s),!s)break;if(u=e.getType(s,(function(e){return e.name===s.name&&"mark"===e.type&&t.indexOf(e)<0})),!u){if(n){var v=r.convert(n,s,e);if(v&&v.length>0){s=s.length>0?s.children():v,u="mark";continue}}break}if(o=e.getRule(s),!o)break;t.push(o)}}();if("object"===Object(a["a"])(s))return s.v}}();if("object"===Object(a["a"])(h))return h.v}else if(o.isInline(c))return s.flat(c,e)}else if(c.isText()){var p=c.text();if(/^\n/.test(p)||/^\s/.test(p)){var f=c.get(),g=f.previousSibling,m=f.nextSibling,v=g?e.getType(g):void 0,b=m?e.getType(m):void 0;if(!g&&m&&(!b||"block"===b))return void c.remove();m||!g||v&&"block"!==v||c.remove()}}}))}else{if(!n)return;var c=t.find(St);c.each((function(t,i){var o=c.eq(i);o&&r.convert(n,o,e)}));var u=t.find("".concat(mt,",").concat(ft,",").concat(gt));u.each((function(t,i){var o=u.eq(i);o&&r.convert(n,o,e)}))}}},{key:"traverse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=this.editor.node,a=t.first();while(a)if(["style","script","meta"].includes(a.name))a=a.next();else{if(a.isElement()){var s=a.name,l=a.attributes();if(l[J]===nt){a=a.next();continue}var c=Gt(l.style||"");if(delete l.style,["left","right"].indexOf(l[Ct])>=0){a=a.next();continue}var u=!0,d=void 0;if(e&&l[J]!==it)if(d=e.getType(a),void 0===d){var h,p;u=!1;var f=a.parent();if(f&&o.isBlock(f,e)&&1===(null===(h=f.get())||void 0===h?void 0:h.childNodes.length)&&0===(null===(p=a.get())||void 0===p?void 0:p.childNodes.length)){var g=He("<br />");a.before(g),a.remove(),a=g,s=g.name,l={},c={},u=!0}}else e.filter(a,l,c);if("center"!==l[Ct]&&r.onOpen&&u){var m=r.onOpen(a,s,l,c);if(!1===m){a=a.next();continue}}("card"===s||l[bt]&&"true"!==l[At])&&!i||this.traverse(a,e,n,r,i),"center"!==l[Ct]&&r.onClose&&u&&r.onClose(a,s,l,c)}else if(a.isText()){var v=a[0].nodeValue?Xt(a[0].nodeValue):"";""===v&&o.isBlock(a.parent(),e||void 0)&&(a.prev()||(v=v.replace(/^[ \n]+/,"")),a.next()||(v=v.replace(/[ \n]+$/,"")));var b=a.prev(),y=a.next();b&&o.isBlock(b,e||void 0)&&y&&o.isBlock(y,e||void 0)&&""===v.trim()&&(v=v.trim()),r.onText&&r.onText(a,v)}a=a.next()}}},{key:"toValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=this.editor,a=o.node,s=this.root.clone(!0);t&&this.normalize(s,t,e),o.trigger("parse:value-before",s),this.traverse(s,t,e,{onOpen:function(e,n,r,s){var l;if(!1===o.trigger("parse:value",e,r,s,i))return!1;if(i.push("<"),i.push(n),Object.keys(r).length>0&&i.push(" "+xn(r)),Object.keys(s).length>0){var c=Cn(s);""!==c&&(i.push(' style="'),i.push(c),i.push('"'))}a.isVoid(n,t||void 0)&&0===(null===(l=e.get())||void 0===l?void 0:l.childNodes.length)?i.push(" />"):i.push(">")},onText:function(t,e){n&&e.length>1&&(e=e.replace(/[\u00a0 ]+/g,(function(t){var e=[];t=t.replace(/\u00a0/g," ");for(var n=0;n<t.length;n++)e[n]=n%2==0?t[n]:" ";return e.join("")}))),i.push(e)},onClose:function(e,n){a.isVoid(n,t||void 0)||i.push("</".concat(n,">"))}}),o.trigger("parse:value-after",i),i.length>0&&/^\n+/g.test(i[0])&&(i[0]=i[0].replace(/^\n+/g,"")),i.length>0&&/\n+$/g.test(i[i.length-1])&&(i[i.length-1]=i[i.length-1].replace(/\n+$/g,""));var l=i.join("");return r?re(l):l}},{key:"toHTML",value:function(t,e){var n=He("<div />"),r=this.editor,i=r.container.css();return t&&e?(He(t).append(this.root).css(i),n.append(e)):n.append(this.root),r.trigger("parse:html-before",this.root),r.trigger("parse:html",n),r.trigger("parse:html-after",n),n.html().replace(/\u200b/g,"")}},{key:"toDOM",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=this.toValue(t,e,!1,!0),r=(new DOMParser).parseFromString(n,"text/html"),i=r.createDocumentFragment(),o=r.body.childNodes;while(o.length>0){var a=o[0];i.appendChild(a)}return i}},{key:"toText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.root.clone(!0),i=[],o=this.editor;return this.traverse(r,null,null,{onOpen:function(t,e,r,a){if(!1===o.trigger("parse:text",t,r,a,i))return!1;if("br"===e&&i.push("\n"),n&&"li"===t.name){if(t.hasClass(o.list.CUSTOMZIE_LI_CLASS))return;var s=t.parent(),l=null===s||void 0===s?void 0:s.css("listStyleType");if("ol"===(null===s||void 0===s?void 0:s.name)){var c=s[0]["start"],u=c||1;i.push("".concat(le(l,u),". ")),s.attributes("start",u+1)}else"ul"===(null===s||void 0===s?void 0:s.name)&&i.push(le(l)+" ")}},onText:function(t,e){e=Kt(e),e=e.replace(/\u00a0/g," "),e=e.replace(/\u200b/g,""),i.push(e)},onClose:function(e,n){var r=o.node;if("p"===n||r.isBlock(e,t||o.schema)){var a=Array.from(e.get().childNodes);if(0===a.length||a.some((function(e){if(e instanceof Text)return!1;if("BR"===e.nodeName)return!0;var n=(t||o.schema).getType(e);return!n||"block"===n})))return;i.push("\n")}}},e),i.join("").trim()}}]),t}(),An=function(){function t(e,n){Object(c["a"])(this,t),this.source=void 0,this.engine=void 0,this.schema=void 0,this.source=e,this.engine=n,this.schema=this.engine.schema.clone()}return Object(u["a"])(t,[{key:"parser",value:function(){var t=this,e=this.engine.conversion.clone();this.engine.trigger("paste:schema",this.schema);var n=new kn(this.source,this.engine,(function(e){t.engine.trigger("paste:origin",e)}));return n.toDOM(this.schema,e)}},{key:"getDefaultStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.engine.container,e={color:O()(t.css("color")).toHexString(),"background-color":O()(t.css("background-color")).toHexString(),"font-size":t.css("font-size")};return e}},{key:"elementNormalize",value:function(t){var e=this,n=this.getDefaultStyle(),r=this.engine,i=r.inline,o=r.list,a=this.engine.node,s=this.engine.mark,l=this.engine.block,c=[];He(t).traverse((function(r){var u,d,h,p=r.parent();if(p&&!r.isCard()&&r.fragment!==t)if(r.isText()){var f=r.text();if(/\u200b/.test(f)){var g=!0,m=r.next(),v=r.prev(),b=r.parent();(b&&a.isMark(b,e.schema)||b&&a.isInline(b,e.schema)||m&&a.isInline(m,e.schema)||v&&a.isInline(v,e.schema))&&(g=!1),g&&(f=f.replace(/\u200b/g,""),r.text(f))}else{var y;if(/^\n(\t)+$/.test(f))return r.remove(),void(0===(null===(y=p.get())||void 0===y?void 0:y.childNodes.length)&&p.remove());if(/^\n$/.test(f)){if(a.isList(p))return void r.remove();var w=r.next();w&&a.isBlock(w)&&r.remove()}}if(a.isList(p)){var x=r.next(),C=r.prev(),k=function(t,e){if(a.isCustomize(t)){var n=t.first();if(n&&n.isCard()){var r=n.attributes(bt)||n.attributes(yt);r&&o.addCardToCustomize(e,r)}}},A=null;return"li"===(null===x||void 0===x?void 0:x.name)?(A=x.clone(),k(x,A)):"li"===(null===C||void 0===C?void 0:C.name)?(A=C.clone(),k(C,A)):A=He("<li></li>"),r.before(A),A.append(r),A}}else{var S=r.css();for(var E in n){var T=S[E];T&&(E.endsWith("color")&&(T=O()(T).toHexString()),T.toLowerCase()===n[E].toLowerCase()&&r.css(E,""))}var _=e.schema.getType(r);if(!_){var M=r.first();return a.unwrap(r),M}a.removeMinusStyle(r,"text-indent"),a.isList(r)&&r.css("padding-left","");var N=r.attributes();N.style&&""===N.style.trim()&&r.removeAttributes("style");while("span"===r.name&&a.isEmpty(r)){var P=r.children();if(P.length>0)break;if(p=r.parent(),r.remove(),!p)return;if(r=p,p=r.parent(),!p)return;_=void 0,N=void 0}if(N||(N=r.attributes()),!N[yt]){var L=_?"block"===_:a.isBlock(r,e.schema),D=a.isVoid(r,e.schema),j=a.isBlock(p,e.schema);if(!L||"p"===N["data-type"]||D||j||//!node.isSolid() &&
""!==a.html(r)){var I;if("p"===N["data-type"]&&r.removeAttributes("data-type"),L&&"p"===(null===(u=p)||void 0===u?void 0:u.name))a.unwrap(p),p=r.parent(),(null===(I=p)||void 0===I?void 0:I.fragment)===t&&(p=void 0),j=!!p&&a.isBlock(p,e.schema);var R=!!p&&a.isList(p);if("li"===r.name&&p&&!R){var F=He("<ul />");return r.before(F),void F.append(r)}if(a.isList(r)&&p&&a.isList(p)){var B=[],z=[],H=!0,V=p.children().toArray(),q=p.clone(),U=function(){var t,e;return(null!==(t=null===(e=q.get())||void 0===e?void 0:e.childNodes.length)&&void 0!==t?t:0)>0&&(H?B.push(q):z.push(q),q=p.clone(),!0)};V.forEach((function(t,e){if(t)return H&&t.equal(r)?(V.length-1===e?(U(),z.push(r)):(0===e||U(),B.push(r)),void(H=!1)):void("li"!==t.name?(U(),H?B.push(t):z.push(t)):q.append(t))})),U();var W=p.attributes(o.INDENT_KEY)||"0";r.attributes(o.INDENT_KEY,W),o.addIndent(r,1);var $=p;return B.forEach((function(t){var e,n=He(t);n&&0!==(null===(e=n.get())||void 0===e?void 0:e.childNodes.length)&&($.after(n),$=n)})),z.forEach((function(t){var e,n=He(t);n&&0!==(null===(e=n.get())||void 0===e?void 0:e.childNodes.length)&&($.after(n),$=n)})),p.remove(),r||void 0}if("li"!==r.name&&R){if("br"===r.name)return void r.remove();var G=He("<li />");return r.before(G),void G.append(r)}if(a.isList(r)&&"li"===(null===(d=p)||void 0===d?void 0:d.name)){var Y,X,K,Z,J,Q,tt=null===(Y=p)||void 0===Y?void 0:Y.parent();if(!tt)return void a.unwrap(p);var et=tt.clone(),nt=tt.clone(),rt=!0,it=tt.children().toArray();it.forEach((function(t){t&&(rt&&t.equal(p)?rt=!1:rt?et.append(t):nt.append(t))}));var ot=null===(X=p)||void 0===X||null===(K=X.parent())||void 0===K?void 0:K.hasClass("data-list"),at=null===(Z=p)||void 0===Z?void 0:Z.children(),st=null,lt=null;at.each((function(t,n){var r=at.eq(n);if(r&&(!a.isEmptyWithTrim(r)||a.isVoid(r))){var i=a.isList(r),s=et[et.length-1];if(i){var l,c=(null===(l=He(s))||void 0===l?void 0:l.attributes(o.INDENT_KEY))||"0";return r.attributes(o.INDENT_KEY,c),o.addIndent(r,1),et[et.length]=r[0],void(st=null)}if(a.isBlock(t,e.schema)){var u=et.length;return et[u]=r[0],et[u+1]=et.clone()[0],void(st=null)}if(!st){var d;st=He(ot?'<li class="'.concat(o.CUSTOMZIE_LI_CLASS,'" />'):"<li />");var h=null===(d=He(s))||void 0===d?void 0:d.last();h?null===h||void 0===h||h.after(st):He(s).append(st)}st.append(t),lt||(lt=st)}})),null===(J=p)||void 0===J||J.remove();var ct=tt;return et.each((function(t){var e,n=He(t);n&&0!==(null===(e=n.get())||void 0===e?void 0:e.childNodes.length)&&(ct.after(n),ct=n)})),nt.each((function(t){var e,n=He(t);n&&0!==(null===(e=n.get())||void 0===e?void 0:e.childNodes.length)&&(ct.after(n),ct=n)})),tt.remove(),(null===(Q=lt)||void 0===Q?void 0:Q.next())||et.next()||void 0}if("p"===r.name&&R){var ut=He("<li />");return a.replace(r,ut),ut}if(L&&!D&&""===a.html(r).trim()&&(a.isRootBlock(r,e.schema)||"li"===r.name)&&a.html(r,"<br />"),L&&"li"===(null===(h=p)||void 0===h?void 0:h.name)){var dt,ht,pt=null!==(dt=null===(ht=r.get())||void 0===ht?void 0:ht.childNodes)&&void 0!==dt?dt:[];if("p"===r.name){var ft=r.next();0!==pt.length||ft||r.append("<br />");var gt=r.first();return ft&&"p"===ft.name&&r.append("<br />"),a.unwrap(r),gt}var mt=p.parent();if(!mt)return;var vt=mt.clone(),wt=mt.clone(),xt=p.prev();while(xt)vt.prepend(xt),xt=p.prev();var Ct=p.next();while(Ct)wt.append(Ct),Ct=p.next();var kt=p.clone(),At=p.clone(),St=r.prev();while(St)kt.prepend(St),St=r.prev();var Et=r.next();while(Et)At.append(Et),Et=r.next();return mt.after(r),kt.first()&&vt.append(kt),At.first()&&wt.prepend(At),vt.first()&&mt.before(vt),wt.first()&&r.after(wt),void mt.remove()}if(!L&&a.isInline(r)&&!r.isCard()&&!D){var Ot=r.allChildren().some((function(t){return a.isVoid(t,e.schema)}));a.isEmptyWithTrim(r)&&!Ot?r.remove():i.repairCursor(r)}a.removeSide(r);var Tt=p,_t=function t(n){if(Tt&&!Tt.fragment&&a.isBlock(n,e.schema)&&a.isBlock(Tt,e.schema)&&!e.schema.isAllowIn(Tt.name,n.name)){var r=n.children();a.unwrap(n),r.each((function(e,n){t(r.eq(n))}))}};_t(r);while(r.length>0&&Tt&&!Tt.fragment&&a.isBlock(r,e.schema)&&!a.isBlock(Tt,e.schema)){var Mt=r.clone();a.unwrap(r),Tt.before(Mt),Mt.append(Tt),r=Mt,Tt=r.parent()}var Nt=a.isMark(r,e.schema);if(r.length>0&&Nt){var Pt=l.closest(r);if(!Pt.equal(r)){var Lt,Dt=s.findPlugin(r),jt=l.findPlugin(Pt);if(Dt&&(null===jt||void 0===jt||null===(Lt=jt.disableMark)||void 0===Lt?void 0:Lt.includes(Dt.name))){var It=r.first();return a.unwrap(r),It||void 0}}}if(Nt){var Rt=s.findPlugin(r),Ft=c.concat();if(Ft.pop(),Rt){var Bt,zt=Ft.find((function(t){var e;return(null===(e=t.plugin)||void 0===e?void 0:e.name)===Rt.name&&t.node.length>0&&!t.node.equal(r)}));if(zt)return void(1===(null===(Bt=zt.node.get())||void 0===Bt?void 0:Bt.childNodes.length)?a.unwrap(zt.node):a.unwrap(r))}}if(Tt=p,r.length>0&&Tt&&a.isMark(Tt,e.schema)&&Nt){var Ht,Vt=s.findPlugin(Tt),qt=null===(Ht=c[c.length-1])||void 0===Ht?void 0:Ht.plugin;if(Vt&&qt&&qt.mergeLeval>Vt.mergeLeval){var Ut=Tt.clone(!1),Wt=Tt.children().toArray(),$t=Ut.clone(),Gt=Ut.clone(),Yt=!0,Xt=-1;if(Wt.forEach((function(t,e){if(t.equal(r)){var n=r.children();Ut.append(n),r.append(Ut),Yt=!1,Xt=e}else Yt?$t.append(t):Gt.append(t)})),Xt>0&&Tt.before($t),Xt<Wt.length-1&&Tt.after(Gt),Xt>-1)return Tt.before(r),Tt.remove(),c.splice(c.length-2,1),r}}}else r.remove()}}}),void 0,void 0,(function(t){if(a.isMark(t)){var e=s.findPlugin(t);t["is_mark"]=!0,c.push({plugin:e,node:t})}}),(function(t){t["is_mark"]&&c.pop()}))}},{key:"normalize",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.engine.node,r=this.parser();this.elementNormalize(r);var i=this.engine.change.range.get(),o=i.commonAncestorNode,a=this.engine.inline.closest(o);if(o.inEditor()&&!a.isCard()&&n.isInline(a,this.schema))return this.removeElementNodes(He(r)),r;if(o.inEditor()&&o.isText()&&i.startContainer===i.endContainer){var s=o[0].nodeValue,l=null===s||void 0===s?void 0:s.substr(0,i.startOffset),c=null===s||void 0===s?void 0:s.substr(i.endOffset);if(/\[.*?\]\($/.test(l||"")&&/^\)/.test(c||""))return this.removeElementNodes(He(r)),r}He(r).traverse((function(e){var i;if(e.fragment!==r){var o=null===(i=e.get())||void 0===i?void 0:i.firstChild;if(e.length>0&&e[0].parentNode&&t.engine.trigger("paste:each",e),e.isText()){var a=e.text();if(/^(\r|\n)+$/.test(a)){var s,l=e.prev(),c=e.next();(l&&!n.isBlock(l)||c&&!n.isBlock(c)||l&&n.isBlock(l)&&c&&n.isBlock(c)||"p"===(null===(s=e.parent())||void 0===s?void 0:s.name))&&e.remove()}var u=/((\n)+)/.exec(a);if(u&&u.index>0&&u.index<a.length-1){var d=e.get().splitText(u.index),h=d.splitText(u[0].length);e.after(d),d.after(h),e.text()||e.remove()}}else"pre"===e.name&&e.find(Et).length>0&&n.unwrap(e);return 0===e.length&&o?He(o):void 0}})),this.engine.trigger("paste:each-after",He(r));var u=n.normalize(He(r));u.fragment&&(r=u.fragment),r.normalize();var d=He(r),h=d.find("ul,ol");return h.each((function(e,r){var i=h.eq(r);i&&n.isList(i)&&t.engine.list.addStart(i)})),this.engine.nodeId.generateAll(He(r),e),r}},{key:"removeElementNodes",value:function(t){var e=this,n=t.allChildren();n.forEach((function(t){t.isElement()&&e.engine.node.unwrap(t)}))}}]),t}();(function(t){t["INLINE"]="inline",t["BLOCK"]="block"})(gn||(gn={})),function(t){t["CARD_CHANGE"]="card_change",t["CLICK"]="click",t["MOUSE_DOWN"]="mouse_down"}(mn||(mn={})),function(t){t["NONE"]="none",t["BACKGROUND"]="background",t["BORDER"]="border"}(vn||(vn={}));var Sn=Object(_["a"])("lastePasteRange"),En=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,Object.defineProperty(this,Sn,{writable:!0,value:void 0}),this.prevSelection=null,this.engine=e}return Object(u["a"])(t,[{key:"repairInput",value:function(t,e){var n=e,r=n.commonAncestorNode,i=this.engine.card.find(r),o=this.engine,a=o.node,s=o.mark,l=o.change;if(i&&i.type===gn.INLINE)if(i.isLeftCursor(r)){var c=r.closest(Ot),u=c.text().replace(/\u200B/g,"");u&&(u=Xt(u),e.setStartBefore(i.root),e.collapse(!0),a.html(c,"&#8203;"),a.insertText(u,e),l.apply(e))}else if(i.isRightCursor(r)){var d=r.closest(_t),h=d.text().replace(/\u200B/g,"");if(h){h=Xt(h);var p=i.root.next(),f=i.queryMarks?i.queryMarks(!0):[];if(f.length>0){var g=f[f.length-1];g.append(h);for(var m=f.length-2;m>=0;m--)g=f[m].append(g);i.root.after(g),e.select(g,!0).collapse(!1)}else p&&(p.isText()||a.isMark(p))?(e.select(p,!0).collapse(!0),a.insertText(h,e)):(e.setEndAfter(i.root),e.collapse(!1),a.insertText(h,e));a.html(d,"&#8203;"),l.apply(e)}}else l.range.toTrusty(e);var v=e.cloneRange().shrinkToTextNode(),b=v.startNode,y=v.startOffset,w=b.parent();if(b.isText()&&w&&a.isMark(w)){var x=b.get(),C=b.text(),k=t.inputType;if(y===C.length&&t.data&&k&&0===k.indexOf("insert")){var A=w,S=[];while(A&&a.isMark(A)){var E,O,T=s.findPlugin(A);T&&!T.followStyle&&S.push(A),A=A.parent();var _=null===(E=A)||void 0===E?void 0:E.parent();if((null===(O=A)||void 0===O?void 0:O.next())&&_&&a.isMark(_))break}var M=b.next();if(S.forEach((function(t,e){if(w.equal(t)&&M)S.splice(e,1);else{var n=t.next(),r=t;while(!n&&r){var i=r.parent();if(i&&a.isBlock(i))break;n=(null===i||void 0===i?void 0:i.next())||null,r=i}var o=n;while(o&&!o.isText()){if(a.isMark(o)&&s.compare(o,t)){S.splice(e,1);break}o=o.first()}}})),S.length>0){var N=x.splitText(C.length-t.data.length);N.remove(),a.isEmpty(w)&&w.remove(),s.unwrap(S.map((function(t){return t.clone()}))),a.insertText(C.substr(C.length-t.data.length)),s.merge(),e=l.range.get().cloneRange().shrinkToTextNode(),b=e.startNode,y=e.startOffset,x=b.get(),C=b.text()}}else if(t.data&&y===t.data.length&&k&&0===k.indexOf("insert")){var P=w,L=[];while(P&&a.isMark(P)){var D,j,I=s.findPlugin(P);I&&!I.followStyle&&L.push(P),P=P.parent();var R=null===(D=P)||void 0===D?void 0:D.parent();if((null===(j=P)||void 0===j?void 0:j.prev())&&R&&a.isMark(R))break}var F=b.prev();L.forEach((function(t,e){if(w.equal(t)&&F)L.splice(e,1);else{var n=t.prev(),r=t;while(!n&&r){var i=r.parent();if(i&&a.isBlock(i))break;n=(null===i||void 0===i?void 0:i.prev())||null,r=i}var o=n;while(o&&!o.isText()){if(a.isMark(o)&&s.compare(o,t)){L.splice(e,1);break}o=o.last()}}})),L.length>0&&(x.splitText(t.data.length),x.remove(),a.isEmpty(w)&&w.remove(),s.unwrap(L.map((function(t){return t.clone()}))),a.insertText(""===t.data?" ":t.data),s.merge(),e=l.range.get().cloneRange().shrinkToTextNode(),b=e.startNode,y=e.startOffset,x=b.get(),C=b.text())}C.length>0&&/^\u200B$/g.test(C.substr(0,1))&&(x.splitText(1),x.remove())}var B=b.prev();if(b.isText()&&B&&a.isMark(B)){var z=b.get(),H=b.text();H.length>0&&/^\u200B$/g.test(H.substr(0,1))&&(z.splitText(1),z.remove())}}},{key:"handleSelectionChange",value:function(){var t,e,n,r,i=this,o=this.engine,a=o.change,s=o.container,l=o.card;if(!a.isComposing()){var c=s.window,u=null===c||void 0===c?void 0:c.getSelection();if(((null===(t=this.prevSelection)||void 0===t?void 0:t.anchorNode)!==(null===u||void 0===u?void 0:u.anchorNode)||(null===(e=this.prevSelection)||void 0===e?void 0:e.anchorOffset)!==(null===u||void 0===u?void 0:u.anchorOffset)||(null===(n=this.prevSelection)||void 0===n?void 0:n.focusNode)!==(null===u||void 0===u?void 0:u.focusNode)||(null===(r=this.prevSelection)||void 0===r?void 0:r.focusOffset)!==(null===u||void 0===u?void 0:u.focusOffset))&&(this.prevSelection=u?{anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}:null,u&&u.anchorNode)){var d=cn.from(this.engine,u);if(!d.commonAncestorNode.inEditor(s))return;a.onSelect();var h=d.containsCard()||d.commonAncestorNode.closest(St).length>0&&0===d.startNode.closest("".concat(Ot,",").concat(_t,",").concat(rt)).length,p=d.collapsed;if(!p){var f=d.startNode,g=d.endNode,m=d.startOffset,v=d.endOffset,b=f.isElement()&&!f.isCard()?f.children().eq(m):f,y=g.isElement()&&!g.isCard()?g.children().eq(v-1):g;b&&y&&b.isCard()&&b.equal(y)&&(p=!0)}l.each((function(t){var e=t.getCenter();if(e&&e.length>0){var n=!!u.containsNode&&u.containsNode(e[0]);if(!n&&h&&u.focusNode){var r=i.engine.card.find(u.focusNode);r&&(p=!u.anchorNode||r.root.contains(u.anchorNode),p&&t.root.equal(r.root)&&(n=!0)),n&&p&&(h=!1)}var o=t.constructor.autoSelected;t.select(n&&(!p||!1!==o))}}))}}}},{key:"init",value:function(){var t=this,e=this.engine,n=e.change,i=e.card,o=e.clipboard;n.event.onInput((function(e){var r=n.range.get();t.repairInput(e,r),n.range.select(r),n.onSelect(r),n.change()})),n.event.onDocument("selectionchange",(function(){t.handleSelectionChange()})),n.event.onSelect((function(t){var e=n.range.get();0!==e.startNode.closest(et).length&&(e.collapsed&&e.containsCard()&&n.range.toTrusty(e),n.range.select(e),Object(r["isHotkey"])("shift+left",t)||Object(r["isHotkey"])("shift+right",t)||Object(r["isHotkey"])("shift+up",t)||Object(r["isHotkey"])("shift+down",t)||i.activate(e.commonAncestorNode),n.onSelect(e))}),(function(){n.onSelectStart()}),(function(){n.onSelectEnd()})),n.event.onDocument("mousedown",(function(t){if(t.target){var e=He(t.target);if(0!==e.closest("body").length&&!(e.closest(".am-view").length>0)){var n=e;while(n){var r=n.attributes(J);if(r&&[tt,it].indexOf(r)<0)return;n=n.parent()}i.activate(e,mn.MOUSE_DOWN,t)}}})),n.event.onDocument("copy",(function(e){var r=n.range.get();t.engine.container.contains(r.commonAncestorNode)&&o.write(e)})),n.event.onDocument("cut",(function(e){var r=n.range.get();if(t.engine.container.contains(r.commonAncestorNode)&&!t.engine.readonly){var i=o.write(e,void 0);i&&(e.stopPropagation(),o.cut(),n.change())}}));var a=function(e){n.cacheRangeBeforeCommand();var r=ge(t.engine,"zero");r.enable(["paragraph","html_inline","newline"]);var i=r.parse(e,{});if(0!==i.length)return me(t.engine,r,i)},l=function(){var e=Object(s["a"])(v.a.mark((function e(r){var i,o,s;return v.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(o=a(r),null!==o){e.next=3;break}return e.abrupt("return");case 3:if(s=function(){t.engine.history.saveOp(),n.cacheRangeBeforeCommand(),t.paste(o,Object(T["a"])(t,Sn)[Sn],void 0,!1)},"confirm"===(null===(i=t.engine.options.markdown)||void 0===i?void 0:i.mode)){e.next=7;break}return s(),e.abrupt("return");case 7:t.engine.messageConfirm("markdown",t.engine.language.get("checkMarkdown","title")).then((function(){s()})).catch((function(e){e&&t.engine.messageError("markdown",e)}));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();n.event.onPaste((function(e){var r=e.html,i=e.text,o=e.files,a=e.isPasteText,s="";if(0===o.length)if(a){var c="";i?c=i:r&&(c=new kn(r,t.engine).toText()),s=new wn(c).toHTML()}else r&&r.indexOf('<meta name="source" content="aomao" />')>-1||r?s=r:i&&(s=new wn(i).toHTML());if(!1!==t.engine.trigger("paste:event",e,s)&&0===o.length){n.cacheRangeBeforeCommand(),t.paste(s);var u=t.engine.options.markdown||{};if(!1!==u.mode)if(u.check||!i||/^https?:\/\/\S+$/i.test(i.trim()))u.check&&u.check(null!==i&&void 0!==i?i:"",null!==r&&void 0!==r?r:"").then((function(t){t&&l(t)}));else{if(!i)return;if(!r)return void setTimeout((function(){l(i)}),0);var d=i.split(/\r\n|\n/)||"",h=0,p=0,f=!1,g=(new DOMParser).parseFromString(r,"text/html"),m=g.querySelectorAll("li"),v=[];m.forEach((function(t){var e,n,r=null!==(e=t.textContent)&&void 0!==e?e:"";("OL"===(null===(n=t.parentElement)||void 0===n?void 0:n.nodeName)||/\d\.\s+/.test(r))&&v.push(r)}));for(var b=0;b<d.length;b++){var y=d[b];y.trim()&&(y.startsWith("```")?f?f=!1:(f=!0,p++,h++):f||(h++,/^(#|\*|-|\+|\[ \]|\[x\]|>){1,}\s+/.test(y)?p++:/^\d\.\s+/.test(y)?v.includes(y)||v.includes(y.replace(/^\d\./,"").trim())||p++:(/^(---|\*\*\*|\+\+\+)/.test(y)||/(\*|~|\^|_|\`|\]\(https?:\/\/)/.test(y))&&p++))}p>0&&(0===h||p/h>.5)&&setTimeout((function(){l(i)}),0)}}}));var c=function(t){return!t||i.closest(t.commonAncestorContainer)};n.event.onDrop((function(e){var r=e.event,i=e.range,o=e.card,a=e.files;if(o){if(r.preventDefault(),c(i))return;var s=o.constructor,l=s.cardName,u=o.getValue();t.engine.card.remove(o.root),n.range.select(i),t.engine.card.insert(l,u)}if(a.length>0){if(r.preventDefault(),c(i))return;n.range.select(i),t.engine.trigger("drop:files",a)}}))}},{key:"paste",value:function(t,e,n){var r=this,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0,a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this.engine.change,l=new An(t,this.engine).normalize(a);this.engine.trigger("paste:before",l),o?o(l,e,void 0,i):s.insert(l,e,(function(t){var e;r.engine.trigger("paste:insert",t);var i=t.cloneRange(),o=i.endNode,a="";o.isCard()&&0===(null===(e=o.get())||void 0===e?void 0:e.childNodes.length)&&(i.setEndAfter(o),a=o.attributes(Q)),Object(T["a"])(r,Sn)[Sn]=i,t.collapse(!1);var l=t.startNode.closest("".concat(St,",").concat(Et));if(l.length>0){var c=l.attributes();(c[kt]||c[yt])&&t.setStartAfter(l)}var u=t.createSelection();r.engine.card.render(void 0,(function(e){if(u.move(),a){var o=r.engine.container.find('[data-id="'.concat(a,'"]'));o.length>0&&(i.setEndAfter(o),Object(T["a"])(r,Sn)[Sn]=i)}t.scrollRangeIntoView(),s.range.select(t),n&&n(e),r.engine.trigger("paste:after")}))}),i)}}]),t}(),On=Object(_["a"])("lastBlurRange"),Tn=Object(_["a"])("otpions"),_n=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(c["a"])(this,t),this.engine=void 0,Object.defineProperty(this,On,{writable:!0,value:void 0}),Object.defineProperty(this,Tn,{writable:!0,value:void 0}),this.engine=e,Object(T["a"])(this,Tn)[Tn]=n}return Object(u["a"])(t,[{key:"setLastBlurRange",value:function(t){(null===t||void 0===t?void 0:t.commonAncestorNode.inEditor())?Object(T["a"])(this,On)[On]=t:Object(T["a"])(this,On)[On]=void 0}},{key:"toTrusty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.get(),e=t.commonAncestorNode;e.isEditable()||e.inEditor()||t.select(this.engine.container,!0).shrinkToElementNode().collapse(!1);var n=t.cloneRange();if(n.collapse(!0),this.setCardRang(n),t.startNode.equal(n.startNode)&&t.startOffset===n.startOffset||t.setStart(n.startContainer,n.startOffset),n=t.cloneRange(),n.collapse(!1),this.setCardRang(n),t.endNode.equal(n.endNode)&&t.endOffset===n.endOffset||t.setEnd(n.endContainer,n.endOffset),t.collapsed){n=t.cloneRange(),n.enlargeFromTextNode();var r=He(n.startContainer),i=n.startOffset;this.engine.node.isInline(r)&&0===i&&t.setStartBefore(r[0]),this.engine.node.isInline(r)&&i===r[0].childNodes.length&&t.setStartAfter(r[0]),t.collapse(!0)}return t}},{key:"setCardRang",value:function(t){var e=this,n=t.startNode,r=t.startOffset,i=this.engine.card,o=i.find(n);if(o){var a,s=o.getCenter().get();if(s&&(!n.isElement()||(null!==(a=n[0].parentElement)&&void 0!==a?a:n[0].parentNode)!==o.root[0]||n.attributes(Ct))){var l=function(){var t=cn.create(e.engine);return t.select(s,!0),t.comparePoint(n,r)<0};if("inline"===o.type)return t.select(o.root),void t.collapse(l());l()?i.focusPrevBlock(o,t,!0):i.focusNextBlock(o,t,!0)}}}},{key:"get",value:function(){var t=this.engine.container,e=t.window,n=cn.from(this.engine,e,!1);return n||(n=cn.create(this.engine,e.document).select(t,!0).shrinkToElementNode().collapse(!1)),n}},{key:"select",value:function(t){var e,n,r,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=this.engine,a=o.container,s=o.inline,l=o.node,c=o.change,u=a.window,d=null===u||void 0===u?void 0:u.getSelection();if(!c.isComposing()){if(t.collapsed){var h,p,f,g,m=t.startNode,v=t.startOffset;if((m.isElement()&&1===v&&1===(null===(h=m.get())||void 0===h?void 0:h.childNodes.length)||2===v&&2===(null===(p=m.get())||void 0===p?void 0:p.childNodes.length)&&(null===(f=m.first())||void 0===f?void 0:f.isCard()))&&"br"===(null===(g=m.last())||void 0===g?void 0:g.name)&&(t.setStart(m,v-1),t.collapse(!0)),m.isText()){var b=m.parent();"right"===(null===b||void 0===b?void 0:b.attributes(Ct))&&0===v?(t.setStart(m,1),t.collapse(!0)):"left"===(null===b||void 0===b?void 0:b.attributes(Ct))&&1===v&&(t.setStart(m,0),t.collapse(!0))}}var y=t.cloneRange().shrinkToTextNode(),w=y.startNode,x=y.endNode,C=y.startOffset,k=y.endOffset,A=w.prev(),S=x.next();if(A&&!A.isCard()&&!l.isVoid(A)&&l.isInline(A)){var E=w.text();/^\u200B/g.test(E)&&0===C&&(t.setStart(x,C+1),t.collapsed&&t.collapse(!0))}if(S&&!S.isCard()&&!l.isVoid(S)&&l.isInline(S)){var O=x.text();/\u200B$/g.test(O)&&k===O.length&&(t.setEnd(x,k-1),t.collapsed&&t.collapse(!1))}var _=s.closest(w);if(!_.isCard()&&l.isInline(_)&&!l.isVoid(_)){var M,N;if(w.isText()&&!w.prev()&&(null===(M=w.parent())||void 0===M?void 0:M.equal(_))&&0===C){var P=w.text();/^\u200B/g.test(P)&&(t.setStart(w,C+1),t.collapsed&&t.collapse(!0))}if(x.isText()&&!x.next()&&(null===(N=x.parent())||void 0===N?void 0:N.equal(_))){var L=x.text();k===L.length&&/\u200B$/g.test(L)&&(t.setEnd(x,k-1),t.collapsed&&t.collapse(!1))}}if(w=t.startNode,x=t.endNode,w.isText()||x.isText()){var D=t.cloneRange().enlargeFromTextNode();w=D.startNode,x=D.endNode}var j=w.children();l.isCustomize(w)&&0===C&&t.setStart(w,1),l.isCustomize(x)&&0===k&&t.setEnd(x,1);var I=this.engine.ot.isStopped();if("p"===w.name&&!I)if(0===j.length)w.append("<br />");else if(!jt&&j.length>1&&"BR"!==j[j.length-2].nodeName&&"BR"===j[j.length-1].nodeName){var R=w.last();null===R||void 0===R||R.remove()}t.collapsed||I||"p"!==x.name||0!==(null===(e=x.get())||void 0===e?void 0:e.childNodes.length)||x.append("<br />");var F=w.children();if(l.isList(w)&&!I&&(0===F.length||"BR"===F[0].nodeName)){var B=He("<p><br /></p>");this.engine.nodeId.create(B),w.before(B),w.remove(),w=B}if("li"===w.name&&!I){var z;if(l.isCustomize(w)&&!(null===(z=w.first())||void 0===z?void 0:z.isCard())){var H,V,q=null===(H=w.parent())||void 0===H?void 0:H.children().toArray().find((function(t){var e;return null===(e=t.first())||void 0===e?void 0:e.isCard()})),U=null===q||void 0===q||null===(V=q.first())||void 0===V?void 0:V.attributes(bt);U?this.engine.list.addCardToCustomize(w,U):this.engine.list.unwrapCustomize(w)}if(0===j.length)w.append("<br />");else if(!l.isCustomize(w)&&j.length>1&&"BR"!==j[j.length-2].nodeName&&"BR"===j[j.length-1].nodeName){var W;null===(W=w.last())||void 0===W||W.remove()}else if(l.isCustomize(w)&&1===j.length)w.append("<br />");else if(l.isCustomize(w)&&j.length>2&&"BR"!==j[j.length-2].nodeName&&"BR"===j[j.length-1].nodeName){var $;null===($=w.last())||void 0===$||$.remove()}}if(!t.collapsed&&"li"===x.name&&!I){var G=x.children();if(0===G.length)x.append("<br />");else if(!l.isCustomize(x)&&G.length>1&&"BR"!==G[G.length-2].nodeName&&"BR"===G[G.length-1].nodeName){var Y;null===(Y=w.last())||void 0===Y||Y.remove()}else if(l.isCustomize(x)&&1===G.length)x.append("<br />");else if(l.isCustomize(x)&&G.length>2&&"BR"!==G[G.length-2].nodeName&&"BR"===G[G.length-1].nodeName){var X;null===(X=w.last())||void 0===X||X.remove()}}!w.isEditable()||I||0!==(null===(n=w.get())||void 0===n?void 0:n.childNodes.length)||this.engine.ot.isStopped||w.html("<p><br /></p>"),d&&(t.collapsed||d.rangeCount>0&&!t.equal(d.getRangeAt(0)))&&(null===(r=t.startNode.get())||void 0===r?void 0:r.isConnected)&&(d.removeAllRanges(),d.addRange(t.toRange()));var K=Object(T["a"])(this,Tn)[Tn].onSelect;K&&i&&K(t)}}},{key:"focus",value:function(t){var e,n=this,r=Object(T["a"])(this,On)[On]||this.get();void 0!==t&&r.select(this.engine.container,!0).shrinkToElementNode().collapse(t),this.select(r);var i=r.commonAncestorNode.closest(ot);if(null===i||void 0===i||null===(e=i.get())||void 0===e||e.focus(),i.length>0&&!this.engine.container.equal(i)){var o,a=new MouseEvent("mousedown");null===(o=this.engine.container.get())||void 0===o||o.dispatchEvent(a),setTimeout((function(){var t,e=new MouseEvent("mouseup");null===(t=n.engine.container.get())||void 0===t||t.dispatchEvent(e)}),0)}}},{key:"blur",value:function(){var t,e,n=this.get();null===(t=n.commonAncestorNode.closest(ot).get())||void 0===t||t.blur(),null===(e=this.engine.container.get())||void 0===e||e.blur(),this.engine.trigger("blur")}}]),t}(),Mn=new WeakMap,Nn=new WeakMap,Pn=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(c["a"])(this,t),this.engine=void 0,this.options=void 0,this.event=void 0,this.valueCached=null,this.onChange=void 0,this.onRealtimeChange=void 0,this.onSelect=void 0,this.onSelectStart=void 0,this.onSelectEnd=void 0,this.onSetValue=void 0,this.rangePathBeforeCommand=void 0,this.marks=[],this.blocks=[],this.inlines=[],this.changeTrigger=[],this.range=void 0,this.nativeEvent=void 0,this.options=r,this.engine=e,this.event=new yn(e,{}),this.onChange=this.options.onChange||function(){},this.onRealtimeChange=this.options.onRealtimeChange||function(){};var i=null;this.onSelect=function(t){var r,o,a,s,l=e.mark,c=e.block,u=e.inline;t=t||n.range.get(),n.marks=l.findMarks(t),n.blocks=c.findBlocks(t),n.inlines=u.findInlines(t),(null===(r=i)||void 0===r?void 0:r.startContainer)===t.startContainer&&(null===(o=i)||void 0===o?void 0:o.startOffset)===t.startOffset&&(null===(a=i)||void 0===a?void 0:a.endContainer)===t.endContainer&&(null===(s=i)||void 0===s?void 0:s.endOffset)===t.endOffset||(i={startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},Nn.get(n.engine)||(Nn.set(n.engine,!0),Promise.resolve().then((function(){Nn.set(n.engine,!1),n.options.onSelect&&n.options.onSelect()}))))},this.onSelectStart=function(){n.options.onSelectStart&&n.options.onSelectStart()},this.onSelectEnd=function(){n.options.onSelectEnd&&n.options.onSelectEnd()},this.onSetValue=this.options.onSetValue||function(){},this.range=new _n(e,{onSelect:function(t){n.onSelect(t)}}),this.nativeEvent=new En(e)}return Object(u["a"])(t,[{key:"init",value:function(){this.nativeEvent.init()}},{key:"_change",value:function(){if(!this.isComposing()){this.engine.card.gc();var t=2===this.changeTrigger.length?"both":"remote"===this.changeTrigger[0]?"remote":"local";this.onChange(t),this.changeTrigger=[]}}},{key:"change",value:function(t,e){var n=this,r=t?"remote":"local",i=void 0;if(t)null===e||void 0===e||e.forEach((function(t){if(i=t.closest(ot),i&&i.length>0){var e=n.engine.card.find(i,!0);(null===e||void 0===e?void 0:e.onChange)&&(null===e||void 0===e||e.onChange(r,i))}}));else{var o=this.range.get(),a=o.startNode;if(a.inEditor())i=a.closest(ot);else{var s,l=a.closest(rt),c=l.attributes(Mt);if(c)i=null===(s=this.engine.card.find(c))||void 0===s?void 0:s.root.closest(ot)}if(i&&i.length>0){var u=this.engine.card.find(i,!0);(null===u||void 0===u?void 0:u.onChange)&&(null===u||void 0===u||u.onChange(r,i))}else null===e||void 0===e||e.forEach((function(t){if(i=t.closest(ot),i&&i.length>0){var e=n.engine.card.find(i,!0);(null===e||void 0===e?void 0:e.onChange)&&(null===e||void 0===e||e.onChange(r,i))}}))}this.onRealtimeChange(r),this.changeTrigger.indexOf(r)<0&&this.changeTrigger.push(r),Mn.get(this.engine)||(Mn.set(this.engine,!0),Promise.resolve().then((function(){Mn.set(n.engine,!1),n._change()})))}},{key:"isComposing",value:function(){return this.event.isComposing}},{key:"isSelecting",value:function(){return this.event.isSelecting}},{key:"initValue",value:function(t){var e,n,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.engine.container,o=i.html(),a="<p><br /></p>";if(!(o===a||((null===(e=i.get())||void 0===e?void 0:e.childNodes.length)||0)>0)){var s=o||a,l=He(s);0===(null===(n=l.get())||void 0===n?void 0:n.childNodes.length)&&l.html("<br />"),i.empty().append(l);var c=t||this.range.get();!t&&r&&(c.select(l,!0).collapse(!1),this.apply(c))}}},{key:"setValue",value:function(t,e,n){var r=this.range.get(),i=this.engine,o=i.schema,a=i.conversion,s=i.container,l=i.history,c=i.mark,u=i.card;if(""===t)this.engine.container.html(t),this.initValue(void 0,!1),n&&n(0);else{var d=new kn(t,this.engine,(function(t){c.removeEmptyMarks(t),t.allChildren("editable").forEach((function(t){e&&e(t)}))}),!1);s.html(d.toValue(o,a,!1,!0)),u.render(void 0,(function(t){n&&n(t)}));var h=s.find(mt),p=new Ke(this.engine,r);h.length>0&&(p.anchor=h,p.focus=h);var f=s.find(ft),g=s.find(gt);f.length>0&&g.length>0&&(p.anchor=f,p.focus=g),p.anchor&&p.focus&&(p.move(),this.range.select(r),this.onSelect()),this.onSetValue(),l.clear()}this.change()}},{key:"setHtml",value:function(t,e){var n=this,r=this.engine,i=r.card,o=r.container;this.nativeEvent.paste(t,void 0,e,!0,(function(t,r,a,s){o.empty().append(t),i.render(void 0,(function(t){n.initValue(void 0,!1),n.engine.trigger("paste:after"),e&&e(t)})),n.change()}),!1)}},{key:"setMarkdown",value:function(t,e){var n=this,r=ge(this.engine,"zero");r.enable(["paragraph","html_inline","newline"]);var i=r.parse(t,{});if(0!==i.length){var o=me(this.engine,r,i);o||(o=t);var a=this.engine,s=a.card,l=a.container;this.nativeEvent.paste(o,void 0,e,!0,(function(t,r,i,o){l.empty().append(t),s.render(void 0,(function(t){n.initValue(void 0,!1),n.engine.trigger("paste:after"),e&&e(t)})),n.change()}))}}},{key:"getOriginValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.engine.container,e=this.engine,n=e.schema,r=e.conversion;return new kn(t.clone(!0),this.engine,void 0,!1).toValue(n,r)}},{key:"getValue",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.ignoreCursor||this.isComposing())t=this.getOriginValue();else{var n,r,i=this.range.get();if(!i.inCard()){var o=i.toPath(!0);if(!o)return this.getOriginValue();i=cn.fromPath(this.engine,o,!0),r=i.createSelection()}t=this.getOriginValue(),null===(n=r)||void 0===n||n.move()}return t}},{key:"cacheRangeBeforeCommand",value:function(){this.rangePathBeforeCommand=this.range.get().toPath()}},{key:"getRangePathBeforeCommand",value:function(){var t=this.rangePathBeforeCommand;return this.rangePathBeforeCommand=void 0,t}},{key:"isEmpty",value:function(){var t=this.engine,e=t.container,n=t.node,r=t.schema,i=r.getAllowInTags(),o=e.children();return 0===o.length||1===o.length&&n.isEmpty(e)&&!e.allChildren().some((function(t){return i.includes(t.name)}))}},{key:"combinText",value:function(){ue(this.engine.container)}},{key:"apply",value:function(t){this.combinText();var e=this.engine,n=e.inline,r=e.mark,i=e.nodeId;if(t){var o=t.createSelection("change-apply");n.findInlines(t).forEach((function(t){return n.repairCursor(t)})),r.findMarks(t).forEach((function(t){return r.repairCursor(t)})),o.move(),t.shrinkToTextNode(),this.range.select(t)}this.change(),i.generateAll(this.engine.container)}},{key:"insert",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.engine,a=o.block,s=o.list,l=o.schema,c=o.mark,u=o.inline,d=this.engine.node;e=e||this.range.toTrusty();var h=a.closest(e.startNode),p=a.closest(e.endNode),f=p[0]===h[0],g=a.isLastOffset(e,"end"),m=l.getCanMergeTags(),v=l.getAllowInTags(),b=h.closest(m.join(",")),y=e.collapsed,w=t.childNodes,x=He(t.firstChild||[]),C=function(){var n,r=He(t),i=r.first(),o=e.cloneRange().shrinkToElementNode().shrinkToTextNode(),a=o.startNode;if(a.inEditor()&&i&&"p"===i.name&&(1!==i.length||"br"!==(null===(n=i.first())||void 0===n?void 0:n.name))){if("p"===a.name&&d.isEmptyWidthChild(a)){var s=i.css();a.css(s)}d.unwrap(i)}};if(y){if(C(),e.startNode.isText()){var k=u.closest(e.startNode),A=e.startNode.text();0===k.length&&!k.equal(e.startNode)&&/^\u200B/.test(A)&&e.startNode.text(A.substr(1))}}else this.delete(e,f||!g,i),d.isEmptyWidthChild(e.startNode)&&e.shrinkToElementNode().shrinkToTextNode(),C();var S=void 0,E=function(t){S&&S.node[0].isConnected&&(t.shrinkToElementNode().setStart(S.node,S.offset),t.enlargeToElementNode()),a.merge(t),s.merge(void 0,t),c.merge(t),u.flat(t),r&&r(t),n.apply(t)};if(d.isList(e.startNode)||e.startNode.closest("li").length>0){var O=e.startNode.children();return S={node:e.startNode,offset:1===O.length&&"BR"===O[0].nodeName?0:e.startOffset},s.insert(t,e),void E(e)}if(x[0]){if(!d.isBlock(x)){if(e.shrinkToElementNode(),w.length>0){var T=e.startNode.children();S={node:e.startNode,offset:1===T.length&&"BR"===T[0].nodeName?0:e.startOffset}}var _=x.next(),M=x,N=d.insert(x,e);N&&(e=N);while(_&&!d.isBlock(_)){e.startContainer.nodeType===Node.TEXT_NODE&&e.enlargeToElementNode().collapse(!1);var P=_.next();M.after(_),M=_,_=P}if(M!==x&&e.select(M,!0).collapse(!1),0===w.length)return void E(e)}var L=e.cloneRange().enlargeToElementNode(!0).collapse(!1),D=L.startContainer.childNodes[0===e.startOffset?0:e.startOffset-1],j=L.startContainer.childNodes[e.startOffset];if(0!==w.length){var I=He(w[w.length-1]);if("br"===I.name&&(I.remove(),I=He(w[w.length-1])),!S){var R=e.startNode.children();S={node:e.startNode,offset:1===R.length&&"BR"===R[0].nodeName?0:e.startOffset}}var F=He(w[0]),B=null,z=[];while(F&&F.length>0){var H,V;d.removeSide(F);var q=F.next();if(q||(I=F),B?B.after(F):(d.isInline(e.startNode)&&(e.setStartAfter(e.startNode),e.collapse(!0)),d.insert(F,e,!0),d.isInline(F)&&(e.setEndAfter(F),e.collapse(!1))),(null===(H=F.get())||void 0===H?void 0:H.isConnected)&&z.push(F),d.isBlock(F)||(null===q||void 0===q?void 0:q.isText())?B=F:(B&&e.select(F,!0).collapse(!1),B=null),q||!(null===(V=F.get())||void 0===V?void 0:V.isConnected)||d.isInline(F)||e.select(F,!0).collapse(!1),S&&!S.node[0].isConnected){var U=F.parent();U&&(S={node:U,offset:F.index()})}F=q}b[0]&&z.forEach((function(t){m.indexOf(t.name)<0&&0===t.closest(b.name).length&&d.wrap(t,d.clone(b,!1,!1))}))}var W=function(t){var e=t.first();if(!e||!d.isBlock(e))return t;while(v.indexOf(e?e.name:"")>-1)e=e.first();return e},$=function(t){var e=t.last();if(!e||!d.isBlock(e))return t;while(v.indexOf(e?e.name:"")>-1)e=e.last();return e},G=function(t,e){if(!t.isCard()&&!x.isCard()){var n=e.parent(),r=t.parent(),i=n&&!n.isEditable()&&r&&!r.isEditable()&&n.name===r.name;return"p"===e.name&&i||t.name===e.name&&i&&!("li"===t.name&&!s.isSame(t.parent(),e.parent()))}},Y=function(t){while(!t.isEditable()){var e=t.parent();if(t.remove(),!e||!d.isEmpty(e))break;t=e}},X=function(t,e){if(t.name===e.name&&"p"===t.name){var n=e.attributes();n[Q]&&delete n[Q],t.attributes(n)}d.isEmptyWidthChild(t)&&!d.isEmptyWidthChild(e)&&(t.get().innerHTML=""),d.isCustomize(t)===d.isCustomize(e)&&s.unwrapCustomize(e)};if(D){var K=W(He(D.nextSibling||[])),Z=$(He(D));"p"===Z.name&&K.name!==Z.name&&G(Z,K)&&(X(Z,K),d.merge(Z,K,!1),Y(K))}if(j){var J=$(He(j.previousSibling||[])),tt=W(He(j));J&&G(J,tt)&&(d.merge(J,tt,!1),Y(tt))}E(e)}else E(e)}},{key:"paste",value:function(t,e,n){this.nativeEvent.paste(t,e,n,!0)}},{key:"delete",value:function(t,e){var n,r,i,o,a,s,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=t||this.range.toTrusty();if(c.collapsed)return this.isEmpty()&&this.initValue(c),void(t||this.apply(c));var u=this.engine,d=u.mark,h=u.inline,p=u.card,f=this.engine.node,g=this.engine.block,m=c.cloneRange();m.collapse(!0);var v=l?d.findMarks(m):[];c.enlargeToElementNode();var b=g.closest(c.cloneRange().shrinkToElementNode().shrinkToTextNode().enlargeToElementNode().startNode);if(!b.inEditor()&&!b.isRoot())return this.isEmpty()&&this.initValue(c),void(t||this.apply(c));if(b.isRoot()){var y=b.children().eq(c.startOffset);while(null===(w=y)||void 0===w?void 0:w.isCard()){var w,x=y.equal(c.endNode)||y.contains(c.endNode),C=y.next()||void 0,k=p.find(y);if(k?p.removeNode(k):y.remove(),x){y=void 0;break}y=C}if(!y)return this.isEmpty()&&this.initValue(c),void(t||this.apply(c));b=y}var A=c.endNode,S=c.endOffset,E=!g.closest(c.startNode).equal(g.closest(A)),O=h.closest(A);if(O.length>0&&(null===(n=A.parent())||void 0===n?void 0:n.equal(O))&&A.isText()){var T=A.text();S===T.length-1&&c.setEndAfter(O)}var _=c.cloneRange().shrinkToElementNode().shrinkToTextNode().getEndOffsetNode();c.extractContents();var M=c.startNode;if(M.isEditable()&&0===(null===(r=M.get())||void 0===r?void 0:r.childNodes.length)&&(M.html("<p><br /></p>"),this.engine.nodeId.generate(M)),M=c.shrinkToElementNode().shrinkToTextNode().enlargeToElementNode().startNode,M.isCard()&&0===M.find(Tt).length&&p.remove(M),c.collapse(!0),M=c.shrinkToElementNode().shrinkToTextNode().enlargeToElementNode().startNode,b.isElement()&&!b.equal(M)&&0===b.get().childNodes.length&&b.remove(),M.isText()||!b.inEditor())return this.isEmpty()&&this.initValue(c),void(t||this.apply(c));var N=!1;if(E&&0===(null===(i=M.get())||void 0===i?void 0:i.childNodes.length)){var P,L,D,j,I=c.createSelection();M.remove(),(null===(P=I.anchor)||void 0===P||null===(L=P.get())||void 0===L?void 0:L.isConnected)&&(null===(D=I.focus)||void 0===D||null===(j=D.get())||void 0===j?void 0:j.isConnected)&&I.move(),N=!0,M=c.startNode}var R,F,B=b,z=_&&_.isConnected?M:null,H=0===(null===(o=M.get())||void 0===o?void 0:o.childNodes.length);!H&&M.length>0&&M.inEditor()&&(1===M[0].childNodes.length&&(null===(R=M[0].firstChild)||void 0===R?void 0:R.nodeType)===Node.ELEMENT_NODE&&f.isCustomize(M)&&(null===(F=M.first())||void 0===F?void 0:F.isCard())&&(H=!0));if(H&&f.isBlock(M)&&M.inEditor()){if(f.isList(M))M.remove();else{var V=f.getBatchAppendHTML(v,"<br />");M.isEditable()&&(V="<p>".concat(V,"</p>")),M.append(He(V));var q=M.find("br"),U=q.parent();U&&f.isMark(U)&&f.replace(q,He("",null)),c.select(M,!0)}return c.shrinkToElementNode().shrinkToTextNode(),c.collapse(!1),this.isEmpty()&&this.initValue(c),void(t||this.apply(c))}var W,$=function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(f.isBlock(n)&&!f.isVoid(n)&&!n.isCard()){e.select(n,!0),e.collapse(!1);var a=e.shrinkToElementNode().shrinkToTextNode().createSelection(),s=r.parent();f.merge(n,r);while(s&&f.isBlock(s)&&f.isEmpty(s))s.remove(),s=s.parent();a.move(),e.enlargeToElementNode(!0);var l=e.getPrevNode(),c=e.getNextNode(),u=e.startNode;l||c||!f.isBlock(u)||(u.append(He(f.getBatchAppendHTML(i,"<br />"))),e.select(u.find("br"),!0),e.collapse(!1)),l&&c&&!l.isCard()&&!c.isCard()&&o&&t(e,l,c,i)}};if(B&&z&&z.length>0&&f.isBlock(B)&&f.isBlock(z)&&!B.equal(z)&&!(null===(a=B.parent())||void 0===a?void 0:a.equal(z))&&z.inEditor()&&$(c,B,z,v,e),M.children().each((function(t){var e=He(t);!f.isVoid(e)&&e.isElement()&&""===f.html(e)&&e.remove(),f.isInline(e)&&h.repairCursor(e)})),f.isList(M)&&f.isEmpty(M)&&M.remove(),m=c.cloneRange().shrinkToTextNode(),m.startNode.isText()&&/^\u200B/g.test(m.startNode.text())&&0===m.startOffset){var G=m.startNode.prev();G&&this.engine.node.isInline(G)&&(c.select(G,!0),c.collapse(!1))}(f.isBlock(M)&&0===(null===(s=M.get())||void 0===s?void 0:s.childNodes.length)&&M.html("<br />"),N)&&(f.isBlock(B)&&0===(null===(W=B.get())||void 0===W?void 0:W.childNodes.length)&&B.html("<br />"),B.inEditor()&&c.select(B,!0).collapse(!1));this.isEmpty()&&this.initValue(c),t||this.apply(c)}},{key:"unwrap",value:function(t){var e=this.engine.block,n=this.range.get();if(t=t||e.closest(n.startNode),t.inEditor()){var r=n.createSelection();this.engine.node.unwrap(t),r.move(),this.range.select(n)}}},{key:"mergeAfterDelete",value:function(t){var e,n,r=this.engine,i=r.block,o=r.card,a=r.list,s=r.mark,l=this.engine.node,c=this.range.get();t=t||i.closest(c.startNode);var u=t.children();if(0===u.length)return t.append(He("<br />")),void this.apply(c);var d=t.first();if(u.length>1&&"br"===(null===d||void 0===d?void 0:d.name))null===d||void 0===d||d.remove();else{var h=t.prev();if(h){if(h.isCard()){(1===u.length&&"br"===(null===d||void 0===d?void 0:d.name)||l.isEmpty(t))&&t.remove();var p=o.find(h);if(p)return void o.focus(p)}if(l.isVoid(h))return h.remove(),void this.apply(c);if(l.isRootBlock(h)&&l.isEmpty(h))return h.remove(),void this.apply(c);if(h.isText()){var f=He("<p />");h.before(f),f.append(h),h=f}if(l.isList(h)&&(h=h.last()),1===u.length&&"br"===(null===d||void 0===d?void 0:d.name))null===d||void 0===d||d.remove();else if(h&&1===(null===(e=h.get())||void 0===e?void 0:e.childNodes.length)&&"br"===(null===(n=h.first())||void 0===n?void 0:n.name)){var g;null===(g=h.first())||void 0===g||g.remove()}if(!h||h.isText())this.unwrap(t);else{var m=c.createSelection();l.merge(h,t),m.move(),this.range.select(c),s.merge(),a.merge()}}else{var v=t.parent();(null===v||void 0===v?void 0:v.inEditor())&&!(null===v||void 0===v?void 0:v.isEditable())&&this.unwrap(t)}}}},{key:"destroy",value:function(){this.event.destroy()}}]),t}(),Ln={adjustX:!0,adjustY:!0},Dn=[0,0],jn={left:{points:["cr","cl"],overflow:Ln,offset:[-4,0],targetOffset:Dn},right:{points:["cl","cr"],overflow:Ln,offset:[4,0],targetOffset:Dn},top:{points:["bc","tc"],overflow:Ln,offset:[0,-4],targetOffset:Dn},bottom:{points:["tc","bc"],overflow:Ln,offset:[0,4],targetOffset:Dn},topLeft:{points:["bl","tl"],overflow:Ln,offset:[0,-4],targetOffset:Dn},leftTop:{points:["tr","tl"],overflow:Ln,offset:[-4,0],targetOffset:Dn},topRight:{points:["br","tr"],overflow:Ln,offset:[0,-4],targetOffset:Dn},rightTop:{points:["tl","tr"],overflow:Ln,offset:[4,0],targetOffset:Dn},bottomRight:{points:["tr","br"],overflow:Ln,offset:[0,4],targetOffset:Dn},rightBottom:{points:["bl","br"],overflow:Ln,offset:[4,0],targetOffset:Dn},bottomLeft:{points:["tl","bl"],overflow:Ln,offset:[0,4],targetOffset:Dn},leftBottom:{points:["br","bl"],overflow:Ln,offset:[-4,0],targetOffset:Dn}},In=".data-tooltip {\r\n\tfont-size: 14px;\r\n\tfont-variant: tabular-nums;\r\n\tline-height: 1.5;\r\n\tcolor: rgba(0, 0, 0, 0.65);\r\n\t-webkit-box-sizing: border-box;\r\n\tbox-sizing: border-box;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\tlist-style: none;\r\n\tposition: absolute;\r\n\tz-index: 1060;\r\n\tdisplay: block;\r\n\tvisibility: visible;\r\n\tmax-width: 320px;\r\n\tword-wrap:break-word;\r\n top: 0;\r\n}\r\n\r\n.data-tooltip-hidden {\r\n\topacity: 0;\r\n\tvisibility: hidden;\r\n\ttransition: opacity 0.3s ease-in-out;\r\n}\r\n\r\n.data-tooltip-active {\r\n\topacity: 1;\r\n\tvisibility: visible;\r\n}\r\n\r\n.data-tooltip-placement-top,.data-tooltip-placement-topLeft,.data-tooltip-placement-topRight {\r\n\tpadding-bottom: 8px;\r\n}\r\n\r\n.data-tooltip-placement-right,.data-tooltip-placement-rightTop,.data-tooltip-placement-rightBottom {\r\n\tpadding-left: 8px;\r\n}\r\n\r\n.data-tooltip-placement-bottom,.data-tooltip-placement-bottomLeft,.data-tooltip-placement-bottomRight {\r\n\tpadding-top: 8px;\r\n}\r\n\r\n.data-tooltip-placement-left,.data-tooltip-placement-leftTop,.data-tooltip-placement-leftBottom {\r\n\tpadding-right: 8px;\r\n}\r\n\r\n.data-tooltip-inner {\r\n\tpadding: 6px 8px;\r\n\tcolor: #fff;\r\n\ttext-align: left;\r\n\ttext-decoration: none;\r\n\tbackground-color: rgba(0, 0, 0, 0.75);\r\n\tborder-radius: 4px;\r\n\t-webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\r\n\tbox-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\r\n\tword-wrap: break-word;\r\n}\r\n\r\n.data-tooltip-arrow {\r\n\tposition: absolute;\r\n\twidth: 0;\r\n\theight: 0;\r\n\tborder-color: transparent;\r\n\tborder-style: solid;\r\n}\r\n\r\n.data-tooltip-placement-top .data-tooltip-arrow,.data-tooltip-placement-topLeft .data-tooltip-arrow,.data-tooltip-placement-topRight .data-tooltip-arrow {\r\n\tbottom: 3px;\r\n\tborder-width: 5px 5px 0;\r\n\tborder-top-color: rgba(0, 0, 0, 0.75);\r\n}\r\n\r\n.data-tooltip-placement-top .data-tooltip-arrow {\r\n\tleft: 50%;\r\n\tmargin-left: -5px;\r\n}\r\n\r\n.data-tooltip-placement-topLeft .data-tooltip-arrow {\r\n\tleft: 16px;\r\n}\r\n\r\n.data-tooltip-placement-topRight .data-tooltip-arrow {\r\n\tright: 16px;\r\n}\r\n\r\n.data-tooltip-placement-right .data-tooltip-arrow,.data-tooltip-placement-rightTop .data-tooltip-arrow,.data-tooltip-placement-rightBottom .data-tooltip-arrow {\r\n\tleft: 3px;\r\n\tborder-width: 5px 5px 5px 0;\r\n\tborder-right-color: rgba(0, 0, 0, 0.75);\r\n}\r\n\r\n.data-tooltip-placement-right .data-tooltip-arrow {\r\n\ttop: 50%;\r\n\tmargin-top: -5px;\r\n}\r\n\r\n.data-tooltip-placement-rightTop .data-tooltip-arrow {\r\n\ttop: 8px;\r\n}\r\n\r\n.data-tooltip-placement-rightBottom .data-tooltip-arrow {\r\n\tbottom: 8px;\r\n}\r\n\r\n.data-tooltip-placement-left .data-tooltip-arrow,.data-tooltip-placement-leftTop .data-tooltip-arrow,.data-tooltip-placement-leftBottom .data-tooltip-arrow {\r\n\tright: 3px;\r\n\tborder-width: 5px 0 5px 5px;\r\n\tborder-left-color: rgba(0, 0, 0, 0.75);\r\n}\r\n\r\n.data-tooltip-placement-left .data-tooltip-arrow {\r\n\ttop: 50%;\r\n\tmargin-top: -5px;\r\n}\r\n\r\n.data-tooltip-placement-leftTop .data-tooltip-arrow {\r\n\ttop: 8px;\r\n}\r\n\r\n.data-tooltip-placement-leftBottom .data-tooltip-arrow {\r\n\tbottom: 8px;\r\n}\r\n\r\n.data-tooltip-placement-bottom .data-tooltip-arrow,.data-tooltip-placement-bottomLeft .data-tooltip-arrow,.data-tooltip-placement-bottomRight .data-tooltip-arrow {\r\n\ttop: 3px;\r\n\tborder-width: 0 5px 5px;\r\n\tborder-bottom-color: rgba(0, 0, 0, 0.75);\r\n}\r\n\r\n.data-tooltip-placement-bottom .data-tooltip-arrow {\r\n\tleft: 50%;\r\n\tmargin-left: -5px;\r\n}\r\n\r\n.data-tooltip-placement-bottomLeft .data-tooltip-arrow {\r\n\tleft: 16px;\r\n}\r\n\r\n.data-tooltip-placement-bottomRight .data-tooltip-arrow {\r\n\tright: 16px;\r\n}";pn(In);var Rn=function(t){return"\n <div ".concat(J,'="tooltip" class="data-tooltip data-tooltip-placement-').concat(t.placement,' data-tooltip-hidden" style="transform-origin: 50% 45px 0px;">\n <div class="data-tooltip-content">\n <div class="data-tooltip-arrow"></div>\n <div class="data-tooltip-inner" data-role="tooltip"></div>\n </div>\n </div>')},Fn=function(){function t(){Object(c["a"])(this,t)}return Object(u["a"])(t,null,[{key:"show",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{placement:"top"};t.hide();var i=He(Rn(r));"string"===typeof n?i.find("[data-role=tooltip]").html(n):i.find("[data-role=tooltip]").append(n);var o=He(document.body);o.append(i);var a=Object(j["c"])(i.get(),e.get(),Object(l["a"])({},jn[r.placement])),s=Object.keys(jn).find((function(t){var e=jn[t].points;return e[0]===a.points[0]&&e[1]===a.points[1]}));s!==r.placement&&i.removeClass("data-tooltip-placement-".concat(r.placement)).addClass("data-tooltip-placement-".concat(s)),i.addClass("data-tooltip-active")}},{key:"hide",value:function(){He("div[".concat(J,"=tooltip]")).remove()}}]),t}(),Bn=function(t){return'\n <span class="data-toolbar-item">\n <a class="data-toolbar-btn"'.concat(t.disabled?' disabled="disabled"':""," ").concat(t.link?' href="'+t.link+'" target="_blank"':"",">\n ").concat(t.content,"\n </a>\n </span>")},zn=function(){function t(e){Object(c["a"])(this,t),this.options=void 0,this.root=void 0,this.options=e,this.root=He(Bn(e)),e.style&&this.root.attributes("style",e.style),e.class&&this.root.addClass(e.class)}return Object(u["a"])(t,[{key:"getPlacement",value:function(){var t=this.root.closest(".data-toolbar").attributes("data-placement")||"top";return t.startsWith("top")?"top":"bottom"}},{key:"render",value:function(t){var e=this,n=this.options,r=n.title,i=n.didMount,o=n.onClick,a=n.link;t.append(this.root),r&&(this.root.on("mouseenter",(function(){var t=e.getPlacement();Fn.show(e.root,"function"===typeof r?r():r,{placement:t})})),this.root.on("mouseleave",(function(){Fn.hide()})),this.root.on("mousedown",(function(){Fn.hide()}))),!a&&o&&this.root.find("a").on("click",(function(t){t.preventDefault(),t.stopPropagation(),o(t,e.root)})),i&&i(this.root)}}]),t}(),Hn=function(t){var e=!!t.checked;return t.getState&&(e=t.getState()),'\n <div class="data-toolbar-item data-toolbar-dropdown-item data-toolbar-dropdown-switch">\n <span class="data-toolbar-dropdown-item-content"'.concat(t.disabled?' disabled="disabled"':"",">").concat(t.content,'</span>\n <button type="button"').concat(t.disabled?' disabled="disabled"':"",' role="switch" aria-checked="true" class="switch-btn ').concat(e?" switch-checked":"",'">\n <div class="switch-handle"></div>\n <span class="switch-inner"></span>\n </button>\n </div>')},Vn=function(){function t(e){Object(c["a"])(this,t),this.options=void 0,this.root=void 0,this.switch=void 0,this.options=e}return Object(u["a"])(t,[{key:"renderTo",value:function(t){var e=this;this.root=He(Hn(this.options)),this.switch=this.root.find(".switch-btn"),t.append(this.root),this.root.on("mousedown",(function(t){return t.preventDefault()}));var n=this.options.onClick;this.root.on("click",(function(t){t.stopPropagation(),n&&(n(t,e.root),e.updateSwitch())}))}},{key:"updateSwitch",value:function(){var t,e;this.options.getState&&(this.options.getState()?null===(t=this.switch)||void 0===t||t.addClass("switch-checked"):null===(e=this.switch)||void 0===e||e.removeClass("switch-checked"))}}]),t}(),qn=function(t){return'\n <div class="data-toolbar-item data-toolbar-dropdown-item data-toolbar-dropdown-btn">\n <span class="data-toolbar-dropdown-item-content"'.concat(t.disabled?' disabled="disabled"':"",">\n ").concat(t.content,"\n </span>\n </div>")},Un=function(){function t(e){Object(c["a"])(this,t),this.options=void 0,this.root=void 0,this.options=e}return Object(u["a"])(t,[{key:"renderTo",value:function(t){var e=this;this.root=He(qn(this.options)),t.append(this.root);var n=this.options.onClick;n&&this.root.on("click",(function(t){return n(t,e.root)}))}}]),t}(),Wn=function(t){return'\n <span class="data-toolbar-item data-toolbar-item-dropdown">\n <a class="data-toolbar-btn data-toolbar-dropdown"'.concat(t.disabled?' disabled="disabled"':"",">").concat(t.content,'</a>\n <div class="dropdown-container"></div>\n </span>')},$n=function(){function t(e){var n=this;Object(c["a"])(this,t),this.options=void 0,this.root=void 0,this.dropdown=void 0,this.documentMouseDown=function(t){var e;n.root&&!n.root[0].contains(t.target)&&(null===(e=n.dropdown)||void 0===e?void 0:e.hasClass("show"))&&n.hideDropdown()},this.options=e}return Object(u["a"])(t,[{key:"initToggleEvent",value:function(){var t=this,e=this.root.find(".data-toolbar-dropdown");e.on("mousedown",(function(t){t.preventDefault(),t.stopPropagation()})),e.on("click",(function(e){e.stopPropagation(),t.toggleDropdown()})),document.addEventListener("mousedown",this.documentMouseDown,!0)}},{key:"toggleDropdown",value:function(){var t;(null===(t=this.dropdown)||void 0===t?void 0:t.hasClass("show"))?this.hideDropdown():this.showDropdown()}},{key:"showDropdown",value:function(){var t;null===(t=this.dropdown)||void 0===t||t.addClass("show")}},{key:"hideDropdown",value:function(){var t;null===(t=this.dropdown)||void 0===t||t.removeClass("show")}},{key:"getPlacement",value:function(){var t=this.root.closest(".data-toolbar").attributes("data-placement")||"top";return t.startsWith("top")?"top":"bottom"}},{key:"renderTooltip",value:function(){var t=this,e=this.options.title;e&&(this.root.on("mouseenter",(function(){var n=t.getPlacement();Fn.show(t.root,"function"===typeof e?e():e,{placement:n})})),this.root.on("mouseleave",(function(){Fn.hide()})),this.root.on("mousedown",(function(){Fn.hide()})))}},{key:"renderDropdown",value:function(){var t=this;this.dropdown=this.root.find(".dropdown-container");var e=this.options.items;e.forEach((function(e){switch(e.type){case"switch":return new Vn(e).renderTo(t.dropdown);case"button":return new Un(e).renderTo(t.dropdown)}})),this.dropdown.on("click",(function(e){e.stopPropagation(),t.hideDropdown()}))}},{key:"render",value:function(t){this.root=He(Wn(this.options)),t.append(this.root),this.initToggleEvent(),this.renderTooltip(),this.renderDropdown();var e=this.options.didMount;e&&e(this.root)}},{key:"destroy",value:function(){document.removeEventListener("mousedown",this.documentMouseDown,!0)}}]),t}(),Gn=function(t){return'\n <span class="data-toolbar-item data-toolbar-item-input">\n '.concat(t.prefix?"<span class='data-toolbar-input-prefix'>"+Xt(t.prefix)+"</span>":"",'<input data-role="input" placeholder="').concat(Xt(t.placeholder),'" class="data-toolbar-input" type="input" value="').concat(Xt(t.value.toString()),'" />').concat(t.suffix?"<span class='data-toolbar-input-suffix'>"+Xt(t.suffix)+"</span>":"","\n </span>")},Yn=function(){function t(e){Object(c["a"])(this,t),this.options=void 0,this.root=void 0,this.onEnter=void 0,this.onInput=void 0,this.onChange=void 0,this.options=e,this.root=He(Gn(e)),this.onEnter=e.onEnter||function(){},this.onInput=e.onInput||function(){},this.onChange=e.onChange||function(){}}return Object(u["a"])(t,[{key:"find",value:function(t){var e="[data-role=".concat(t,"]");return this.root.find(e)}},{key:"render",value:function(t){var e=this,n=this.options,r=n.value,o=n.didMount,a=this.find("input"),s=a.get();s&&(s.value=(void 0!==r?r:"").toString(),a.on("keydown",(function(t){t.stopPropagation(),i()("enter",t)&&(t.preventDefault(),s.blur(),e.onEnter(s.value))})),a.on("input",(function(){e.onInput(s.value)})),a.on("change",(function(){setTimeout((function(){e.onChange(s.value)}),10)})),t.append(this.root),o&&o(this.root))}}]),t}(),Xn=function(t){var e=!!t.checked;return t.getState&&(e=t.getState()),'\n <div class="data-toolbar-switch">\n <span class="switch-content"'.concat(t.disabled?' disabled="disabled"':"",">").concat(t.content,'</span>\n <button type="button" role="switch" aria-checked="true" class="switch-btn ').concat(e?" switch-checked":"",'"').concat(t.disabled?' disabled="disabled"':"",'>\n <div class="switch-handle"></div>\n <span class="switch-inner"></span>\n </button>\n </div>')},Kn=function(){function t(e){Object(c["a"])(this,t),this.options=void 0,this.root=void 0,this.switch=void 0,this.options=e,this.root=He(Xn(e)),this.switch=this.root.find(".switch-btn"),e.class&&this.root.addClass(e.class)}return Object(u["a"])(t,[{key:"render",value:function(t){var e=this,n=this.options,r=n.didMount,i=n.onClick;t.append(this.root),this.root.on("mousedown",(function(t){return t.preventDefault()})),this.root.on("click",(function(t){t.stopPropagation(),i&&(i(t,e.root),e.updateSwitch())})),r&&r(this.root)}},{key:"updateSwitch",value:function(){var t,e;this.options.getState&&(this.options.getState()?null===(t=this.switch)||void 0===t||t.addClass("switch-checked"):null===(e=this.switch)||void 0===e||e.removeClass("switch-checked"))}}]),t}(),Zn='.data-toolbar {\n\tposition: absolute;\n\topacity: 0;\n\tvisibility: hidden;\n\twidth: auto;\n\tline-height: 26px;\n\tdisplay: flex;\n\tflex-direction: row;\n\tfont-size: 14px;\n\tfont-weight: normal;\n\ttext-indent: 0;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t user-select: none;\n z-index: 127;\n}\n\n.data-toolbar-active {\n\topacity: 1;\n\tvisibility: visible;\n}\n\n.data-toolbar-block {\n\ttop: auto;\n\tbottom: -46px;\n\tleft: -1px;\n\tright: auto;\n\theight: 40px;\n}\n\n.data-toolbar-btn {\n\tline-height: 26px;\n\tmin-width: 28px;\n\tdisplay: inline-block;\n\ttext-align: center;\n\tcolor: #595959;\n\ttransition: background-color 0.3s ease-in-out;\n\tcursor: pointer;\n}\n\n.data-toolbar-btn-disabled,.data-toolbar-btn-disabled:hover {\n\tbackground-color: transparent;\n\tbox-shadow: none;\n\tcursor: not-allowed;\n}\n\n.data-toolbar-group {\n\tborder: 1px solid rgba(226, 226, 226, 0.84);\n border-radius: 4px;\n box-shadow: 0px 2px 4px 0px rgb(225 225 225 / 50%);\n background: #fff;\n position: relative;\n display: inline-flex;\n padding: 5px;\n align-items: center;\n}\n\n.data-toolbar-item {\n\tposition: relative;\n\tdisplay: inline-block;\n\tline-height: 26px;\n\ttext-align: left;\n\tcolor: #595959;\n\tflex: 0 0 auto;\n font-size: 12px;\n cursor: pointer;\n}\n\n.data-toolbar-item:not(.data-toolbar-item-input):hover, .data-toolbar-item.active:not(.data-toolbar-item-input){\n background-color: #f4f4f4;\n border-radius: 2px;\n}\n\n.data-toolbar-item > * {\n font-size: 12px !important;\n}\n\n.data-toolbar-item[disabled] {\n\topacity: 0.5;\n\tcursor: not-allowed;\n}\n\n.data-toolbar-item-split {\n\twidth: 1px;\n\theight: 16px;\n\tline-height: 16px;\n\tmargin: 6px 4px;\n\tborder-left: 1px solid #e8e8e8;\n\tdisplay: inline-block;\n}\n\n.data-toolbar-item-dropdown-active {\n\topacity: 1;\n\tvisibility: visible;\n\ttransform: translateY(0px);\n}\n\n.data-toolbar-item-input {\n\tdisplay: flex;\n margin: 0 4px;\n}\n\n.data-toolbar-item-input .data-toolbar-input {\n width: 46px;\n line-height: 12px;\n font-size: 12px;\n outline: none;\n border: 1px solid #dadada;\n border-radius: 4px;\n}\n\n.data-toolbar-item-input .data-toolbar-input::-moz-selection {\n color: inherit;\n background:transparent\n}\n\n.data-toolbar-item-input .data-toolbar-input::selection {\n color: inherit;\n background:transparent\n}\n\n.data-toolbar-item-input .data-toolbar-input:focus::-moz-selection\n{\n color: #fff;\n background: #1890ff;\n}\n\n.data-toolbar-item-input .data-toolbar-input:focus::selection\n{\n color: #fff;\n background: #1890ff;\n}\n\n.data-toolbar-item-dropdown .dropdown-container {\n\tdisplay: none;\n\tposition: absolute;\n\tpadding: 8px 0;\n\ttop: 100%;\n\tmargin-top: 6px;\n\tborder-radius: 2px;\n\tbackground-color: #fff;\n\tbox-shadow: 0 1px 4px -2px rgba(0, 0, 0, 0.13), 0 2px 8px 0 rgba(0, 0, 0, 0.08), 0 8px 16px 4px rgba(0, 0, 0, 0.04);\n z-index: 99999;\n}\n\n.data-toolbar-item-dropdown .dropdown-container.show {\n\tdisplay: block;\n}\n\n.data-toolbar-dropdown-item {\n\tpadding: 2px 16px;\n\tmargin: 0;\n\twhite-space: nowrap;\n\tline-height: 26px;\n\tcolor: #404040;\n\tcursor: pointer;\n display: block;\n}\n\n.data-toolbar-dropdown-item:hover {\n\tbackground-color: #f5f5f5;\n}\n\n.data-toolbar-dropdown-switch {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.data-toolbar-dropdown-switch .data-toolbar-dropdown-item-content {\n\tflex: 1;\n margin-right: 4px;\n}\n\n.data-toolbar-dropdown-switch .switch-btn {\n margin: 0;\n padding: 0;\n color: #595959;\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5;\n list-style: none;\n -webkit-font-feature-settings: "tnum";\n font-feature-settings: "tnum";\n position: relative;\n display: inline-block;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n vertical-align: middle;\n background-color: rgba(0,0,0,.25);\n border: 0;\n border-radius: 100px;\n cursor: pointer;\n -webkit-transition: all .2s;\n transition: all .2s;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n min-width: 28px;\n height: 16px;\n line-height: 16px;\n}\n\n.data-toolbar-dropdown-switch .switch-btn.switch-checked {\n background-color: #347EFF\n}\n\n.data-toolbar-dropdown-switch .switch-btn .switch-handle {\n top: 2px;\n left: 2px;\n width: 12px;\n height: 12px;\n}\n\n.data-toolbar-dropdown-switch .switch-btn .switch-handle, .data-toolbar-dropdown-switch .switch-btn .switch-handle:before {\n position: absolute;\n -webkit-transition: all .2s ease-in-out;\n transition: all .2s ease-in-out;\n}\n\n.data-toolbar-dropdown-switch .switch-btn.switch-checked .switch-handle {\n left: calc(100% - 14px);\n}\n\n.data-toolbar-dropdown-switch .switch-btn .switch-handle:before {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: #fff;\n border-radius: 9px;\n -webkit-box-shadow: 0 2px 4px 0 rgb(0 35 11 / 20%);\n box-shadow: 0 2px 4px 0 rgb(0 35 11 / 20%);\n content: "";\n}\n\n.data-toolbar-dropdown-switch .switch-btn .switch-inner {\n display: block;\n margin: 0 5px 0 18px;\n font-size: 12px;\n color: #fff;\n -webkit-transition: margin .2s;\n transition: margin .2s;\n}\n\n.data-toolbar-dropdown-switch .switch-btn.switch-checked .switch-inner {\n margin: 0 18px 0 5px;\n}\n.data-toolbar-switch {\n\tdisplay: flex;\n\talign-items: center;\n padding: 0 4px;\n cursor: pointer;\n width: -webkit-max-content;\n width: -moz-max-content;\n width: max-content;\n}\n\n.data-toolbar-switch:hover {\n background-color: #f4f4f4;\n border-radius: 2px;\n}\n\n.data-toolbar-switch .switch-content {\n\tflex: 1;\n margin-right: 4px;\n}\n\n.data-toolbar-switch .switch-btn {\n margin: 0;\n padding: 0;\n color: #595959;\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5;\n list-style: none;\n -webkit-font-feature-settings: "tnum";\n font-feature-settings: "tnum";\n position: relative;\n display: inline-block;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n vertical-align: middle;\n background-color: rgba(0,0,0,.25);\n border: 0;\n border-radius: 100px;\n cursor: pointer;\n -webkit-transition: all .2s;\n transition: all .2s;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n min-width: 28px;\n height: 16px;\n line-height: 16px;\n}\n\n.data-toolbar-switch .switch-btn.switch-checked {\n background-color: #347EFF\n}\n\n.data-toolbar-switch .switch-btn .switch-handle {\n top: 2px;\n left: 2px;\n width: 12px;\n height: 12px;\n}\n\n.data-toolbar-switch .switch-btn .switch-handle, .data-toolbar-switch .switch-btn .switch-handle:before {\n position: absolute;\n -webkit-transition: all .2s ease-in-out;\n transition: all .2s ease-in-out;\n}\n\n.data-toolbar-switch .switch-btn.switch-checked .switch-handle {\n left: calc(100% - 14px);\n}\n\n.data-toolbar-switch .switch-btn .switch-handle:before {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: #fff;\n border-radius: 9px;\n -webkit-box-shadow: 0 2px 4px 0 rgb(0 35 11 / 20%);\n box-shadow: 0 2px 4px 0 rgb(0 35 11 / 20%);\n content: "";\n}\n\n.data-toolbar-switch .switch-btn .switch-inner {\n display: block;\n margin: 0 5px 0 18px;\n font-size: 12px;\n color: #fff;\n -webkit-transition: margin .2s;\n transition: margin .2s;\n}\n\n.data-toolbar-switch .switch-btn.switch-checked .switch-inner {\n margin: 0 18px 0 5px;\n}';pn(Zn);var Jn=function(){return"<div ".concat(J,'="ui" class="data-toolbar data-toolbar-active" ').concat(Ue,'="false"></div>')},Qn=function(){function t(e){Object(c["a"])(this,t),this.options=void 0,this.root=void 0,this.items=[],this.options=Object(l["a"])({},e),this.root=He(Jn())}return Object(u["a"])(t,[{key:"getPlacement",value:function(){var t=this.root.attributes("data-placement")||"top";return t.startsWith("top")?"top":"bottom"}},{key:"addItems",value:function(t){var e=this;this.options.items.forEach((function(n){var r;if("button"===n.type&&(r=new zn(n),r.render(t)),"switch"===n.type&&(r=new Kn(n),r.render(t)),"input"===n.type){var i=n;r=new Yn(i),r.render(t)}if("dropdown"===n.type&&(r=new $n(n),r.render(t)),"node"===n.type){var o=n,a=o.node;a.addClass("data-toolbar-item");var s=o.title;s&&(a.on("mouseenter",(function(){var t=e.getPlacement();Fn.show(a,"function"===typeof s?s():s,{placement:t})})),a.on("mouseleave",(function(){Fn.hide()})),a.on("mousedown",(function(){Fn.hide()}))),t.append(a),n.didMount&&n.didMount(a)}r&&e.items.push(r)}))}},{key:"find",value:function(t){var e="[data-role=".concat(t,"]");return this.root.find(e)}},{key:"destroy",value:function(){this.root.remove()}},{key:"hide",value:function(){this.root.removeClass("data-toolbar-active")}},{key:"show",value:function(){this.root.addClass("data-toolbar-active")}},{key:"renderGroup",value:function(){return He('<div class="data-toolbar-group"></div>')}},{key:"render",value:function(t){var e=this.renderGroup();return this.root.append(e),this.addItems(e),t&&t.append(this.root),this.root.addClass("data-toolbar-block"),this.root}},{key:"update",value:function(t){this.options=t,this.root.empty();var e=this.renderGroup();this.root.append(e),this.addItems(e)}}]),t}(),tr="ot-user-background",er="ot-user-cursor",nr="ot-user-cursor-card",rr="ot-card-mask",ir="ot-user-cursor-trigger",or="ot-user-cursor-trigger-active",ar=new Map,sr=new Map,lr=new Map,cr=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.root=void 0,this.hideCursorInfoTimeoutMap=void 0,this.engine=e,this.root=e.root,this.hideCursorInfoTimeoutMap={}}return Object(u["a"])(t,[{key:"destroy",value:function(){var t,e=Object(C["a"])(ar);try{for(e.s();!(t=e.n()).done;){var n=Object(w["a"])(t.value,2),r=n[0],i=n[1];i.remove(),ar.delete(r)}}catch(g){e.e(g)}finally{e.f()}var o,a=Object(C["a"])(sr);try{for(a.s();!(o=a.n()).done;){var s=Object(w["a"])(o.value,2),l=s[0],c=s[1];c.remove(),sr.delete(l)}}catch(g){a.e(g)}finally{a.f()}var u,d=Object(C["a"])(lr);try{for(d.s();!(u=d.n()).done;){var h=Object(w["a"])(u.value,2),p=h[0],f=h[1];f.remove(),lr.delete(p)}}catch(g){d.e(g)}finally{d.f()}}},{key:"getRectWithRange",value:function(t,e){var n,r=e.getClientRect(),i=null===(n=t.get())||void 0===n?void 0:n.getBoundingClientRect();return new DOMRect(r.left-((null===i||void 0===i?void 0:i.left)||0),r.top-((null===i||void 0===i?void 0:i.top)||0),r.right-r.left,r.bottom-r.top)}},{key:"isWrapByRange",value:function(t){var e=t.cloneRange().collapse(!0).getClientRect(),n=t.cloneRange().collapse(!1).getClientRect();return e.bottom!==n.bottom}},{key:"drawSubRang",value:function(t,e,n,r){var i=n.startOffset,o=n.startNode,a=n.endNode,s=n.startOffset,c=n.endOffset,u=n.getClientRect().top,d=i;while(s<c){n.setStart(n.commonAncestorContainer,s),n.setEnd(n.commonAncestorContainer,s+1);var h=n.getClientRect();if(h.top>u||s===c-1){n.setStart(n.commonAncestorContainer,d),d=s,u=h.top;var p=this.getRectWithRange(t,n);e.clearRect(p),e.drawRect(Object(l["a"])(Object(l["a"])({},p.toJSON()),r))}s++}n.setStart(o,i),n.setEnd(a,c)}},{key:"drawBackground",value:function(t,e){var n,r,i,o,a=this,s=this.engine.card,c=e.uuid,u=e.color,d=ar.get(c),h=null!==(n=this.engine.scrollNode)&&void 0!==n?n:this.root,p=function(){if(d&&d.length>0){d.attributes(ye,u.toString());var t=d[0]["__canvas"];return d[0]["__clear"]||(t.clear(),d[0]["__clear"]=!0),t}};if(t.collapsed)return p(),[t];d&&d.length>0?o=p():(d=He('<div class="'.concat(tr,'" ').concat(be,'="').concat(c,'" ').concat(ye,'="').concat(u,'" />')),h.append(d),ar.set(c,d),o=new Z({container:d.get()}),d[0]["__canvas"]=o),d.get().style.cssText="position: absolute; top: 0; left: 0; transform: translateX(0) translateY(0); will-change: transform; pointer-events: none;",d[0]["__range"]=t.cloneRange();var f=(null===(r=h.get())||void 0===r?void 0:r.clientWidth)||h.width(),g=this.root.height();o.resize(f,g),d[0]["__clear"]=!1;var m=s.find(t.commonAncestorNode,!0);m&&!m.isCenter(t.commonAncestorNode)&&(m=void 0);var v=O()(u);v.setAlpha(.3);var b=v.toRgbString(),y={fill:b},w=t.getSubRanges();if((null===(i=m)||void 0===i?void 0:i.isEditable)&&m.drawBackground){var x=m.drawBackground(d,t,o);if(!1===x)return[t];if(x){if(!Array.isArray(x))return x.x<0&&(o.resize(f-x.x,g),d.css("transform","translateX(".concat(x.x,"px) translateY(0)")),x.x=0),o.clearRect(x),o.drawRect(Object(l["a"])(Object(l["a"])({},x.toJSON()),y)),[t];w=x}}else if(m)return[t];return w.forEach((function(t){if(a.isWrapByRange(t))a.drawSubRang(d,o,t,y);else{var e=a.getRectWithRange(d,t);o.clearRect(e),o.drawRect(Object.assign({},e.toJSON(),y))}})),w}},{key:"getNodeRect",value:function(t,e){var n,r=t.parent();if(t.isCard()&&(null===r||void 0===r?void 0:r.hasClass(this.engine.list.CUSTOMZIE_LI_CLASS))&&(null===r||void 0===r||null===(n=r.first())||void 0===n?void 0:n.equal(t))&&t.next()&&(t=t.next()),t.isElement()&&(e=t.get().getBoundingClientRect()),t.isText()){var i=cn.create(this.engine).cloneRange();i.select(t,!0),e=i.getClientRect()}return e}},{key:"getCursorRect",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=(null===(e=this.root.get())||void 0===e?void 0:e.getBoundingClientRect())||{top:0,left:0};if(hn(t)){var o=t,a=o.startNode;o.shrinkToElementNode();var s=o.getClientRect();if(a.isElement()&&0===s.height){var l=He(a[0].childNodes[o.startOffset]);l&&l.length>0?s=this.getNodeRect(l,s):(l=a.first(),l&&l.length>0&&(s=this.getNodeRect(l,s)))}var c=s.top-(i.top||0),u=s.left-(i.left||0)-r,d=s.height;return{top:c+"px",left:u+"px",height:d>0?d+"px":-1,elementHeight:s.height||0}}var h=t,p=te(h.css("outline-width")),f=(null===(n=h.get())||void 0===n?void 0:n.getBoundingClientRect())||{top:0,left:0,height:0},g=f.top-i.top-1,m=f.left-i.left;return p&&(g-=p+1,m-=2),{left:m+"px",top:g+"px",height:0,elementHeight:f.height||0}}},{key:"setCursorRect",value:function(t,e,n){var r=e.get();if(r)if(-1!==n.height){if(r.style.cssText+="top: 0; left: 0; height: ".concat(n.height,"; transform: translateX(").concat(n.left,") translateY(").concat(n.top,"); will-change: transform, height;"),0===n.height)return void e.addClass(nr);e.removeClass(nr)}else e.remove(),sr.delete(t)}},{key:"showCursorInfo",value:function(t,e){var n=e.uuid,r=e.color;this.hideCursorInfoTimeoutMap[n]&&clearTimeout(this.hideCursorInfoTimeoutMap[n]);var i=t.find(".".concat(ir)),o=t.css("background-color");t.attributes("data-old-background-color",o),i.addClass("".concat(or)),t.css("background-color",r),i.css("background-color",r)}},{key:"hideCursorInfo",value:function(t){var e=t.find(".".concat(ir)),n=t.attributes("data-old-background-color");e.removeClass("".concat(or)),t.css("background-color",n),e.css("background-color",n)}},{key:"drawCursor",value:function(t,e,n){var r=this,i=e.uuid,o=e.name,a=e.color,s=this.getCursorRect(t),l=sr.get(i);if(l&&l.length>0)this.setCursorRect(i,l,s);else{var c='\n <div class="'.concat(er,'" ').concat(be,'="').concat(i,'">\n <div class="').concat(ir,'">').concat(Xt(o||""),"</div>\n </div>");l=He(c),sr.set(i,l);var u=l.find(".".concat(ir));if(0===s.elementHeight){var d=0,h=function e(){d++,s=r.getCursorRect(t),s.elementHeight<20&&d<=50?setTimeout((function(){e()}),20):r.setCursorRect(i,l,s)};h()}else this.setCursorRect(i,l,s);l.on("mouseenter",(function(){return r.showCursorInfo(l,e)}));var p=!0;l.on("transitionstart",(function(){p=!1})),l.on("transitionend",(function(){p=!0})),l.on("mouseleave",(function(){p&&r.hideCursorInfo(l)})),l.css("background-color",a),u.css("background-color",a),this.root.append(l)}if(l&&l[0]){l.css("z-index","");var f=this.engine.card.components.find((function(t){return t.isMaximize}));if(f){var g=this.engine.card.closest(hn(t)?t.startNode:t,!0);g&&f.root.equal(g)||l.css("z-index",120)}return l[0]["__target"]=hn(t)?t.toPath(!0):t,!1===n?l:(this.showCursorInfo(l,e),this.hideCursorInfoTimeoutMap[i]&&clearTimeout(this.hideCursorInfoTimeoutMap[i]),this.hideCursorInfoTimeoutMap[i]=setTimeout((function(){r.hideCursorInfo(l)}),2e3),l)}}},{key:"drawCard",value:function(t,e,n){var r,i,o=this,a=this.engine.language,s=(null===(r=this.root.get())||void 0===r?void 0:r.getBoundingClientRect())||{left:0,top:0,width:0,height:0},l=(null===(i=t.get())||void 0===i?void 0:i.getBoundingClientRect())||{left:0,top:0,width:0,height:0},c="top: 0; left: 0; transform: translateX(".concat(l.left-s.left,"px) translateY(").concat(l.top-s.top,"px); will-change: transform;"),u=lr.get(n.uuid);if(u&&u.length>0)return u[0]["__node"]=t[0],void(u.get().style.cssText=c);if(u=He('<div class="'.concat(rr,'" ').concat(be,'="').concat(n.uuid,'" />')),lr.set(n.uuid,u),u[0]["__node"]=t[0],0===l.height){var d=0,h=function e(){var n;d++,l=(null===(n=t.get())||void 0===n?void 0:n.getBoundingClientRect())||{left:0,top:0,width:0,height:0},l.height<20&&d<=50?setTimeout((function(){e()}),20):u&&(u.get().style.cssText=c+"height: ".concat(l.height,"px; width: ").concat(l.width,"px;"))};h()}else u.get().style.cssText=c+"height: ".concat(l.height,"px; width: ").concat(l.width,"px;");u.on("mouseenter",(function(){o.showCursorInfo(e,n),Fn.show(u,a.get("card","lockAlert").toString(),{placement:"bottomLeft"})})),u.on("mousemove",(function(t){var e=He("div[".concat(J,"=tooltip]"));e.get().style.cssText="left: 0; top: 0; transform: translateX(".concat(t.pageX-16,"px) translateY(").concat(t.pageY+32,"px); will-change: transform;")})),u.on("mouseleave",(function(){o.hideCursorInfo(e),Fn.hide()})),u.on("click",(function(t){t.preventDefault(),t.stopPropagation()})),u.on("mousedown",(function(t){t.preventDefault(),t.stopPropagation()})),this.root.append(u)}},{key:"setCardSelectedByOther",value:function(t,e){var n=e||{},r=n.uuid,i=n.color;if(i){var o=O()(i);o.setAlpha(.3);var a,s=o.toRgbString();return t.selectedByOther||(a=t.onSelectByOther(!0,{color:i,rgb:s})),t.selectedByOther=r,a}t.selectedByOther&&t.onSelectByOther(!1),t.selectedByOther=!1}},{key:"setCardActivatedByOther",value:function(t,e){if(!t.isEditable){var n=e||{},r=n.uuid,i=n.color;if(i){var o=O()(i);o.setAlpha(.3);var a,s=o.toRgbString();return t.activatedByOther||(a=t.onActivateByOther(!0,{color:i,rgb:s})),t.activatedByOther=r,a}t.activatedByOther&&t.onActivateByOther(!1),t.activatedByOther=!1}}},{key:"drawRange",value:function(t,e,n){var r=this,i=this.engine.card,o=e.uuid,a=t,s=a.commonAncestorNode,l=i.find(s);l&&!l.isCenter(s)&&(l=void 0);var c=[];if(i.each((function(t){t.isEditable||l&&t.root.equal(l.root)||(t.activatedByOther===o&&r.setCardActivatedByOther(t),c.push(o))})),c.length>0){for(var u=0;u<c.length;u++){var d=c[u],h=lr.get(d);null===h||void 0===h||h.remove(),lr.delete(d)}Fn.hide()}if(l&&!l.isEditable){var p,f=this.setCardActivatedByOther(l,e)||l.root;null===(p=sr.get(o))||void 0===p||p.remove(),sr.delete(o);var g=l.constructor.collab;if(void 0===g||!0===g){var m=this.drawCursor(f,e,n);m&&this.drawCard(f,m,e),this.drawBackground(t,e)}}else{var v;if(l)return this.drawBackground(t,e),null===(v=sr.get(o))||void 0===v||v.remove(),void sr.delete(o);i.each((function(n){var i=n.getCenter();if(i&&i.length>0){if(n.isEditable&&i.contains(t.startNode)&&i.contains(t.endNode)&&(t.startNode.closest(ot).length>0||t.endNode.closest(ot).length>0))return void r.setCardSelectedByOther(n);t.isPointInRange(i.get(),0)?r.setCardSelectedByOther(n,e):n.selectedByOther===o&&r.setCardSelectedByOther(n)}}));var b=i.getSingleSelectedCard(t);if(b){if(b.isEditable){var y=b.getCenter();if(y.contains(t.startNode)&&y.contains(t.endNode)&&(t.startNode.closest(ot).length>0||t.endNode.closest(ot).length>0))return}var w=this.setCardSelectedByOther(b,e)||b.root;this.drawCursor(w,e,n)}else{t.shrinkToElementNode();var x=this.drawBackground(t,e);t.collapsed||(x.forEach((function(e){e.collapsed||(t=e)})),t.shrinkToElementNode(),t.collapse(!1)),this.drawCursor(t,e,n)}}}},{key:"updateBackgroundPosition",value:function(){var t,e=Object(C["a"])(ar.values());try{for(e.s();!(t=e.n()).done;){var n=t.value,r=n.get();if(r){var i=r["__range"],o=n.attributes(be),a=n.attributes(ye);this.drawBackground(i,{uuid:o,color:a})}}}catch(s){e.e(s)}finally{e.f()}}},{key:"updateCursorPosition",value:function(){var t,e=Object(C["a"])(sr);try{for(e.s();!(t=e.n()).done;){var n=Object(w["a"])(t.value,2),r=n[0],i=n[1],o=i.get();if(o&&o instanceof HTMLElement){var a=o["__target"];if(!a)return i.remove(),void sr.delete(r);if(a.name||(a=cn.fromPath(this.engine,a,!0)),a.startContainer||a[0].isConnected){var s=this.getCursorRect(a);this.setCursorRect(r,i,s)}else i.remove(),sr.delete(r)}}}catch(l){e.e(l)}finally{e.f()}}},{key:"updateCardPosition",value:function(){var t,e,n=(null===(t=this.root.get())||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0},r=Object(C["a"])(lr);try{for(r.s();!(e=r.n()).done;){var i=Object(w["a"])(e.value,2),o=i[0],a=i[1],s=a.get();if(s&&s instanceof HTMLElement){var l=s["__node"];if(null===l||void 0===l?void 0:l.isConnected){var c=l.getBoundingClientRect();s.style.left=c.left-n.left+"px",s.style.top=c.top-n.top+"px"}else{var u,d;null===(u=null!==(d=s.parentElement)&&void 0!==d?d:s.parentNode)||void 0===u||u.removeChild(s),lr.delete(o)}}}}catch(h){r.e(h)}finally{r.f()}}},{key:"updatePosition",value:function(){this.updateBackgroundPosition(),this.updateCursorPosition(),this.updateCardPosition()}},{key:"updateBackgroundAlpha",value:function(t){var e,n=this.getCursorRect(t),r=Object(C["a"])(sr.values());try{for(r.s();!(e=r.n()).done;){var i=e.value,o=i.get();if(o&&o instanceof HTMLElement){var a=o.querySelector(".".concat(ir)),s=o.style.left,l=o.style.top,c=O()(o.style.backgroundColor);n.left===s&&n.top===l?c.setAlpha(.3):c.setAlpha(1);var u=c.toRgbString();o.style.backgroundColor=u,a&&(a.style.backgroundColor=u)}}}catch(d){r.e(d)}finally{r.f()}}},{key:"render",value:function(t,e,n){var r=t.path,i=t.uuid,o=t.active;if(r){var a=cn.fromPath(this.engine,r,!0);this.drawRange(a,e,o||n)}else this.remove(i)}},{key:"remove",value:function(t){var e,n,r,i=this;null===(e=null!==(n=null===(r=this.engine.scrollNode)||void 0===r?void 0:r.get())&&void 0!==n?n:this.root.get())||void 0===e||e.querySelectorAll("[".concat(be,'="').concat(t,'"]')).forEach((function(e){var n,r;if(e.classList.contains(rr)){var o=e["__node"],a=o?i.engine.card.find(o):null;a&&!a.isEditable&&a.activatedByOther===t&&i.setCardActivatedByOther(a)}null===(n=null!==(r=e.parentElement)&&void 0!==r?r:e.parentNode)||void 0===n||n.removeChild(e)})),this.engine.card.each((function(e){e.isEditable||e.selectedByOther!==t||i.setCardSelectedByOther(e)}))}}]),t}(),ur=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(t){var r;return Object(c["a"])(this,n),r=e.call(this),r.engine=void 0,r.rangeColoring=void 0,r.currentRangePath=void 0,r.data=new Map,r.current=null,r.handleResize=function(){r.rangeColoring.updatePosition()},r.handleScroll=function(t){var e,n=null===(e=r.engine.container.get())||void 0===e?void 0:e.childNodes;if(n){var i,o=Object(C["a"])(r.data);try{for(o.s();!(i=o.n()).done;){var a,s,l=Object(w["a"])(i.value,2),c=l[0],u=l[1];if(c!==(null===(a=r.current)||void 0===a?void 0:a.uuid)&&(null===(s=u.path)||void 0===s?void 0:s.start.id)){var d=u.path.start.path[0],h=n.item(d);if(h&&t.equal(h)){r.rangeColoring.updatePosition();break}}}}catch(p){o.e(p)}finally{o.f()}}},r.handleMouseDown=function(){var t=r.engine.container;t.off("mouseup",r.handleMouseUp),t.off("mousemove",r.emitSelectChange),t.on("mouseup",r.handleMouseUp),t.on("mousemove",r.emitSelectChange)},r.handleMouseUp=function(){var t=r.engine.container;t.off("mouseup",r.handleMouseUp),t.off("mousemove",r.emitSelectChange),setTimeout((function(){r.emitSelectChange()}),10)},r.observer=null,r.emitSelectChange=function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!r.engine.change.isComposing()){var n=r.engine.change.range.get();null===(t=r.observer)||void 0===t||t.disconnect();var i=r.engine.card.find(n.commonAncestorContainer,!0);if(null===i||void 0===i?void 0:i.getSelectionNodes){var o=r.getCardResizeRange(i);o&&(n=o.cloneRange(),r.observer=new ResizeObserver((function(){var t;(o=r.getCardResizeRange(i),o)?r.onSelectionChange(o,!0,e):null===(t=r.observer)||void 0===t||t.disconnect()})),r.observer.observe(i.root.get()))}n.commonAncestorNode.isRoot()||n.commonAncestorNode.inEditor()?r.onSelectionChange(n,!0,e,!1):r.current&&r.removeAttirbute(r.current.uuid)}},r.engine=t,r.rangeColoring=new cr(t),t.container.on("keyup",r.emitSelectChange),t.container.on("mousedown",r.handleMouseDown),t.on("scroll",r.handleScroll,{passive:!0}),window.addEventListener("resize",r.handleResize,{passive:!0}),r}return Object(u["a"])(n,[{key:"getCardResizeRange",value:function(t){if(null===t||void 0===t?void 0:t.getSelectionNodes){var e=t.getSelectionNodes();if(e.length>0){var n,r=cn.create(this.engine);r.setStart(e[0],0);var i=e[e.length-1];return r.setEnd(i,i.isText()?i.text().length:(null===(n=i.get())||void 0===n?void 0:n.childNodes.length)||0),r}}return null}},{key:"setCurrent",value:function(t){this.current=t}},{key:"setAttribute",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this.data.get(t.uuid);!t.force&&A()(o||{},t)||(this.data.set(t.uuid,Object.assign({},t,{active:!o})),t.uuid===(null===(n=this.current)||void 0===n?void 0:n.uuid)?(!0===r&&this.rangeColoring.updatePosition(),this.emit("change",t)):this.rangeColoring.render(t,e,i))}},{key:"removeAttirbute",value:function(t){var e;this.data.has(t)&&(this.data.delete(t),t===(null===(e=this.current)||void 0===e?void 0:e.uuid)?this.emit("change",{uuid:t,remove:!0}):this.rangeColoring.remove(t))}},{key:"getAttribute",value:function(t){return this.data.get(t)}},{key:"onSelectionChange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.current){var i=this.engine.card;t=t.cloneRange();var o=i.active;if(o&&!o.isEditable){var a=o.getCenter();if(Ze(o.root)){var s=o.root.prev();s?t.select(s,!0).collapse(!1):(t.setStartBefore(o.root),t.collapse(!0))}else a&&a.length>0&&t.select(a.get(),!0)}if(!o&&!t.collapsed){var l=this.engine.card.find(t.startNode,!0);l&&l.type===gn.BLOCK&&t.setStart(l.getCenter().parent(),1);var c=this.engine.card.find(t.endNode,!0);c&&c.type===gn.BLOCK&&t.setEnd(c.getCenter().parent(),1)}var u=t.toPath(!0);this.currentRangePath=t.toPath();var d=this.getAttribute(this.current.uuid);this.setAttribute(Object.assign({},d,{path:u,uuid:this.current.uuid,force:e}),this.current,n,r),this.rangeColoring.updateBackgroundAlpha(t)}}},{key:"refreshAttributes",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e){var n=t.getAttribute(e.uuid);n&&t.rangeColoring.render(n,e)}))}},{key:"destory",value:function(){var t=this.engine.container;t.off("mouseup",this.handleMouseUp),t.off("mousemove",this.emitSelectChange),t.off("keyup",this.emitSelectChange),t.off("mousedown",this.handleMouseDown),this.engine.off("scroll",this.handleScroll),window.removeEventListener("resize",this.handleResize)}}]),n}(D["EventEmitter2"]),dr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(t){var r;return Object(c["a"])(this,n),r=e.call(this),r.engine=void 0,r.type=null,r.data=void 0,r.engine=t,r.create(),r}return Object(u["a"])(n,[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.engine?on(this.engine.container):[];this.data=t}},{key:"apply",value:function(t,e){if(t.length>0)try{this.data=R.a.type.apply(this.data,t),e&&e(void 0)}catch(r){var n;e?e(r):null===(n=this.engine)||void 0===n||n.messageError("ot",r)}}},{key:"submitOp",value:function(t,e,n){this.apply(t,n)}},{key:"destroy",value:function(){delete this.data}}]),n}(D["EventEmitter2"]),hr=function(){function t(e){var n=this;Object(c["a"])(this,t),this.engine=void 0,this.getElementFromPath=function(t,e){xe(t)&&(t=t[0]);var r=e[0];if(r===ve.ATTRIBUTE)return{startNode:t,startOffset:r,endNode:t,endOffset:r};var i=r-ve.ELEMENT;if(t instanceof Element&&t.hasAttribute(kt)){var o=n.engine.card,a=o.find(t);a&&(a.getCenter().empty(),o.renderComponent(a))}var s=[];t.childNodes.forEach((function(t){Ze(t)||s.push(t)}));var l=s[i],c=e[1];return 1===e.length||c===ve.TAG_NAME||c===ve.ATTRIBUTE||l instanceof Text?{startNode:l,startOffset:i,endNode:t,endOffset:c||0}:n.getElementFromPath(l,e.slice(1))},this.engine=e}return Object(u["a"])(t,[{key:"fromRemoteAttr",value:function(t){var e;if(t){var n=t.id,r=t.leftText,i=t.rightText,o=null===(e=this.engine.container.get())||void 0===e?void 0:e.querySelector("[".concat(Q,'="').concat(n,'"]'));if(o){var a=o.textContent||"";if(""===a)return{container:o,offset:0};if(null===a||void 0===a?void 0:a.startsWith(r)){var s=o.firstChild,l=r.length;while(s&&(3!==s.nodeType||((null===(c=s.textContent)||void 0===c?void 0:c.length)||0)<l)){var c,u,d;if(((null===(u=s.textContent)||void 0===u?void 0:u.length)||0)<l)l-=(null===(d=s.textContent)||void 0===d?void 0:d.length)||0,s=s.nextSibling;else s=s.firstChild}return{container:s,offset:l}}if(null===a||void 0===a?void 0:a.endsWith(i)){var h,p,f=i.length,g=o.lastChild;while(g&&(3!==g.nodeType||((null===(m=g.textContent)||void 0===m?void 0:m.length)||0)<f)){var m,v,b,y;if((null===(v=g.textContent)||void 0===v?void 0:v.length)||0<f)f-=(null===(b=g)||void 0===b||null===(y=b.textContent)||void 0===y?void 0:y.length)||0,g=g.previousSibling;else g=g.lastChild}return{container:g,offset:(null===(h=g)||void 0===h||null===(p=h.textContent)||void 0===p?void 0:p.length)||0-f}}var w=0;while(a[w]===r[w])w++;var x=o.firstChild;while(x&&(3!==x.nodeType||((null===(C=x.textContent)||void 0===C?void 0:C.length)||0)<w)){var C,k,A;if((null===(k=x.textContent)||void 0===k?void 0:k.length)||0<w)w-=(null===(A=x.textContent)||void 0===A?void 0:A.length)||0,x=x.nextSibling;else x=x.firstChild}return{container:x,offset:w}}}}},{key:"getSideText",value:function(t,e){var n=this.engine.block.closest(t);if(n.length>0){var r=n.attributes(Q),i=cn.create(this.engine),o=cn.create(this.engine);return i.setStart(n[0],0),i.setEnd(t[0],e),o.setStart(t[0],e),o.setEnd(n[0],n[0].childNodes.length),{id:r,leftText:i.toString(),rightText:o.toString()}}}},{key:"setAttribute",value:function(t,e,n,r,i){var o,a=this.engine.card,s=this.getElementFromPath(t,e),l=s.startNode,c=He(l);if(c&&c.length>0&&!c.isRoot()&&(n=Jt(n),r=Kt(r),null===(o=c.get())||void 0===o||o.setAttribute(n,r),c.isCard())){var u=a.find(c);if(!u)return;u.isEditable||a.reRender(u),u.isEditable&&u.onChange&&u.onChange(i?"remote":"local",c)}return c}},{key:"removeAttribute",value:function(t,e,n){var r,i=this.getElementFromPath(t,e),o=i.startNode,a=He(o);a.length>0&&!a.isRoot()&&(null===(r=a.get())||void 0===r||r.removeAttribute(n));return a}},{key:"insertNode",value:function(t,e,n,r){var i=this.engine,o=this.getElementFromPath(t,e),a=o.startNode,s=o.endNode,l=He(a),c=He(s);if(c.length>0&&!l.isRoot()&&(!t.isCard()||t.isEditableCard()&&(0===l.length||l.closest(ot).isEditable()))){var u,d,h="string"===typeof n?document.createTextNode(n):nn(n);if(l&&l.parent())null===(u=c.get())||void 0===u||u.insertBefore(h,l.get());else null===(d=c.get())||void 0===d||d.insertBefore(h,null);var p=He(h);return p.isCard()&&p.attributes(kt,r?"remote":"true"),i.card.render(p),p}}},{key:"deleteNode",value:function(t,e,n){var r=this.engine.card,i=this.getElementFromPath(t,e),o=i.startNode,a=He(o);if(a.length>0&&!a.isRoot()){var s=a.parent();return a.isCard()?n?r.removeRemote(a):r.remove(a,!1):a.remove(),(null===s||void 0===s?void 0:s.isRoot())?void 0:s}}},{key:"insertText",value:function(t,e,n,r){var i,o=this.getElementFromPath(t,e),a=o.startNode,s=o.endNode,l=He(a);if(!a||l.isText()){var c=a&&a.nodeValue?a.nodeValue:"",u=c.substring(0,n)+r+c.substring(n);if(a&&(null!==(i=a.parentElement)&&void 0!==i?i:a.parentNode)===s)a.nodeValue=u;else if(u){var d,h=document.createTextNode(u);"BR"===(null===(d=s.firstChild)||void 0===d?void 0:d.nodeName)&&s.firstChild.remove(),s.insertBefore(h,s.firstChild)}return l}}},{key:"deleteText",value:function(t,e,n,r){var i=this.getElementFromPath(t,e),o=i.startNode,a=He(o);if(a.isText()){var s=o&&o.nodeValue?o.nodeValue:"",l=s.substring(0,n)+s.substring(n+r.length);return o.nodeValue=l,a}}},{key:"handleOperation",value:function(t,e){var n,r,i=t.p;if(0!==i.length){var o=this.engine.container;if("id"in t&&t.id&&t.bi&&t.bi>-1){var a=this.engine.container.find("[".concat(Q,'="').concat(t.id,'"]'));a.length>0&&a.inEditor()&&(o=a,i=i.slice(t.bi))}return("si"in t||"sd"in t)&&(r=i[i.length-1],i=i.slice(0,-1)),("oi"in t||"od"in t)&&(n=i[i.length-1].toString(),i=i.slice(0,-1)),"oi"in t?this.setAttribute(o,i,n,t.oi,e):"od"in t?this.removeAttribute(o,i,n):"sd"in t?this.deleteText(o,i,r,t.sd):"si"in t?this.insertText(o,i,r,t.si):"ld"in t?this.deleteNode(o,i,e):"li"in t?this.insertNode(o,i,t.li,e):void 0}}},{key:"handleRemoteOperations",value:function(t){var e=this;try{var n=this.getRangeRemotePath(),r=[];return t.forEach((function(t){var n=e.handleOperation(t,!0);n&&r.push(n)})),n&&this.engine.isFocus()&&this.setRangeByRemotePath(n),this.engine.change.change(!0,r),r}catch(i){return this.engine.messageError("ot",i),[]}}},{key:"handleSelfOperations",value:function(t){var e=this,n=[];return t.forEach((function(t){var r=e.handleOperation(t);r&&n.push(r)})),this.engine.change.change(!1,n),n}},{key:"setRangeAfterOp",value:function(t){var e,n=this.engine,r=t.p;("si"in t||"sd"in t)&&(e=r[r.length-1],r=r.slice(0,-1)),("oi"in t||"od"in t)&&(r=r.slice(0,-1));var i=this.engine.container;if("id"in t&&t.id&&t.bi&&t.bi>-1){var o=this.engine.container.find("[".concat(Q,'="').concat(t.id,'"]'));o.inEditor()&&(i=o,r=r.slice(t.bi))}var a=this.getElementFromPath(i,r),s=a.startNode,l=a.endNode,c=cn.create(this.engine);if("si"in t||"sd"in t){var u=""===s["data"]?l:s,d=t,h=e+(d.si?d.si.length:0);return c.setOffset(u,h,h),void n.change.range.select(c)}c.select(s||l.lastChild||l,!0).shrinkToElementNode().collapse(!1),n.change.range.select(c)}},{key:"getRangeRemotePath",value:function(){try{var t;if(0===(null===(t=window.getSelection())||void 0===t?void 0:t.rangeCount))return;var e=cn.from(this.engine);if(!e||e.inCard())return;e.startNode.isRoot()&&e.shrinkToElementNode();var n=e.startNode,r=e.startOffset,i=e.endNode,o=e.endOffset;return{start:this.getSideText(n,r),end:this.getSideText(i,o)}}catch(a){return void this.engine.messageError("ot",a)}}},{key:"setRangeByRemotePath",value:function(t){try{var e,n=window.getSelection(),r=n?null===(e=cn.from(this.engine,n))||void 0===e?void 0:e.cloneRange():void 0;if(!r)return;var i,o,a=t.start,s=t.end;a&&(i=this.fromRemoteAttr(a)),s&&(o=this.fromRemoteAttr(s)),i&&i.container&&r.setStart(i.container,i.offset),o&&o.container&&r.setEnd(o.container,o.offset),this.engine.change.range.select(r,!1)}catch(l){this.engine.messageError("ot",l)}}},{key:"setRangeByPath",value:function(t){if(t){var e=t.start,n=t.end;if(e&&n){var r=e.path[e.path.length-1],i=n.path[n.path.length-1],o=e.path.slice(),a=n.path.slice();o.pop(),a.pop();var s=this.engine,l=s.container,c=s.change,u=e.id?l.find("[".concat(Q,'="').concat(e.id,'"]')).get():l.getChildByPath(o,(function(t){return!Ze(He(t))}));if(!u)return;var d=n.id?l.find("[".concat(Q,'="').concat(n.id,'"]')).get():l.getChildByPath(a,(function(t){return!Ze(He(t))}));if(!d)return;var h=function(t,e){if(t.nodeType===ce().TEXT_NODE){var n=t.textContent||"";return n.length<e?n.length:e}var r=t.childNodes;return r.length<e?r.length:e};try{var p=c.range.get();if("BR"===u.nodeName||this.engine.node.isVoid(u)?p.select(u).collapse(!1):(p.setStart(u,h(u,r)),p.setEnd(d,h(d,i))),!p.collapsed){var f=this.engine.card.find(p.startNode,!0),g=this.engine.card.find(p.endNode,!0);if(f&&g&&(null===f||void 0===f?void 0:f.root.equal(g.root))){var m=p.startNode.closest(ot);0===m.length&&(m=p.startNode.find(ot));var v=p.endNode.closest(ot);0===v.length&&(v=p.endNode.find(ot)),m.length>0&&v.length>0&&!m.equal(v)&&p.collapse(!0)}}c.range.select(p),p.scrollRangeIntoView()}catch(b){this.engine.messageError("ot",b)}}}}}]),t}(),pr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(t,r){var i;return Object(c["a"])(this,n),i=e.call(this),i.engine=void 0,i.doc=void 0,i.dmp=void 0,i.timer=null,i.lineStart=!1,i.handleFirstLineText=function(t,e,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[],l=o[0],c="string"===typeof l,u="root"===t?"":t,d="root"===t?-1:e;if(c&&r!==l)for(var h=i.textToOps(n,l,r),p=0;p<h.length;p++)s.push(Object.assign({},h[p],{id:u,bi:d,nl:a}));for(var f=o.length-1;f>=(c?1:0);f--){var g=o[f],m=n.concat();m[m.length-1]=f+ve.ELEMENT,s.push({id:u,nl:a,bi:d,p:m,ld:g})}return c||s.push({id:u,nl:a,bi:d,p:n,li:r}),s},i.isLoadingCard=function(t){if(t.length>ve.ATTRIBUTE&&!Array.isArray(t[1])&&"object"===Object(a["a"])(t[1])){var e=t[ve.ATTRIBUTE],n=e[bt],r=e[wt],o=e[Q];if(n&&r&&o){var s,l=null===(s=i.engine.container.get())||void 0===s?void 0:s.querySelector("[".concat(Q,'="').concat(o,'"]'));if(null===l||void 0===l?void 0:l.getAttribute(kt))return!0}}return!1},i.handleChildren=function(t,e,n,r,o){var s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=[],c="root"===t?"":t,u="root"===t?-1:e;if(0===r.length)for(var d=0;d<o.length;d++)l.push({id:t,nl:s,bi:u,p:n.concat(d+ve.ELEMENT),li:o[d]});else if(0===o.length)for(var h=r.length-1;h>=0;h--)l.push({id:c,nl:s,bi:u,p:n.concat(h+ve.ELEMENT),ld:r[h]});else if(1===o.length&&"string"===typeof o[0])l.push.apply(l,Object(S["a"])(i.handleFirstLineText(t,u,n.concat(ve.ELEMENT),o[0],r,s)));else if(o.every((function(t){return!!Array.isArray(t)&&t[ve.ATTRIBUTE][Q]}))&&r.every((function(t){return!!Array.isArray(t)&&t[ve.ATTRIBUTE][Q]}))){for(var p=function(t){var e=r[t],i=o.find((function(t){return t[ve.ATTRIBUTE][Q]===e[ve.ATTRIBUTE][Q]}));i||(l.push({id:c,nl:s,bi:u,p:n.concat(t+ve.ELEMENT),ld:e}),r.splice(t,1))},f=r.length-1;f>=0;f--)p(f);for(var g=function(e){var a=o[e],c=r.find((function(t){return t[ve.ATTRIBUTE][Q]===a[ve.ATTRIBUTE][Q]}));if(c){if(!A()(a,c)){var d=a[ve.ATTRIBUTE],h=c[ve.ATTRIBUTE],p=n.concat(e+ve.ELEMENT);l.push.apply(l,Object(S["a"])(i.handleAttributes(t,u,p,h,d,s))),l.push.apply(l,Object(S["a"])(i.handleChildren(t,u,p,c.slice(ve.ELEMENT),a.slice(ve.ELEMENT),s)))}}else l.push({id:t,nl:s,bi:u,p:n.concat(e+ve.ELEMENT),li:a}),r.splice(e,0,a)},m=0;m<o.length;m++)g(m)}else{if(r.length>o.length)for(var v=r.length-1;v>=o.length;v--)l.push({id:c,nl:s,bi:u,p:n.concat(v+ve.ELEMENT),ld:r[v]});for(var b=0;b<o.length;b++){var y=o[b],w=r[b];if(w){if(!A()(y,w))if("string"!==typeof y&&Object(a["a"])(y)===Object(a["a"])(w)&&y[ve.TAG_NAME]===w[ve.TAG_NAME]){var x=y[ve.ATTRIBUTE],C=w[ve.ATTRIBUTE],k=n.concat(b+ve.ELEMENT);l.push.apply(l,Object(S["a"])(i.handleAttributes(t,u,k,C,x,s))),l.push.apply(l,Object(S["a"])(i.handleChildren(t,u,k,w.slice(ve.ELEMENT),y.slice(ve.ELEMENT),s)))}else l.push({id:c,nl:s,bi:u,p:n.concat(b+ve.ELEMENT),ld:w}),l.push({id:t,nl:s,bi:u,p:n.concat(b+ve.ELEMENT),li:y})}else l.push({id:t,nl:s,bi:u,p:n.concat(b+ve.ELEMENT),li:y})}}return l},i.engine=t,i.doc=r.doc,i.dmp=new F["diff_match_patch"],i}return Object(u["a"])(n,[{key:"setDoc",value:function(t){this.doc=t}},{key:"textToOps",value:function(t,e,n){var r=[],i=this.dmp.patch_make(e,n);return Object.keys(i).forEach((function(e){var n=i[e];if(null!==n.start1){var o=n.start1;n.diffs.forEach((function(e){var n=Object(w["a"])(e,2),i=n[0],a=n[1];if(i!==F["DIFF_DELETE"])if(i!==F["DIFF_INSERT"])i===F["DIFF_EQUAL"]&&(o+=a.length);else{var s=[];r.push({si:a,p:s.concat(Object(S["a"])(t),[o])})}else{var l=[];r.unshift({sd:a,p:l.concat(Object(S["a"])(t),[o])})}}))}})),r}},{key:"handleAttributes",value:function(t,e,n,r,i){var o=this,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=[],l="root"===t?"":t,c="root"===t?-1:e;return Object.keys(i).forEach((function(t){var e=i[t],u=[].concat(Object(S["a"])(n),[ve.ATTRIBUTE,t]);if(r.hasOwnProperty(t)||e===r[t]){var d=r[t];if(e!==d){var h=a;if(t===xt){var p=ne(e),f=o.engine.card.find(p.id);(null===f||void 0===f?void 0:f.writeHistoryOnValueChange)&&!1===f.writeHistoryOnValueChange(p)&&(h=!0)}s.push({id:l,nl:h,bi:c,p:u,od:d,oi:e})}}else s.push({id:l,nl:a,bi:c,p:u,oi:e})})),Object.keys(r).forEach((function(t){i.hasOwnProperty(t)||s.push({id:l,nl:a,bi:c,p:n.concat(ve.ATTRIBUTE,t),od:r[t]})})),s}},{key:"handleMutations",value:function(t){var e,n=this,r=[],i=null===(e=this.doc)||void 0===e?void 0:e.data;if(i&&0!==t.length){if(0===i.length)r.push(this.engine.container.get());else for(var o=function(e){var n=t[e];if(!n)return"continue";var i=n.type,o=n.target,a=o instanceof Element&&_e(o);if("attributes"===i&&(n.attributeName&&Je(o,n.attributeName)||a))return"continue";if(o instanceof Text&&(o=o.parentElement),!o||!o.isConnected||!(o instanceof Element)||Ze(o))return"continue";if(a)return r=[o],"break";if(0===r.length||!r.includes(o)&&r.every((function(t){return!t.contains(o)}))){for(var s=r.length,l=0;l<s;l++)o.contains(r[l])&&(r.splice(l,1),s--,l--);r.push(o)}},a=0;a<t.length;a++){var s=o(a);if("continue"!==s&&"break"===s)break}if(0!==r.length){var l=[];r.forEach((function(t){l.push.apply(l,Object(S["a"])(n.diff(t,i)))})),l.length>0&&this.emit("ops",l)}}}},{key:"diff",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(null===(e=this.doc)||void 0===e?void 0:e.data)||[],r=[];if(!t.isConnected)return[];var i=_e(t)?"root":t.getAttribute(Q);if(!i){var o=this.engine.block.closest(He(t),(function(t){return!!t.attributes(Q)})).get();if(!(o instanceof Element))return[];t=o,i=t.getAttribute(Q)}if(!i)return[];var a=on(t);if(!a)return[];var s="root"===i,l=s?n:sn(n,(function(t){return t[Q]===i}));if(!l)return[];var c=l.path,u=this.isLoadingCard(a);if("root"!==i){var d=a[ve.ATTRIBUTE],h=l.attributes;r.push.apply(r,Object(S["a"])(this.handleAttributes(i,c.length,c,h,d,u)))}var p=a.slice(2),f=Array.isArray(l)?l.slice(2):l.children;return r.push.apply(r,Object(S["a"])(this.handleChildren(s?"":i,s?-1:c.length,null!==c&&void 0!==c?c:[],f,p,u))),r}}]),n}(D["EventEmitter2"]),fr={childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0},gr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(t,r){var i;return Object(c["a"])(this,n),i=e.call(this),i.node=void 0,i.engine=void 0,i.doc=void 0,i.isStopped=void 0,i.observer=void 0,i.producer=void 0,i.isCache=!1,i.cache=[],i.node=t,i.isStopped=!0,i.engine=r.engine,i.doc=r.doc,i.producer=new pr(i.engine,{doc:i.doc}),i.observer=new MutationObserver((function(t){var e;i.isCache&&(e=i.cache).push.apply(e,Object(S["a"])(t));i.isStopped||i.isCache||i.producer.handleMutations(t)})),i.producer.on("ops",(function(t){i.onChange(t)})),i}return Object(u["a"])(n,[{key:"setDoc",value:function(t){this.doc=t,this.producer.setDoc(t)}},{key:"start",value:function(){this.isStopped&&(this.observer.observe(this.node[0],fr),this.isStopped=!1)}},{key:"stop",value:function(){this.isStopped||(this.observer.disconnect(),this.isStopped=!0)}},{key:"startCache",value:function(){this.isCache||(this.cache=[],this.isCache=!0)}},{key:"submitCache",value:function(){var t=this;this.isCache&&setTimeout((function(){t.engine.change.isComposing()||(t.isCache=!1,t.cache=t.cache.map((function(t){return"characterData"===t.type&&t.target.nodeType===document.TEXT_NODE&&(t["text-data"]=t.target.textContent),t})),t.cache.length>0&&t.producer.handleMutations(t.cache),t.cache=[])}),20)}},{key:"destroyCache",value:function(){var t=this;this.isCache&&setTimeout((function(){t.isCache=!1,t.cache=[]}),20)}},{key:"getCaches",value:function(){return this.cache}},{key:"onChange",value:function(t){this.isStopped||this.emit("onChange",t)}},{key:"diff",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.engine.container.get();return this.producer.diff(e,null===(t=this.doc)||void 0===t?void 0:t.data)}}]),n}(D["EventEmitter2"]),mr=".ot-user-cursor {\r\n\tposition: absolute;\r\n\tz-index: 125;\r\n\twidth: 2px;\r\n}\r\n\r\n.ot-user-cursor-trigger {\r\n\tposition: absolute;\r\n\ttop: -5px;\r\n\tleft: -2px;\r\n\tborder-radius: 100%;\r\n\tcolor: #ffffff;\r\n\twidth: 6px;\r\n\theight: 6px;\r\n\tfont-size: 0;\r\n\toverflow: hidden;\r\n\ttransition: all 0.1s linear;\r\n}\r\n\r\n.ot-user-cursor-trigger-active {\r\n\ttop: -17px;\r\n\tborder-radius: 2px;\r\n\tcolor: #ffffff;\r\n\tfont-size: 10px;\r\n\tline-height: 18px;\r\n\theight: 18px;\r\n\twidth: auto;\r\n\tpadding: 0 3px;\r\n\twhite-space: nowrap;\r\n}\r\n\r\n.ot-card-mask {\r\n\tposition: absolute;\r\n\tz-index: 10;\r\n\tbackground: transparent;\r\n\tcursor: not-allowed;\r\n}\r\n\r\n.ot-user-background {\r\n z-index: 120;\r\n}\r\n\r\n.ot-user-cursor-card {\r\n\tposition: absolute;\r\n}\r\n\r\n.ot-user-cursor-card .ot-user-cursor-trigger {\r\n\tdisplay: none;\r\n}\r\n\r\n.ot-user-cursor-card .ot-user-cursor-trigger-active {\r\n\tposition: absolute;\r\n\tdisplay: block;\r\n\ttop: -19px;\r\n\tleft: 0;\r\n\tborder-radius: 2px;\r\n\tcolor: #ffffff;\r\n\tfont-size: 10px;\r\n\tline-height: 18px;\r\n\theight: 18px;\r\n\twidth: auto;\r\n\tpadding: 0 3px;\r\n\twhite-space: nowrap;\r\n}";pn(mr);var vr=new WeakMap,br=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(t){var r;return Object(c["a"])(this,n),r=e.call(this),r.engine=void 0,r.members=void 0,r.currentMember=void 0,r.clientId=void 0,r.selection=void 0,r.consumer=void 0,r.mutation=void 0,r.doc=null,r.isRemote=!1,r.debounceRefreshAttributes=void 0,r.colors=["#597EF7","#73D13D","#FF4D4F","#9254DE","#36CFC9","#FFA940","#F759AB","#40A9FF"],r.handleChange=function(t){var e=r.engine.trigger("opsChange",t);e&&(t=e),r.submitOps(t);var n=r.engine,i=n.history,o=n.change;i.handleSelfOps(t.filter((function(t){return!0===t["nl"]&&t.p[t.p.length-1]===xt&&i.handleNLCardValue(t),!t["nl"]&&!t.p.includes(yt)}))),r.engine.trigger("ops",t),t.find((function(t){return("od"in t||"oi"in t)&&t.p.includes(xt)}))&&o.change(!1)},r.engine=t,r.members=[],r.selection=new ur(t),r.consumer=new hr(t),r.mutation=new gr(t.container,{engine:t}),r.mutation.on("onChange",r.handleChange),r.clientId=Vt(8),r.debounceRefreshAttributes=N()((function(t){var e;(e=r.selection).refreshAttributes.apply(e,Object(S["a"])(r.members.filter((function(e){return t.includes(e.uuid)}))))}),200),r}return Object(u["a"])(n,[{key:"isCache",get:function(){var t,e;return null!==(t=null===(e=this.mutation)||void 0===e?void 0:e.isCache)&&void 0!==t&&t}},{key:"initLocal",value:function(){var t;this.doc||(this.stopMutation(),this.doc=new dr(this.engine),null===(t=this.mutation)||void 0===t||t.setDoc(this.doc),this.engine.readonly||this.startMutation())}},{key:"initRemote",value:function(t,e,n){var r,i=this,o=!this.doc||null===this.doc.type;this.stopMutation(),o||this.doc.destroy(),this.isRemote=!0,this.doc=t,null===(r=this.mutation)||void 0===r||r.setDoc(t),this.syncValue(e),t.on("op",(function(t,e){if(i.clientId!==e.toString()){var n=Qe(t);n.length>0&&(i.apply(n),i.engine.history.handleRemoteOps(n))}})),this.selection.removeAllListeners(),this.selection.on("change",(function(t){n&&n(t)})),this.engine.readonly||this.startMutation(),o&&this.emit("load")}},{key:"submitOps",value:function(t){var e=this;if(this.doc&&0!==t.length){t.forEach((function(t){var n;t.uid=null===(n=e.currentMember)||void 0===n?void 0:n.uuid}));var n=new dr,r=JSON.parse(JSON.stringify(this.doc.data));n.create(r),n.submitOp(t,null,(function(i){if(n.destroy(),e.doc){if(i){e.engine.messageError("ot","If there is an error in the collaborative structure, the content of the server will be reset, and the current history will also be cleared.",i,t,r),e.engine.history.clear();for(var o=[],a=e.doc.data,s=a.length-1;s>1;s--){var l=a[s];o.push({bi:-1,id:"",ld:l,p:[s],nl:void 0})}for(var c=[],u=on(e.engine.container)||[],d=2;d<u.length;d++){var h=u[d];c.push({bi:-1,id:"",li:h,p:[d],nl:void 0})}return e.doc.submitOp(o.concat(c),{source:e.clientId}),void e.selection.emitSelectChange(!0)}e.doc.submitOp(t,{source:e.clientId},(function(n){var r,i;n&&(e.engine.messageError("ot","SubmitOps Error:",n,"OPS:",t,"DATA:",null===(r=e.doc)||void 0===r?void 0:r.data),null===(i=e.doc)||void 0===i||i.destroy());e.selection.emitSelectChange(!0)}))}}))}}},{key:"diff",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.engine.container.get();return(null===(t=this.mutation)||void 0===t?void 0:t.diff(e))||[]}},{key:"apply",value:function(t){var e=this;this.stopMutation(),this.consumer.handleRemoteOperations(t),this.selection.emitSelectChange();var n=[];t.forEach((function(t){"uid"in t&&n.push(t["uid"])})),setTimeout((function(){e.debounceRefreshAttributes(n)}),0),this.startMutation()}},{key:"syncValue",value:function(t){var e=this,n=this.doc,r=this.engine;n&&(n.type&&Array.isArray(n.data)&&n.data.length>2?this.engine.setJsonValue(n.data):(t&&r.setValue(t),n.on("create",(function(){var t=on(r.container);n.submitOp([{p:[],oi:t}],{source:e.clientId})}))))}},{key:"startMutation",value:function(){this.mutation&&this.mutation.start()}},{key:"stopMutation",value:function(){this.mutation&&this.mutation.stop()}},{key:"isStopped",value:function(){var t,e;return null!==(t=null===(e=this.mutation)||void 0===e?void 0:e.isStopped)&&void 0!==t&&t}},{key:"startMutationCache",value:function(){this.mutation&&this.mutation.startCache()}},{key:"submitMutationCache",value:function(){this.mutation&&this.mutation.submitCache()}},{key:"destroyMutationCache",value:function(){this.mutation&&this.mutation.destroyCache()}},{key:"getCaches",value:function(){var t;return(null===(t=this.mutation)||void 0===t?void 0:t.getCaches())||[]}},{key:"getColors",value:function(){return this.colors}},{key:"setColors",value:function(t){this.colors=t}},{key:"setMemberColor",value:function(t){var e=t.index||this.members.length+1;e=(e-1)%this.colors.length,t.color=this.colors[e]}},{key:"getMembers",value:function(){return L()(this.members)}},{key:"setMembers",value:function(t){var e=this;t=L()(t),t.forEach((function(t){e.setMemberColor(t)})),this.members=t}},{key:"addMember",value:function(t){t=L()(t),this.setMemberColor(t),this.members.find((function(e){return e.uuid===t.uuid}))||this.members.push(t)}},{key:"removeMember",value:function(t){t=L()(t),t.uuid&&(this.members=this.members.filter((function(e){return e.uuid!==t.uuid})),this.selection.removeAttirbute(t.uuid))}},{key:"setCurrentMember",value:function(t){t=L()(t),this.setMemberColor(t);var e=this.members.find((function(e){return e.uuid===t.uuid}));e&&(this.currentMember=e,this.selection.setCurrent(e))}},{key:"getCurrentMember",value:function(){return this.currentMember}},{key:"renderSelection",value:function(t){var e=this;vr.get(this.engine)||(vr.set(this.engine,!0),Promise.resolve().then((function(){vr.set(e.engine,!1),Array.isArray(t)||(t=[t]),t.forEach((function(t){if(!e.currentMember||t.uuid!==e.currentMember.uuid){var n=e.members.find((function(e){return e.uuid===t.uuid}));"remove"in t||!n?e.selection.removeAttirbute(t.uuid):e.selection.setAttribute(t,n)}}))})))}},{key:"destroy",value:function(){var t,e;this.doc&&this.doc.destroy(),this.selection.destory(),null===(t=this.mutation)||void 0===t||t.off("onChange",this.handleChange),null===(e=this.mutation)||void 0===e||e.destroyCache(),this.stopMutation(),this.mutation=null}}]),n}(D["EventEmitter2"]),yr=Object(_["a"])("selfWaiting"),wr=function(){function t(e){var n=this;Object(c["a"])(this,t),this.actionOps=[],this.engine=void 0,this.currentAction={},this.currentActionIndex=0,this.filterEvents=[],this.selfEvents=[],Object.defineProperty(this,yr,{writable:!0,value:void 0}),this.lazySave=N()((function(){n.saveOp()}),200),this.handlePath=function(t,e,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(t){return!Ze(He(t))},a=n.engine.container.find("[".concat(Q,'="').concat(e,'"]'));if(a.length>0&&a.inEditor()){var s,l=a.getPath(n.engine.container,(null===(s=a.parent())||void 0===s?void 0:s.isRoot())?void 0:o);return(i?l.map((function(t){return t+2})):l).concat(t.slice(r))}return t},this.engine=e}return Object(u["a"])(t,[{key:"reset",value:function(){this.actionOps=[],this.currentAction={},this.currentActionIndex=0}},{key:"onFilter",value:function(t){this.filterEvents.push(t)}},{key:"onSelf",value:function(t){this.selfEvents.push(t)}},{key:"hasUndo",value:function(){return!!this.getUndoOp()}},{key:"hasRedo",value:function(){return!!this.getRedoOp()}},{key:"undo",value:function(){this.saveOp();var t=this.getUndoOp();if(t){var e=!1;this.engine.ot.stopMutation();try{var n=this.engine.ot;n.submitOps(t.ops||[]),n.consumer.handleSelfOperations(t.ops),this.currentActionIndex--,e=!0}catch(r){this.reset(),this.engine.messageError("history-undo",r)}this.engine.isEmpty()&&this.engine.change.initValue(),e&&(this.engine.change.getRangePathBeforeCommand(),this.engine.ot.consumer.setRangeByPath(t.startRangePath),this.engine.change.change(),this.engine.trigger("undo")),this.engine.ot.startMutation()}}},{key:"redo",value:function(){this.saveOp();var t=this.getRedoOp();if(t){var e=!1;this.engine.ot.stopMutation();try{var n=this.engine.ot;n.submitOps(t.ops||[]),n.consumer.handleSelfOperations(t.ops),this.currentActionIndex++,e=!0}catch(r){this.reset(),this.engine.messageError("history-redo",r)}e&&(this.engine.change.getRangePathBeforeCommand(),this.engine.ot.consumer.setRangeByPath(t.rangePath),this.engine.change.change(),this.engine.trigger("redo")),this.engine.ot.startMutation()}}},{key:"clear",value:function(){var t=this;setTimeout((function(){t.reset()}),10)}},{key:"saveOp",value:function(){this.currentAction&&this.currentAction.ops&&this.currentAction.ops.length>0&&(this.currentAction.self&&(this.currentAction.rangePath=this.getCurrentRangePath(),this.currentAction.id=Vt(8),this.actionOps.splice(this.currentActionIndex),this.actionOps.push(this.currentAction),this.currentActionIndex=this.actionOps.length,this.engine.trigger("historyChange")),this.currentAction={},this.engine.change.getRangePathBeforeCommand())}},{key:"handleSelfOps",value:function(t){var e,n=this;(null===(e=this.currentAction)||void 0===e?void 0:e.self)||this.saveOp();var r=!1;if(t.forEach((function(t){if(r=!0,n.filterEvents.some((function(e){return e(t)}))){var e;n.actionOps.length>0&&!t["nl"]&&(null===(e=n.actionOps[n.actionOps.length-1].ops)||void 0===e||e.push(t))}else{n.currentAction.self=!0,n.currentAction.ops||(n.currentAction.ops=[]),n.currentAction.startRangePath||(n.currentAction.startRangePath=n.getRangePathBeforeCommand());var i=n.currentAction.ops[n.currentAction.ops.length-1];i&&tn(t,i)?n.currentAction.ops.pop():n.currentAction.ops.push(t)}})),r){var i=void 0;if(this.selfEvents.some((function(e){return i=e(t),void 0!==i})),Object(T["a"])(this,yr)[yr])return;"boolean"===typeof i?i?this.saveOp():this.currentAction={}:"object"===Object(a["a"])(i)?(Object(T["a"])(this,yr)[yr]=i,i.then((function(t){t?n.saveOp():n.currentAction={}})).finally((function(){return Object(T["a"])(n,yr)[yr]=void 0}))):void 0===i&&this.lazySave()}}},{key:"handleNLCardValue",value:function(t){var e=t.p[t.p.length-1];if(!0===t.nl&&"string"===typeof e&&e===xt&&t["oi"]){var n=t["oi"],r=ne(n);this.actionOps.forEach((function(t){var e;null===(e=t.ops)||void 0===e||e.forEach((function(t){if(t.p[t.p.length-1]===xt&&t["oi"]){var e=ne(t["oi"]);r.id===e.id&&(t["oi"]=r)}else t["li"]&&ln(t["li"],(function(t){var e=ne(t[xt]);return e.id===r.id&&(t[xt]=n,!0)}))}))}))}}},{key:"handleRemoteOps",value:function(t){var e=this;this.currentAction.self&&!Object(T["a"])(this,yr)[yr]&&this.saveOp();var n=this.engine.change.range.get();this.actionOps.forEach((function(t){var r;if(null===(r=t.ops)||void 0===r||r.forEach((function(t){t.id&&void 0!==t.bi&&(t.p=e.handlePath(t.p,t.id,t.bi))})),t.rangePath){var i=t.rangePath,o=i.start,a=i.end;o.id&&void 0!==o.bi&&(o.path=e.handlePath(o.path,o.id,o.bi,!1,n.filterPath(!0))),a.id&&void 0!==a.bi&&(a.path=e.handlePath(a.path,a.id,a.bi,!1,n.filterPath(!0)))}if(t.startRangePath){var s=t.startRangePath,l=s.start,c=s.end;l.id&&void 0!==l.bi&&(l.path=e.handlePath(l.path,l.id,l.bi,!1,n.filterPath(!0))),c.id&&void 0!==c.bi&&(c.path=e.handlePath(c.path,c.id,c.bi,!1,n.filterPath(!0)))}})),t.forEach((function(t){e.currentAction.ops||(e.currentAction.ops=[]);var n=e.currentAction.ops[e.currentAction.ops.length-1];n&&tn(t,n)?e.currentAction.ops.pop():e.currentAction.ops.push(t),e.actionOps.some((function(n,r){var i,o=null===(i=n.ops)||void 0===i?void 0:i.some((function(e){return R.a.type.canOpAffectPath(t,e.p)}));if(o){for(var a=[n],s=function(t){var r,i=e.actionOps[t],o=null===(r=i.ops)||void 0===r?void 0:r.some((function(t){var e;return null===(e=n.ops)||void 0===e?void 0:e.some((function(e){return R.a.type.canOpAffectPath(t,e.p)}))}));if(o){var s;a.push(i);var l=t+1,c=e.actionOps[l];c&&(null===(s=c.ops)||void 0===s?void 0:s.some((function(t){var e;return null===(e=i.ops)||void 0===e?void 0:e.some((function(e){return R.a.type.canOpAffectPath(t,e.p)}))})))&&a.push(c)}},l=r+1;l<e.actionOps.length;l++)s(l);var c=e.actionOps.filter((function(t){return void 0===a.find((function(e){return e.id===t.id}))}));return e.actionOps=c,e.currentActionIndex=e.actionOps.length,o}return!1}))}))}},{key:"getUndoOp",value:function(){var t=this.currentActionIndex-1;if(this.actionOps[t]){var e=L()(this.actionOps[t]),n=z()(this.actionOps,(function(t){return t.id==e.id}));-1!==n?e=this.actionOps[n]:n=t;var r=R.a.type.invert(e.ops||[]);r.forEach((function(t,n){var i=(e.ops||[])[r.length-n-1];t["id"]=i.id,t["bi"]=i.bi}));try{return{self:!0,ops:r,id:e.id,type:"undo",rangePath:e.rangePath,startRangePath:e.startRangePath}}catch(i){this.engine.messageError("history-undo-op",i)}}}},{key:"getRedoOp",value:function(){var t=this.currentActionIndex;if(this.actionOps[t]){var e=L()(this.actionOps[t]),n=[];"undo"===e.type?(n=R.a.type.invert(e.ops||[]),n.forEach((function(t,r){var i=(e.ops||[])[n.length-r-1];t["id"]=i.id,t["bi"]=i.bi}))):n=e.ops;try{return{self:!0,ops:n,id:e.id,type:"redo",rangePath:e.rangePath,startRangePath:e.startRangePath}}catch(r){this.engine.messageError("history-redo-op",r)}}}},{key:"getCurrentRangePath",value:function(){var t=this.engine,e=t.ot,n=t.change,r=e.selection.currentRangePath;return r||n.range.get().toPath()}},{key:"getRangePathBeforeCommand",value:function(){return this.engine.change.getRangePathBeforeCommand()||this.getCurrentRangePath()}}]),t}(),xr=function(){function t(e){var n=this;Object(c["a"])(this,t),this.engine=void 0,this.disabled=!1,this.engine=e,this.engine.container.on("keydown",(function(t){return n.trigger(t)}))}return Object(u["a"])(t,[{key:"match",value:function(t){var e=this;Object.keys(this.engine.plugin.components).every((function(n){var r=e.engine.plugin.components[n];if(r.hotkey){var o,s=r.hotkey(t),l=!1,c=[];if("string"===typeof s&&i()(s,t)?l=!0:Array.isArray(s)?s.some((function(e){if("string"===typeof e){if(i()(e,t))return l=!0,c=[],!0}else{var n=e.key,r=e.args;if(i()(n,t))return l=!0,c=Array.isArray(r)?r:[r],!0}return!1})):"object"===Object(a["a"])(s)&&i()(s.key,t)&&(l=!0,c=Array.isArray(s.args)?s.args:[s.args]),l)return t.preventDefault(),(o=e.engine.command).execute.apply(o,[n].concat(Object(S["a"])(c))),!1}return!0}))}},{key:"trigger",value:function(t){this.disabled||this.match(t)}},{key:"enable",value:function(){this.disabled=!1}},{key:"disable",value:function(){this.disabled=!0}},{key:"destroy",value:function(){this.engine.container.off("keydown",this.trigger)}}]),t}(),Cr=function(){function t(e){Object(c["a"])(this,t),this.type="keydown",this.hotkey="",this.listeners=[],this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"on",value:function(t){this.listeners.push(t)}},{key:"unshiftOn",value:function(t){this.listeners.unshift(t)}},{key:"off",value:function(t){for(var e=0;e<this.listeners.length;e++)if(this.listeners[e]===t){this.listeners.splice(e,1);break}}},{key:"trigger",value:function(t){for(var e=0;e<this.listeners.length;e++){var n=this.listeners[e],r=n(t);if(!1===r)break}}},{key:"destroy",value:function(){this.listeners=[]}}]),t}(),kr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.type="keydown",t.hotkey="backspace",t}return Object(u["a"])(n,[{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.container,i=n.range.get();if(n.cacheRangeBeforeCommand(),n.isEmpty())return t.preventDefault(),r.empty(),void n.initValue();var o=i.commonAncestorNode,a=this.engine.card.find(o,!0),s=(null===a||void 0===a?void 0:a.isEditable)&&(null===a||void 0===a?void 0:a.getSelectionNodes)?a.getSelectionNodes():[];if(s.length>0)return s.forEach((function(t){t.html("<p></br ></p>")})),void n.apply(i.cloneRange().select(s[0],!0).collapse(!0));var l=i.startNode,c=i.startOffset;if(l.isEditable()){var u=l[0].childNodes[c-1],d=He(u);if("br"===d.name)return t.preventDefault(),d.remove(),void n.apply(i)}for(var h=!0,p=0;p<this.listeners.length;p++){var f=this.listeners[p];if(h=f(t),!1===h)break}if(!1!==h){if(!i.collapsed){t.preventDefault();var g=l.prev();"br"===(null===g||void 0===g?void 0:g.name)&&g.remove(),n.delete(i);var m=i.startNode.prev();return(null===m||void 0===m?void 0:m.isCard())&&0===m.find(Tt).length&&m.remove(),n.apply(i),void(this.engine.scrollNode&&i.scrollIntoViewIfNeeded(this.engine.container,this.engine.scrollNode))}var v,b=void 0;if(this.engine.node.isBlock(l)){var y=l[0].childNodes[c-1];b=He(y)}else"br"===l.name&&(b=l);if("br"===(null===(v=b)||void 0===v?void 0:v.name)){var w=b.prev(),x=b.next(),C=null===x||void 0===x?void 0:x.next(),k=null===w||void 0===w?void 0:w.prev();"br"!==(null===w||void 0===w?void 0:w.name)&&"br"===(null===x||void 0===x?void 0:x.name)&&"br"!==(null===C||void 0===C?void 0:C.name)?(t.preventDefault(),b.remove(),x.remove(),n.apply(i.shrinkToTextNode())):"br"!==(null===x||void 0===x?void 0:x.name)&&"br"===(null===w||void 0===w?void 0:w.name)&&"br"!==(null===k||void 0===k?void 0:k.name)&&(t.preventDefault(),b.remove(),w.remove(),n.apply(i.shrinkToTextNode()))}}else this.engine.scrollNode&&i.scrollIntoViewIfNeeded(this.engine.container,this.engine.scrollNode)}}]),n}(Cr),Ar=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.type="keydown",t.hotkey="delete",t}return Object(u["a"])(n,[{key:"getNext",value:function(t){var e,n=null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode;return He(t).isEditable()?null:t.nextSibling?t.nextSibling:null===n?null:this.getNext(n)}},{key:"getRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(He(t).isEditable())return null;if(!e){var n=this.getNext(t);if(!n)return null;t=n}while(t){var r=He(t);if(r.attributes(bt)){if(!t.ownerDocument)return null;var i=cn.create(this.engine,t.ownerDocument);return i.setStartAfter(t),i.collapse(!0),i}if(this.engine.node.isBlock(r)){if(!t.ownerDocument)return null;var o=cn.create(this.engine,t.ownerDocument);return o.select(r,!0).collapse(!0),o}if("br"===r.name){var a,s;if(1===(null===(a=null!==(s=t.parentElement)&&void 0!==s?s:t.parentNode)||void 0===a?void 0:a.childNodes.length))return null;if(!t.ownerDocument)return null;var l=cn.create(this.engine,t.ownerDocument);return l.setStartAfter(t),l.collapse(!0),l}if(t.nodeType===Node.TEXT_NODE){if(0===t["data"].length)return this.getRange(t);if(!t.ownerDocument)return null;var c=cn.create(this.engine,t.ownerDocument);return c.setStart(t,1),c.collapse(!0),c}if(0===t.childNodes.length)return this.getRange(t);t=t.childNodes[0]}return null}},{key:"trigger",value:function(t){var e=this.engine.change;e.cacheRangeBeforeCommand();var n=e.range.get();if(!n.collapsed)return t.preventDefault(),void e.delete();var r,i=this.engine.card.find(n.startNode),o=!1;if(i){if(i.isLeftCursor(n.startNode))return t.preventDefault(),this.engine.card.select(i),void e.delete();if(!i.isRightCursor(n.startNode))return;r=i.root[0]}else if(n.endContainer.nodeType===Node.TEXT_NODE){if(n.endContainer["data"].length>n.endOffset){t.preventDefault();var a=n.cloneRange();return a.setEnd(n.endContainer,n.endOffset+1),e.range.select(a),e.delete(),void e.range.select(e.range.get().shrinkToTextNode())}r=n.endContainer}else{if(n.endContainer.nodeType!==Node.ELEMENT_NODE)return;if(0===n.endContainer.childNodes.length)r=n.endContainer;else if(0===n.endOffset){var s;1===n.endContainer.childNodes.length&&"BR"===(null===(s=n.endContainer.firstChild)||void 0===s?void 0:s.nodeName)||(o=!0),r=n.endContainer.childNodes[n.endOffset]}else r=n.endContainer.childNodes[n.endOffset-1]}var l=this.getRange(r,o);if(l){t.preventDefault();var c=n.startOffset;1===c&&1===n.startContainer.childNodes.length&&"BR"===n.startContainer.childNodes[0].nodeName&&(c=0),l.setStart(n.startContainer,c),e.range.select(l),e.delete()}for(var u=0;u<this.listeners.length;u++){var d=this.listeners[u],h=d(t);if(!1===h)break}}}]),n}(Cr),Sr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.type="keydown",t.hotkey="enter",t}return Object(u["a"])(n,[{key:"trigger",value:function(t){var e=this.engine.change;e.cacheRangeBeforeCommand();var n=e.range.get(),r=this.engine.block.closest(n.endNode);r.isEditable()&&this.engine.block.wrap("<p />");for(var i=0;i<this.listeners.length;i++){var o=this.listeners[i],a=o(t);if(!1===a)break}this.engine.scrollNode&&this.engine.change.range.get().scrollIntoViewIfNeeded(this.engine.container,this.engine.scrollNode),this.engine.trigger("select")}}]),n}(Cr),Er=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.type="keydown",t.hotkey="tab",t}return Object(u["a"])(n,[{key:"trigger",value:function(t){var e=this.engine.node;t.preventDefault(),e.insertText(" ")}}]),n}(Cr),Or=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.hotkey="shift+tab",t}return Object(u["a"])(n)}(Cr),Tr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.type="keydown",t.hotkey="shift+enter",t}return Object(u["a"])(n,[{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.inline,i=e.block;t.preventDefault(),n.cacheRangeBeforeCommand();var o,a=n.range.get();if(0!==a.startNode.closest("li").length){var s,l,c=He("<br />");if(r.insert(c,a),i.isLastOffset(a,"end")&&(!c.next()||"br"!==(null===(s=c.next())||void 0===s?void 0:s.name))&&(!c.prev()||"br"!==(null===(l=c.prev())||void 0===l?void 0:l.name))){var u=c.clone();c.after(u),a.select(u).collapse(!1)}for(var d=0;d<this.listeners.length;d++){var h=this.listeners[d],p=h(t);if(!1===p)break}n.apply(a),this.engine.scrollNode&&this.engine.change.range.get().scrollIntoViewIfNeeded(this.engine.container,this.engine.scrollNode)}else null===(o=this.engine.typing.getHandleListener("enter","keydown"))||void 0===o||o.trigger(t)}}]),n}(Cr),_r=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.hotkey=function(t){return" "===t.key},t}return Object(u["a"])(n)}(Cr),Mr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),t.hotkey=function(t){return"/"===t.key||i()("/",t)||229===t.keyCode&&"Slash"===t.code},t}return Object(u["a"])(n)}(Cr),Nr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.hotkey="mod+a",t}return Object(u["a"])(n)}(Cr),Pr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),t.type="keydown",t.hotkey=function(t){return i()("left",t)||i()("shift+left",t)||i()("ctrl+a",t)||i()("ctrl+b",t)},t}return Object(u["a"])(n)}(Cr),Lr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),t.type="keydown",t.hotkey=function(t){return i()("right",t)||i()("shift+right",t)||i()("ctrl+e",t)||i()("ctrl+f",t)},t}return Object(u["a"])(n)}(Cr),Dr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),t.hotkey=function(t){return i()("up",t)||i()("ctrl+p",t)},t}return Object(u["a"])(n)}(Cr),jr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),t.hotkey=function(t){return i()("down",t)||i()("ctrl+n",t)},t}return Object(u["a"])(n)}(Cr),Ir=[{name:"default",handle:Cr},{name:"enter",handle:Sr,triggerName:"keydown:enter"},{name:"backspace",handle:kr,triggerName:"keydown:backspace"},{name:"delete",handle:Ar,triggerName:"keydown:delete"},{name:"tab",handle:Er,triggerName:"keydown:tab"},{name:"shift-tab",handle:Or,triggerName:"keydown:shift-tab"},{name:"shift-enter",handle:Tr,triggerName:"keydown:shift-enter"},{name:"space",handle:_r,triggerName:"keydown:space"},{name:"slash",handle:Mr,triggerName:"keydown:slash"},{name:"all",handle:Nr,triggerName:"keydown:all"},{name:"left",handle:Pr,triggerName:"keydown:left"},{name:"right",handle:Lr,triggerName:"keydown:right"},{name:"up",handle:Dr,triggerName:"keydown:up"},{name:"down",handle:jr,triggerName:"keydown:down"}],Rr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.type="keyup",t}return Object(u["a"])(n)}(Cr),Fr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.hotkey="enter",t}return Object(u["a"])(n)}(Rr),Br=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.type="keyup",t.hotkey="backspace",t}return Object(u["a"])(n,[{key:"trigger",value:function(t){var e=this.engine.change;if(e.isEmpty())t.preventDefault();else for(var n=!0,r=0;r<this.listeners.length;r++){var i=this.listeners[r];if(n=i(t),!1===n)break}}}]),n}(Rr),zr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.hotkey="tab",t}return Object(u["a"])(n)}(Rr),Hr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.hotkey=function(t){return" "===t.key},t}return Object(u["a"])(n)}(Rr),Vr=[{name:"default",handle:Rr},{name:"enter",handle:Fr,triggerName:"keyup:enter"},{name:"backspace",handle:Br,triggerName:"keyup:backspace"},{name:"tab",handle:zr,triggerName:"keyup:tab"},{name:"space",handle:Hr,triggerName:"keyup:space"}],qr=function(){function t(e){var n=this;Object(c["a"])(this,t),this.engine=void 0,this.handleListeners=[],this.bindKeydown=function(t){var e=n.engine,r=e.readonly,o=e.card;r?i()("mod+a",t)&&t.preventDefault():t.target&&o.find(He(t.target))||n.trigger("keydown",t)},this.bindKeyup=function(t){var e=n.engine,r=e.readonly,i=e.card;r||t.target&&i.find(He(t.target))||n.trigger("keyup",t)},this.engine=e,Ir.concat(Vr).forEach((function(t){n.addHandleListener(t.name,t.handle,t.triggerName)}));var r=e.container;r.on("keydown",this.bindKeydown),r.on("keyup",this.bindKeyup)}return Object(u["a"])(t,[{key:"addHandleListener",value:function(t,e,n,r){this.handleListeners.push({name:t,handle:new e(this.engine),triggerName:n,triggerParams:r})}},{key:"getHandleListener",value:function(t,e){var n;return null===(n=this.handleListeners.find((function(n){return n.name===t&&n.handle.type===e})))||void 0===n?void 0:n.handle}},{key:"removeHandleListener",value:function(t,e){for(var n=0;n<this.handleListeners.length;n++)if(this.handleListeners[n].name===t&&this.handleListeners[n].handle.type===e){this.handleListeners[n].handle.destroy(),this.handleListeners.splice(n,1);break}}},{key:"trigger",value:function(t,e){var n,r=this,o=this.handleListeners.filter((function(e){var n=e.handle;return n.type===t})).some((function(t){var n=t.name,o=t.handle,a=t.triggerName,s=t.triggerParams;if("default"===n||!o.hotkey)return!1;if("function"===typeof o.hotkey?o.hotkey(e):i()(o.hotkey,e)){var l,c=[e];return"function"===typeof s&&(c=s(r.engine,e)),a&&!1===(l=r.engine).trigger.apply(l,[a].concat(Object(S["a"])(c)))||o.trigger(e),!0}return!1}));!1===o&&!1!==this.engine.trigger(t+":default",e)&&(null===(n=this.getHandleListener("default",t))||void 0===n||n.trigger(e))}},{key:"destroy",value:function(){var t=this.engine.container;this.handleListeners=[],t.off("keydown",this.bindKeydown),t.off("keyup",this.bindKeyup)}}]),t}(),Ur="data-placeholder",Wr="am-engine-placeholder",$r=function(){function t(e,n){var r=this;Object(c["a"])(this,t),this.options=void 0,this.node=void 0,this._focused=!1,this._setFocus=function(){r._focused=!0},this._setBlur=function(){r._focused=!1},this.handleClick=function(t){var e=r.options,n=e.engine,i=e.autoAppend,o=e.autoPrepend;if(t.target&&!n.readonly&&pe(n)){var a,s,l,c=He(t.target);if(!c.isEditable())return;var u=He("<p><br /></p>"),d=c.closest("".concat(ot,",").concat(et)),h=d.first();h||n.change.initValue(void 0,!0,c);var p=d.last(),f=!1;if(!1!==o&&h&&t.offsetY<((null===(a=h.get())||void 0===a?void 0:a.offsetTop)||0)&&!n.node.isEmptyWidthChild(h)?(d.prepend(u),f=!0):!1!==i&&p&&t.offsetY>((null===(s=p.get())||void 0===s?void 0:s.offsetTop)||0)+((null===(l=p.get())||void 0===l?void 0:l.clientHeight)||0)&&!n.node.isEmptyWidthChild(p)&&(d.append(u),f=!0),f){var g=n.change.range.get();g.select(u,!0).collapse(!1),n.change.apply(g)}}},this.handleFocus=function(){var t=r.options.engine;r.triggerFoucs(),!t.ot.isStopped()&&t.isEmpty()&&t.change.initValue()},this.focusTimeout=null,this.triggerFoucs=function(){var t=r.options.engine;r.focusTimeout&&clearTimeout(r.focusTimeout),r.focusTimeout=setTimeout((function(){if(!r._focused){var e=t.change.range.get();(e.commonAncestorNode.isRoot(t.container)||e.commonAncestorNode.inEditor(t.container))&&(t.change.range.setLastBlurRange(),t.trigger("focus"))}}),0)},this.onInput=function(t){var e=r.options.engine;if(!e.readonly&&(!t.target||!e.card.find(He(t.target)))){var n=e.change.range.get();n.handleBr(!0)}},this.onRealtimeChange=function(){var t=r.options.engine;t.isEmpty()?t.showPlaceholder():t.hidePlaceholder()},this.blurTimeout=null,this.docMouseDown=function(t){if(t.target){var e=He(t.target),n=r.options.engine;if(r._focused&&0===e.closest(rt).length&&!e.inEditor(n.container)){r.blurTimeout&&clearTimeout(r.blurTimeout);var i=n.change.range.get();r.blurTimeout=setTimeout((function(){var t=n.change.range.get();t.commonAncestorNode.inEditor(n.container)||(n.change.range.setLastBlurRange(i),n.trigger("blur"))}),0)}}},this.node=He(e),this.options=n,this._init(),this._focused=null!==document.activeElement&&this.node.equal(document.activeElement);var i=n.engine;i.on("blur",this._setBlur),i.on("focus",this._setFocus)}return Object(u["a"])(t,[{key:"_init",value:function(){var t,e=this,n=this.options,r=n.lang,i=n.tabIndex,o=n.className;this.node.attributes((t={},Object(x["a"])(t,Ue,"true"),Object(x["a"])(t,"role","textbox"),Object(x["a"])(t,"autocorrect","en-US"===r?"on":"off"),Object(x["a"])(t,"autocomplete","off"),Object(x["a"])(t,"spellcheck","en-US"===r?"true":"false"),Object(x["a"])(t,"data-gramm","false"),t)),void 0!==i&&this.node.attributes("tabindex",i),this.node.hasClass(lt)||this.node.addClass(lt),Rt&&this.node.addClass(ct),void 0!==o&&(Array.isArray(o)?o:o.split(/\s+/)).forEach((function(t){""!==t.trim()&&e.node.addClass(t)}))}},{key:"init",value:function(){var t=this.options.engine;this.node.on("input",this.onInput),t.on("realtimeChange",this.onRealtimeChange),this.node.on("click",this.handleClick),document.addEventListener("mousedown",this.docMouseDown),this.node.on(Rt?"touchstart":"mousedown",this.triggerFoucs,{passive:!0}),this.node.on("focus",this.handleFocus)}},{key:"isFocus",value:function(){return this._focused}},{key:"getNode",value:function(){return this.node}},{key:"setReadonly",value:function(t){this.node.attributes(Ue,t?"false":"true")}},{key:"showPlaceholder",value:function(){var t=this.options.placeholder;t&&(this.node.attributes(Object(x["a"])({},Ur,t)),this.node.addClass(Wr))}},{key:"hidePlaceholder",value:function(){this.node.removeAttributes(Ur),this.node.removeClass(Wr)}},{key:"destroy",value:function(){var t=this,e=this.options,n=e.className,r=e.engine;r.on("blur",this._setBlur),r.on("focus",this._setFocus),r.off("realtimeChange",this.onRealtimeChange),document.removeEventListener("mousedown",this.docMouseDown),this.node.removeAttributes(Ue),this.node.removeAttributes("role"),this.node.removeAttributes("autocorrect"),this.node.removeAttributes("autocomplete"),this.node.removeAttributes("spellcheck"),this.node.removeAttributes("data-gramm"),this.node.removeAttributes("tabindex"),this.node.removeAttributes(Ur),this.options.className&&(Array.isArray(n)?n:(n||"").split(/\s+/)).forEach((function(e){""!==e.trim()&&t.node.removeClass(e)})),r.card.closest(this.node)&&this.node.removeClass(lt),this.node.removeAllEvents()}}]),t}(),Gr=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(c["a"])(this,t),this.data={},this.locale="zh-CN",this.locale=e,this.data=n}return Object(u["a"])(t,[{key:"add",value:function(t){this.data=V()(this.data,t)}},{key:"get",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=function t(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1?arguments[1]:void 0,i=n;i<e.length;i++){var o=r[e[i]];return"object"===Object(a["a"])(o)?t(i+1,o):o||""}return r};return r(0,this.data[this.locale])}}]),t}(),Yr={dnd:{title:"Drag to reposition"},copy:{title:"Copy",success:"Copied successfully",error:"Copy error"},delete:{title:"Delete"},copyAnchor:{title:"Copy anchor link"},link:{placeholder:"Please enter a link or anchor and press Enter to confirm",save:"Apply",edit:"Change",delete:"Remove link",open:"Open link",text:"link"},copyContent:{title:"copy content"},maximize:{title:"Maximize",back:"Back to document"},expand:{title:"Embedded preview"},collapse:{title:"Compact display"},card:{lockAlert:"Please wait for the other user to finish editing"},preferences:{title:"Preferences"},download:{title:"Download"},more:{title:"More"},checkMarkdown:{title:"It is detected that the paste content conforms to the Markdown syntax. Do you need to do style conversion?"},searchEmtpy:{title:"No matching card"}},Xr={dnd:{title:"拖动调整位置"},copy:{title:"复制",success:"复制成功",error:"复制失败"},delete:{title:"删除"},copyAnchor:{title:"复制锚点链接"},link:{placeholder:"请输入链接或锚点,回车确认",save:"保存",edit:"编辑",delete:"取消链接",open:"打开链接",text:"链接"},copyContent:{title:"复制内容"},maximize:{title:"最大化",back:"返回文档"},expand:{title:"嵌入预览"},collapse:{title:"紧凑展示"},card:{lockAlert:"请等待对方编辑完毕后,再进入编辑"},preferences:{title:"设置"},download:{title:"下载"},more:{title:"更多"},checkMarkdown:{title:"检测到粘贴内容符合 Markdown 语法,是否需要转换?"},searchEmtpy:{title:"无匹配卡片"}},Kr={"en-US":Yr,"zh-CN":Xr},Zr=Object(u["a"])((function t(e,n){Object(c["a"])(this,t),this.editor=void 0,this.options=void 0,this.kind="plugin",this.name=this.constructor.pluginName,this.disabled=void 0,this.editor=e,this.options=n||{};var r=this.options.disabled;this.disabled=r}));Zr.pluginName=void 0;var Jr=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.kind="element",t.sechamCache=void 0,t.tagName=void 0,t.style=void 0,t.attributes=void 0,t.variable=void 0,t}return Object(u["a"])(n,[{key:"init",value:function(){var t=this.editor,e=t.schema,n=t.conversion;e.add(this.schema()),this.conversion&&this.conversion().forEach((function(t){var e=t.from,r=t.to;n.add(e,r)}))}},{key:"setStyle",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];ke(t)&&(t=He(t)),this.style&&Object.keys(this.style).forEach((function(n){var i,o=e.style[n];"object"===Object(a["a"])(o)&&(o=o.value),null===(i=o.match(/@var\d/g))||void 0===i||i.forEach((function(t){var e=parseInt(t.replace("@var",""),10);o=o.replace(new RegExp(t,"gm"),r[e]||"")})),t.css(n,o)}))}},{key:"setAttributes",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];ke(t)&&(t=He(t)),this.attributes&&Object.keys(this.attributes).forEach((function(n){var i,o=e.attributes[n];"object"===Object(a["a"])(o)&&(o=o.value),null===(i=o.match(/@var\d/g))||void 0===i||i.forEach((function(t){var e=parseInt(t.replace("@var",""),10);o=o.replace(new RegExp(t,"gm"),r[e]||"")})),t.attributes(n,o)}))}},{key:"getStyle",value:function(t){var e=this;ke(t)&&(t=He(t));var n={};return this.style&&this.isSelf(t)&&Object.keys(this.style).forEach((function(r){t=t;var i=r.toLowerCase().indexOf("color")>-1?O()(t.css(r)||"").toHexString():t.css(r),o=e.style[r];"object"===Object(a["a"])(o)&&(i=o.format(i)),i&&(n[r]=i)})),n}},{key:"getAttributes",value:function(t){var e=this;ke(t)&&(t=He(t));var n={};return this.attributes&&this.isSelf(t)&&Object.keys(this.attributes).forEach((function(r){var i=t.attributes(r),o=e.attributes[r];"object"===Object(a["a"])(o)&&(i=o.format(i)),i&&(n[r]=i)})),n}},{key:"isSelf",value:function(t){ke(t)&&(t=He(t));var e=this.schema();return Array.isArray(e)&&(e=e.find((function(e){var n=e.name;return n===t.name}))),!!e&&((Array.isArray(this.tagName)?this.tagName.indexOf(t.name)>-1:t.name===this.tagName)&&this.editor.schema.checkNode(t,e.attributes))}},{key:"schema",value:function(){var t=this;if(this.sechamCache)return this.sechamCache;var e={};if(this.attributes&&Object.keys(this.attributes).forEach((function(n){var r,i=t.attributes[n];"object"===Object(a["a"])(i)&&(i=i.value),e[n]=i,null===(r=i.match(/@var\d/g))||void 0===r||r.forEach((function(r){if(!t.variable)throw"Please specify the variable type";e[n]=t.variable[r]}))})),this.style){var n={};Object.keys(this.style).forEach((function(e){var r,i=t.style[e];"object"===Object(a["a"])(i)&&(i=i.value),null===(r=i.match(/@var\d/g))||void 0===r||r.forEach((function(r){if(!t.variable)throw"Please specify the variable type";n[e]=t.variable[r]}))})),e=Object(l["a"])(Object(l["a"])({},e),{},{style:n})}if(this.sechamCache={type:this.kind,attributes:e},"string"===typeof this.tagName)this.sechamCache.name=this.tagName.toLowerCase();else if(Array.isArray(this.tagName)){var r=[];this.tagName.forEach((function(e){r.push(Object(l["a"])(Object(l["a"])({},t.sechamCache),{},{name:e}))})),this.sechamCache=r}return this.sechamCache}},{key:"createElement",value:function(){for(var t=He("<".concat(this.tagName," />")),e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.setStyle.apply(this,[t].concat(n)),this.setAttributes.apply(this,[t].concat(n)),t}}]),n}(Zr),Qr=function(t){return"element"===t.kind},ti=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.kind="block",t.allowIn=void 0,t.disableMark=void 0,t.canMerge=void 0,t}return Object(u["a"])(n,[{key:"schema",value:function(){var t=this,e=Object(h["a"])(Object(p["a"])(n.prototype),"schema",this).call(this);return Array.isArray(e)?e.map((function(e){return Object(l["a"])(Object(l["a"])({},e),{},{allowIn:t.allowIn})})):Object(l["a"])(Object(l["a"])({},e),{},{allowIn:this.allowIn,canMerge:this.canMerge})}}]),n}(Jr),ei=function(t){return"block"===t.kind},ni=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.kind="inline",t.markdown=void 0,t}return Object(u["a"])(n,[{key:"execute",value:function(){var t=this.editor;if(pe(t)){for(var e=He("<".concat(this.tagName," />")),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];this.setStyle.apply(this,[e].concat(r)),this.setAttributes.apply(this,[e].concat(r));var o=t.inline,a=this.isTrigger?this.isTrigger.apply(this,r):!this.queryState();a?o.wrap(e):o.unwrap()}}},{key:"queryState",value:function(){var t=this,e=this.editor;if(pe(e)){var n=e.change;if(!this.style&&!this.attributes)return n.inlines.some((function(e){return e.name===t.tagName}));var r=[];return n.inlines.forEach((function(e){r.push.apply(r,Object(S["a"])(Object.values(t.getStyle(e)))),r.push.apply(r,Object(S["a"])(Object.values(t.getAttributes(e))))})),0===r.length?void 0:r}}}]),n}(Jr),ri=function(t){return"inline"===t.kind},ii='.am-engine ol, .am-engine-view ol, .am-engine ul, .am-engine-view ul {\n margin: 0 0 0 3px;\n padding: 0;\n list-style: none;\n}\n\n.am-engine ol ul,.am-engine-view ol ul,.am-engine ul ul,.am-engine-view ul ul,.am-engine ol ol,.am-engine-view ol ol,.am-engine ul ol,.am-engine-view ul ol {\n\tmargin-left: 0;\n}\n\n.am-engine ol ul li,.am-engine-view ol ul li,.am-engine ul ul li,.am-engine-view ul ul li,.am-engine ol ol li,.am-engine-view ol ol li,.am-engine ul ol li,.am-engine-view ul ol li {\n\tmargin-left: 2em;\n}\n\n.am-engine ol ol[data-indent-new="0"],.am-engine-view ol ol[data-indent-new="0"],.am-engine ul ol[data-indent-new="0"],.am-engine-view ul ol[data-indent-new="0"],.am-engine ol ol[data-indent-new="3"],.am-engine-view ol ol[data-indent-new="3"],.am-engine ul ol[data-indent-new="3"],.am-engine-view ul ol[data-indent-new="3"],.am-engine ol ol[data-indent-new="6"],.am-engine-view ol ol[data-indent-new="6"],.am-engine ul ol[data-indent-new="6"],.am-engine-view ul ol[data-indent-new="6"],.am-engine ol ol[data-indent-new="6"],.am-engine ol ol[data-indent-new="9"],.am-engine-view ol ol[data-indent-new="9"],.am-engine ul ol[data-indent-new="9"],.am-engine-view ul ol[data-indent-new="9"],.am-engine ol ol[data-indent-new="12"],.am-engine-view ol ol[data-indent-new="12"],.am-engine ul ol[data-indent-new="12"],.am-engine-view ul ol[data-indent-new="12"],.am-engine ol ol[data-indent-new="15"],.am-engine-view ol ol[data-indent-new="15"],.am-engine ul ol[data-indent-new="15"],.am-engine-view ul ol[data-indent-new="15"],.am-engine ol ol[data-indent-new="18"],.am-engine-view ol ol[data-indent-new="18"],.am-engine ul ol[data-indent-new="18"],.am-engine-view ul ol[data-indent-new="18"] {\n\tlist-style-type: decimal;\n}\n\n.am-engine ol ol[data-indent-new="1"],.am-engine-view ol ol[data-indent-new="1"],.am-engine ul ol[data-indent-new="1"],.am-engine-view ul ol[data-indent-new="1"],.am-engine ol ol[data-indent-new="4"],.am-engine-view ol ol[data-indent-new="4"],.am-engine ul ol[data-indent-new="4"],.am-engine-view ul ol[data-indent-new="4"],.am-engine ol ol[data-indent-new="7"],.am-engine-view ol ol[data-indent-new="7"],.am-engine ul ol[data-indent-new="7"],.am-engine-view ul ol[data-indent-new="7"],.am-engine ol ol[data-indent-new="10"],.am-engine-view ol ol[data-indent-new="10"],.am-engine ul ol[data-indent-new="10"],.am-engine-view ul ol[data-indent-new="10"],.am-engine ol ol[data-indent-new="13"],.am-engine-view ol ol[data-indent-new="13"],.am-engine ul ol[data-indent-new="13"],.am-engine-view ul ol[data-indent-new="13"],.am-engine ol ol[data-indent-new="16"],.am-engine-view ol ol[data-indent-new="16"],.am-engine ul ol[data-indent-new="16"],.am-engine-view ul ol[data-indent-new="16"],.am-engine ol ol[data-indent-new="19"],.am-engine-view ol ol[data-indent-new="19"],.am-engine ul ol[data-indent-new="19"],.am-engine-view ul ol[data-indent-new="19"] {\n\tlist-style-type: lower-alpha;\n}\n\n.am-engine ol ol[data-indent-new="2"],.am-engine-view ol ol[data-indent-new="2"],.am-engine ul ol[data-indent-new="2"],.am-engine-view ul ol[data-indent-new="2"],.am-engine ol ol[data-indent-new="5"],.am-engine-view ol ol[data-indent-new="5"],.am-engine ul ol[data-indent-new="5"],.am-engine-view ul ol[data-indent-new="5"],.am-engine ol ol[data-indent-new="8"],.am-engine-view ol ol[data-indent-new="8"],.am-engine ul ol[data-indent-new="8"],.am-engine-view ul ol[data-indent-new="8"],.am-engine ol ol[data-indent-new="11"],.am-engine-view ol ol[data-indent-new="11"],.am-engine ul ol[data-indent-new="11"],.am-engine-view ul ol[data-indent-new="11"],.am-engine ol ol[data-indent-new="14"],.am-engine-view ol ol[data-indent-new="14"],.am-engine ul ol[data-indent-new="14"],.am-engine-view ul ol[data-indent-new="14"],.am-engine ol ol[data-indent-new="17"],.am-engine-view ol ol[data-indent-new="17"],.am-engine ul ol[data-indent-new="17"],.am-engine-view ul ol[data-indent-new="17"],.am-engine ol ol[data-indent-new="20"],.am-engine-view ol ol[data-indent-new="20"],.am-engine ul ol[data-indent-new="20"],.am-engine-view ul ol[data-indent-new="20"] {\n\tlist-style-type: lower-roman;\n}\n\n.am-engine ol ul[data-indent-new="3"],.am-engine-view ol ul[data-indent-new="3"],.am-engine ul ul[data-indent-new="3"],.am-engine-view ul ul[data-indent-new="3"],.am-engine ol ul[data-indent-new="6"],.am-engine-view ol ul[data-indent-new="6"],.am-engine ul ul[data-indent-new="6"],.am-engine-view ul ul[data-indent-new="6"],.am-engine ol ul[data-indent-new="9"],.am-engine-view ol ul[data-indent-new="9"],.am-engine ul ul[data-indent-new="9"],.am-engine-view ul ul[data-indent-new="9"],.am-engine ol ul[data-indent-new="12"],.am-engine-view ol ul[data-indent-new="12"],.am-engine ul ul[data-indent-new="12"],.am-engine-view ul ul[data-indent-new="12"],.am-engine ol ul[data-indent-new="15"],.am-engine-view ol ul[data-indent-new="15"],.am-engine ul ul[data-indent-new="15"],.am-engine-view ul ul[data-indent-new="15"],.am-engine ol ul[data-indent-new="18"],.am-engine-view ol ul[data-indent-new="18"],.am-engine ul ul[data-indent-new="18"],.am-engine-view ul ul[data-indent-new="18"] {\n\tlist-style-type: disc;\n}\n\n.am-engine ol ul[data-indent-new="1"],.am-engine-view ol ul[data-indent-new="1"],.am-engine ul ul[data-indent-new="1"],.am-engine-view ul ul[data-indent-new="1"],.am-engine ol ul[data-indent-new="4"],.am-engine-view ol ul[data-indent-new="4"],.am-engine ul ul[data-indent-new="4"],.am-engine-view ul ul[data-indent-new="4"],.am-engine ol ul[data-indent-new="7"],.am-engine-view ol ul[data-indent-new="7"],.am-engine ul ul[data-indent-new="7"],.am-engine-view ul ul[data-indent-new="7"],.am-engine ol ul[data-indent-new="10"],.am-engine-view ol ul[data-indent-new="10"],.am-engine ul ul[data-indent-new="10"],.am-engine-view ul ul[data-indent-new="10"],.am-engine ol ul[data-indent-new="13"],.am-engine-view ol ul[data-indent-new="13"],.am-engine ul ul[data-indent-new="13"],.am-engine-view ul ul[data-indent-new="13"],.am-engine ol ul[data-indent-new="16"],.am-engine-view ol ul[data-indent-new="16"],.am-engine ul ul[data-indent-new="16"],.am-engine-view ul ul[data-indent-new="16"],.am-engine ol ul[data-indent-new="19"],.am-engine-view ol ul[data-indent-new="19"],.am-engine ul ul[data-indent-new="19"],.am-engine-view ul ul[data-indent-new="19"] {\n\tlist-style-type: circle;\n}\n\n.am-engine ol ul[data-indent-new="2"],.am-engine-view ol ul[data-indent-new="2"],.am-engine ul ul[data-indent-new="2"],.am-engine-view ul ul[data-indent-new="2"],.am-engine ol ul[data-indent-new="5"],.am-engine-view ol ul[data-indent-new="5"],.am-engine ul ul[data-indent-new="5"],.am-engine-view ul ul[data-indent-new="5"],.am-engine ol ul[data-indent-new="8"],.am-engine-view ol ul[data-indent-new="8"],.am-engine ul ul[data-indent-new="8"],.am-engine-view ul ul[data-indent-new="8"],.am-engine ol ul[data-indent-new="11"],.am-engine-view ol ul[data-indent-new="11"],.am-engine ul ul[data-indent-new="11"],.am-engine-view ul ul[data-indent-new="11"],.am-engine ol ul[data-indent-new="14"],.am-engine-view ol ul[data-indent-new="14"],.am-engine ul ul[data-indent-new="14"],.am-engine-view ul ul[data-indent-new="14"],.am-engine ol ul[data-indent-new="17"],.am-engine-view ol ul[data-indent-new="17"],.am-engine ul ul[data-indent-new="17"],.am-engine-view ul ul[data-indent-new="17"],.am-engine ol ul[data-indent-new="20"],.am-engine-view ol ul[data-indent-new="20"],.am-engine ul ul[data-indent-new="20"],.am-engine-view ul ul[data-indent-new="20"] {\n\tlist-style-type: square;\n}\n\n.am-engine li,.am-engine-view li {\n\tmargin-left: 23px;\n position: relative;\n}\n\n.am-engine ol,.am-engine-view ol,.am-engine ol[data-indent="3"],.am-engine-view ol[data-indent="3"],.am-engine ol[data-indent="6"],.am-engine-view ol[data-indent="6"],.am-engine ol[data-indent="9"],.am-engine-view ol[data-indent="9"],.am-engine ol[data-indent="12"],.am-engine-view ol[data-indent="12"],.am-engine ol[data-indent="15"],.am-engine-view ol[data-indent="15"],.am-engine ol[data-indent="18"],.am-engine-view ol[data-indent="18"] {\n\tlist-style-type: decimal;\n}\n\n.am-engine ol[data-indent="1"],.am-engine-view ol[data-indent="1"],.am-engine ol[data-indent="4"],.am-engine-view ol[data-indent="4"],.am-engine ol[data-indent="7"],.am-engine-view ol[data-indent="7"],.am-engine ol[data-indent="10"],.am-engine-view ol[data-indent="10"],.am-engine ol[data-indent="13"],.am-engine-view ol[data-indent="13"],.am-engine ol[data-indent="16"],.am-engine-view ol[data-indent="16"],.am-engine ol[data-indent="19"],.am-engine-view ol[data-indent="19"] {\n\tlist-style-type: lower-alpha;\n}\n\n.am-engine ol[data-indent="2"],.am-engine-view ol[data-indent="2"],.am-engine ol[data-indent="5"],.am-engine-view ol[data-indent="5"],.am-engine ol[data-indent="8"],.am-engine-view ol[data-indent="8"],.am-engine ol[data-indent="11"],.am-engine-view ol[data-indent="11"],.am-engine ol[data-indent="14"],.am-engine-view ol[data-indent="14"],.am-engine ol[data-indent="17"],.am-engine-view ol[data-indent="17"],.am-engine ol[data-indent="20"],.am-engine-view ol[data-indent="20"] {\n\tlist-style-type: lower-roman;\n}\n\n.am-engine ul,.am-engine-view ul,.am-engine ul[data-indent="3"],.am-engine-view ul[data-indent="3"],.am-engine ul[data-indent="6"],.am-engine-view ul[data-indent="6"],.am-engine ul[data-indent="9"],.am-engine-view ul[data-indent="9"],.am-engine ul[data-indent="12"],.am-engine-view ul[data-indent="12"],.am-engine ul[data-indent="15"],.am-engine-view ul[data-indent="15"],.am-engine ul[data-indent="18"],.am-engine-view ul[data-indent="18"] {\n\tlist-style-type: disc;\n}\n\n.am-engine ul[data-indent="1"],.am-engine-view ul[data-indent="1"],.am-engine ul[data-indent="4"],.am-engine-view ul[data-indent="4"],.am-engine ul[data-indent="7"],.am-engine-view ul[data-indent="7"],.am-engine ul[data-indent="10"],.am-engine-view ul[data-indent="10"],.am-engine ul[data-indent="13"],.am-engine-view ul[data-indent="13"],.am-engine ul[data-indent="16"],.am-engine-view ul[data-indent="19"],.am-engine ul[data-indent="19"],.am-engine-view ul[data-indent="19"] {\n\tlist-style-type: circle;\n}\n\n.am-engine ul[data-indent="2"],.am-engine-view ul[data-indent="2"],.am-engine ul[data-indent="5"],.am-engine-view ul[data-indent="5"],.am-engine ul[data-indent="8"],.am-engine-view ul[data-indent="8"],.am-engine ul[data-indent="11"],.am-engine-view ul[data-indent="11"],.am-engine ul[data-indent="14"],.am-engine-view ul[data-indent="14"],.am-engine ul[data-indent="17"],.am-engine-view ul[data-indent="17"],.am-engine ul[data-indent="20"],.am-engine-view ul[data-indent="20"] {\n\tlist-style-type: square;\n}\n\n.am-engine ol[data-indent="1"],.am-engine-view ol[data-indent="1"],.am-engine ul[data-indent="1"],.am-engine-view ul[data-indent="1"] {\n\tpadding-left: 2em;\n}\n\n.am-engine ol[data-indent="2"],.am-engine-view ol[data-indent="2"],.am-engine ul[data-indent="2"],.am-engine-view ul[data-indent="2"] {\n\tpadding-left: 4em;\n}\n\n.am-engine ol[data-indent="3"],.am-engine-view ol[data-indent="3"],.am-engine ul[data-indent="3"],.am-engine-view ul[data-indent="3"] {\n\tpadding-left: 6em;\n}\n\n.am-engine ol[data-indent="4"],.am-engine-view ol[data-indent="4"],.am-engine ul[data-indent="4"],.am-engine-view ul[data-indent="4"] {\n\tpadding-left: 8em;\n}\n\n.am-engine ol[data-indent="5"],.am-engine-view ol[data-indent="5"],.am-engine ul[data-indent="5"],.am-engine-view ul[data-indent="5"] {\n\tpadding-left: 10em;\n}\n\n.am-engine ol[data-indent="6"],.am-engine-view ol[data-indent="6"],.am-engine ul[data-indent="6"],.am-engine-view ul[data-indent="6"] {\n\tpadding-left: 12em;\n}\n\n.am-engine ol[data-indent="7"],.am-engine-view ol[data-indent="7"],.am-engine ul[data-indent="7"],.am-engine-view ul[data-indent="7"] {\n\tpadding-left: 14em;\n}\n\n.am-engine ol[data-indent="8"],.am-engine-view ol[data-indent="8"],.am-engine ul[data-indent="8"],.am-engine-view ul[data-indent="8"] {\n\tpadding-left: 16em;\n}\n\n.am-engine ol[data-indent="8"],.am-engine-view ol[data-indent="8"],.am-engine ul[data-indent="8"],.am-engine-view ul[data-indent="8"] {\n\tpadding-left: 16em;\n}\n\n.am-engine ol[data-indent="9"],.am-engine-view ol[data-indent="9"],.am-engine ul[data-indent="9"],.am-engine-view ul[data-indent="9"] {\n\tpadding-left: 18em;\n}\n\n.am-engine ol[data-indent="10"],.am-engine-view ol[data-indent="10"],.am-engine ul[data-indent="10"],.am-engine-view ul[data-indent="10"] {\n\tpadding-left: 20em;\n}\n.am-engine ol[data-indent="11"],.am-engine-view ol[data-indent="11"],.am-engine ul[data-indent="11"],.am-engine-view ul[data-indent="11"] {\n\tpadding-left: 22em;\n}\n\n.am-engine ol[data-indent="12"],.am-engine-view ol[data-indent="12"],.am-engine ul[data-indent="8"],.am-engine-view ul[data-indent="12"] {\n\tpadding-left: 24em;\n}\n\n.am-engine ol[data-indent="13"],.am-engine-view ol[data-indent="13"],.am-engine ul[data-indent="13"],.am-engine-view ul[data-indent="13"] {\n\tpadding-left: 26em;\n}\n\n.am-engine ol[data-indent="14"],.am-engine-view ol[data-indent="14"],.am-engine ul[data-indent="14"],.am-engine-view ul[data-indent="14"] {\n\tpadding-left: 28em;\n}\n\n.am-engine ol[data-indent="15"],.am-engine-view ol[data-indent="15"],.am-engine ul[data-indent="15"],.am-engine-view ul[data-indent="15"] {\n\tpadding-left: 30em;\n}\n.am-engine ol[data-indent="16"],.am-engine-view ol[data-indent="16"],.am-engine ul[data-indent="16"],.am-engine-view ul[data-indent="16"] {\n\tpadding-left: 32em;\n}\n.am-engine ol[data-indent="17"],.am-engine-view ol[data-indent="17"],.am-engine ul[data-indent="17"],.am-engine-view ul[data-indent="17"] {\n\tpadding-left: 34em;\n}\n.am-engine ol[data-indent="18"],.am-engine-view ol[data-indent="18"],.am-engine ul[data-indent="18"],.am-engine-view ul[data-indent="18"] {\n\tpadding-left: 36em;\n}\n.am-engine ol[data-indent="19"],.am-engine-view ol[data-indent="19"],.am-engine ul[data-indent="19"],.am-engine-view ul[data-indent="19"] {\n\tpadding-left: 38em;\n}\n.am-engine ol[data-indent="20"],.am-engine-view ol[data-indent="20"],.am-engine ul[data-indent="20"],.am-engine-view ul[data-indent="20"] {\n\tpadding-left: 40em;\n}\n\n.am-engine .data-list,.am-engine-view .data-list {\n\tcolor: #262626;\n\ttext-indent: 0;\n}\n\n.am-engine .data-list-item,.am-engine-view .data-list-item {\n line-height: inherit;\n position: relative;\n list-style: none;\n text-indent: 0;\n}\n';pn(ii);var oi=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.cardName=void 0,t.isPasteList=!1,t.canMerge=!0,t.pasteBefore=function(e){var n=t.editor;if(t.cardName&&n){var r=n.list,i=He(e),o=i.allChildren();o.forEach((function(t){if("li"===t.name&&t.hasClass(r.CUSTOMZIE_LI_CLASS)){var e;if(!(null===(e=t.first())||void 0===e?void 0:e.isCard()))return t.removeClass(r.CUSTOMZIE_LI_CLASS),void t.closest("ul").removeClass(r.CUSTOMZIE_UL_CLASS);t.closest("ul").addClass(r.CUSTOMZIE_UL_CLASS)}})),t.isPasteList=o.some((function(t){return"li"===t.name}))}},t.pasteInsert=function(){var e=t.editor;if(t.cardName&&pe(e)){var n=e.change,r=e.list,i=n.range.get(),o=i.getRootBlock(),a=null===o||void 0===o?void 0:o.next(),s=null===a||void 0===a?void 0:a.find("li.".concat(r.CUSTOMZIE_LI_CLASS));s&&s.length>0&&s.each((function(e){var n=He(e);0===n.find("[".concat(bt,"=").concat(t.cardName,"],[").concat(yt,"=").concat(t.cardName,"]")).length&&r.addReadyCardToCustomize(n,t.cardName)}))}},t.pasteAfter=function(){var e;t.isPasteList&&(null===(e=t.editor)||void 0===e||e.list.merge())},t}return Object(u["a"])(n,[{key:"init",value:function(){Object(h["a"])(Object(p["a"])(n.prototype),"init",this).call(this);var t=this.editor;pe(t)&&(t.on("paste:before",this.pasteBefore),t.on("paste:insert",this.pasteInsert),t.on("paste:after",this.pasteAfter))}},{key:"queryState",value:function(){var t=this.editor;return!!pe(t)&&t.list.getPluginNameByNodes(t.change.blocks)===this.constructor.pluginName}},{key:"destroy",value:function(){var t=this.editor;pe(t)&&(t.off("paste:before",this.pasteBefore),t.off("paste:insert",this.pasteInsert),t.off("paste:after",this.pasteAfter))}}]),n}(ti),ai=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(){var t;Object(c["a"])(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),t.kind="mark",t.copyOnEnter=void 0,t.followStyle=!0,t.combineValueByWrap=!1,t.mergeLeval=1,t}return Object(u["a"])(n,[{key:"execute",value:function(){var t=this.editor;if(pe(t)){var e=t.change,n=t.mark,r=this.createElement.apply(this,arguments),i=this.isTrigger?this.isTrigger.apply(this,arguments):!this.queryState();if(i){if(!this.followStyle&&e.range.get().collapsed)return;n.wrap(r)}else n.unwrap(r)}}},{key:"queryState",value:function(){var t=this,e=this.editor;if(pe(e)){var n=e.change;if(!this.style&&!this.attributes)return n.marks.some((function(e){return e.name===t.tagName}));var r=[];return n.marks.forEach((function(e){r.push.apply(r,Object(S["a"])(Object.values(t.getStyle(e)))),r.push.apply(r,Object(S["a"])(Object.values(t.getAttributes(e))))})),0===r.length?void 0:r}}},{key:"schema",value:function(){var t=Object(h["a"])(Object(p["a"])(n.prototype),"schema",this).call(this);return Array.isArray(t)?t.map((function(t){return Object(l["a"])({},t)})):Object(l["a"])({},t)}}]),n}(Jr),si=function(t){return"mark"===t.kind},li=function(){function t(e){Object(c["a"])(this,t),this.data={},this.components={},this.editor=void 0,this.editor=e}return Object(u["a"])(t,[{key:"init",value:function(t,e){var n=this;t.forEach((function(t){n.data[t.pluginName]=t;var r=new t(n.editor,e[t.pluginName]);n.components[t.pluginName]=r,r.init&&r.init()}))}},{key:"add",value:function(t,e){this.data[t.pluginName]=t,e=Object(l["a"])({},e);var n=this.editor;if(pe(n)){var r=new t(n,e);r.init&&r.init(),this.components[t.pluginName]=r}}},{key:"findPlugin",value:function(t){var e=this.components[t];if(e)return e}},{key:"findElementPlugin",value:function(t){var e=this.findPlugin(t);if(e)return Qr(e)?e:void 0}},{key:"findMarkPlugin",value:function(t){var e=this.findPlugin(t);if(e)return si(e)?e:void 0}},{key:"findInlinePlugin",value:function(t){var e=this.findPlugin(t);if(e)return ri(e)?e:void 0}},{key:"findBlockPlugin",value:function(t){var e=this.findPlugin(t);if(e)return ei(e)?e:void 0}},{key:"each",value:function(t){var e=this;Object.keys(this.data).forEach((function(n,r){!t||t(n,e.data[n],r)}))}},{key:"destroy",value:function(){var t=this;Object.keys(this.components).forEach((function(e){var n=t.components[e];n.destroy&&n.destroy()}))}}]),t}(),ci=function(){function t(e){Object(c["a"])(this,t),this.editor=void 0,this.editor=e}return Object(u["a"])(t,[{key:"queryEnabled",value:function(t){var e=this.editor,n=e.plugin.components[t];if(!n||n.disabled)return!1;if((!pe(e)||e.readonly)&&!1!==n.disabled)return!1;var r=e.card;return!r.active||(!(!si(n)&&"plugin"!==n.kind||!r.active.executeMark)||!!r.active.isEditable)}},{key:"queryState",value:function(t){var e=this.editor,n=e.plugin.components[t];if(n&&n.queryState)try{for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return n.queryState(i)}catch(a){e.messageError("command-query",a)}}},{key:"handleExecuteBefore",value:function(){var t,e=this.editor;if(pe(e)){t=e.change;var n=t.range.get();if(!n.commonAncestorNode.isRoot()&&!n.commonAncestorNode.inEditor()){var r=n.commonAncestorNode.closest(rt),i=void 0;if(r.length>0){var o=r.attributes(Mt);if(o){var a=e.card;i=a.find(o),i&&a.select(i)}}i||e.focus()}t.cacheRangeBeforeCommand()}return t}},{key:"execute",value:function(t){var e=this.editor,n=e.plugin.components[t];if(n&&n.execute){for(var r=this.handleExecuteBefore(),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];e.trigger.apply(e,["beforeCommandExecute",t].concat(o));try{var s=n.execute.apply(n,o);return null===r||void 0===r||r.combinText(),null===r||void 0===r||r.onSelect(),e.trigger.apply(e,["afterCommandExecute",t].concat(o)),s}catch(l){e.messageError("command-execute",l)}}}},{key:"executeMethod",value:function(t,e){var n=this.editor,r=n.plugin.components[t];if(r&&r[e])try{for(var i=pe(n)?n.change:null,o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];var l=r[e].apply(r,a);return null===i||void 0===i||i.combinText(),l}catch(c){n.messageError("command-excute-method",c)}}}]),t}(),ui=["blocks","inlines","marks","globals"],di=function(){function t(){Object(c["a"])(this,t),this._all=[],this._typeMap={},this._invalidKeys=[],this._tagMap={blocks:[],inlines:[],marks:[]},this.data={blocks:[],inlines:[],marks:[],globals:{}}}return Object(u["a"])(t,[{key:"add",value:function(t){var e=this;t=L()(t),Array.isArray(t)||(t=[t]),t.forEach((function(t){pi(t)?(t.attributes&&Object.keys(t.attributes).forEach((function(n){e.data.globals[t.type]&&("style"===n?Object.keys(t.attributes.style).forEach((function(r){e.data.globals[t.type][n]&&e.data.globals[t.type][n][r]===t.attributes.style[r]&&delete t.attributes.style[r]})):e.data.globals[t.type][n]===t.attributes[n]&&delete t.attributes[n])})),"block"===t.type?e.data.blocks.push(t):"inline"===t.type?e.data.inlines.push(t):"mark"===t.type&&e.data.marks.push(t)):e.data["".concat(t.type,"s")]&&(e.data.globals[t.type]=V()(Object.assign({},e.data.globals[t.type]),t.attributes))})),this.updateTagMap();var n=function(t){var e=t.attributes||{},n=e.style||{},r=0,i=0;return Object.keys(e).forEach((function(t){var n=e[t];hi(n)&&n.required&&r++})),Object.keys(n).forEach((function(t){var e=n[t];hi(e)&&e.required&&i++})),[r,i]},r=this.data,i=r.blocks,o=r.marks,a=r.inlines;this._all=[].concat(Object(S["a"])(i),Object(S["a"])(o),Object(S["a"])(a)).sort((function(t,e){var r=n(t),i=Object(w["a"])(r,2),o=i[0],a=i[1],s=n(e),l=Object(w["a"])(s,2),c=l[0],u=l[1];return o>c?-1:o===c?a===u?0:a>u?-1:1:1}))}},{key:"updateTagMap",value:function(){var t=this;this._tagMap.marks=[],this.data.marks.forEach((function(e){~~t._tagMap.marks.indexOf(e.name)&&t._tagMap.marks.push(e.name)})),this._tagMap.blocks=[],this.data.blocks.forEach((function(e){~~t._tagMap.blocks.indexOf(e.name)&&t._tagMap.blocks.push(e.name)})),this._tagMap.inlines=[],this.data.inlines.forEach((function(e){~~t._tagMap.inlines.indexOf(e.name)&&t._tagMap.inlines.push(e.name)}))}},{key:"getTags",value:function(t){return this._tagMap[t]}},{key:"remove",value:function(t){var e=this._all.findIndex((function(e){return A()(e,t)}));e>-1&&this._all.splice(e,1);var n=this.data["".concat(t.type,"s")];n&&(e=n.findIndex((function(e){return A()(e,t)})),e>-1&&n.splice(e,1)),this._typeMap={},this.updateTagMap()}},{key:"clone",value:function(){var e=new t;return e._all=L()(this._all),e._typeMap=L()(this._typeMap),e._tagMap=L()(this._tagMap),e.data=L()(this.data),e}},{key:"find",value:function(t){var e=this,n=[];return ui.forEach((function(r){if("globals"!==r){var i=e.data[r].filter(t);n.push.apply(n,Object(S["a"])(i))}})),n}},{key:"getType",value:function(t,e){var n=ke(t)?t:t[0];if(n&&n.nodeType===Node.ELEMENT_NODE){var r=n.getAttribute(Q);if(r=r?r.split("-")[0]:Ye(n,!1),"CARD"===n.nodeName||!~this._invalidKeys.indexOf(r)){var i=this._typeMap[r];if(i&&(!e||e(i)))return i.type;var o=this.getRule(n,e);return o?this._typeMap[r]=o:this._invalidKeys.push(r),null===o||void 0===o?void 0:o.type}}}},{key:"getRule",value:function(t,e){var n=this,r=ke(t)?t:t[0];return e=e||function(t){return t.name===r.localName},this._all.find((function(t){return e(t)&&n.checkNode(r,t.attributes)}))}},{key:"checkNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ke(t)?t:t[0];for(var r in e){var i;if("style"!==r){var o=e;if(!o[r])return!1;if(!this.checkValue(o,r,null!==(i=n.getAttribute(r))&&void 0!==i?i:void 0))return!1}}var a=Gt(n.getAttribute("style")||""),s=e.style||{};for(var l in s){if(!s[l])return!1;if(!this.checkValue(s,l,a[l]))return!1}return!0}},{key:"checkValue",value:function(t,e,n,r){if(!t[e])return!1;var i=t[e];if(hi(i)){if(void 0===n)return!i.required;i=i.value}else if(!r||void 0===n)return!0;if("string"===typeof i&&"@"===i.charAt(0))switch(i){case"@number":i=/^-?\d+(\.\d+)?$/;break;case"@length":i=/^-?\d+(\.\d+)?(\w*|%)$/;break;case"@color":i=/^(rgb(.+?)|#\w{3,6}|\w+)$/i;break;case"@url":i=ie;break}return"string"===typeof i?"*"===i||("class"===e?(n||"").split(/\s+/).some((function(t){return t.trim()===i})):i===n):Array.isArray(i)?"class"===e?(n||(n="*"),n.split(/\s+/).every((function(t){return""===t.trim()||~i.indexOf(t.trim())}))):i.indexOf(n)>-1:"object"===Object(a["a"])(i)&&"function"===typeof i.test?"class"===e?(n||"").split(/\s+/).every((function(t){return""===t.trim()||i.test(t.trim())})):i.test(n||""):"function"!==typeof i||i(n)}},{key:"filterStyles",value:function(t,e,n){var r=this;Object.keys(t).forEach((function(i){var o;(null===(o=e.attributes)||void 0===o?void 0:o.style)&&r.checkValue(e.attributes.style,i,t[i],!0)||(n&&n(i,t[i]),delete t[i])}))}},{key:"filterAttributes",value:function(t,e,n){var r=this;Object.keys(t).forEach((function(i){e.attributes&&r.checkValue(e.attributes,i,t[i],!0)||(n&&n(i,t[i]),delete t[i])}))}},{key:"filter",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=this.getRule(t);if(i){var o=this.data.globals,a=o[i.type]?i.type:void 0,s=Object.assign({},i,{attributes:V()({},i.attributes,a?o[a]:{})});this.filterAttributes(e,s,r?function(e){return t.removeAttributes(e)}:void 0),this.filterStyles(n,s,r?function(e){return t.css(e,"")}:void 0)}}},{key:"closest",value:function(t){var e=this,n=t;return this.data.blocks.forEach((function(r){if(r.name===t){var i=r;i.allowIn&&(i.allowIn.forEach((function(t){e.isAllowIn(t,n)&&(n=t)})),n=e.closest(n))}})),n}},{key:"isAllowIn",value:function(t,e){return"p"!==t&&this.data.blocks.some((function(n){if(n.name===e){var r=n;return!!(r.allowIn&&r.allowIn.indexOf(t)>-1)||void 0}}))}},{key:"addAllowIn",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"p",n=this.data.blocks.find((function(t){return t.name===e}));n.allowIn||(n.allowIn=[]),~~n.allowIn.indexOf(t)&&n.allowIn.push(t)}},{key:"getAllowInTags",value:function(){var t=[];return this.data.blocks.forEach((function(e){var n=e;n.allowIn&&n.allowIn.forEach((function(e){t.indexOf(e)<0&&t.push(e)}))})),t}},{key:"getCanMergeTags",value:function(){var t=[];return this.data.blocks.forEach((function(e){var n=e;!0===n.canMerge&&t.indexOf(n.name)<0&&t.push(n.name)})),t}}]),t}(),hi=function(t){return void 0!==t.required},pi=function(t){return!!t["name"]},fi=function(){function t(e){Object(c["a"])(this,t),this.editor=void 0,this.data=[],this.editor=e}return Object(u["a"])(t,[{key:"getData",value:function(){return this.data}},{key:"clone",value:function(){var e=L()(this.data),n=new t(this.editor);return n.data=e,n}},{key:"add",value:function(t,e){this.data.push({from:t,to:e})}},{key:"transform",value:function(t,e){var n=t.name,r=t.attributes(),i=Gt(r.style||""),o=!1;delete r.style,t.isCursor()&&(n=r[J].toLowerCase(),r={},i={});var a=this.data.find((function(t){if(!e||e(t)){var a=t.from,s=t.to,l=!1;if("string"===typeof a)l=a===n;else if("function"===typeof a)l=a(n,i,r);else{var c=Object.keys(a);l=c.indexOf(n)>=0&&c.some((function(t){var e=a[t];return Object.keys(e.style||{}).every((function(t){var n=e.style[t];return i[t]&&Array.isArray(n)?n.indexOf(i[t])>-1:n===i[t]}))&&Object.keys(e.attributes||{}).every((function(t){var n=e.attributes[t];return i[t]&&Array.isArray(n)?n.indexOf(i[t])>-1:n===i[t]}))}))}if(l)if("string"===typeof s)n=s,i={},r={};else{var u="function"===typeof s?s(n,i,r):s,d=u;if(u.hasOwnProperty("replace")){var h=u;d=h.node,o=h.replace}n=d.name,i=d.css(),r=d.attributes()}return l}}));return a?{rule:a,node:{name:n,style:i,attributes:r},replace:o}:void 0}}]),t}(),gi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"insertNewline",value:function(t,e,n){var r=this.engine.change,i=He("<p><br /></p>");this.engine.nodeId.generate(i),n?e.root.before(i):e.root.after(i),t.select(i,!0),t.collapse(!1),r.range.select(t)}},{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.card,i=n.range.get(),o=r.find(i.startNode);if(!o)return!0;if(o.type===gn.INLINE){var a=i.startNode.closest(Ot);a.length>0&&(i.select(o.root),i.collapse(!0),n.range.select(i));var s=i.startNode.closest(_t);s.length>0&&(i.select(o.root),i.collapse(!1),n.range.select(i))}else{var l=i.startNode.closest(Ot);if(l.length>0){t.preventDefault();var c=o.root.prev();return!c||c.isCard()?(r.focusPrevBlock(o,i,!0),n.range.select(i)):this.insertNewline(i,o,!0),!1}var u=i.startNode.closest(_t);if(u.length>0){t.preventDefault();var d=o.root.next();return!d||d.isCard()?(r.focusNextBlock(o,i,!0),n.range.select(i)):this.insertNewline(i,o,!1),!1}}return!0}}]),t}(),mi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"focusPrevBlock",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.engine.change,r=n.range.get();t=t||this.engine.block.closest(r.startNode);var i=t.prev();if(i)if(i.isCard()){var o=this.engine.card.find(i);o&&o.focus(r)}else this.engine.node.isList(i)&&(i=i.last()),i&&(e&&this.engine.node.isEmptyWithTrim(i)?i.remove():(r.select(i,!0),r.collapse(!1),n.range.select(r.shrinkToTextNode())))}},{key:"trigger",value:function(t){var e=this.engine.change,n=e.range.get().cloneRange().shrinkToElementNode().shrinkToTextNode();if(n.collapsed){var r=this.engine.card.find(n.startNode);if(!r){var i=n.getPrevNode(),o=null===i||void 0===i?void 0:i.parent();if(!t["isDelete"]&&i&&i.isCard()&&(!o||!this.engine.node.isCustomize(o))){t.preventDefault();var a=n.cloneRange();return a.setStartBefore(i),a.collapse(!0),this.engine.card.remove(i),e.range.select(a.shrinkToTextNode()),a.handleBr(),!1}return!0}if(t["isDelete"])return!0;if(r.type===gn.INLINE){var s=n.startNode.closest(Ot);if(s.length>0){var l=r.root.prev();if(!l)return t.preventDefault(),e.mergeAfterDelete(),!1;var c=this.engine.card.find(l);if(c)return this.engine.card.remove(c.id),n.handleBr(),!1;n.select(r.root).collapse(!0),e.range.select(n)}var u=n.startNode.closest(_t);if(u.length>0){t.preventDefault();var d=n.cloneRange();return d.setStartBefore(r.root),d.collapse(!0),this.engine.card.remove(r.id),e.range.select(d.shrinkToTextNode()),d.handleBr(),!1}}else{var h,p=n.startNode.closest(Ot);if(p.length>0)return t.preventDefault(),(null===(h=r.root.parent())||void 0===h?void 0:h.inEditor())?e.unwrap(r.root.parent()):this.focusPrevBlock(r.root,!0),!1;var f=n.startNode.closest(_t);if(f.length>0)return t.preventDefault(),this.focusPrevBlock(r.root),this.engine.card.remove(r.id,!1),e.isEmpty()&&e.initValue(),!1}return!1!==this.engine.trigger("keydown:backspace",t)}}}]),t}(),vi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"inline",value:function(t,e){var n=this.engine.change,r=n.range.get().cloneRange(),i=t.constructor.singleSelectable,o=r.commonAncestorNode.closest(Ot);if(o.length>0){var a=t.root.prev();return a?(r.setStartBefore(t.root[0]),r.collapse(!0)):t.focus(r,!0),n.range.select(r),!0}var s=r.commonAncestorNode.closest(_t),l=0===o.length&&0===s.length;if(s.length>0||l){var c,u;if(e.preventDefault(),l)t.select(!1),null===(c=t.toolbarModel)||void 0===c||c.hide(),t.activate(!1);else if(r.collapsed){var d=this.engine.card.find(r.startNode);if(d&&d.onSelectLeft)return d.onSelectLeft(e)}if(l||!1===i)t.focus(r,!0),t.select(!1),null===(u=t.toolbarModel)||void 0===u||u.hide(),n.range.select(r);else this.engine.card.select(t,e);return!1}return!0}},{key:"block",value:function(t,e){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=o.commonAncestorNode.closest(Ot);if(a.length>0){var s=t.root.prev();return s?(e.preventDefault(),i.focusPrevBlock(t,o,!1),r.range.select(o),!1):void 0}var l,c,u=o.commonAncestorNode.closest(_t),d=0===a.length&&0===u.length;d&&(t.select(!1),null===(l=t.toolbarModel)||void 0===l||l.hide(),t.activate(!1));if(u.length>0){if(o.collapsed){var h=i.find(o.startNode);if(h&&h.onSelectLeft)return h.onSelectLeft(e)}return e.preventDefault(),i.select(t,e),!1}return!i.getSingleSelectedCard(o)||(e.preventDefault(),t.focus(o,!0),t.select(!1),null===(c=t.toolbarModel)||void 0===c||c.hide(),r.range.select(o),!1)}},{key:"fincPrevCard",value:function(t){if(!t.collapsed)return null;var e=t.startNode,n=t.startOffset;if(e.isText()&&0===n){var r=e.prevElement();if(r&&r.isCard())return this.engine.card.find(r)}return null}},{key:"trigger",value:function(t){var e=this.engine.change,n=e.range.get(),r=this.engine.card.getSingleCard(n);if(!r){var o=this.fincPrevCard(n);return!o||(t.preventDefault(),o.focus(n,!1),e.range.select(n),!1)}return!i()("shift+left",t)&&(r.type===gn.INLINE?this.inline(r,t):this.block(r,t))}}]),t}(),bi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"inline",value:function(t,e){var n=this.engine.change,r=n.range.get(),i=t.constructor.singleSelectable,o=r.commonAncestorNode.closest(Ot),a=r.commonAncestorNode.closest(_t),s=0===o.length&&0===a.length;if(o.length>0||s){var l,c;if(e.preventDefault(),s)t.select(!1),t.activate(!1),null===(l=t.toolbarModel)||void 0===l||l.hide();else if(r.collapsed){var u=this.engine.card.find(r.startNode);if(u&&u.onSelectRight)return u.onSelectRight(e)}if(s||!1===i)t.focus(r,!1),t.select(!1),null===(c=t.toolbarModel)||void 0===c||c.hide(),n.range.select(r);else this.engine.card.select(t,e);return!1}if(a.length>0){var d=t.root.next();d?(r.setEndAfter(t.root[0]),r.collapse(!1)):t.focus(r,!1),n.range.select(r)}return!0}},{key:"block",value:function(t,e){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=o.commonAncestorNode.closest(Ot);if(a.length>0){if(o.collapsed){var s=this.engine.card.find(o.startNode);if(s&&s.onSelectRight)return s.onSelectRight(e)}return e.preventDefault(),i.select(t,e),!1}var l,c,u=o.commonAncestorNode.closest(_t),d=0===a.length&&0===u.length;d&&(t.select(!1),null===(l=t.toolbarModel)||void 0===l||l.hide(),t.activate(!1));if(u.length>0){var h=t.root.next();return h?(e.preventDefault(),i.focusNextBlock(t,o,!1),r.range.select(o),!1):void 0}return!this.engine.card.getSingleSelectedCard(o)||(e.preventDefault(),t.focus(o,!1),t.select(!1),null===(c=t.toolbarModel)||void 0===c||c.hide(),r.range.select(o),!1)}},{key:"fincNextCard",value:function(t){if(!t.collapsed)return null;var e=t.startNode,n=t.startOffset;if(e.isText()){var r=e.text();if(r.length===n){var i=e.nextElement();if(i&&i.isCard())return this.engine.card.find(i)}}return null}},{key:"trigger",value:function(t){var e=this.engine.change,n=e.range.get(),r=this.engine.card.getSingleCard(n);if(!r){var o=this.fincNextCard(n);return!o||(t.preventDefault(),o.focus(n,!0),e.range.select(n),!1)}if(!i()("shift+right",t))return r.type===gn.INLINE?this.inline(r,t):this.block(r,t)}}]),t}(),yi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"inline",value:function(t,e){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=t.root.prev();if(a)return e.preventDefault(),i.focusPrevBlock(t,o,!1),r.range.select(o),!1}},{key:"block",value:function(t,e){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=t.root.prev();if(a)return e.preventDefault(),i.focusPrevBlock(t,o,!1),r.range.select(o),!1}},{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.card,o=e.block,a=n.range.get();if(a.collapsed){var s=o.closest(a.startNode),l=s.prev();if(null===l||void 0===l?void 0:l.isCard()){var c=r.find(l);if(c&&c.onSelectUp)return c.onSelectUp(t)}}var u=r.getSingleCard(a);return!u||(i()("shift+up",t)?void 0:u.type===gn.INLINE?this.inline(u,t):this.block(u,t))}}]),t}(),wi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"inline",value:function(t,e){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=t.root.next();if(a)return e.preventDefault(),i.focusNextBlock(t,o,!1),r.range.select(o),!1}},{key:"block",value:function(t,e){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=t.root.next();if(a)return e.preventDefault(),i.focusNextBlock(t,o,!1),r.range.select(o),!1}},{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.block,o=e.card,a=n.range.get(),s=o.getSingleCard(a);if(a.collapsed){var l=r.closest(a.startNode),c=l.next();if(null===c||void 0===c?void 0:c.isCard()){var u=o.find(c);if(u&&u.onSelectDown)return u.onSelectDown(t)}}return!s||(!!i()("shift+down",t)||(s.type===gn.INLINE?this.inline(s,t):this.block(s,t)))}}]),t}(),xi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"block",value:function(t,e){var n=this.engine,r=n.change,i=n.card,o=r.range.get(),a=o.commonAncestorNode.closest(Ot);if(a.length>0)return e.metaKey||e.ctrlKey||(i.focusPrevBlock(t,o,!0),r.range.select(o)),!0;var s=o.commonAncestorNode.closest(_t);return s.length>0&&(e.metaKey||e.ctrlKey||(i.focusNextBlock(t,o,!0),r.range.select(o))),!0}},{key:"trigger",value:function(t){var e=this.engine.change,n=e.range.get(),r=this.engine.card.getSingleCard(n);return!r||(r.type!==gn.BLOCK||this.block(r,t))}}]),t}(),Ci='.am-engine .card-selected [data-card-element="center"].data-card-background-selected {\n background: rgba(27, 162, 227, 0.2);\n}\n\n.am-engine .card-selected [data-card-element="center"].data-card-border-selected {\n outline: 2px solid #1890FF;\n border-radius: 2px;\n}\n\n.am-engine .card-selected [data-card-element="center"].data-card-border-selected::-moz-selection {\n background: transparent;\n}\n\n.am-engine .card-selected [data-card-element="center"].data-card-border-selected::selection {\n background: transparent;\n}\n\n.am-engine-view [data-card-element="center"] .data-card-loading,.am-engine [data-card-element="center"] .data-card-loading {\n display: inline-block;\n font-style: normal;\n vertical-align: -0.125em;\n text-align: center;\n text-transform: none;\n line-height: 0;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n margin-right: 5px;\n padding: 16px;\n width: 100%;\n}\n\n.am-engine-view [data-card-element="center"] .data-card-loading .data-card-spin,.am-engine [data-card-element="center"] .data-card-loading .data-card-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n';pn(Ci);var ki=function(){function t(e){var n=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Object(c["a"])(this,t),this.classes=void 0,this.components=void 0,this.lazyRender=void 0,this.asyncComponents=[],this.editor=void 0,this.renderTimeout=void 0,this.renderAsyncComponents=Object(s["a"])(v.a.mark((function t(){var e;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:n.renderTimeout&&clearTimeout(n.renderTimeout),e=n.editor,n.renderTimeout=setTimeout((function(){var t=n.asyncComponents.concat();t.forEach(function(){var t=Object(s["a"])(v.a.mark((function t(r){var i,o;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:(0===r.root.length||e.root.inViewport(r.root,!0)&&!1!==e.trigger("card:async-render-component",r))&&(n.asyncComponents.splice(n.asyncComponents.findIndex((function(t){return t===r})),1),r.root.length>0&&r.loading&&(r.destroy&&r.destroy(),r.getCenter().empty(),n.renderComponent(r),pe(e)&&e.readonly&&!e.ot.isRemote&&((null===(i=e.ot.doc)||void 0===i?void 0:i.type)?e.ot.doc.data=on(e.container):null===(o=e.ot.doc)||void 0===o||o.create(on(e.container)))));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}),50);case 3:case"end":return t.stop()}}),t)}))),this.classes={},this.components=[],this.editor=e,this.lazyRender=r}return Object(u["a"])(t,[{key:"active",get:function(){return this.components.find((function(t){return t.activated}))}},{key:"length",get:function(){return this.components.length}},{key:"init",value:function(t){var e,n,r=this,i=this.editor;if(pe(i)){var o,a,s,l,c,u,d,h=i.typing,p=new gi(i);null===(o=h.getHandleListener("enter","keydown"))||void 0===o||o.on((function(t){return p.trigger(t)}));var f=new mi(i);null===(a=h.getHandleListener("backspace","keydown"))||void 0===a||a.on((function(t){return f.trigger(t)}));var g=new vi(i);null===(s=h.getHandleListener("left","keydown"))||void 0===s||s.on((function(t){return g.trigger(t)}));var m=new bi(i);null===(l=h.getHandleListener("right","keydown"))||void 0===l||l.on((function(t){return m.trigger(t)}));var v=new yi(i);null===(c=h.getHandleListener("up","keydown"))||void 0===c||c.on((function(t){return v.trigger(t)}));var b=new wi(i);null===(u=h.getHandleListener("down","keydown"))||void 0===u||u.on((function(t){return b.trigger(t)}));var y=new xi(i);null===(d=h.getHandleListener("default","keydown"))||void 0===d||d.on((function(t){return y.trigger(t)}))}t.forEach((function(t){r.classes[t.cardName]=t})),this.lazyRender&&(window.addEventListener("resize",this.renderAsyncComponents,{passive:!0}),null===(e=i.scrollNode)||void 0===e||null===(n=e.get())||void 0===n||n.addEventListener("scroll",this.renderAsyncComponents,{passive:!0}),window.addEventListener("scroll",this.renderAsyncComponents,{passive:!0}),i.on("card:async-render",this.renderAsyncComponents))}},{key:"add",value:function(t){this.classes[t.cardName]=t}},{key:"each",value:function(t){this.components.every((function(e,n){return!t||!1!==t(e,n)}))}},{key:"closest",value:function(t,e){if(ke(t)&&(t=He(t)),!t.isCard()){var n=t.closest(St,(function(t){var n;if(!(t&&e?He(t).isRoot():He(t).isEditable()))return(null!==(n=t.parentElement)&&void 0!==n?n:t.parentNode)||void 0}));if(!n||0===n.length)return;t=n}return t}},{key:"find",value:function(t,e){if("string"!==typeof t){var n=this.closest(t,e);if(!n)return;t=n}var r=function(t){ke(t)&&(t=He(t));var e=t.attributes(xt);return ne(e)},i=this.components.filter((function(e){return"string"===typeof t?e.id===t:e.root.name===(ke(t)?t.nodeName.toString().toLowerCase():t.name)&&(e.root.equal(t)||e.id===r(t).id)}));if(0!==i.length)return i[0]}},{key:"findBlock",value:function(t){if(ke(t)&&(t=He(t)),t.get()){var e=t.parent();if(e){var n=this.find(e);if(n)return n.type===gn.BLOCK?n:this.findBlock(n.root)}}}},{key:"getSingleCard",value:function(t){var e=this.find(t.commonAncestorNode);return e||(e=this.getSingleSelectedCard(t)),e}},{key:"getSingleSelectedCard",value:function(t){var e=t.findElements(),n=e[0];if(1===e.length&&n){var r=He(n);if(r.isCard())return this.find(r)}}},{key:"insertNode",value:function(t,e){var n="inline"===e.type,r=this.editor;!t.collapsed&&pe(r)&&r.change.delete(t),this.gc();var i=r.inline,o=r.block,a=r.node,s=[];if(n){if(pe(r)&&e.executeMark){s=r.change.marks.map((function(t){return t.clone()}));var l,c=r.card.find(t.startNode);if(null===c||void 0===c?void 0:c.queryMarks)(l=s).push.apply(l,Object(S["a"])(c.queryMarks()))}i.insert(e.root,t)}else o.insert(e.root,t,(function(t){var e=t.parent();while(e&&!e.isEditable()){t=e;var n=e.parent();if(!n||!a.isBlock(n))break;e=n}return t}),!0);this.components.push(e);var u=e.root.parent();!n&&u&&u.inEditor()&&a.isBlock(u)&&o.unwrap(u,t);for(var d=arguments.length,h=new Array(d>2?d-2:0),p=2;p<d;p++)h[p-2]=arguments[p];return this.renderComponent.apply(this,[e].concat(h)),e.focus(t,!1),e.didInsert&&e.didInsert(),s.forEach((function(t){e.executeMark(t,!0)})),e}},{key:"removeNode",value:function(t){t.destroy&&t.destroy(),this.removeComponent(t),t.root.remove()}},{key:"updateNode",value:function(t,e){t.destroy&&t.destroy();var n=t.getCenter();null===n||void 0===n||n.empty(),t.setValue(e);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];this.renderComponent.apply(this,[t].concat(i)),t.didUpdate&&t.didUpdate()}},{key:"replaceNode",value:function(t,e,n){var r=this.classes[e];if(!r)throw"".concat(e,": This card does not exist");var i=(null===n||void 0===n?void 0:n.type)||r.cardType,o=t.attributes(Q),a=re("<card ".concat(null!==o&&void 0!==o?o:"".concat(Q,'="').concat(o,'"'),' type="').concat(i,'" name="').concat(e,'" value="').concat(ee(n),'"></card>')),s=He(a);return t.before(s),s.append(t),s}},{key:"activate",value:function(t,e,n){var r=this.editor;if(pe(r)&&!r.readonly){var i=t.getRoot(),o=this.active;if(!i.get()||r.container.equal(i)){var a=this.find(t),s=t.closest(ot);if(!a&&s.length>0){var l=s.parent();a=l?this.find(l):void 0}var c=a?this.findBlock(a.root):void 0;if(c&&(a=c),a&&a.isCursor(t))if(s.length>0){var u=s.parent();a=u?this.find(u):void 0}else a=void 0;var d,h=a&&o&&o.root.equal(a.root);if(o&&!h)null===(d=o.toolbarModel)||void 0===d||d.hide(),o.select(!1),o.activate(!1);if(a){if(a.activatedByOther)return;var p;if(h)a.isEditable?a.select(!1):e===mn.MOUSE_DOWN&&"input"!==t.name&&0===a.root.find(".data-drag-image").length&&(null===n||void 0===n||n.preventDefault());else!1===a.constructor.singleSelectable||e===mn.CLICK&&!pe(r)||this.select(a,n),a.isEditable||!1===a.constructor.autoSelected||a.select(!a.isEditable),a.activate(!0),null===(p=a.toolbarModel)||void 0===p||p.show(n);r.change.onSelect()}}else if(o){var f;null===(f=o.toolbarModel)||void 0===f||f.hide(),o.select(!1),o.activate(!1)}}}},{key:"select",value:function(t,e){var n=this.editor;if(pe(n)&&!1!==t.constructor.singleSelectable&&(t.type!==gn.BLOCK||!t.activated)){var r=n.change.range.get().cloneRange();if(r.startNode.closest(ot).length>0&&(!e||e instanceof MouseEvent&&(!e.target||!this.closest(e.target,!1)))||t.isEditable||t.isMaximize)return;null===e||void 0===e||e.preventDefault();var i=t.root,o=i.parent(),a=o.children().toArray().findIndex((function(t){return t.equal(i)}));r.setStart(o,a),r.setEnd(o,a+1),n.change.range.select(r)}}},{key:"focus",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.editor;if(pe(n)){var r=n.change,i=n.container,o=n.scrollNode,a=r.range.get();t.focus(a,e),r.range.select(a),this.activate(a.startNode,mn.MOUSE_DOWN),r.onSelect(),o&&a.scrollIntoViewIfNeeded(i,o)}}},{key:"insert",value:function(t,e){var n=this.editor;if(!pe(n))throw"Engine not found";for(var r=this.create(t,{value:e}),i=n.change,o=i.range.toTrusty(),a=arguments.length,s=new Array(a>2?a-2:0),l=2;l<a;l++)s[l-2]=arguments[l];var c=this.insertNode.apply(this,[o,r].concat(s));return i.change(),c}},{key:"update",value:function(t,e){var n=this.editor;if(pe(n)){var r=n.change,i=this.find(t);if(i){for(var o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];this.updateNode.apply(this,[i,e].concat(a));var l=r.range.get();i.focus(l,!1),r.change()}}}},{key:"replace",value:function(t,e,n){this.remove(t.root);for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return this.insert.apply(this,[e,n].concat(i))}},{key:"remove",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.editor;if(pe(n)){var r=n.change,i=n.list,o=n.node,a=r.range.get(),s=this.find(t);if(s){s.type===gn.INLINE?(a.setEndAfter(s.root[0]),a.collapse(!1)):this.focusPrevBlock(s,a,e);var l=s.root.parent();this.removeNode(s),i.addBr(a.startNode),l&&o.isEmpty(l)&&!n.ot.isStopped&&(l.isEditable()?(o.html(l,"<p><br /></p>"),a.select(l,!0),a.shrinkToElementNode(),a.collapse(!1)):(o.html(l,"<br />"),a.select(l,!0),a.collapse(!1))),e?r.apply(a):(r.range.select(a),r.change())}}}},{key:"removeRemote",value:function(t){var e=this.editor;if(pe(e)){var n=e.node,r=this.find(t);if(r){var i=r.root.parent();this.removeNode(r),i&&n.isEmpty(i)&&!e.ot.isStopped&&(i.isEditable()?n.html(i,"<p><br /></p>"):n.html(i,"<br />"))}}}},{key:"create",value:function(t,e){var n,r=this.classes[t];if(!r)throw"".concat(t,": This card does not exist");var i=(null===e||void 0===e||null===(n=e.value)||void 0===n?void 0:n.type)||r.cardType;if(["inline","block"].indexOf(i)<0)throw"".concat(t,': the type of card must be "inline", "block"');(null===e||void 0===e?void 0:e.root)&&e.root.empty();var o=this.editor,a=new r({editor:o,value:null===e||void 0===e?void 0:e.value,root:null===e||void 0===e?void 0:e.root}),s=a.root;s.attributes(wt,i),s.attributes(bt,t),s.attributes(kt,"true");var l=i===gn.INLINE?"span":"div",c=He("<".concat(l," ").concat(a.isEditable?at+"='*'":"","/>"));c.attributes(Ct,"center");var u=He("<".concat(l," ").concat(Ct,'="body" />'));return u.append(c),s.append(u),this.createCursor(a),i===gn.BLOCK&&o.nodeId.generate(a.root),a.init(),a}},{key:"createCursor",value:function(t){var e=this.editor,n=t.constructor,r=void 0!==n.focus?n.focus:pe(e)&&!e.readonly,i=t.getCenter();i.removeAttributes(Ue);var o=t.root;o.removeAttributes(Ue);var a=t.findByKey("left"),s=t.findByKey("right");r?(i.attributes(Ue,"false"),a||i.before(He("<span ".concat(Ct,'="left" ').concat(st,'="true">&#8203;</span>'))),s||i.after(He("<span ".concat(Ct,'="right" ').concat(st,'="true">&#8203;</span>')))):(null===a||void 0===a||a.remove(),null===s||void 0===s||s.remove(),o.attributes(Ue,"false"))}},{key:"reRender",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];0===n.length&&(n=this.components),n.forEach((function(e){e.destroy&&e.destroy(),t.createCursor(e),e.init(),t.renderComponent(e)}))}},{key:"render",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.lazyRender,i=t?t.isCard()?t:t.find("".concat(Et)):this.editor.container.find(Et);this.gc();var o=[],a=[],s=i.toArray();s.forEach((function(t){a.find((function(e){return e.equal(t)}))||a.push(t);var e=t.find("".concat(St,",").concat(Et)).toArray();e.forEach((function(e){if(!e.equal(t)){var n=a.findIndex((function(t){return t.equal(e)}));n>-1&&a.splice(n,1)}}))})),a.forEach((function(t){var e=t.attributes(),r=e[yt],i=e[bt],a=r||i;if(n.classes[a]){var s,l=e[xt];i&&(s=n.find(t),s&&s.root.equal(t)&&(s.destroy&&s.destroy(),n.removeComponent(s)),t.attributes(kt,"true"),e[kt]="true",t.empty()),s=n.create(a,{value:ne(l),root:i?t:void 0}),Object.keys(e).forEach((function(t){(0===t.indexOf("data-")&&0!==t.indexOf("data-card")||t===kt)&&s.root.attributes(t,e[t])})),r&&(t.replaceWith(s.root),t.remove()),n.components.push(s),o.push(s),r&&s.root.removeAttributes(yt)}}));var l=!1,c=pe(this.editor)&&this.editor.ot.isRemote;o.forEach((function(t){if(!r||!t.constructor.lazyRender||t.isEditable&&c)n.renderComponent(t);else{if(t.beforeRender){var e=t.beforeRender(),i=t.getCenter();void 0!==e&&i.append("string"===typeof e?He(e):e)}l=!0,n.asyncComponents.push(t)}})),e&&e(o.length),l&&this.renderAsyncComponents()}},{key:"renderComponent",value:function(t){for(var e=this.editor,n=t.getCenter(),r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var a=t.render.apply(t,i);if(void 0!==a&&n.append("string"===typeof a?He(a):a),t.contenteditable.length>0){var s=!pe(e)||e.readonly?"false":"true";n.find(t.contenteditable.join(",")).each((function(t){var n=He(t);n.attributes(Ue)!==s&&n.attributes(Ue,s),n.attributes(J)!==it&&n.attributes(J,it),pe(e)&&e.normalize(n)})),this.render(n)}t.didRender()}},{key:"removeComponent",value:function(t){var e=this;this.each((function(n,r){if(n.root.equal(t.root))return e.components.splice(r,1),!1}))}},{key:"gc",value:function(){for(var t=0;t<this.components.length;t++){var e=this.components[t];e.root[0]&&0!==e.root.closest("body").length||(e.destroy&&e.destroy(),this.components.splice(t,1),t--)}}},{key:"destroy",value:function(){var t,e;this.gc();var n=this.editor;window.removeEventListener("resize",this.renderAsyncComponents),null===(t=n.scrollNode)||void 0===t||null===(e=t.get())||void 0===e||e.removeEventListener("scroll",this.renderAsyncComponents),window.removeEventListener("scroll",this.renderAsyncComponents),n.off("card:async-render",this.renderAsyncComponents)}},{key:"focusPrevBlock",value:function(t,e,n){var r,i=this.editor;if(!pe(i))throw"Engine not initialized";if("inline"===t.type){var o=i.block.closest(t.root);r=o.isEditable()?t.root.prevElement():o.prevElement()}else r=t.root.prevElement();if(n){if(!r||r.attributes(bt)){var a=He("<p><br /></p>");return t.root.before(a),e.select(a,!0),e.collapse(!1),void i.nodeId.generate(a)}}else{if(!r)return;var s;if(r.attributes(bt))return void(null===(s=i.card.find(r))||void 0===s||s.focus(e,!1))}e.select(r,!0).shrinkToElementNode().shrinkToTextNode().collapse(!1)}},{key:"focusNextBlock",value:function(t,e,n){var r,i=this.editor;if(!pe(i))throw"Engine not initialized";if("inline"===t.type){var o=i.block.closest(t.root);r=o.isEditable()?t.root.nextElement():o.nextElement()}else r=t.root.nextElement();if(n){if(!r||r.attributes(bt)){var a=He("<p><br /></p>");return t.root.after(a),e.select(a,!0),e.collapse(!1),void i.nodeId.generate(a)}}else{if(!r)return;var s;if(r.attributes(bt))return void(null===(s=i.card.find(r))||void 0===s||s.focus(e,!0))}e.select(r,!0).shrinkToElementNode().shrinkToTextNode().collapse(!0)}}]),t}(),Ai=Object(_["a"])("rules"),Si=function(){function t(e){Object(c["a"])(this,t),this.schema=void 0,Object.defineProperty(this,Ai,{writable:!0,value:{}}),this.schema=e}return Object(u["a"])(t,[{key:"init",value:function(){Object(T["a"])(this,Ai)[Ai]=this.getRules()}},{key:"getRules",value:function(){var t={};return this.schema.data.blocks.forEach((function(e){t[e.name]||(t[e.name]=[]),t[e.name].push(e)})),t}},{key:"create",value:function(t){ke(t)&&(t=He(t));var e=Ye(t);return t.attributes(Q,e),e}},{key:"generateAll",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Object(T["a"])(this,Ai)[Ai],i=Object.keys(r).join(",");xe(t)&&t.fragment&&(t=t.fragment);var o=ke(t)?t:t.get();if(o&&o.nodeType!==Node.TEXT_NODE){var a=ke(t)?t:t.get(),s=null===a||void 0===a?void 0:a.querySelectorAll(i),l=function(t){!n&&t.getAttribute(Q)||e.generate(t,n)};a instanceof Element&&i.includes(a.nodeName.toLowerCase())&&l(a),null===s||void 0===s||s.forEach(l)}}},{key:"generate",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(ke(t)&&(t=He(t)),!t.isText()){var r=Object(T["a"])(this,Ai)[Ai],i=r[t.name];if(i&&0!==i.length&&i.some((function(n){return e.schema.checkNode(t,n.attributes)}))){var o=t.closest("".concat(St,",").concat(rt),he);if(!(o.length>0&&o.attributes(J)===nt)&&(!(!t.isCard()&&o.length>0&&o.isCard())||o.isEditableCard())){if(!n){var a=t.attributes(Q);if(a)return a}return this.create(t)}}}}},{key:"isNeed",value:function(t){var e=this,n=Object(T["a"])(this,Ai)[Ai],r=n[t.name];return!(!r||0===r.length||!r.some((function(n){return e.schema.checkNode(t,n.attributes)})))}}]),t}(),Ei=function(t){return!!t.dataTransfer},Oi=function(){function t(e){Object(c["a"])(this,t),this.editor=void 0,this.editor=e}return Object(u["a"])(t,[{key:"getData",value:function(t){var e,n=Ei(t)?t.dataTransfer:t.clipboardData,r=null===n||void 0===n?void 0:n.getData("text/html"),i=null===n||void 0===n?void 0:n.getData("text"),o=[];try{(null===n||void 0===n?void 0:n.items)&&n.items.length>0?Array.from(n.items).forEach((function(t){var e,n="file"===t.kind?t.getAsFile():null;null!==n&&(n.type&&n.type.indexOf("image/png")>-1&&!n.lastModified&&(n=new File([n],"image.png",{type:n.type})),n["ext"]=null===(e=i)||void 0===e?void 0:e.split(".").pop());n&&o.push(n)})):(null===n||void 0===n?void 0:n.files)&&n.files.length>0&&(o=Array.from(n.files))}catch(a){(null===n||void 0===n?void 0:n.files)&&n.files.length>0&&(o=Array.from(n.files))}return""===r&&i&&/^.+\.\w+$/.test(i)&&o.length>0?i="":""===i&&r&&/^(<meta.+?>)?<img.+?>$/.test(r)&&o.length>0?r="":(r||i)&&o.length>0&&!(null===(e=r)||void 0===e?void 0:e.startsWith("<img"))&&(r||!/^https(s)?:/.test(i||""))&&(o=[]),{html:r,text:i,files:o}}},{key:"write",value:function(t,e){var n,r,i=this.editor.getSelectionData(e);if(i){var o=i.html,a=i.text;return null===t||void 0===t||t.preventDefault(),null===t||void 0===t||null===(n=t.clipboardData)||void 0===n||n.setData("text/html",'<meta name="source" content="aomao" />'+o),null===t||void 0===t||null===(r=t.clipboardData)||void 0===r||r.setData("text",a),i}}},{key:"copy",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"===typeof t){var r=/<[^>]+>/g.test(t);return r?U()(t,{format:"text/html",onCopy:function(n){n.setData("text/plain",new kn(t,e.editor).toText())}}):U()(t,{format:"text/plain"}),!0}var i=this.editor,o=window.getSelection(),a=o&&cn.from(i,o)||cn.create(i),s=a.cloneRange(),l=He('<div class="'.concat(ut,'" ').concat(J,'="').concat(tt,'">&#8203;</div>'));l.css({position:"fixed",top:0,clip:"rect(0, 0, 0, 0)"});var c=function(){l.remove(),null===o||void 0===o||o.removeAllRanges(),null===o||void 0===o||o.addRange(s.toRange())};l.on("copy",(function(t){t.stopPropagation(),e.write(t,a),c()})),He(document.body).append(l),l.append(i.node.clone(He(t),!0)),n&&l.traverse((function(t){t.equal(l)||i.trigger("copy",t)})),l.append(He("&#8203;",null));var u=l.first(),d=l.last();a.select(l,!0),a.setStartAfter(u),a.setEndBefore(d),null===o||void 0===o||o.removeAllRanges(),null===o||void 0===o||o.addRange(a.toRange());var h=!1;try{if(h=document.execCommand("copy"),!h)throw"Copy failed"}catch(p){i.messageError("copy","The copy command was not executed successfully ",p),c()}return h}},{key:"cut",value:function(){var t=this.editor,e=cn.from(t);if(e&&pe(t)){var n=e.commonAncestorNode,r=t.change;r.cacheRangeBeforeCommand(),r.delete(e);for(var i=t.node.isList(n)?n:n.find("ul,ol"),o=0;o<i.length;o++){var a,s=He(i[o]),l=s.find("li");l.each((function(t){var e,n;(""===t.innerText||It&&"\n"===t.innerText)&&(null===(e=null!==(n=t.parentElement)&&void 0!==n?n:t.parentNode)||void 0===e||e.removeChild(t))})),0===(null===(a=s.get())||void 0===a?void 0:a.childNodes.length)&&s.remove()}r.range.select(e)}}}]),t}(),Ti=function t(e,n,r,i){var o=void 0,s=void 0,l=/\[\]$/;if(Array.isArray(n))for(s=0;s<n.length;s++){var c=n[s];r||l.test(e)?i(e,c):t(e+"["+("object"===("undefined"===typeof c?"undefined":Object(a["a"])(c))?s:"")+"]",c,r,i)}else if("[object Object]"===n.toString())for(o in n)n.hasOwnProperty(o)&&t(e+"["+o+"]",n[o],r,i);else i(e,n)},_i=function(t,e){return t+(/\?/.test(t)?"&":"?")+e},Mi=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=void 0,r=[],i=function(t,e){"function"===typeof e?e=e():null!==e&&void 0!==e||(e=""),r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(Array.isArray(t))for(var o=0;o<t.length;o++)i(t[o].name,t[o].value);else for(n in t)t.hasOwnProperty(n)&&Ti(n,t[n],e,i);return r.join("&").replace(/%20/g,"+")},Ni=function(t){return"undefined"!==typeof FormData&&t instanceof FormData},Pi=/^http/,Li=/(^\w+):\/\//,Di=/^(20\d|1223)$/,ji="readyState",Ii="Content-Type",Ri="X-Requested-With",Fi="XMLHttpRequest",Bi="XDomainRequest",zi={traditional:!1,contentType:"application/x-www-form-urlencoded",requestedWith:Fi,accept:{"*":"text/javascript, text/html, application/xml, text/xml, */*",xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript",js:"application/javascript, text/javascript"},dataFilter:function(t){return t}},Hi=function(){function t(e){var n;Object(c["a"])(this,t),this.options=void 0,this.headNode=void 0,this.request=void 0,this.isAborted=!1,this.isTimeout=!1,this.timeout=void 0,this.callbackData=void 0,this.callbackPrefix="request_"+new Date,this.uuid=0,this.promise=void 0,this.__resolve=void 0,this.__reject=void 0,"string"===typeof e&&(e={url:e});var r=e,i=r.url;$()(i,"//")&&(i=window.location.protocol+i),this.options=Object(l["a"])(Object(l["a"])(Object(l["a"])({},zi),e),{},{url:i,context:e.context||window,doc:e.doc||ce(),jsonpCallback:e.jsonpCallback||"callback",method:e.method||"GET"}),this.headNode=null===(n=this.options.doc)||void 0===n?void 0:n.getElementsByTagName("head")[0],this.initPromise(),this.init()}return Object(u["a"])(t,[{key:"initPromise",value:function(){var t=this;this.promise=new Promise((function(e,n){t.__resolve=e,t.__reject=n})).catch((function(){}))}},{key:"init",value:function(){var t=this,e=function(){var e;t.isTimeout=!0,null===(e=t.request)||void 0===e||e.abort()};this.timeout&&clearTimeout(this.timeout),this.timeout=void 0,this.options.timeout&&(this.timeout=setTimeout(e,this.options.timeout));var n=function(e,n){t.triggerError(e,n)},r=function(e){t.triggerSuccess(e)};this.getRequest(r,n).then((function(e){t.request=e}))}},{key:"abort",value:function(){var t;null===(t=this.request)||void 0===t||t.abort()}},{key:"defaultXHR",value:function(){var t=this.options,e=t.context,n=t.crossOrigin;if(e){if(!0===n){var r=e[Fi]?new e[Fi]:null;if(r&&"withCredentials"in r)return r;if(e[Bi])return new e[Bi];throw new Error("Browser does not support cross-origin requests")}return e[Fi]?new e[Fi]:new e.ActiveXObject("Microsoft.XMLHTTP")}}},{key:"succeed",value:function(){var t,e,n,r=this.options,i=r.url,o=r.context,a=Li.exec(i),s=a?a[1]:"";return s||(s=(null===o||void 0===o?void 0:o.location.protocol)||""),Pi.test(s)?Di.test((null===(t=this.request)||void 0===t||null===(e=t.status)||void 0===e?void 0:e.toString())||""):!!(null===(n=this.request)||void 0===n?void 0:n.response)}},{key:"noop",value:function(){}},{key:"handleReadyState",value:function(t,e){return this.isAborted?e("Request is aborted",this.request):this.isTimeout?e("Request is aborted: timeout",this.request):void(this.request&&4===this.request[ji]&&(this.request.onreadystatechange=this.noop,this.succeed()?t(this.request):e(this.request.statusText,this.request)))}},{key:"setHeaders",value:function(t,e){e.Accept=e.Accept||zi.accept[this.options.type||"*"],this.options.crossOrigin||e[Ri]||(e[Ri]=zi.requestedWith),e[Ii]||Ni(this.options.data)||(e[Ii]=this.options.contentType||zi.contentType),Object.keys(e).forEach((function(n){t.setRequestHeader(n,e[n])}))}},{key:"setCredentials",value:function(t){"undefined"!==typeof this.options.withCredentials&&"undefined"!==typeof t.withCredentials&&(t.withCredentials=!!this.options.withCredentials)}},{key:"generalCallback",value:function(t){this.callbackData=t}},{key:"getCallbackPrefix",value:function(t){return this.callbackPrefix+"_"+t}},{key:"handleJsonp",value:function(t,e,n){var r,i=this,o=this.options,a=o.jsonpCallback,s=o.jsonpCallbackName,l=o.doc,c=o.context;if(l&&c){var u=this.uuid++,d=a||"callback",h=s||this.getCallbackPrefix(u),p=new RegExp("((^|\\?|&)"+d+")=([^&]+)"),f=t.match(p),g=l.createElement("script"),m=0,v=-1!==navigator.userAgent.indexOf("MSIE 10.0");return f?"?"===f[3]?t=t.replace(p,"$1="+h):h=f[3]:t=_i(t,d+"="+h),c[h]=this.generalCallback,g.type="text/javascript",g.src=t,g.async=!0,"undefined"===typeof g["onreadystatechange"]||v||(g.htmlFor=g.id="_request_"+u),g.onload=g["onreadystatechange"]=function(){var t;return!(g[ji]&&"complete"!==g[ji]&&"loaded"!==g[ji]||m)&&(g.onload=g["onreadystatechange"]=null,g.onclick&&g.onclick(),e(i.callbackData),i.callbackData=void 0,null===(t=i.headNode)||void 0===t||t.removeChild(g),m=1,!0)},null===(r=this.headNode)||void 0===r||r.appendChild(g),{abort:function(){var t;g.onload=g["onreadystatechange"]=null,n("Request is aborted: timeout"),i.callbackData=void 0,null===(t=i.headNode)||void 0===t||t.removeChild(g),m=1}}}}},{key:"getRequest",value:function(){var t=Object(s["a"])(v.a.mark((function t(e,n){var r,i,o,s,l,c,u,d,h,p,f,g,m,b,y,w,x=this;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(o=(null===(r=this.options.method)||void 0===r?void 0:r.toUpperCase())||"GET",s=this.options,l=s.processData,c=s.traditional,u=s.type,d=s.context,h=s.xhr,p=s.async,f=s.before,d){t.next=4;break}return t.abrupt("return",Promise.resolve(void 0));case 4:if(g=this.options.url,m=this.options.data,"function"!==typeof m){t.next=10;break}return t.next=9,m();case 9:m=t.sent;case 10:if(((null===(i=this.options.contentType)||void 0===i?void 0:i.indexOf("json"))||-1)>-1&&"object"===Object(a["a"])(m)&&!Ni(m)&&(m=JSON.stringify(m)),m=!1!==l&&m&&"string"!==typeof m&&!Ni(m)?Mi(m,c||zi.traditional):m||null,b=void 0,y=!1,"jsonp"!==u&&"GET"!==o||!m||(g=_i(g,m),m=null),"jsonp"!==u){t.next=17;break}return t.abrupt("return",Promise.resolve(this.handleJsonp(g,e,n)));case 17:if(w=this.options.headers||{},"function"!==typeof w){t.next=22;break}return t.next=21,w();case 21:w=t.sent;case 22:if(b=("function"===typeof h?h(this.options):h)||this.defaultXHR(),b){t.next=25;break}return t.abrupt("return");case 25:return b.open(o,g,!1!==p),this.setHeaders(b,w),this.setCredentials(b),d[Bi]&&b instanceof d[Bi]?(b.onload=e,b.onerror=function(){n("http error",b)},b.onprogress=this.noop,y=!0):b.onreadystatechange=function(){x.handleReadyState(e,n)},f&&f(b),y?setTimeout((function(){var t;null===(t=b)||void 0===t||t.send(m)}),200):b.send(m),t.abrupt("return",Promise.resolve(b));case 32:case"end":return t.stop()}}),t,this)})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"getType",value:function(t){if(t)return t.match("json")?"json":t.match("javascript")?"js":t.match("text")?"html":t.match("xml")?"xml":void 0}},{key:"triggerSuccess",value:function(t){var e=this.options,n=e.dataFilter,r=e.context,i=e.success;if(r){var o=this.options.type,a=(n||zi.dataFilter)(t.responseText,o);o||(o=t&&this.getType(t.getResponseHeader("Content-Type")));var s="jsonp"!==o?this.request:t;try{s["responseText"]=a}catch(l){}if(a)switch(o){case"json":try{s=r.JSON.parse(a)}catch(c){return this.triggerError("Could not parse JSON in response",s)}break;case"html":s=a;break;case"xml":s=s.responseXML&&s.responseXML.parseError&&s.responseXML.parseError.errorCode&&s.responseXML.parseError.reason?null:s.responseXML;break}i&&i(s),this.triggerComplete(s),this.__resolve&&this.__resolve(s)}}},{key:"triggerError",value:function(t,e){var n=this.options.error,r=new Error(t);r["xhr"]=e,n&&n(r),this.triggerComplete(r),this.__reject&&this.__reject(r)}},{key:"triggerComplete",value:function(t){var e=this.options.complete;this.timeout&&clearTimeout(this.timeout),this.timeout=void 0,e&&e(t)}},{key:"retry",value:function(){this.initPromise(),this.init()}},{key:"then",value:function(t,e){var n;return null===(n=this.promise)||void 0===n?void 0:n.then(t,e)}},{key:"always",value:function(t){var e;return null===(e=this.promise)||void 0===e?void 0:e.then(t,t)}},{key:"fail",value:function(t){var e;return null===(e=this.promise)||void 0===e?void 0:e.then(void 0,t)}},{key:"catch",value:function(t){return this.fail(t)}}]),t}();Hi.setup=function(t){Object.keys(t).forEach((function(e){zi[e]&&(zi[e]=t[e])}))};var Vi={"image/jpeg":["jpeg","jpg","jpe"],"image/png":["png"],"image/gif":["gif"],"image/vnd.wap.wbmp":["wbmp"],"image/tiff":["tiff","tiff"],"image/vnd.adobe.photoshop":["psd"],"image/svg+xml":["svg","svgz"],"text/jsx":["jsx"],"text/less":["less"],"text/css":["css"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/csv":["cvs"],"text/xml":["xml"],"text/x-vcard":["vcf"],"text/x-vcalendar":["vcs"],"text/markdown":["md"],"text/plain":["txt"],"text/richtext":["rtx"],"text/rtf":["rtf"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js"],"text/yaml":["yaml","yml"],"audio/mp3":["mp3"],"audio/mp4":["mp4","mp4a"],"video/mp4":["mp4"],"audio/mpeg":["mpeg","mp2","mp3"],"audio/ogg":["oga"],"audio/wav":["wav"],"audio/wave":["wav"],"audio/webm":["weba"],"video/x-msvideo":["avi"],"video/quicktime":["mov","qt"],"video/ogg":["ogv"],"video/x-sgi-movie":["movie"],"application/rss+xml":["rss"],"application/json":["json"],"application/zip":["zip"],"application/gzip":["gzip"],"application/pdf":["pdf"],"application/postscript":["ai","eps","ps"],"application/msword":["doc","dot"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.ms-fontobject":["eot"],"application/vnd.android.package-archive":["apk"],"application/x-apple-diskimage":["dmg"],"application/x-iwork-keynote-sffkey":["key"],"application/x-iwork-pages-sffpages":["pages"],"application/x-iwork-keynote-sffnumbers":["numbers"],"application/x-iwork-numbers-sffnumbers":["numbers"]},qi=function(t){var e;if("string"===typeof t)return null!==(e=t.split(".").pop())&&void 0!==e?e:"";var n,r=Vi[t.type]?Vi[t.type][0]:"";!r&&"name"in t&&(r=null!==(n=t.name.split(".").pop())&&void 0!==n?n:"");return r},Ui=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ht?2:10,n={exponent:2,round:1};return t<1024&&(n.exponent=-1,n.round=0),t<1048576&&(n.exponent=1,n.round=0),Y()(t,Object(l["a"])({base:e},n))},Wi=function(){function t(e){Object(c["a"])(this,t),this.options=void 0,this.uploadingFiles=[],this.options=e}return Object(u["a"])(t,[{key:"createUid",value:function(t){return Date.now()+"-"+t}},{key:"request",value:function(){var t=Object(s["a"])(v.a.mark((function t(e,n){var r,i;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r<e.length)){t.next=12;break}return i=e[r],i.uid||(i.uid=this.createUid(r)),t.next=6,this.handleBefore(i,e);case 6:if(t.t0=t.sent,!1!==t.t0){t.next=9;break}e.splice(r,1);case 9:r++,t.next=1;break;case 12:this.upload(e,n);case 13:case"end":return t.stop()}}),t,this)})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"upload",value:function(){var t=Object(s["a"])(v.a.mark((function t(e){var n,r=this,i=arguments;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:n=i.length>1&&void 0!==i[1]?i[1]:"file",e.forEach(function(){var t=Object(s["a"])(v.a.mark((function t(e){var i,o,a,s,l,c,u,d,h,p,f,g,m,b,y;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(i=new FormData,o=r.options,a=o.url,s=o.onUploading,l=o.onSuccess,c=o.onError,u=o.withCredentials,d=o.crossOrigin,h=o.headers,p=r.options.data,"function"!==typeof p){t.next=7;break}return t.next=6,p();case 6:p=t.sent;case 7:if(p)if(Ni(p)){f=Object(C["a"])(p);try{for(f.s();!(g=f.n()).done;)m=Object(w["a"])(g.value,2),b=m[0],y=m[1],i.append(b,y)}catch(v){f.e(v)}finally{f.f()}}else Object.keys(p).forEach((function(t){i.append(t,p[t])}));return e.data&&Object.keys(e.data).forEach((function(t){i.append(t,e.data[t])})),i.append(n,e,e.name),t.next=12,new Hi({xhr:function(){var t=new window.XMLHttpRequest;return t.upload.addEventListener("progress",(function(t){t.lengthComputable&&s&&s(e,{percent:parseInt((t.loaded/t.total*100).toString(),10)})}),!1),t},url:a,data:i,contentType:r.options.contentType,type:r.options.type||"json",withCredentials:u,crossOrigin:d,headers:h,success:function(t){l&&l(t,e)},error:function(t){c&&c(t,e)},method:"POST",processData:!0});case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 2:case"end":return t.stop()}}),t)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"handleBefore",value:function(){var t=Object(s["a"])(v.a.mark((function t(e,n){var r,i,o,a,l,c,u=this;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(r=e.type,i=e.uid,o=e.name,a=e.size,l=qi(e),c=this.options.onBefore,t.t0=c,!t.t0){t.next=9;break}return t.next=7,c(e);case 7:t.t1=t.sent,t.t0=!1===t.t1;case 9:if(!t.t0){t.next=11;break}return t.abrupt("return",!1);case 11:return t.abrupt("return",new Promise((function(t,c){var d=new FileReader;d.addEventListener("load",(function(){u.uploadingFiles[i]={uid:i,src:d.result,name:o,size:a,type:r,ext:l},n.every((function(t){return!!u.uploadingFiles[t.uid]}))?Promise.all(Object(S["a"])(n.map((function(t){return new Promise(function(){var e=Object(s["a"])(v.a.mark((function e(n){return v.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!u.options.onReady){e.next=3;break}return e.next=3,u.options.onReady(u.uploadingFiles[t.uid],t);case 3:n(!0);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())})))).then((function(){t(!0)})):t(!0)}),!1),d.addEventListener("error",(function(){c(!1)})),d.readAsDataURL(e)})));case 12:case"end":return t.stop()}}),t,this)})));function e(e,n){return t.apply(this,arguments)}return e}()}]),t}(),$i=function(){function t(){Object(c["a"])(this,t)}return Object(u["a"])(t,[{key:"ajax",value:function(t){return new Hi(t)}},{key:"upload",value:function(t,e,n){return new Wi(t).request(e,n)}},{key:"getFiles",value:function(t){var e=t||{},n=e.event,r=e.accept,i=e.multiple;r=r||"*",!1===i?i=1:void 0!==i&&!0!==i||(i=100);var o=document.createElement("input");o.type="file",o.accept=r,o.style.display="none",o.multiple=i>1;var a=function t(){o.remove(),document.removeEventListener("mousedown",t)};return new Promise((function(t){var e=function e(){for(var n,r=[],s=null!==(n=o.files)&&void 0!==n?n:[],l=Math.min(s.length,i),c=0;c<l;c++)r.push(s[c]);o.removeEventListener("change",e),a(),t(r)};o.addEventListener("change",e),document.body.appendChild(o),n||(n=document.createEvent("MouseEvents"),n.initEvent("click",!0,!0));try{if(o.dispatchEvent)o.dispatchEvent(n);else{if(!o["fireEvent"])throw"";o["fireEvent"](n)}document.addEventListener("mousedown",a)}catch(r){o.removeEventListener("change",e),a(),t([])}}))}}]),t}(),Gi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"trigger",value:function(t,e){var n=this.engine,r=n.change,i=n.command,o=n.list,a=n.node,s=r.range.get(),l=this.engine.block;if(s.collapsed){var c=l.closest(s.startNode);if("li"===c.name&&o.isFirst(s))return t["isDelete"]||(t.preventDefault(),i.execute(o.getPluginNameByNode(c))),!1}else{var u=s.startNode,d=s.endNode,h=l.closest(u),p=l.closest(d);if("li"===h.name||"li"===p.name){t.preventDefault();var f=s.cloneRange(),g=u.first(),m=u.isCard()?u:g;if((null===m||void 0===m?void 0:m.isCard())&&o.isEmptyItem(h)){var v,b=h.parent();h.remove(),b&&a.isCustomize(b)&&0===(null===(v=b.get())||void 0===v?void 0:v.childNodes.length)&&b.remove()}var y,w="li"===h.name?h.parent():null,x="li"===p.name?p.parent():null;if("li"===h.name&&o.isFirst(s)&&f.setStartBefore(h),"li"===p.name&&l.isLastOffset(s,"end")&&f.setEndAfter(p),r.delete(f,e),h.inEditor()&&!h.equal(p)&&p.inEditor()&&"li"===p.name){f.shrinkToElementNode().shrinkToTextNode();var C=f.createSelection();h.append(p.children()),p.remove(),C.move()}if("li"===h.name)a.isCustomize(h)&&0===(null===(y=h.get())||void 0===y?void 0:y.childNodes.length)&&h.remove();var k=function(t){if(a.isList(t)){var e,n=(null===(e=t.get())||void 0===e?void 0:e.childNodes)||[];if(0==n.length)t.remove();else if(1===n.length){var r=t.first();(null===r||void 0===r?void 0:r.isCursor())&&(t.after(r),t.remove())}}};return w&&w.length>0&&a.isList(w)&&k(w),x&&x.length>0&&a.isList(x)&&k(x),o.addBr(h),h.equal(p)||o.addBr(p),s.setStart(f.startContainer,f.startOffset),s.collapse(!0),o.merge(),r.isEmpty()&&r.initValue(s),r.apply(s),!1}}if(l.isFirstOffset(s,"start")){var A=l.closest(s.startNode);if(a.isList(A)){var S=A.first();if(!S||S.isText())return t.preventDefault(),r.mergeAfterDelete(A),!1;A=S,s.setStart(A[0],0),s.collapse(!0),r.range.select(s)}if("li"===A.name){var E;if(a.isCustomize(A))return;t.preventDefault();var O=A.closest("ul");return(null===(E=A.parent())||void 0===E?void 0:E.isEditable())?(r.mergeAfterDelete(A),!1):(O.length>0?i.execute(o.getPluginNameByNode(O)):r.unwrap(A),!1)}return!0}}}]),t}(),Yi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.backspace=void 0,this.engine=e,this.backspace=new Gi(e)}return Object(u["a"])(t,[{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.command,i=e.list,o=n.range.get();o.shrinkToElementNode();var a=this.engine.block.closest(o.startNode),s=this.engine.block.closest(o.endNode);if("li"===a.name||"li"===s.name){o.collapsed||(this.backspace.trigger(t,a.name!==s.name),o=n.range.get()),t.preventDefault();var l=i.getPluginNameByNode(a);if(i.isLast(o)&&i.isFirst(o))r.execute(l);else{this.engine.block.split(),o=n.range.get();var c=this.engine.block.closest(o.endNode),u=i.getPlugins().find((function(t){return l===t.constructor.pluginName}));if(!u)return;if(u.cardName){var d=c.prev();d&&(i.addCardToCustomize(d,u.cardName),i.addBr(d)),i.addCardToCustomize(c,u.cardName),i.addBr(c);var h=c.next();h&&(i.addCardToCustomize(h,u.cardName),i.addBr(h))}i.merge(void 0,o),i.addBr(o.startNode.closest("ul")),o.setStart(c,this.engine.node.isCustomize(c)?1:0),o.collapse(!0).shrinkToTextNode(),n.apply(o)}return o.scrollIntoView(),!1}return!0}}]),t}(),Xi=function(){function t(e){Object(c["a"])(this,t),this.editor=void 0,this.CUSTOMZIE_UL_CLASS="data-list",this.CUSTOMZIE_LI_CLASS="data-list-item",this.INDENT_KEY="data-indent",this.STYLE_POSITION_NAME="list-style-position",this.STYLE_POSITION_VALUE="inside",this.backspaceEvent=void 0,this.editor=e}return Object(u["a"])(t,[{key:"init",value:function(){var t=this,e=this.editor;if(pe(e)){var n,r,i=new Yi(e);null===(n=e.typing.getHandleListener("enter","keydown"))||void 0===n||n.on((function(t){return i.trigger(t)})),this.backspaceEvent=new Gi(e),null===(r=e.typing.getHandleListener("backspace","keydown"))||void 0===r||r.on((function(e){var n;return null===(n=t.backspaceEvent)||void 0===n?void 0:n.trigger(e)}))}}},{key:"isEmptyItem",value:function(t){var e=t.children().toArray().filter((function(t){return!t.isCursor()})),n=this.editor.node;return"li"===t.name&&(n.isEmpty(t)||(1===e.length?n.isCustomize(t)&&e[0].isCard()||"br"===e[0].name:2===e.length&&n.isCustomize(t)&&!!e[0].isCard()&&"br"===e[1].name))}},{key:"isSame",value:function(t,e){if(t.name!==e.name)return!1;var n=this.editor.node;if(n.isCustomize(t)!==n.isCustomize(e))return!1;var r=parseInt(t.attributes(this.INDENT_KEY),10)||0,i=parseInt(e.attributes(this.INDENT_KEY),10)||0;return r===i}},{key:"isSpecifiedType",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ul",n=arguments.length>2?arguments[2]:void 0,r=this.editor.node,i=!0;return t.forEach((function(t){var o;if(-1!==["li","p"].indexOf(t.name)||!(t.name===e||t.find(e).length>0))switch(t.name){case"li":if(n){var a,s,l=t.first();(null===(a=l)||void 0===a?void 0:a.isCursor())&&(l=l.next()),i=i&&r.isCustomize(t)&&((null===(s=l)||void 0===s?void 0:s.attributes(bt))||"")===n}else i=i&&!r.isCustomize(t);break;case"p":t.parent()&&"li"!==(null===(o=t.parent())||void 0===o?void 0:o.name)&&(i=!1);break;default:i=!1;break}})),i}},{key:"getPlugins",value:function(){var t=[],e=this.editor.plugin;return Object.keys(e.components).forEach((function(n){var r=e.components[n];r.isCurrent&&t.push(r)})),t}},{key:"getPluginNameByNode",value:function(t){var e=this,n=t.name,r=function(t){var n="";return e.getPlugins().some((function(e){if(e.isCurrent(t))return n=e.constructor.pluginName,!0})),n};return this.editor.node.isCustomize(t)?r(t):"li"===n&&t.parent()?r(t.parent()):""}},{key:"getPluginNameByNodes",value:function(t){for(var e="",n=0;n<t.length;n++){var r=t[n],i=r.parent(),o="";switch(r.name){case"li":case"ul":case"ol":o=this.getPluginNameByNode(t[n]);break;case"p":if(!i||"li"!==i.name)return"";o=this.getPluginNameByNode(i);break;default:if(this.editor.node.isBlock(r)&&r.find("ul,ol").length>0)break;return""}if(e&&o&&e!==o)return"";e=o}return e}},{key:"unwrapCustomize",value:function(t){var e=this.editor.node;if(e.isCustomize(t))switch(t.name){case"li":if(e.isCustomize(t)){var n=t.first();(null===n||void 0===n?void 0:n.isCard())&&n.remove()}return t.removeAttributes("class"),t;case"ul":return t.removeAttributes("class"),t;default:return t}return t}},{key:"unwrap",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:He("<p />"),r=0,i=this.editor,o=i.node,a=i.schema,s=a.data.globals["block"]||{},l=s.style||{};t.forEach((function(t){if(e.unwrapCustomize(t),o.isList(t)&&(r=parseInt(t.attributes(e.INDENT_KEY),10)||0,o.unwrap(t)),"li"===t.name){var i=o.clone(n,!1,!1);0!==r&&i.css("text-indent",2*r+"em"),t.removeAttributes(e.INDENT_KEY);var a=t.attributes();Object.keys(a).forEach((function(t){t!==Q&&"id"!==t&&s[t]&&i.attributes(t,a[t])}));var c=t.css();c["text-align"]&&e.addAlign(i,c["text-align"]),delete c["text-align"],c[e.STYLE_POSITION_NAME]="",Object.keys(c).forEach((function(t){l[t]||(c[t]="")})),i.css(c),o.replace(t,i)}}))}},{key:"normalize",value:function(t){var e=this.editor;if(!pe(e))return[];var n=e.change,r=e.block,i=e.node;t=t||n.range.get();var o=r.getBlocks(t),a=[];o.forEach((function(t,e){var n=t.parent();if("p"===t.name){if("li"===(null===n||void 0===n?void 0:n.name))return 0===e&&a.push(n),void i.unwrap(t);if(n&&["ul","ol"].indexOf(n.name)>-1)return t=i.replace(t,He("<li />")),void a.push(t)}if("li"===t.name&&"li"===(null===n||void 0===n?void 0:n.name))return 0===e&&a.push(n),void i.unwrap(t);["ul","ol"].indexOf(t.name)>-1&&"li"===(null===n||void 0===n?void 0:n.name)?i.unwrap(t):a.push(t)}));var s=t.endNode.closest("li");return a.some((function(t){return t[0]===s[0]}))||a.push(s),a}},{key:"split",value:function(t){var e=this.editor;if(pe(e)){var n=e.change,r=e.node,i=t||n.range.toTrusty(),o=this.normalize(t);if(o.length>0&&("li"===o[0].name||"li"===o[o.length-1].name)){var a,s,l,c,u=i.createSelection(),d=o[0],h=o[o.length-1],p=[],f=[];if(d.prev()){a=d.parent();var g=0;while(o[g]&&"li"===o[g].name)p.push(o[g]),g+=1}if(h.next()){s=h.parent();var m=h.next();while(m&&"li"===m.name)f.push(m),m=m.next()}if(f.length>0&&s&&(l=r.clone(s,!1,!1),f.forEach((function(t){var e;null===(e=l)||void 0===e||e.append(t[0])})),s.after(l)),p.length>0&&a&&(c=r.clone(a,!1,!1),p.forEach((function(t){var e;null===(e=c)||void 0===e||e.append(t[0])})),a.after(c)),a&&s&&s.equal(a)&&"ol"===a.name){var v=(parseInt(a.attributes("start"),10)||1)+a.find("li").length;l.attributes("start",v)}u.move()}t||n.apply(i)}}},{key:"merge",value:function(t,e){var n=this,r=this.editor;if(pe(r)){var i=r.change,o=r.block,a=r.node,s=r.schema,l=s.getCanMergeTags();if(0!==l.length){var c=e||i.range.toTrusty(),u=c.cloneRange(),d=t?void 0:u.shrinkToElementNode().createSelection();t=t||o.getBlocks(c);var h=!1;if(t.forEach((function(t){if(t=t.closest("ul,ol"),a.isList(t)&&-1!==l.indexOf(t.name)){var e=t.prev(),r=t.next();e&&n.isSame(e,t)&&(a.merge(e,t),t=e,h=!0),r&&n.isSame(r,t)&&(a.merge(t,r),h=!0)}})),h&&(t=o.getBlocks(c),t.length>0)){var p=t[0].closest("ul,ol");this.addStart(p)}null===d||void 0===d||d.move(),e||void 0===d||i.apply(u)}}}},{key:"addStart",value:function(t){var e=this.editor;if(pe(e)){var n=e.change,r=e.node;if(!t){var i=e.block.getBlocks(n.range.get());if(0===i.length)return;t=i[0].closest("ul,ol")}if(t&&r.isList(t)){var o=parseInt(t.attributes(this.INDENT_KEY),10)||0,a=[],s=o,l=t.prev();while(l&&r.isList(l)){if("ol"===l.name){var c=parseInt(l.attributes(this.INDENT_KEY),10)||0,u=parseInt(l.attributes("start"),10)||1,d=l.find("li").length;if(0===c){a[c]=u+d;break}c<=s&&(s=c,a[c]=a[c]||u+d)}else s=parseInt(l.attributes(this.INDENT_KEY),10)||0;l=l.prev()}var h=t;while(h){if(r.isList(h)){var p=parseInt(h.attributes(this.INDENT_KEY),10)||0,f=parseInt(h.attributes("start"),10),g=h.find("li").length;if("ol"===h.name){var m=a[p];p>0?(m=m||1,m>1?h.attributes("start",m):h.removeAttributes("start"),a[p]=m+g):m&&m!==f?(m>1?h.attributes("start",m):h.removeAttributes("start"),a[p]=m+g):(a[p]=(f||1)+g,a=a.slice(0,p+1))}}else a=[];var v=h.next();if(!v)break;h=v}}}}},{key:"addIndent",value:function(t,e,n){if(this.editor.node.isList(t)){var r=this.getIndent(t);e=r+(e<0?-1:1),n&&e>n&&(e=n),e<1?t.removeAttributes(this.INDENT_KEY):t.attributes(this.INDENT_KEY,e)}}},{key:"getIndent",value:function(t){return this.editor.node.isList(t)&&parseInt(t.attributes(this.INDENT_KEY),10)||0}},{key:"addAlign",value:function(t,e){var n;"li"===t.name&&(e&&"left"!==e?(["center","right"].indexOf(e)>-1&&t.css(Object(x["a"])({},this.STYLE_POSITION_NAME,this.STYLE_POSITION_VALUE)),t.css({"text-align":e})):t.css((n={},Object(x["a"])(n,this.STYLE_POSITION_NAME,""),Object(x["a"])(n,"text-align",""),n)))}},{key:"addCardToCustomize",value:function(t,e,n){var r,i;if(ke(t)&&(t=He(t)),"li"===t.name){var o=t.first();if(!((null===o||void 0===o?void 0:o.isBlockCard())||(null===o||void 0===o?void 0:o.isCard())&&o.attributes(bt)===e)){var a,s=this.editor,l=s.card,c=l.create(e,{value:n}),u=cn.create(s),d=He("<br />");if((null!==(r=null===(i=t.get())||void 0===i?void 0:i.childNodes.length)&&void 0!==r?r:0)>0)null===(a=t.first())||void 0===a||a.before(d);else t.append(d);u.select(d,!0),l.insertNode(u,c);var h=t.last();return"br"===(null===h||void 0===h?void 0:h.name)&&h.remove(),c}}}},{key:"addReadyCardToCustomize",value:function(t,e,n){if(ke(t)&&(t=He(t)),"li"===t.name){var r=t.first();if(!((null===r||void 0===r?void 0:r.isBlockCard())||(null===r||void 0===r?void 0:r.isCard())&&r.attributes(bt)===e)){var i=He("<span />");return t.prepend(i),this.editor.card.replaceNode(i,e,n),i}}}},{key:"addBr",value:function(t){var e=this,n=this.editor.node;if(n.isList(t))t.find("li").each((function(t){e.addBr(He(t))}));else if(n.isCustomize(t)){var r=t.last();while(null===(i=r)||void 0===i?void 0:i.isCursor()){var i;r=r.prev()}if(r){var o,a=t.children();if(1===a.length&&r.isCard())return void t.append(He("<br />"));if(a.length>2&&"br"===r.name)return void("br"!==(null===(o=r.prev())||void 0===o?void 0:o.name)&&r.remove());while(r){if(r.equal(t.first())&&(r.isCard()||""===r.text()))return void t.append(He("<br />"));if(r.type===Node.TEXT_NODE){if(""!==r.text())return;r=r.prev()}else if(r.type===Node.ELEMENT_NODE){if(!n.isMark(r)||""!==r.text())return;r=t.prev()}else r=r.prev()}}else t.append(He("<br />"))}}},{key:"insert",value:function(t,e){var n,r,i,o=this,a=this.editor;if(pe(a)&&0!==t.childNodes.length){var s=a.change,l=a.node,c=a.block,u=e||s.range.toTrusty();u.collapsed||s.delete(u,!0,!0);var d=u.cloneRange().shrinkToElementNode(),h=d.startNode,p=d.startOffset,f=h;if(l.isList(h)&&(f=h.children().eq(p)),f=null===(n=f)||void 0===n?void 0:n.closest("li",(function(t){return l.isBlock(t)&&"LI"!==t.nodeName?void 0:t.parentElement||void 0})),0!==(null===(r=f)||void 0===r?void 0:r.length)&&"li"===(null===(i=f)||void 0===i?void 0:i.name)){u.shrinkToElementNode().shrinkToTextNode(),c.split(u);var g=u.createSelection("list-insert");this.split(u);var m=function(t){c.merge(t),o.merge(void 0,t),null===g||void 0===g||g.move(),e||s.apply(t)},v=He(t).toArray().some((function(t){return l.isBlock(t)}))?He(t.childNodes[0]):He("<p></p>").append(He(t)),b=u.startNode.closest("ul,ol");if(b&&l.isList(b)){var y=u.startNode.closest("li");if(l.isCustomize(b)){var w,x,C=null===(w=b.prev())||void 0===w||null===(x=w.first())||void 0===x?void 0:x.first();if(C){var k=a.card.find(C);k&&this.addCardToCustomize(y,k.name,k.getValue())}}var A=!l.isList(v)||this.isSame(b,v);if(A){var S,E;while(l.isBlock(v)){var O=v.first();if(!O||!l.isBlock(O))break;v=O}var T=null===(S=y.parent())||void 0===S||null===(E=S.prev())||void 0===E?void 0:E.last();if("li"===(null===T||void 0===T?void 0:T.name)){var _,M,N=null===T||void 0===T?void 0:T.children();if(null===N||void 0===N||N.each((function(t,e){var n;"BR"===t.nodeName&&(null===(n=N.eq(e))||void 0===n||n.remove())})),l.isCustomize(v))null===(_=v.first())||void 0===_||_.remove();if(v.isBlockCard())null===(M=T.parent())||void 0===M||M.after(v);else null===T||void 0===T||T.append(l.isBlock(v)?v.children():v),T&&this.addBr(T),l.isBlock(v)&&v.remove()}}else{var P,L,D,j,I,R=null===(P=y.parent())||void 0===P||null===(L=P.prev())||void 0===L?void 0:L.last();if(R&&(l.isEmpty(R)||this.isEmptyItem(R)))R.remove(),0===(null===(D=R.parent())||void 0===D||null===(j=D.get())||void 0===j?void 0:j.childNodes.length)&&(null===(I=R.parent())||void 0===I||I.remove())}if(0===t.childNodes.length||1===t.childNodes.length&&l.isList(t.childNodes[0])&&0===t.childNodes[0].childNodes.length){var F=y.parent();if(v.isBlockCard()){if(F){var B;this.isEmptyItem(y)&&1===(null===(B=F.get())||void 0===B?void 0:B.childNodes.length)&&F.remove();var z=[F],H=v.prev();H&&l.isList(H)&&z.push(H),this.merge(z)}}else{var V,q,U;if(l.isCustomize(y))null===(U=y.first())||void 0===U||U.remove();y.find("br").remove(),null===F||void 0===F||null===(V=F.prev())||void 0===V||null===(q=V.last())||void 0===q||q.append(y.children()),null===F||void 0===F||F.remove()}m(u)}else{var W=u.startNode.closest("li").parent();if(W){for(var $=t.childNodes.length,G=He(t.childNodes[$-1]),Y=(!l.isList(G)||this.isSame(b,G))&&!G.isBlockCard(),X=!1,K=0;K<t.childNodes.length;K++){var Z=He(t.childNodes[K]);if(l.isList(t.childNodes[K])&&!this.isSame(b,Z)||Z.isBlockCard()){X=!0;break}}for(var J=W.prev(),Q=J?[J]:[],tt=0;tt<(Y&&!X?$-1:$);tt++){var et=He(t.childNodes[0]);if(l.isList(et)){var nt;if(0===(null===(nt=et.get())||void 0===nt?void 0:nt.childNodes.length)){et.remove();continue}W.before(et),Q.push(et)}else{if(X){null===W||void 0===W||W.before(et);continue}if(l.isBlock(et)&&et.allChildren().forEach((function(t){t.type!==ce().TEXT_NODE&&l.isBlock(t)&&l.unwrap(t)})),l.isCustomize(W)){var rt,it=null===(rt=W.first())||void 0===rt?void 0:rt.first();if(it&&it.isCard()){var ot=it.attributes(bt)||it.attributes("name"),at=this.toCustomize(et,ot);at&&(Array.isArray(at)?at:[at]).forEach((function(t){null===W||void 0===W||W.before(t)}))}}else{var st=this.toNormal(et,W.name);(Array.isArray(st)?st:[st]).forEach((function(t){a.node.isList(t)&&(null===W||void 0===W||W.before(t))}))}}}if(Q.length>0&&this.merge(Q),!A&&l.isEmptyWidthChild(W)&&W.remove(),0!==t.childNodes.length){while(l.isBlock(G)){var lt=G.last();if(!lt||!l.isBlock(lt))break;G=lt}var ct=y;if(ct){var ut;if(!(null===(ut=G.parent())||void 0===ut?void 0:ut.fragment)){var dt=ct,ht=G.prev();while(ht&&ht.length>0){var pt=ht.prev();dt.before(ht),dt=ht,ht=pt}}if("br"===G.name)G.remove();else{var ft=G.children();if(ft.each((function(t,e){var n;"BR"===t.nodeName&&(null===(n=ft.eq(e))||void 0===n||n.remove())})),l.isCustomize(ct)){var gt;if(l.isCustomize(G)){var mt=G.first();(null===mt||void 0===mt?void 0:mt.isCard())&&mt.remove()}null===(gt=ct.first())||void 0===gt||gt.after(l.isBlock(G)?G.children():G)}else ct.prepend(l.isBlock(G)?G.children():G);this.addBr(ct),l.isBlock(G)&&G.remove()}}m(u)}else{if(l.isEmpty(y)||this.isEmptyItem(y)){var vt,yt,wt,xt,Ct=null===(vt=y.parent())||void 0===vt?void 0:vt.prev();y.find("br").remove(),l.isCustomize(y)&&(null===(yt=y.first())||void 0===yt||yt.remove()),Ct&&l.isList(Ct)?null===(wt=Ct.last())||void 0===wt||wt.append(y.children()):Ct&&Ct.append(y.children()),null===(xt=y.parent())||void 0===xt||xt.remove()}m(u)}}else m(u)}}else m(u)}}}},{key:"blockToItem",value:function(t,e,n,r){var i=He("<li></li>"),o=this.editor,a=o.node,s=o.schema;if(!a.isList(e))return e;var l=te(t.css("text-indent"))/2,c=s.data.globals["block"]||{},u=t.attributes();Object.keys(u).forEach((function(t){t!==Q&&"id"!==t&&c["name"]&&i.attributes(t,u[t])}));var d=c.style||{},h=t.css();return h["text-align"]&&this.addAlign(i,h["text-align"]),delete h["text-align"],delete h[this.STYLE_POSITION_NAME],Object.keys(h).forEach((function(t){d[t]||delete h[t]})),i.css(h),t=a.replace(t,i),n&&(t.addClass(this.CUSTOMZIE_LI_CLASS),this.addCardToCustomize(t,n,r)),l&&e.attributes(this.INDENT_KEY,l),a.wrap(t,e)}},{key:"toCustomize",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ul",o=this.editor.node;if(Array.isArray(t)){var a=[];return t.forEach((function(t){o.isCustomize(t)&&r.unwrapCustomize(t),a=a.concat(r.toCustomize(t,e,n,i))})),a}var s=He("<".concat(i,' class="').concat(this.CUSTOMZIE_UL_CLASS,'"/>'));switch(t.name){case"li":return t.addClass(this.CUSTOMZIE_LI_CLASS),this.addCardToCustomize(t,e,n),t;case"ul":case"ol":return s.attributes(t.attributes()),t=o.replace(t,s),t;default:if("p"===t.name||o.isNestedBlock(t)&&!t.isBlockCard()){var l;if("li"===(null===(l=t.parent())||void 0===l?void 0:l.name))return o.unwrap(t),t;t=this.blockToItem(t,s,e,n)}return t}}},{key:"toNormal",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ul",r=arguments.length>2?arguments[2]:void 0,i=this.editor.node;if(Array.isArray(t)){var o=[];return t.forEach((function(t){var i=e.toNormal(t,n,r);o=o.concat(i)})),o}this.unwrapCustomize(t);var a=He("<".concat(n," />"));switch(t.name){case"li":case n:return t;case"ol":case"ul":return a.attributes(t.attributes()),"ul"===a.name&&a.removeAttributes("start"),t=i.replace(t,a),t;default:if("p"===t.name||i.isNestedBlock(t)&&!t.isBlockCard()){var s;if("li"===(null===(s=t.parent())||void 0===s?void 0:s.name))return i.unwrap(t),t;t=this.blockToItem(t,a),r&&t.attributes("start",r)}return t}}},{key:"isFirst",value:function(t){var e=t.startNode,n=t.startOffset,r=t.cloneRange(),i="li"===e.name?e:e.closest("li");if(!i[0])return!1;r.select(i,!0),r.setEnd(e[0],n);var o=r.cloneContents();if(!o.firstChild)return!0;var a=He(o.firstChild),s=He(o.lastChild||[]);if(1===o.childNodes.length&&"br"===a.name)return!0;if(1===o.childNodes.length&&i.hasClass(this.CUSTOMZIE_LI_CLASS)&&a.isCard())return!0;var l=this.editor.node;if(2===o.childNodes.length&&i.hasClass(this.CUSTOMZIE_LI_CLASS)&&a.isCard()&&l.isEmpty(s))return!0;var c=He("<div />");return c.append(o),l.isEmpty(c)}},{key:"isLast",value:function(t){var e=t.endNode,n=t.endOffset,r=t.cloneRange(),i="li"===e.name?e:e.closest("li");if(!i[0])return!1;r.select(i,!0),r.setStart(e,n);var o=r.cloneContents();if(!o.firstChild)return!0;var a=He(o.firstChild),s=He(o.lastChild||[]);if(1===o.childNodes.length&&"br"===a.name)return!0;if(1===o.childNodes.length&&i.hasClass(this.CUSTOMZIE_LI_CLASS)&&a.isCard())return!0;var l=this.editor.node;if(2===o.childNodes.length&&i.hasClass(this.CUSTOMZIE_LI_CLASS)&&a.isCard()&&l.isEmpty(s))return!0;var c=He("<div />");return c.append(o),l.isEmpty(c)}}]),t}(),Ki=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.node,i=e.block,o=n.range.get(),a=o.cloneRange().shrinkToTextNode(),s=a.collapsed,l=a.endNode,c=a.startNode,u=a.startOffset,d=a.endOffset;if(s){var h=i.closest(c);if(h.length>0&&r.isEmpty(h))return}if(l.type===Node.TEXT_NODE||c.type===Node.TEXT_NODE){if(!s){var p=l.parent();if(p&&l.type===Node.TEXT_NODE&&r.isMark(p)){var f=l.text(),g=f.substr(d);if(!/^\u200b$/.test(g))return!0;o.setEnd(l,d+1)}return!0}var m=c.parent();if(m&&c.type===Node.TEXT_NODE&&r.isMark(m)){if(u<1)return!0;var v=c.text(),b=v.substr(u-1,1);if(!/^\u200b$/.test(b))return!0;if(1===u){var y=m.prev();if(y&&!r.isEmpty(y)){var w=o.cloneRange().select(y,!0).shrinkToTextNode().collapse(!1),x=w.startNode,C=w.startOffset;o.setStart(x,C-1)}else if(!y&&r.isEmpty(m)){var k=m.parent(),A=m.getIndex();m.remove(),k&&o.setStart(k,A<=0?0:A-1)}}else o.setStart(c,u-1);return!0}if(m=c.prev()||void 0,m&&c.type===Node.TEXT_NODE&&r.isMark(m)){var S=c.text(),E=S.substr(u-1,1);if(!/^\u200b$/.test(E))return!0;if(1===u){var O=o.cloneRange().select(m,!0).shrinkToTextNode().collapse(!1),T=O.startNode,_=O.startOffset;o.setStart(T,_-1)}else o.setStart(c,u>0?u-1:0)}}return!0}}]),t}(),Zi=function(){function t(e){var n=this;Object(c["a"])(this,t),this.editor=void 0,this.pluginCaches=new Map,this.findSameParent=function(t,e){var r=n.editor.node;if(r.isMark(t)){var i=void 0;if(n.compare(t,e,!0))return!0;if(i=t.parent())return n.findSameParent(i,e)}return!1},this.editor=e}return Object(u["a"])(t,[{key:"init",value:function(){var t=this,e=this.editor;if(pe(e)){var n,r=new Ki(e);null===(n=e.typing.getHandleListener("backspace","keydown"))||void 0===n||n.on((function(t){return r.trigger(t)})),e.on("keydown:space",(function(e){return t.triggerMarkdown(e)})),e.on("keydown:enter",(function(e){return t.triggerMarkdown(e)}))}}},{key:"triggerMarkdown",value:function(t){var e,n=this.editor;if(pe(n)&&!1!==(null===(e=n.options.markdown)||void 0===e?void 0:e.mode)){var r=n.change,i=r.range.get();if(i.collapsed&&!r.isComposing()){var o=i.cloneRange().shrinkToTextNode(),a=o.startNode,s=o.startOffset,l=a.type===Node.TEXT_NODE?a:a.children().eq(s-1);if(l){var c=i.toPath(),u=l.type===Node.TEXT_NODE?l.text().substr(0,s):l.text(),d=ge(n,"zero"),h=d.renderer,p=d.options,f=d.parseInline(u,{});if(0!==f.length){var g=!1,m="";if(f.forEach((function(t){var e="",r=t.children||[];r.forEach((function(i,o){var a=i.type,s=n.trigger("markdown-it-token",{token:t,markdown:d,callback:function(t){e+=t}});!1!==s?(g||"text"===a||(g=!0),"undefined"!==typeof h.rules[a]?e+=h.rules[a](r,o,p,{},h):e+=h.renderToken(r,o,p)):g=!0})),m+=e})),g){var v=n.node;t.preventDefault(),i.setStart(l[0],0),i.setEnd(l[0],s),r.paste(m,i),r.rangePathBeforeCommand=c,i.collapse(!1),i.enlargeToElementNode();var b=He(m),y=b.last(),w=b.eq(b.length-1);(v.isMark(b)||y&&v.isMark(y)||w&&v.isMark(w))&&v.insertText(" ",i),r.range.select(i)}return!g}}}}}},{key:"findPlugin",value:function(t){var e=this.editor,n=e.node,r=e.plugin,i=e.schema;if(0!==t.length&&n.isMark(t)){var o=t.get().cloneNode(),a=o.outerHTML,s=this.pluginCaches.get(a);if(s)return s;for(var l in r.components){var c=r.components[l];if(si(c)&&t.name===c.tagName){var u=c.schema();if(Array.isArray(u)?u.find((function(e){return i.checkNode(t,e.attributes)})):i.checkNode(t,u.attributes))return this.pluginCaches.set(a,c),c}}return s}}},{key:"closest",value:function(t){var e=this.editor.node,n=t.parent();while(n&&!n.isEditable()&&!e.isBlock(n)){if(e.isMark(n))return n;var r=n.parent();if(!r)break;n=r}return t}},{key:"closestNotMark",value:function(t){while(this.editor.node.isMark(t)||t.isText()){if(t.isEditable())break;var e=t.parent();if(!e)break;t=e}return t}},{key:"compare",value:function(t,e,n){if(t.name!==e.name)return!1;var r=t.attributes();delete r["style"],delete r[Q];var i=e.attributes();delete i["style"],delete i[Q];var o=t.css(),a=e.css();delete r["class"],delete i["class"];var s=t.get().className.trim(),l=e.get().className.trim(),c=""!==s?s.split(/\s+/):[],u=""!==l?l.split(/\s+/):[],d=this.editor.schema,h=d.find((function(e){return e.name===t.name})),p=function(t){for(var e=0;e<h.length;e++){var n=h[e];if(n.attributes&&d.checkValue(n.attributes,"class",t.join(" ").trim()))return n.attributes["class"].toString()}return t.join(" ").trim()};return n||(c=c.length>0?[p(c)]:[],u=u.length>0?[p(u)]:[]),Object.keys(r).length===Object.keys(i).length&&(!!Object.keys(r).every((function(t){return n?r[t]===i[t]:!!i[t]}))&&(Object.keys(o).length===Object.keys(a).length&&(!!Object.keys(o).every((function(t){return n?o[t]===a[t]:!!a[t]}))&&(c.length===u.length&&!!c.every((function(t){return-1!==u.indexOf(t)}))))))}},{key:"contain",value:function(t,e){var n=e.attributes(),r=n["style"]||{};delete n["style"];var i=t.attributes(),o=i["style"]||{};return delete i["style"],Object.keys(n).every((function(t){return!!i[t]}))&&Object.keys(r).every((function(t){return!o[t]}))}},{key:"unwrapEmptyMarks",value:function(t,e){var n=this.editor.node,r=t.allChildren();r.forEach((function(t){if(n.isEmpty(t)&&n.isMark(t)&&(!e||e(t))){var r=t.children();1===r.length&&r.isText()?t.remove():n.unwrap(t)}}))}},{key:"splitOnCollapsed",value:function(t,e,n){var r=this;if(t.collapsed){t.enlargeFromTextNode(),t.shrinkToElementNode();var i=t.startNode,o=i.parent(),a=i.isCard()?i:i.closest(St),s=this.editor.node;if((0===a.length||"inline"!==a.attributes(wt))&&(s.isMark(i)||o&&s.isMark(o))){var l,c,u=this.closestNotMark(i),d=t.createSelection(),h=d.getNode(u,"left"),p=void 0,f=void 0,g=[];if(n){ke(n)&&(n=He(n));var m=n.getPath(u.get()),v=u.clone(!0);g=m.slice(1),f=He(v.getChildByPath(m.slice(0,1))),p=d.getNode(v,"right",!1)}else p=d.getNode(u,"right");this.unwrapEmptyMarks(h,(function(t){return!t.isCursor()})),this.unwrapEmptyMarks(p,(function(t){e&&!Array.isArray(e)&&(e=[e]);var n=!e||0===e.length||!t.isCard()&&e.some((function(e){return r.compare(t,e)}));return n}));var b=u.children();b.each((function(t,e){var n=b.eq(e);(null===n||void 0===n?void 0:n.isCard())||null===n||void 0===n||n.remove()}));var y=void 0,w=function(t){t.each((function(e,n){var r=t.eq(n);if(null===r||void 0===r?void 0:r.isCard())return y=y?y.next():u.first(),void(y&&(t[n]=y[0]));y?(y.after(e),y=r):(y=r,u.prepend(e))}))},x=h.children(),C=x.toArray();w(x);var k=p.children(),A=k.toArray();f&&(n=null===(l=A.find((function(t){return t.equal(f)})))||void 0===l?void 0:l.getChildByPath(g)),w(k),A=k.toArray();var S=He("",null);if(1===C.length&&"br"===C[0].name&&(C[0].remove(),C.splice(0,1)),1===A.length&&"br"===A[0].name&&(A[0].remove(),A.splice(0,1)),A.filter((function(t){return!t.isCursor()})).length>0){for(var E=A[0],O=0;O<A.length-1;O++)if(E=A[O],!E.isCursor())break;if(s.isEmpty(E)){var T=E.first();while(T&&!T.isText())E=T,T=T.first();E.isText()?E.before(S):E.prepend(S)}else{var _=s.isMark(i)?i:i.parent(),M=S;e&&!Array.isArray(e)&&(e=[e]);var N=function(){var t=_.clone();if(!e.some((function(e){return r.compare(t,e)}))){var n=S.equal(M);M=s.wrap(M,t),n&&(S=M.first())}_=_.parent()};while(e&&e.length>0&&_&&s.isMark(_))N();E.before(M)}t.select(S).collapse(!1)}else if(C.filter((function(t){return!t.isCursor()})).length>0){var P=C[C.length-1];P.after(S),t.select(S).collapse(!1)}else t.select(u,!0).collapse(!0);var L=!1;u.children().each((function(t){var e=He(t);if(e.isText()){var n=t.textContent,r=(null===n||void 0===n?void 0:n.replace(/\u200b+/g,""))||"";if(n!==r&&(t.textContent=r),L){var i=e.next(),o=e.parent();(!i&&o&&!s.isInline(o)||i&&!s.isInline(i))&&r.startsWith("")?(r=r.substring(1),r?t.textContent=r:e.remove()):L=!1}r.endsWith("")&&(L=!0)}else L=!1}));var D=s;if(null!==(c=S[0].parentElement)&&void 0!==c?c:S[0].parentNode){var j=S[0],I=null,R=0,F=function(t,e){var n=function(t){return e?t.previousSibling:t.nextSibling};while(t){if(t.nodeType!==j.nodeType)return;var r=n(t);if(t.textContent===I){var i,o=null!==(i=t.parentElement)&&void 0!==i?i:t.parentNode;if(r&&D.isInline(r)||!r&&o&&D.isInline(o))break;null===o||void 0===o||o.removeChild(t),t=r}else{var a,s;if(e)while(I&&(null===(l=t.textContent)||void 0===l?void 0:l.endsWith(I))){var l,c,u=null!==(c=t.parentElement)&&void 0!==c?c:t.parentNode;if(r&&D.isInline(r)||!r&&u&&D.isInline(u))break;t.textContent=t.textContent.substring(0,t.textContent.length-R)}else while(I&&(null===(d=t.textContent)||void 0===d?void 0:d.startsWith(I))){var d,h,p=null!==(h=t.parentElement)&&void 0!==h?h:t.parentNode;if(r&&D.isInline(r)||!r&&p&&D.isInline(p))break;t.textContent=t.textContent.substring(I.length)}if(0!==(null===(a=t.textContent)||void 0===a?void 0:a.length))return;var f=null!==(s=t.parentElement)&&void 0!==s?s:t.parentNode;null===f||void 0===f||f.removeChild(t),t=r}}};if(j.nodeType===Node.TEXT_NODE){var B=j.textContent;I=B,R=I.length,F(j.previousSibling,!0),F(j.nextSibling,!1)}}}return n}}},{key:"splitOnExpanded",value:function(t,e){if(!t.collapsed){t.enlargeToElementNode(),t.shrinkToElementNode();var n=t.startNode,r=t.endNode,i=n.isCard()?n:n.closest(St),o=r.isCard()?r:r.closest(St);if(!(i.length>0&&"inline"===i.attributes(wt)||o.length>0&&"inline"===o.attributes(wt))){var a=this.closestNotMark(n),s=this.closestNotMark(r);if(!a.equal(s)){var l=t.cloneRange();l.collapse(!0);var c=t.cloneRange();c.collapse(!1);var u=void 0,d=l.startOffset,h=c.endOffset;return void(a.contains(s)?(u=this.splitOnCollapsed(l,e,c.endNode),t.setStart(l.startContainer,l.startOffset),u&&c.setOffset(u,h,h),this.splitOnCollapsed(c,e),t.setEnd(c.startContainer,c.startOffset)):(u=this.splitOnCollapsed(c,e,l.startNode),t.setEnd(c.startContainer,c.startOffset),u&&l.setOffset(u,d,d),this.splitOnCollapsed(l,e),t.setStart(l.startContainer,l.startOffset)))}var p=this.editor.node,f=n.parent(),g=p.isMark(n)||f&&p.isMark(f),m=r.parent(),v=p.isMark(r)||m&&p.isMark(m);if(!g&&!v)return;var b=t.commonAncestorNode;b.isText()&&(b=b.parent());var y=this.closestNotMark(b),w=t.createSelection(),x=w.getNode(y,"left"),C=w.getNode(y),k=w.getNode(y,"right");this.unwrapEmptyMarks(x),this.unwrapEmptyMarks(k);var A=y.children();A.each((function(t,e){var n=A.eq(e);(null===n||void 0===n?void 0:n.isCard())||null===n||void 0===n||n.remove()}));var S=void 0,E=function(t){t.each((function(e,n){var r=t.eq(n);if(null===r||void 0===r?void 0:r.isCard())return S=S?S.next():y.first(),void(S&&(t[n]=S[0]));S?(S.after(e),S=r):(S=r,y.prepend(e))}))},O=x.children();E(O);var T=C.children(),_=T.toArray();E(T);var M=k.children();E(M),t.setStartBefore(_[0][0]),t.setEndAfter(_[_.length-1][0])}}}},{key:"split",value:function(t,e){var n=this.editor;if(pe(n)){var r=n.change,i=t||r.range.toTrusty(),o=ce(i.startContainer),a=i.collapsed;if(("string"===typeof e||!Array.isArray(e)&&e&&ke(e))&&(e=He(e,o)),a)this.splitOnCollapsed(i,e);else{var s=i.createSelection("mark-split");this.splitOnExpanded(i,e),s.move()}t||r.apply(i)}}},{key:"wrapByNode",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.findPlugin(e),i=arguments.length>3?arguments[3]:void 0,o=this.editor.node;if(o.isMark(t)){var a;0===(null===(a=t.get())||void 0===a?void 0:a.childNodes.length)&&t.html("&#8203;");var s=t,l=s.children().toArray(),c=this.findPlugin(s),u=!1;while(o.isMark(s)&&1===l.filter((function(t){return!t.isCursor()})).length&&r&&c&&r.mergeLeval<=c.mergeLeval){var d=l.find((function(t){return!t.isCursor()}));if(o.isMark(d))s=d,l=s.children().toArray();else{if(!d.isText())break;s=d}if(r.name===c.name){u=!0;break}c=this.findPlugin(s)}o.removeZeroWidthSpace(s);var h=s.parent();if(s.isText()||u){var p=!1;while(h&&o.isMark(h)){if(this.compare(h.clone(),e,!0)){p=!0;break}if(1===h.children().toArray().filter((function(t){return!t.isCursor()})).length){var f=this.findPlugin(h);if(r&&r===f&&!0===r.combineValueByWrap){o.wrap(h,e,!0),p=!0;break}if(r&&r===f){o.unwrap(h),p=!1;break}}h=h.parent()}if(p)return!1}var g=s.allChildren();return g.forEach((function(t){if(t.type!==ce().TEXT_NODE&&o.isMark(t)){var e=n.findPlugin(t);e!==r||(null===r||void 0===r?void 0:r.combineValueByWrap)||o.unwrap(t)}})),o.wrap(s,e)}if("br"===t.name){var m=t.parent();if(m&&o.isBlock(m)){var v=e.clone(!0);return v.html("&#8203;"),o.replace(t,v),v}}else if(t.isCard()){var b=this.editor.card.find(t);if(b&&b.executeMark)return b.executeMark(e,!0)}else if(t.isText()&&!o.isEmpty(t)){o.removeZeroWidthSpace(t);var y=t.parent(),w=!1;while(y&&o.isMark(y)){if(this.compare(y.clone(),e,!0)){w=!0;break}if(1===y.children().toArray().filter((function(t){return!t.isCursor()})).length||i&&i.equal(y)){var x=this.findPlugin(y);if(r&&r===x&&!0===r.combineValueByWrap){o.wrap(y,e,!0),w=!0;break}if(r&&r===x){var C=o.unwrap(y),k=C.find((function(t){return!t.isCursor()&&o.isMark(t)}));k?y=k:C.length>0&&(y=C[0].parent()),w=!1;break}}var A=y.parent();if(!A||!o.isMark(y))break;y=A}if(w)return!1;var S=t.parent(),E=S?this.findPlugin(S):void 0,O=!1,T=function(){O=!0;var r=S.children().toArray(),i=S.clone();r.forEach((function(n){n.isCursor()||3===n.type&&/^\u200b$/.test(n.text()||"")||(t.equal(n)||n.contains(t)?t=o.wrap(o.replace(t,i),e):(n=o.wrap(n,i),o.wrap(n,e)))})),o.unwrap(S),S=n.closest(t)};while(S&&o.isMark(S)&&r&&E&&r.mergeLeval>E.mergeLeval)T();return O||o.wrap(t,e),t}}},{key:"wrap",value:function(t,e){var n=this,r=this.editor,i=pe(r)?r.change:void 0;if(e||i){var o=r.node,a=e||i.range.toTrusty(),s=ce(a.startContainer);if(t="string"===typeof t||ke(t)?He(t,s):t,o.isMark(t)){var l=a.commonAncestorNode;l.type===Node.TEXT_NODE&&(l=l.parent());var c=r.card.find(l,!0),u=null===c||void 0===c?void 0:c.isEditable,d=u?(null===c||void 0===c?void 0:c.getSelectionNodes)?c.getSelectionNodes():[]:[l];0===d.length&&(u=!1,d.push(l));var h=o,p=this.findPlugin(t);if(a.collapsed&&(!u||!(null===c||void 0===c?void 0:c.getSelectionNodes)||1===d.length)){0===t.children().toArray().filter((function(t){return!t.isCursor()})).length&&t.append(s.createTextNode(""));var f=a.shrinkToTextNode(),g=f.startNode,m=g.parent(),v=[],b=!1;if(g.isText()){var y=!1;while(m&&h.isMark(m)){var w;if(this.compare(m.clone(),t,!0)){y=!0;break}var x=this.findPlugin(m);if(1===(null===(w=m.get())||void 0===w?void 0:w.childNodes.length)){if(p&&p===x&&!0===p.combineValueByWrap){h.wrap(m,t,!0),y=!0;break}if(p&&p===x){if(this.split(a),a.collapsed){var C=m.parent();while(C&&h.isMark(C))t=h.wrap(t,C),C=C.parent()}y=!1;break}}p&&(!x||p.mergeLeval>x.mergeLeval)?v.push(m.clone(!1)):!b&&v.length>0&&(v.push(t.clone(!1)),b=!0),m=m.parent()}if(y)return}if(v.length>0){var k=v[0];k.append(t.children());for(var A=1;A<v.length;A++)k=h.wrap(k,v[A]);t=b?k:h.wrap(k,t),this.split(a)}return h.insert(t,a),this.merge(a),a.handleBr(),void(e||null===i||void 0===i||i.apply(a))}u||(this.split(a),l=a.commonAncestorNode,l.type===Node.TEXT_NODE&&(l=l.parent()),d[0]=l);var S=u?void 0:a.createSelection();if(!S||S.anchor||S.focus){var E=!!u;if(d.forEach((function(e){e.traverse((function(r){if(t=t,u||!r.equal(null===S||void 0===S?void 0:S.anchor)){if(E){if(!u&&r.equal(null===S||void 0===S?void 0:S.focus))return E=!1,!1;var i=h.isMark(r),o=n.wrapByNode(r,t,p,e);if(o&&"boolean"!==typeof o&&i){var a;if(!u&&(null===S||void 0===S?void 0:S.focus)&&o.find('[data-element="'.concat(S.focus.attributes(J),'"]')).equal(S.focus))return E=!1,!1;if((null===S||void 0===S?void 0:S.focus)&&(null===(a=o.next())||void 0===a?void 0:a.equal(S.focus)))return E=!1,!1}if("undefined"!==typeof o)return!0}}else E=!0}),!0,"editable")})),null===S||void 0===S||S.move(),u){var O=[];d.forEach((function(t){t.allChildren().forEach((function(t){t.isElement()&&o.isMark(t)&&O.push(t)}))})),this.mergeMarks(O)}else this.merge(a);e||null===i||void 0===i||i.apply(a)}else e||null===i||void 0===i||i.apply(a)}}}},{key:"mergeMarks",value:function(t){var e=this,n=this.editor.node;t.forEach((function(t){var r=t.prev(),i=t.next(),o=t.parent();if(o&&e.findSameParent(o,t))n.unwrap(t);else{r&&e.compare(r,t,!0)&&(n.merge(r,t),t=r),i&&e.compare(i,t,!0)&&n.merge(t,i);var a=[],s=t.children();s.each((function(t,e){var r=s.eq(e);r&&!r.isCursor()&&n.isMark(r)&&a.push(r)})),a.length>0&&e.mergeMarks(a)}}))}},{key:"merge",value:function(t){var e=this.editor;if(pe(e)){var n=e.change,r=t||n.range.toTrusty(),i=this.findMarks(r);if(0!==i.length){var o=r.shrinkToElementNode().createSelection();this.mergeMarks(i),o.move(),r.handleBr(),t||n.apply(r)}}}},{key:"unwrapByNodes",value:function(t,e){var n=this,r=this.editor,i=r.node;t.forEach((function(t){e=e,!e||!t.isCard()&&(Array.isArray(e)?e:[e]).some((function(e){return n.compare(t,e)}))?i.unwrap(t):e?(Array.isArray(e)?e:[e]).forEach((function(e){var n,i=e.css();Object.keys(i).forEach((function(e){t.css(e,"")}));var o=null===(n=e.get())||void 0===n?void 0:n.className.split(/\s+/);o&&function(){for(var e=r.schema,n=e.find((function(e){return e.name===t.name})),i=function(r){var i=n[r];o.forEach((function(n){n=n.trim(),""!==n&&i.attributes&&e.checkValue(i.attributes,"class",n)&&t.removeClass(n)}))},a=0;a<n.length;a++)i(a)}()})):(t.removeAttributes("class"),t.removeAttributes("style"))}))}},{key:"unwrap",value:function(t,e){var n=this.editor;if(pe(n)){var r=n.change,i=n.node,o=e||r.range.toTrusty(),a=ce(o.startContainer)||document;void 0===t||Array.isArray(t)||"string"!==typeof t&&!ke(t)||(t=He(t,a));var s=o.commonAncestorNode;s.type===Node.TEXT_NODE&&(s=s.parent());var l=n.card.find(s,!0),c=null===l||void 0===l?void 0:l.isEditable,u=c?(null===l||void 0===l?void 0:l.getSelectionNodes)?l.getSelectionNodes():[]:[s];if(0===u.length&&(c=!1,u.push(s)),c||(this.split(o,o.collapsed?t:void 0),s=o.commonAncestorNode,s.type===Node.TEXT_NODE&&(s=s.parent()),u[0]=s),!o.collapsed||c&&(null===l||void 0===l?void 0:l.getSelectionNodes)&&1!==u.length){var d=c?void 0:o.createSelection("mark-unwrap");if(d&&!d.has())return this.merge(o),void(e||r.apply(o));var h=[],p=!!c;if(u.forEach((function(e){e.traverse((function(e){if(c||!e.isText()&&(null===d||void 0===d?void 0:d.anchor))if(c||(null===d||void 0===d?void 0:d.anchor)&&!e.equal(d.anchor)){if(p&&(c||!e.equal(null===d||void 0===d?void 0:d.focus)))if(i.isMark(e)&&!e.isCard()&&(c||o.isPointInRange(e,0)))h.push(e);else if(e.isCard()){var r=n.card.find(e);r&&r.executeMark&&(Array.isArray(t)?t:[t]).forEach((function(t){r.executeMark(t,!1)}))}}else if(!c&&(p=!0,(null===d||void 0===d?void 0:d.anchor)&&e.equal(d.anchor)&&!d.anchor.prev())){var a=d.anchor.parent();while(a&&!a.isCard()&&i.isMark(a)){var s,l;if(h.push(a),a=a.parent(),a&&(null!==(s=null===(l=a.get())||void 0===l?void 0:l.childNodes.length)&&void 0!==s?s:0)>1)break}}}),!0,"editable")})),this.unwrapByNodes(h,t),null===d||void 0===d||d.move(),c){var f=[];u.forEach((function(t){t.allChildren().forEach((function(t){t.isElement()&&i.isMark(t)&&f.push(t)}))})),this.mergeMarks(f)}else this.merge(o);e||r.apply(o)}else e||r.apply(o)}}},{key:"insert",value:function(t,e){var n,r=this.editor;if(pe(r)){var i=r.change,o=r.node,a=e||i.range.toTrusty();if("string"===typeof t||ke(t)){var s=ce(a.startContainer);t=He(t,s)}a.collapsed||i.delete(a),null===(n=o.insert(t,a))||void 0===n||n.handleBr().select(t).collapse(!1),e||i.apply(a)}}},{key:"findMarks",value:function(t){var e=this.editor,n=t.cloneRange();if(n.startNode.isRoot()&&n.shrinkToElementNode(),!n.startNode.inEditor()||e.card.find(n.startNode))return[];var r=e.node,i=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.collapsed){var i=e.startNode,o=e.startOffset,a=i.findParent();if(a){var s=e.cloneRange();if(s.select(a,!0),n){s.setEnd(i,o),s.enlargeFromTextNode(),s.enlargeToElementNode(!0);var l=i.get().childNodes,c=s.endNode,u=s.endOffset,d=c.get().childNodes,h=d.item(u),p=l.item(o)||l.item(o-1);if(!t&&c.type===Node.ELEMENT_NODE&&h&&r.isBlock(h)&&(i.type!==Node.ELEMENT_NODE||p&&!r.isBlock(p)))return;s.select(a,!0),s.setStart(c,u),s.shrinkToElementNode(),s.shrinkToTextNode(),e.setStart(s.startContainer,s.startOffset),e.collapse(!0)}else{s.setStart(i,o),s.enlargeFromTextNode(),s.enlargeToElementNode(!0);var f=i.get().childNodes,g=s.startNode,m=s.startOffset,v=g.get().childNodes,b=v.item(m),y=f.item(o)||f.item(o-1);if(!t&&g.type===Node.ELEMENT_NODE&&b&&r.isBlock(b)&&(i.type!==Node.ELEMENT_NODE||y&&!r.isBlock(y)))return;s.select(a,!0),s.setEnd(g,m),s.shrinkToElementNode(),s.shrinkToTextNode(),e.setEnd(s.endContainer,s.endOffset),e.collapse(!1)}}}};if(!n.collapsed){var o=n.cloneRange(),a=n.cloneRange();o.collapse(!0),a.collapse(!1),i(!0,o,!0),i(!0,a),n.setStart(o.startContainer,o.startOffset),n.setEnd(a.startContainer,a.startOffset)}i(!1,n);var s=n.startContainer,l=n.startOffset,c=n.endContainer,u=n.endOffset,d=s,h=c;s.nodeType===Node.ELEMENT_NODE&&s.childNodes[l]&&(d=s.childNodes[l]||s),c.nodeType===Node.ELEMENT_NODE&&u>0&&c.childNodes[u-1]&&(h=c.childNodes[u-1]||s),n.collapsed&&(d=h);var p=function(t,e){t.push(e)},f=r,g=function(t){var n=[];while(t){if(t.type===Node.ELEMENT_NODE&&t.isEditable())break;if(!f.isMark(t)||t.attributes(bt)||t.attributes(Ct)){if(t.isCard()){var r=e.card.find(t);(null===r||void 0===r?void 0:r.queryMarks)&&n.push.apply(n,Object(S["a"])(r.queryMarks()))}}else n.push(t);var i=t.parent();if(!i)break;t=i}return n},m=g(He(d)),v=n.commonAncestorNode,b=e.card.find(v,!0),y=null===b||void 0===b?void 0:b.isEditable,w=y?(null===b||void 0===b?void 0:b.getSelectionNodes)?b.getSelectionNodes():[]:[v];if(0===w.length&&(y=!1,w.push(v)),(!n.collapsed||y)&&(g(He(h)).forEach((function(t){return p(m,t)})),s!==c||y)){var x=!1,C=!1;w.forEach((function(t){t.traverse((function(t){if(C)return!1;if(t[0]!==s){if(x){if(t[0]===c)return C=!0,!1;if(!f.isMark(t)||t.attributes(bt)||t.attributes(Ct)){if(t.isCard()){var n=e.card.find(t);(null===n||void 0===n?void 0:n.queryMarks)&&n.queryMarks().forEach((function(t){p(m,t)}))}}else p(m,t)}}else x=!0}),!0,"editable")}))}for(var k=0;k<m.length;k++)for(var A=k+1;A<m.length;A++)m[k][0]==m[A][0]&&(m.splice(A,1),A--);return m}},{key:"removeEmptyMarks",value:function(t,e){if(!(0===t.length||t.isEditable()||t.isCard()||t.attributes(J))){var n=this.editor.node;if(!t.attributes(J)){var r,i,o=t.parent();if(1===(null===(r=t.get())||void 0===r?void 0:r.childNodes.length)&&(null===(i=t.first())||void 0===i?void 0:i.attributes(J)))return void(n.isMark(t)?(t.before(t.first()),t.remove(),o&&this.removeEmptyMarks(o,!0)):e&&n.isBlock(t)&&t.prepend("<br />"));var a=n.html(t);""!==a&&""!==a||(n.isMark(t)?(t.remove(),o&&this.removeEmptyMarks(o,!0)):e&&n.isBlock(t)&&n.html(t,"<br />"))}}}},{key:"repairCursor",value:function(t){var e=this.editor.node;t=ke(t)?He(t):t;var n=e.isMark(t);if(n&&!t.isCursor()){var r=t.children();r.each((function(t,e){var n,i=r.eq(e);if((null===i||void 0===i?void 0:i.isText())&&!(null===(n=i.next())||void 0===n?void 0:n.isCursor())){var o=i.text();if(1===o.length&&/\u200b/.test(o))return void i.remove();i.text(o.replace(/\u200b/g,""))}}));var i=t.children().toArray().filter((function(t){return!t.isCursor()}));i.length<2&&(0===i.length||1===i.length&&i[0].isText()&&0===i[0].text().length)&&(i.length>0&&i[0].remove(),t.prepend(He("",null)));var o=t.next(),a=null===o||void 0===o?void 0:o.next();o&&a&&o.isText()&&/^\u200b$/g.test(o.text())&&!e.isInline(a)&&o.remove();var s=t.prev(),l=null===s||void 0===s?void 0:s.prev();s&&l&&s.isText()&&/^\u200b$/g.test(s.text())&&!e.isInline(l)&&s.remove()}}}]),t}(),Ji=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=(e.mark,e.inline),i=e.node,o=n.range.get(),a=o.cloneRange().shrinkToTextNode(),s=a.collapsed,l=a.endNode,c=a.startNode,u=a.startOffset;if(l.type===Node.TEXT_NODE||c.type===Node.TEXT_NODE){if(!s){var d=r.closest(l);if(i.isInline(d)&&!d.isCard()&&i.isEmpty(d)){if(u>1)return!0;var h=l.prev(),p=l.parent();if(p&&i.isInline(p)){if(h)return!0;var f=l.text(),g=f.substr(0,u);if(!/^\u200b$/.test(g))return!0;var m=d.next(),v=null===m||void 0===m?void 0:m.text();if(m&&m.isText()&&v&&/^\u200b/.test(v))return o.setEnd(m,1),!1}}return i.isInline(d)&&!d.isCard()&&setTimeout((function(){r.repairCursor(d)}),100),!0}var b=r.closest(c);if(i.isInline(b)){if(b.isCard())return!0;if(u>1)return!0;var y=c.prev(),w=c.parent();if(w&&i.isInline(w)){if(y)return!0;var x=c.text(),C=x.substr(0,u);if(!/\u200b$/.test(C))return!0}else{if(0!==u)return!0;while(!y&&w&&!i.isInline(w)){var k;y=w.prev(),w=null===(k=w)||void 0===k?void 0:k.parent()}if(y&&!y.isText())return!0;if(y&&!/\u200b$/.test(y.text()))return!0}var A=b.prev(),S=null===A||void 0===A?void 0:A.text();if(A&&A.isText()&&S&&/\u200b$/.test(S)){if(o.setStart(A,S.length-1),i.isEmpty(b)){var E=b.next(),O=null===E||void 0===E?void 0:E.text();E&&E.isText()&&O&&/^\u200b/.test(O)&&o.setEnd(E,1)}else o.collapse(!0);return n.range.select(o),!1}return!0}var T=c.prev(),_=c.parent(),M=void 0;if(T){if(i.isInline(T)&&!T.isCard()){var N=c.text(),P=N.substr(0,u);if(!/^\u200b$/.test(P))return!0;M=T}}else{if(0!==u)return!0;while(!T&&_&&!i.isBlock(_)){var L;T=_.prev(),_=null===(L=_)||void 0===L?void 0:L.parent()}if(T&&!T.isText())return!0;if(T){if(!/^\u200b$/.test(T.text()))return!0;if(T=T.prev(),!T||!i.isInline(T))return!0;M=T}}if(M){var D=M.last(),j=null===D||void 0===D?void 0:D.text();if(D&&D.isText()&&j&&/\u200b$/.test(j))return t.preventDefault(),o.setStart(D,j.length-1),o.collapse(!0),n.range.select(o),!1}}return!0}}]),t}(),Qi=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.inline,o=e.node,a=n.range.get().cloneRange().shrinkToTextNode(),s=a.startNode,l=a.startOffset,c=this.engine.card.getSingleCard(a);if(!c&&s.type===Node.TEXT_NODE){var u=r.closest(s);if(o.isInline(u)){if(u.isCard())return;if(l>1)return!0;var d=s.prev(),h=s.parent();if(h&&o.isInline(h)){if(d)return!0;var p=s.text(),f=p.substr(0,l);if(!/^\u200b$/.test(f))return!0}else{if(0!==l)return!0;while(!d&&h&&!o.isInline(h)){var g;d=h.prev(),h=null===(g=h)||void 0===g?void 0:g.parent()}if(d&&!d.isText())return!0;if(d&&!/^\u200b$/.test(d.text()))return!0}var m=u.prev(),v=null===m||void 0===m?void 0:m.text();if(m&&m.isText()&&v&&/\u200b$/.test(v)){t.preventDefault();var b=a.cloneRange(),y=b.collapsed;return a.setStart(m,v.length-1),y&&a.collapse(!0),n.range.select(a),!1}return!0}var w=s.prev(),x=s.parent(),C=void 0;if(w){if(o.isInline(w)&&!w.isCard()){var k=s.text(),A=k.substr(0,l);if(!/^\u200b$/.test(A))return!0;C=w}}else{if(0!==l)return!0;while(!w&&x&&!o.isBlock(x)){var S;w=x.prev(),x=null===(S=x)||void 0===S?void 0:S.parent()}if(w&&!w.isText())return!0;if(w){if(!/^\u200b$/.test(w.text()))return!0;if(w=w.prev(),!w||!o.isInline(w))return!0;C=w}}if(C){t.preventDefault();var E=C.last(),O=null===E||void 0===E?void 0:E.text();if(E&&E.isText()&&O&&/\u200b$/.test(O)){var T=a.cloneRange(),_=T.collapsed;return a.setStart(E,O.length-1),_&&!i()("shift+left",t)&&a.collapse(!0),n.range.select(a),!1}}}return!0}}]),t}(),to=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.inline,o=e.node,a=n.range.get().cloneRange().shrinkToTextNode(),s=a.endNode,l=a.endOffset,c=this.engine.card.getSingleCard(a);if(!c&&s.type===Node.TEXT_NODE){var u=r.closest(s),d=s.text();if(o.isInline(u)){if(u.isCard())return;if(l<d.length-1)return!0;var h=s.next(),p=s.parent();if(p&&o.isInline(p)){if(h)return!0;var f=d.substr(l);if(!/^\u200b$/.test(f))return!0}else{if(l!==d.length&&l!==d.length-1)return!0;while(!h&&p&&!o.isInline(p)){var g;h=p.next(),p=null===(g=p)||void 0===g?void 0:g.parent()}if(h&&!h.isText())return!0;if(h){if(!/^\u200b$/.test(h.text()))return!0;if(l===d.length-1){t.preventDefault();var m=a.cloneRange(),v=m.collapsed;return a.setEnd(h,0),v&&a.collapse(!1),n.range.select(a),!1}}}var b=u.next(),y=null===b||void 0===b?void 0:b.text();if(b&&b.isText()&&y&&/^\u200b/.test(y)){t.preventDefault();var w=a.cloneRange(),x=w.collapsed;return a.setEnd(b,1),x&&a.collapse(!1),n.range.select(a),!1}return!0}var C=s.next(),k=s.parent(),A=void 0;if(C){if(o.isInline(C)&&!C.isCard()){var S=d.substr(l);if(!/^\u200b$/.test(S))return!0;A=C}}else{if(l!==d.length)return!0;while(!C&&k&&!o.isBlock(k)){var E;C=k.next(),k=null===(E=k)||void 0===E?void 0:E.parent()}if(C&&!C.isText())return!0;if(C){if(!/^\u200b$/.test(C.text()))return!0;if(C=C.next(),!C||!o.isInline(C))return!0;A=C}}if(A){t.preventDefault();var O=A.first(),T=null===O||void 0===O?void 0:O.text();if(O&&O.isText()&&T&&/^\u200b/.test(T)){var _=a.cloneRange(),M=_.collapsed;return a.setEnd(O,1),M&&!i()("shift+right",t)&&a.collapse(!1),n.range.select(a),!1}}}return!0}}]),t}(),eo=function(){function t(e){Object(c["a"])(this,t),this.editor=void 0,this.editor=e}return Object(u["a"])(t,[{key:"init",value:function(){var t=this.editor;if(pe(t)){var e,n,r,i=t.typing,o=(t.event,new Ji(t));null===(e=i.getHandleListener("backspace","keydown"))||void 0===e||e.on((function(t){return o.trigger(t)}));var a=new Qi(t);null===(n=i.getHandleListener("left","keydown"))||void 0===n||n.on((function(t){return a.trigger(t)}));var s=new to(t);null===(r=i.getHandleListener("right","keydown"))||void 0===r||r.on((function(t){return s.trigger(t)}))}}},{key:"repairRange",value:function(t){var e=this.editor,n=e.change,r=e.node;t=t||n.range.get();var i=t,o=i.startNode,a=i.startOffset,s=i.endNode,l=i.endOffset,c=i.collapsed;if(c)return t;var u=this.closest(o);if(u&&r.isInline(u)&&a<=1){var d=!0,h=o;while(h&&!h.equal(u)){if(h.prev()){d=!1;break}h=h.parent()}if(d){var p=u.prev(),f=(null===p||void 0===p?void 0:p.text())||"";p&&p.isText()&&/\u200B$/g.test(f)&&t.setStart(p,f.length-1)}}var g=this.closest(s),m=g.last();if(g&&r.isInline(g)&&m&&s.equal(m)&&l>=m.text().length-1){var v=!0,b=o;while(b&&!b.equal(g)){if(b.next()){v=!1;break}b=b.parent()}if(v){var y=g.next(),w=(null===y||void 0===y?void 0:y.text())||"";y&&y.isText()&&/^\u200B/g.test(w)&&t.setEnd(y,1)}}return t}},{key:"closest",value:function(t){var e=this.editor.node,n=t.parent();while(n&&!n.isEditable()&&!e.isBlock(n)){if(e.isInline(n))return n;var r=n.parent();if(!r)break;n=r}return t}},{key:"closestNotInline",value:function(t){var e=this.editor.node;while(e.isInline(t)||e.isMark(t)||t.isText()){if(t.isEditable())break;var n=t.parent();if(!n)break;t=n}return t}},{key:"wrap",value:function(t,e){var n=this,r=this.editor;if(pe(r)){var i=r.change,o=r.mark,a=r.node,s=e||i.range.toTrusty(),l=ce(s.startContainer);if(t="string"===typeof t||ke(t)?He(t,l):t,a.isInline(t)){if(s.collapsed)return this.insert(t,s),void(e||i.apply(s));o.split(s),this.split(s);var c=s.commonAncestorNode;if(c.type===Node.TEXT_NODE||a.isMark(c)){c=c.parent();while(a.isMark(c))c=c.parent()}var u=s.enlargeToElementNode().createSelection();if(u.has()){var d=!1,h=a.clone(t,!1),p=[];c.traverse((function(t){if(t.equal(u.anchor))d=!0;else if(d){if(t.equal(u.focus))return d=!1,!1;if(a.isInline(t))if(t.isCard())p.push(t);else{var e=t.children();a.unwrap(t),t=e}if(a.isMark(t)&&!t.isCard()||t.isText())return a.isEmpty(t)?(t.remove(),!0):(h.parent()||t.before(h),h.append(t),n.repairCursor(h),p.push(h),!0);0!==h[0].childNodes.length&&h.parent()&&(h=a.clone(h,!1,!1))}}));var f=u.anchor,g=u.focus,m=null===f||void 0===f?void 0:f.parent();if(m&&a.isRootBlock(m)&&!f.prev()&&!f.next()&&f.after("<br />"),!f.equal(g)){var v=null===g||void 0===g?void 0:g.parent();v&&a.isRootBlock(v)&&!g.prev()&&!g.next()&&g.before("<br />")}if(u.move(),p.length>0){var b=p[0];if(!b.isCard()){var y=b.first();s.setStart(y,1)}var w=p[p.length-1];if(!w.isCard()){var x=w.last();s.setEnd(x,x.text().length-1)}}e||i.apply(s)}else e||i.apply(s)}}}},{key:"unwrap",value:function(t){var e=this.editor;if(pe(e)){var n=e.change,r=e.mark,i=t&&hn(t)?t:n.range.toTrusty();this.repairRange(i),r.split(i);var o=t&&!hn(t)?[t]:this.findInlines(i),a=i.createSelection();o.forEach((function(t){var n,r,i,o,a=t.prev();a&&a.isCursor()&&(a=a.prev());var s=t.next();s&&s.isCursor()&&(s=s.prev());var l=t.first();l&&l.isCursor()&&(l=l.next());var c=(null===(n=a)||void 0===n?void 0:n.text())||"",u=(null===(r=s)||void 0===r?void 0:r.text())||"",d=(null===(i=l)||void 0===i?void 0:i.text())||"";a&&a.isText()&&/\u200B$/g.test(c)&&(/^\u200B$/g.test(c)?a.remove():a.text(c.substr(0,c.length-1))),s&&s.isText()&&/^\u200B/g.test(u)&&(/^\u200B$/g.test(u)?s.remove():s.text(u.substr(1))),l&&l.isText()&&/^\u200B/g.test(d)&&(/^\u200B$/g.test(d)||l.get().splitText(1),l.remove());var h=t.last();h&&h.isCursor()&&(h=h.prev());var p=(null===(o=h)||void 0===o?void 0:o.text())||"";h&&h.isText()&&/\u200B$/g.test(p)&&(/^\u200B$/g.test(p)?h.remove():h.get().splitText(p.length-1).remove()),e.node.unwrap(t)})),a.move(),r.merge(i),t||n.apply(i)}}},{key:"insert",value:function(t,e){var n,r,i=this.editor;if(pe(i)){var o=i.change,a=i.node,s=i.mark,l=e||o.range.toTrusty(),c=ce(l.startContainer);if(("string"===typeof t||ke(t))&&(t=He(t,c)),a.isInline(t)){l.collapsed||o.delete(l),s.split(l),this.split(l),null===(n=a.insert(t,l))||void 0===n||n.select(t).collapse(!1),"br"!==t.name&&l.handleBr();var u=0!==(null===(r=t.get())||void 0===r?void 0:r.childNodes.length);if(this.repairCursor(t),!t.isCard()&&!a.isVoid(t))if(u){var d=t.next();l.setStart(d,1),l.setEnd(d,1)}else{var h=t.last(),p=h.text();l.setStart(h,p.length-1),l.setEnd(h,p.length-1)}e||o.apply(l)}}}},{key:"unwrapEmptyInlines",value:function(t,e){var n=this.editor.node,r=t.allChildren();r.forEach((function(t){n.isEmpty(t)&&n.isInline(t)&&(!e||e(t))&&n.unwrap(t)}))}},{key:"splitOnCollapsed",value:function(t,e){var n=this;if(t.collapsed){t.enlargeFromTextNode(),t.shrinkToElementNode();var r=t.startNode,i=r.parent(),o=this.editor.node,a=r.isCard()?r:r.closest(St);if((0===a.length||"inline"!==a.attributes(wt))&&(o.isInline(r)||i&&o.isInline(i))){var s,l=this.closestNotInline(r),c=t.createSelection(),u=c.getNode(l,"left"),d=void 0,h=void 0,p=[];if(e){ke(e)&&(e=He(e));var f=e.getPath(l.get()),g=l.clone(!0);p=f.slice(1),h=He(g.getChildByPath(f.slice(0,1))),d=c.getNode(g,"right",!1)}else d=c.getNode(l,"right");this.unwrapEmptyInlines(u),this.unwrapEmptyInlines(d);var m=l.children();m.each((function(t,e){var n,r;(null===(n=m.eq(e))||void 0===n?void 0:n.isCard())||(null===(r=m.eq(e))||void 0===r||r.remove())}));var v=void 0,b=function(t){t.each((function(e,n){var r=t.eq(n);if(null===r||void 0===r?void 0:r.isCard())return v=v?v.next():l.first(),void(v&&(t[n]=v[0]));v?(v.after(e),v=r):(v=r,l.prepend(e))}))},y=u.children(),w=y.toArray();b(y);var x=d.children(),C=x.toArray();if(h&&(e=null===(s=C.find((function(t){return t.equal(h)})))||void 0===s?void 0:s.getChildByPath(p)),b(x),C=x.toArray(),1===w.length&&"br"===w[0].name&&(w[0].remove(),w.splice(0,1)),1===C.length&&"br"===C[0].name&&(C[0].remove(),C.splice(0,1)),C.filter((function(t){return!t.isCursor()})).length>0){for(var k=C[0],A=0;A<C.length-1;A++)if(k=C[A],!k.isCursor())break;t.setStartBefore(k),t.collapse(!0)}else if(w.filter((function(t){return!t.isCursor()})).length>0){for(var S=w[w.length-1],E=w.length-1;E>=0;E--)if(S=w[E],!S.isCursor())break;t.setStartAfter(S),t.collapse(!0)}else t.select(l,!0).collapse(!0);l.traverse((function(t){o.isInline(t)&&n.repairCursor(t)}))}return t.enlargeToElementNode(!o.isBlock(t.startNode),!1),e}}},{key:"splitOnExpanded",value:function(t){var e=this;if(!t.collapsed){t.enlargeToElementNode(),t.shrinkToElementNode();var n=t.startNode,r=t.endNode,i=n.isCard()?n:n.closest(St),o=r.isCard()?r:r.closest(St);if(!(i.length>0&&"inline"===i.attributes(wt)||o.length>0&&"inline"===o.attributes(wt))){var a=this.closestNotInline(n),s=this.closestNotInline(r);if(!a.equal(s)){var l=t.cloneRange();l.collapse(!0);var c=t.cloneRange();c.collapse(!1);var u=void 0,d=l.startOffset,h=c.endOffset;return void(a.contains(s)?(u=this.splitOnCollapsed(l,c.endNode),t.setStart(l.startContainer,l.startOffset),u&&c.setOffset(u,h,h),this.splitOnCollapsed(c),t.setEnd(c.startContainer,c.startOffset)):(u=this.splitOnCollapsed(c,l.startNode),t.setEnd(c.startContainer,c.startOffset),u&&l.setOffset(u,d,d),this.splitOnCollapsed(l),t.setStart(l.startContainer,l.startOffset)))}var p=this.editor.node,f=n.parent(),g=p.isInline(n)||f&&p.isInline(f),m=r.parent(),v=p.isInline(r)||m&&p.isInline(m);if(!g&&!v)return;var b=t.commonAncestorNode;b.isText()&&(b=b.parent());var y=this.closestNotInline(b),w=t.createSelection(),x=w.getNode(y,"left"),C=w.getNode(y),k=w.getNode(y,"right");this.unwrapEmptyInlines(x),this.unwrapEmptyInlines(k);var A=y.children();A.each((function(t,e){var n,r;(null===(n=A.eq(e))||void 0===n?void 0:n.isCard())||(null===(r=A.eq(e))||void 0===r||r.remove())}));var S=void 0,E=function(t){t.each((function(e,n){var r;if(null===(r=t.eq(n))||void 0===r?void 0:r.isCard())return S=S?S.next():y.first(),void(S&&(t[n]=S[0]));S?(S.after(e),S=t.eq(n)):(S=t.eq(n),y.prepend(e))}))};E(x.children());var O=C.children(),T=O.toArray();E(O),E(k.children()),y.traverse((function(t){p.isInline(t)&&e.repairCursor(t)})),t.setStartBefore(T[0][0]),t.setEndAfter(T[T.length-1][0])}}}},{key:"split",value:function(t){var e=this.editor;if(pe(e)){var n=e.change,r=t||n.range.toTrusty();r.collapsed?this.splitOnCollapsed(r):this.splitOnExpanded(r),t||n.apply(r)}}},{key:"findInlines",value:function(t){var e=this.editor,n=t.cloneRange();if(n.startNode.isRoot()&&n.shrinkToElementNode(),!n.startNode.inEditor()||e.card.find(n.startNode))return[];var r=e.node,i=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.collapsed){var i=e.startNode,o=e.startOffset,a=i.findParent();if(a){var s=e.cloneRange();if(s.select(a,!0),n){s.setEnd(i,o),s.enlargeFromTextNode(),s.enlargeToElementNode(!0);var l=i.children(),c=s.endNode,u=s.endOffset,d=c.children(),h=d.eq(u),p=l.eq(o)||l.eq(o-1);if(!t&&c.type===Node.ELEMENT_NODE&&h&&r.isBlock(h)&&(i.type!==Node.ELEMENT_NODE||p&&!r.isBlock(p)))return;s.select(a,!0),s.setStart(c,u),s.shrinkToElementNode(),s.shrinkToTextNode(),e.setStart(s.startContainer,s.startOffset),e.collapse(!0)}else{s.setStart(i,o),s.enlargeFromTextNode(),s.enlargeToElementNode(!0);var f=i.children(),g=s.startNode,m=s.startOffset,v=g.children(),b=v.eq(m),y=f.eq(o)||f.eq(o-1);if(!t&&g.type===Node.ELEMENT_NODE&&b&&r.isBlock(b)&&(i.type!==Node.ELEMENT_NODE||y&&!r.isBlock(y)))return;s.select(a,!0),s.setEnd(g,m),s.shrinkToElementNode(),s.shrinkToTextNode(),e.setEnd(s.endContainer,s.endOffset),e.collapse(!1)}}}};if(!n.collapsed){var o=n.cloneRange(),a=n.cloneRange();o.collapse(!0),a.collapse(!1),i(!0,o,!0),i(!0,a),n.setStart(o.startContainer,o.startOffset),n.setEnd(a.startContainer,a.startOffset)}i(!1,n);var s=n.startContainer,l=n.startOffset,c=n.endContainer,u=n.endOffset,d=s,h=c;s.nodeType===Node.ELEMENT_NODE&&s.childNodes[l]&&(d=s.childNodes[l]||s),c.nodeType===Node.ELEMENT_NODE&&u>0&&c.childNodes[u-1]&&(h=c.childNodes[u-1]||s),n.collapsed&&(d=h);var p=function(t,e){t.some((function(t){return t[0]===e[0]}))||t.push(e)},f=function(t){var e=[];while(t){if(t.isEditable())break;r.isInline(t)&&e.push(t);var n=t.parent();if(!n)break;t=n}return e},g=f(He(d)),m=n.commonAncestorNode,v=e.card.find(m,!0),b=null===v||void 0===v?void 0:v.isEditable,y=b?(null===v||void 0===v?void 0:v.getSelectionNodes)?v.getSelectionNodes():[]:[m];if(0===y.length&&(b=!1,y.push(m)),(!n.collapsed||b)&&(f(He(h)).forEach((function(t){return p(g,t)})),s!==c||b)){var w=!1,x=!1;y.forEach((function(t){t.traverse((function(t){if(x)return!1;if(t.equal(s))w=!0;else if(w){if(t.equal(c))return x=!0,!1;!r.isInline(t)||t.attributes(bt)||t.attributes(Ct)||p(g,t)}}))}))}return g}},{key:"repairCursor",value:function(t){var e,n,r=this.editor.node;if(ke(t)&&(t=He(t)),!r.isInline(t)||"false"===t.closest(St).attributes(At)||r.isVoid(t)||t.isCard()){var i=t.prev(),o=(null===i||void 0===i?void 0:i.isText())?i.text():void 0;if(o&&/\u200b$/.test(o)){var a=null===i||void 0===i?void 0:i.prev();a&&r.isInline(a)||(1===o.length?null===i||void 0===i||i.remove():null===i||void 0===i||i.text(o.slice(0,-1)))}var s=t.next(),l=(null===s||void 0===s?void 0:s.isText())?s.text():void 0;if(l&&/^\u200b/.test(l)){var c=null===s||void 0===s?void 0:s.next();c&&r.isInline(c)||(1===l.length?null===s||void 0===s||s.remove():null===s||void 0===s||s.text(l.slice(1)))}}else{var u=t.children();u.each((function(t,e){var n=u.eq(e);if(null===n||void 0===n?void 0:n.isText()){var r=n.text();if(1===r.length&&/\u200b/.test(r))return void n.remove();n.text(r.replace(/\u200b/g,""))}})),this.repairBoth(t);var d=t.first();(null===(e=d)||void 0===e?void 0:e.isCursor())&&(d=d.next()),d&&d.type===Node.TEXT_NODE&&/^\u200B/g.test(d.text())||(d?d.isText()?d.text(""+d.text()):d.before(He("",null)):t.append(He("",null)));var h=t.last();(null===(n=h)||void 0===n?void 0:n.isCursor())&&(h=h.prev()),!h||!/^\u200B$/g.test(t.text())&&h.type===Node.TEXT_NODE&&/\u200B$/g.test(h.text())||(h.isText()?h.text(h.text()+""):h.after(He("",null)))}}},{key:"repairBoth",value:function(t){var e,n=this.editor.node;ke(t)&&(t=He(t));var r=t.get();if((null!==(e=null===r||void 0===r?void 0:r.parentElement)&&void 0!==e?e:null===r||void 0===r?void 0:r.parentNode)&&!n.isVoid(t)){var i=He("",null),o=t.prev(),a=null===o||void 0===o?void 0:o.prev(),s=(null===o||void 0===o?void 0:o.text())||"";!o||!o.isText()||!/\u200B$/g.test(s)||a&&n.isInline(a)&&!/\u200B.*\u200B$/g.test(s)?o&&o.isText()?o.text(s+""):t.before(n.clone(i,!0,!1)):o&&o.isText()&&/\u200B\u200B$/g.test(s)&&a&&!n.isInline(a)&&o.text(s.substr(0,s.length-1));var l=t.next(),c=(null===l||void 0===l?void 0:l.text())||"",u=null===l||void 0===l?void 0:l.next();!l||!l.isText()||!/^\u200B/g.test(c)||u&&n.isInline(u)&&!/^\u200B\u200B/g.test(c)?l&&l.isText()?l.text(""+l.text()):(t.after(n.clone(i,!0,!1)),"br"===(null===l||void 0===l?void 0:l.name)&&l.remove()):l&&l.isText()&&/\u200B\u200B$/g.test(c)&&u&&!n.isInline(u)&&l.text(c.substr(0,c.length-1))}}},{key:"flat",value:function(t,e){var n=this,r=this.editor;if(hn(t)){var i=t.cloneRange().shrinkToElementNode().createSelection(),o=this.findInlines(t),s=[];o.forEach((function(t){if(!t.isCard()){var e=n.flat(t);e&&s.push(e)}})),i.move();var l=r.node;s.forEach((function(t){var e,n,r=null===(e=t.prev())||void 0===e?void 0:e.prev(),i=null===(n=t.next())||void 0===n?void 0:n.next();r&&l.isMark(r)&&0===r.get().childNodes.length&&r.remove(),i&&l.isMark(i)&&0===i.get().childNodes.length&&i.remove()}))}else if(!t.isCard()){var c=r.node,u=r.mark;if(c.isInline(t,e)&&"br"!==t.name){var d=this.closest(t);if(!d.equal(t)&&c.isInline(d,e))c.unwrap(t);else{var h=function(){var r=u.closest(t),i=t,o=function(){var e=r.clone(),o=t.clone(),a=r.children();a.each((function(t){if(3!==t.nodeType||!/^\u200b$/.test(t.textContent||"")){var r=He(t);i.equal(r)||r.contains(i)?(i=c.wrap(c.replace(i,e),o),n.repairBoth(i)):c.wrap(r,e)}})),c.unwrap(r),r=u.closest(i)};while(r&&!r.equal(t)&&c.isMark(r,e))o();return{v:i}}();if("object"===Object(a["a"])(h))return h.v}}}}}]),t}(),no=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.node,i=(e.list,n.range.get().shrinkToElementNode().shrinkToTextNode()),o=this.engine.block,a=o.closest(i.endNode),s=a.parent();if(s&&s.inEditor()&&r.isBlock(s)){var l;if("li"===s.name&&"p"===a.name){var c,u;1===(null===(c=a.get())||void 0===c?void 0:c.childNodes.length)&&"br"===(null===(u=a.first())||void 0===u?void 0:u.name)&&a.first().remove();var d=i.createSelection();n.unwrap(a),d.move(),a=o.closest(i.endNode)}if(i.collapsed&&(1===i.startContainer.childNodes.length&&"BR"===(null===(l=i.startContainer.firstChild)||void 0===l?void 0:l.nodeName)||o.isLastOffset(i,"end")&&o.isFirstOffset(i,"end")))return t.preventDefault(),["li"].indexOf(s.name)>=0?(o.unwrap("<".concat(s.name," />")),o.setBlocks("<".concat(s.name," />"))):(o.unwrap("<".concat(s.name," />")),o.setBlocks("<p />")),!1}return!r.isBlock(a)||s&&r.isList(s)||a.isCard()?"li"!==a.name||void 0:(t.preventDefault(),o.insertOrSplit(i,a),!1)}}]),t}(),ro=function(){function t(e){Object(c["a"])(this,t),this.engine=void 0,this.engine=e}return Object(u["a"])(t,[{key:"trigger",value:function(t){var e=this.engine,n=e.change,r=e.node,i=e.block,o=e.card,a=n.range.get();if(a.collapsed){var s=a.getPrevNode();if(s&&r.isBlock(s)&&r.isEmptyWithTrim(s)){t.preventDefault();var l=s.parent();return s.remove(),l&&this.engine.node.isEmpty(l)&&(l.isEditable()?(this.engine.node.html(l,"<p><br /></p>"),a.select(l,!0).shrinkToElementNode().collapse(!1)):(this.engine.node.html(l,"<br />"),a.select(l,!0).collapse(!1)),n.apply(a)),!1}var c=!!o.closest(a.startNode);if(c||i.isFirstOffset(a,"start")){var u=i.closest(a.startNode);return!(!c&&r.isRootBlock(u))||(t.preventDefault(),r.isEmpty(u)&&u.html("<br />"),n.mergeAfterDelete(u),n.change(!1),!1)}var d=a.cloneRange().shrinkToElementNode().shrinkToTextNode();d.startContainer.nodeType===Node.TEXT_NODE&&function(t){var e,i,o,a,s=t,l=s.commonAncestorContainer,c=s.commonAncestorNode,u=c.parent(),d=null===u||void 0===u?void 0:u.attributes();if(t.collapsed&&1===t.startOffset&&t.startContainer===l&&l.nodeType===Node.TEXT_NODE&&(!d||!["left","right"].includes(d[Ct]))&&(t=t.cloneRange(),((null===(e=null!==(o=l.parentElement)&&void 0!==o?o:l.parentNode)||void 0===e||null===(i=e.childNodes)||void 0===i?void 0:i.length)||0)<=1&&1===(null===(a=l.textContent)||void 0===a?void 0:a.length))){var h=t,p=h.startNode,f=h.startOffset,g=p.parent();if(g&&r.isMark(g)&&f>0){var m=p.text(),v=m.substr(f-1,1);if(/^\u200b$/.test(v))if(1===f){var b=g.prev();if(b&&!r.isEmpty(b)){var y=t.cloneRange().select(b,!0).shrinkToTextNode().collapse(!1),w=y.startNode,x=y.startOffset;t.setStart(w,x-1)}}else t.setStart(p,f-1)}return t.collapsed&&t.select(l,!0),n.delete(t,!0),n.apply(t),!0}return!1}(d)&&(t.preventDefault(),t["isDelete"]=!0,n.change())}}}]),t}(),io=function(){function t(e){Object(c["a"])(this,t),this.editor=void 0,this.pluginCaches=new Map,this.editor=e}return Object(u["a"])(t,[{key:"init",value:function(){var t=this,e=this.editor;if(pe(e)){var n,r,i=e.typing,o=e.event,a=new no(e);null===(n=i.getHandleListener("enter","keydown"))||void 0===n||n.on((function(t){return a.trigger(t)}));var s=new ro(e);null===(r=i.getHandleListener("backspace","keydown"))||void 0===r||r.on((function(t){return s.trigger(t)})),o.on("keyup:space",(function(e){return t.triggerMarkdown(e)})),o.on("keydown:enter",(function(e){return t.triggerMarkdown(e)}))}}},{key:"triggerMarkdown",value:function(t){var e,n=this.editor;if(pe(n)&&!1!==(null===(e=n.options.markdown)||void 0===e?void 0:e.mode)){var r=n.change,i=r.range.get();if(i.collapsed&&!r.isComposing()){var o=i.startNode,a=i.startOffset,s=o.type===Node.TEXT_NODE?o:o.children().eq(a-1);if(s){var l=this.closest(s);if(n.node.isRootBlock(l)){var c=s.text().trimEnd();if(""!==c.replace(/\s|\t|\n|\r\n|\u200b/g,"")){var u=i.toPath(),d=ge(n,"zero"),h=d.parse(c,{});if(0!==h.length){var p=me(n,d,h,!1);if(p){var f=l.children();t.preventDefault(),i.select(l,!0),r.paste(p,i);var g=this.closest(i.startNode);return g.isRoot()||g.isCard()||f.each((function(t,e){e>0&&g.append(t)})),r.rangePathBeforeCommand=u,r.range.select(i),!1}return!0}}}}}}}},{key:"findPlugin",value:function(t){var e=this.editor,n=e.node,r=e.schema,i=e.plugin;if(0!==t.length&&n.isBlock(t)){var o=t.get().cloneNode(),a=o.outerHTML,s=this.pluginCaches.get(a);if(s)return s;for(var l in i.components){var c=i.components[l];if(ei(c)&&(c.tagName&&"string"!==typeof c.tagName?c.tagName.indexOf(t.name)>-1:t.name===c.tagName)){var u=c.schema();if(Array.isArray(u)?u.find((function(e){return r.checkNode(t,e.attributes)})):r.checkNode(t,u.attributes))return this.pluginCaches.set(a,c),c}}return s}}},{key:"findTop",value:function(t,e){var n=this.editor,r=n.schema,i=n.node,o=n.list,a=r.closest(t.name),s=r.closest(e.name);if(a===parent.name||s===e.name)return e;if(r.isAllowIn(t.name,e.name))return t;if(i.isList(t)&&i.isList(e)){var l=parseInt(e.attributes(o.INDENT_KEY),10)||0,c=parseInt(t.attributes(o.INDENT_KEY),10)||0;e.attributes(o.INDENT_KEY,c?c+1:l+1)}return e}},{key:"closest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=t;while(t){if((t.isEditable()||this.editor.node.isBlock(t))&&e(t))return t;var r=t.parent();if(!r)break;t=r}return n}},{key:"wrap",value:function(t,e){var n,r=this,i=this.editor;if(pe(i)){var o=i.change,a=i.node,s=i.schema,l=i.list,c=i.mark,u=e||o.range.toTrusty(),d=ce(u.startContainer);if(t="string"===typeof t||ke(t)?He(t,d):t,a.isBlock(t)){var h=this.getBlocks(u),p=this.findPlugin(t);if(h=h.map((function(e){var n;if(!e||e.isCard())return null;var i=t,o=null===(n=e)||void 0===n?void 0:n.parent();while(o&&!o.isEditable()){e=o;var l=o.parent();if(!l||!a.isBlock(l))break;o=l}return s.isAllowIn(i.name,e.name)?e:r.findPlugin(e)===p?e.children():null})).filter((function(t){return null!==t})),0===h.length){var f=this.closest(u.startNode);if(f.isCard()||f.isEditable()||!s.isAllowIn(t.name,f.name))return;var g=u.createSelection();return f.children().each((function(e){t.append(e)})),f.append(t),void g.move()}var m=u.createSelection();null===(n=h[0])||void 0===n||n.before(t),h.forEach((function(e){e&&(p&&e.allChildren().forEach((function(t){if(a.isMark(t)){var e,n=c.findPlugin(t);if(!n)return;(null===(e=p.disableMark)||void 0===e?void 0:e.indexOf(n.constructor.pluginName))&&a.unwrap(t)}})),t.append(e))})),m.move(),this.merge(u),l.merge(void 0,u),e||o.apply(u)}}}},{key:"unwrap",value:function(t,e){var n=this.editor;if(pe(n)){var r=n.change,i=n.node,o=e||r.range.toTrusty(),a=ce(o.startContainer);if(t="string"===typeof t||ke(t)?He(t,a):t,i.isBlock(t)){var s=this.getSiblings(o,t);if(0!==s.length){var l=s[0].node.parent();if(null===l||void 0===l?void 0:l.inEditor()){var c=s.some((function(t){return"left"===t.position})),u=s.some((function(t){return"right"===t.position})),d=void 0;if(c){var h=l;d=i.clone(h,!1,!1),h.before(d)}var p=void 0;if(u){var f=s[s.length-1].node.parent();f&&(p=i.clone(f,!1,!1),null===f||void 0===f||f.after(p))}var g=o.createSelection(),m=i;s.forEach((function(e){var n,r,i,o=e.position,a=e.node,s=a.parent();"left"===o&&(null===(n=d)||void 0===n||n.append(a));"center"===o&&((null===s||void 0===s?void 0:s.name)===(null===(r=t)||void 0===r?void 0:r.name)&&(null===s||void 0===s?void 0:s.inEditor())&&m.unwrap(s));"right"===o&&(null===(i=p)||void 0===i||i.append(a))})),d&&"ol"===d.name&&p&&"ol"===p.name&&p.attributes("start",(parseInt(d.attributes("start"),10)||1)+d.find("li").length),g.move(),e||r.apply(o)}}}}}},{key:"getSiblings",value:function(t,e){var n=this,r=[],i=this.editor.node;if(!i.isBlock(e))return r;var o=function(t,e){var r=n.closest(t);while(r){var i=r.parent();if(!i)break;if(!r.inEditor())break;if(r.text().trim()!==i.text().trim())break;if(i.name===e)break;r=i}return r},a=o(t.startNode,e.name),s=o(t.endNode,e.name),l=a.parent(),c="left",u=null===l||void 0===l?void 0:l.first();while(u){if(u=He(u),!i.isBlock(u))return r;if(!u.inEditor())return r;u[0]===a[0]&&(c="center"),r.push({position:c,node:u}),u[0]===s[0]&&(c="right"),u=u.next()}return r}},{key:"split",value:function(t){var e,n,r=this.editor;if(pe(r)){var i=r.change,o=r.mark,a=r.nodeId,s=t||i.range.toTrusty();s.collapsed||i.delete(s);var l=this.closest(s.startNode);if(l.isEditable()||l.inEditor()){if(l.isEditable()){var c=s.getStartOffsetNode();return c&&s.select(c,!0).shrinkToElementNode().collapse(!1),void(t||i.apply(s))}var u=s.cloneRange();u.shrinkToElementNode().shrinkToTextNode().collapse(!0);var d=o.findMarks(u).filter((function(t){var e=r.mark.findPlugin(t);return!1!==(null===e||void 0===e?void 0:e.copyOnEnter)&&!1!==(null===e||void 0===e?void 0:e.followStyle)})),h=this.getBlockByRange({block:l[0],range:s,isLeft:!1,keepDataId:!0}),p=r.node;h.traverse((function(t){!p.isVoid(t)&&(p.isInline(t)||p.isMark(t))&&p.isEmpty(t)&&t.remove()}),!0);var f=function(t){return p.isBlock(t)&&(0===t.childNodes.length||""===t.innerText)};return f(l[0])&&!f(h[0])?a.generate(l,!0):a.generate(h,!0),l.after(h),p.isEmpty(l)&&p.html(l,p.getBatchAppendHTML(d,d.length>0?"&#8203;":"<br />")),p.isEmpty(h)&&p.html(h,p.getBatchAppendHTML(d,d.length>0?"&#8203;":"<br />")),l.children().each((function(t){p.isInline(t)&&r.inline.repairCursor(t)})),h.children().each((function(t){p.isInline(t)&&r.inline.repairCursor(t)})),s.select(h,!0).shrinkToElementNode(),1===(null===(e=h.get())||void 0===e?void 0:e.childNodes.length)&&"br"===(null===(n=h.first())||void 0===n?void 0:n.name)?s.collapse(!1):s.collapse(!0),t||i.apply(s),h}}}},{key:"insert",value:function(t,e,n){var r,i,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=this.editor;if(pe(a)){var s=a.change,l=a.node,c=a.list,u=a.inline,d=e||s.range.toTrusty(),h=ce(d.startContainer);if(t="string"===typeof t||ke(t)?He(t,h):t,l.isBlock(t)){d.collapsed||s.delete(d);var p=this.closest(d.startNode);if(p.isEditable()||p.inEditor()){if(p.isEditable())return l.insert(t,d,o),d.collapse(!1),void(e||s.apply(d));if(l.isList(d.startNode)||d.startNode.closest("li").length>0){var f=h.createDocumentFragment();return f.appendChild(t[0]),c.insert(f,d),void(e||s.apply(d))}1===(null===(r=p.get())||void 0===r?void 0:r.childNodes.length)&&"br"===(null===(i=p.first())||void 0===i?void 0:i.name)&&d.select(p,!0).collapse(!1);var g=d.enlargeToElementNode().createSelection();if(g.has()){p=n?n(p):p;var m=g.getNode(p,"left");m.traverse((function(t){t.equal(m)||l.isBlock(t)&&(l.isEmpty(t)||c.isEmptyItem(t))&&t.remove()}));var v=g.getNode(p,"right",!0,(function(t){if(t.isCard()){var e=t.parent();if(e&&l.isCustomize(e))return!1}return!0})),b=p.children();if(l.isEmpty(p)||b.each((function(t,e){var n,r=b.eq(e);(null===r||void 0===r?void 0:r.isCard())||(null===(n=b.eq(e))||void 0===n||n.remove())})),v.traverse((function(t){t.equal(v)&&(l.isBlock(t)&&(l.isEmpty(t)||c.isEmptyItem(t))?t.remove():l.isList(t)&&c.addBr(t))})),v.length>0&&!l.isEmpty(v)&&!c.isEmptyItem(v)){var y=v.clone(!1);a.nodeId.generate(y,!0);var w=v.children();w.each((function(t,e){var n;if(null===(n=w.eq(e))||void 0===n?void 0:n.isCard()){var r=a.card.find(t);r&&y.append(r.root)}else y.append(t)})),v=y,p.after(y)}if(m.length>0&&!l.isEmpty(m)&&!c.isEmptyItem(m)){var x=void 0,C=function(t){t.each((function(e,n){var r=t.eq(n);if(r&&l.isInline(r)&&u.repairCursor(r),null===r||void 0===r?void 0:r.isCard())return x=x?x.next():p.first(),void(x&&(t[n]=x[0]));x?(x.after(e),x=r):(x=r,p.prepend(e))}))};C(m.children())}p&&p.length>0&&(d.select(p,!0),d.collapse(!1)),g.focus&&g.focus.remove(),g.anchor&&g.anchor.remove(),l.insert(t,d,o),e||s.apply(d)}else e||s.apply(d)}else e||s.apply(d)}}}},{key:"setBlocks",value:function(t,e){var n=this,r=this.editor;if(pe(r)){var i=r.node,o=r.schema,a=r.mark,s=r.change,l=e||s.range.toTrusty(),c=ce(l.startContainer),u=null,d={};"string"===typeof t?(u=He(t,c),d=u.attributes(),d.style=u.css()):d=t;var h=this.getBlocks(l),p=l.startNode;if(p.isEditable()&&0===h.length){if(p.isCard()||p.isEditable())return;var f=u||He("<p></p>");if(!o.isAllowIn(f.name,p.name))return;i.setAttributes(f,d);var g=l.createSelection();p.children().each((function(t){f.append(t)}));var m=o.data.globals["block"]||{},v=p.attributes();Object.keys(v).forEach((function(t){t!==Q&&"id"!==t&&m["name"]&&f.attributes(t,v[t])}));var b=m.style||{},y=p.css();return Object.keys(y).forEach((function(t){b[t]||delete y[t]})),f.css(y),p.append(f),g.move(),void(e||s.apply(l))}var w=u?this.findPlugin(u):void 0,x=l.createSelection();h.forEach((function(t){if(!t.attributes(bt)){if(u){var e=o.data.globals["block"]||{},r=t.attributes();Object.keys(r).forEach((function(t){var n;t!==Q&&"id"!==t&&e["name"]&&(null===(n=u)||void 0===n||n.attributes(t,r[t]))}));var s=e.style||{},l=t.css();Object.keys(l).forEach((function(t){s[t]||delete l[t]})),u.css(l)}if(!u||n.findPlugin(t)===w&&t.name===u.name)return u&&(d=u.attributes()),void i.setAttributes(t,d);if("p"===u.name||!o.isAllowIn(t.name,u.name)){w&&t.allChildren().forEach((function(t){if(i.isMark(t)){var e=a.findPlugin(t);if(!e)return;w.disableMark&&w.disableMark.indexOf(e.constructor.pluginName)>-1&&i.unwrap(t)}}));var c=i.replace(t,u),h=c.parent();!h||h.isEditable()||o.isAllowIn(h.name,c.name)||i.unwrap(h)}}})),x.move(),e||s.apply(l)}}},{key:"merge",value:function(t){var e=this.editor;if(pe(e)){var n=e.change,r=e.schema,i=t||n.range.toTrusty(),o=this.getBlocks(i);if(0!==o.length){var a=o[0].closest(et),s=r.getCanMergeTags();if(0!==s.length){var l=a.find(s.join(","));if(l.length>0){var c=i.createSelection(),u=l.next();while(u&&s.indexOf(u.name)>0){var d=u.prev(),h=u.attributes(),p=null===d||void 0===d?void 0:d.attributes();u.name===(null===d||void 0===d?void 0:d.name)&&h["class"]===(p?p["class"]:void 0)&&Object.keys(h).join(",")===Object.keys(p||{}).join(",")&&e.node.merge(d,u),u=u.next()}c.move()}t||n.apply(i)}}}}},{key:"findBlocks",value:function(t){var e,n=this.editor;if(t=t.cloneRange(),t.startNode.isRoot()&&t.shrinkToElementNode(),!t.startNode.inEditor()||(null===(e=n.card.find(t.startNode))||void 0===e?void 0:e.type)===gn.BLOCK)return[];var r=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset,s=r,l=o;r.nodeType===Node.ELEMENT_NODE&&r.childNodes[i]&&(s=r.childNodes[i]||r),o.nodeType===Node.ELEMENT_NODE&&a>0&&o.childNodes[a-1]&&(l=o.childNodes[a-1]||r),t.collapsed&&(s=l);var c=function(t,e,n){t.some((function(t){return t[0]===e[0]}))||(n?t.unshift(e):t.push(e))},u=function(t){var e=[];while(t){if(t.isEditable())break;n.node.isBlock(t)&&e.push(t);var r=t.parent();if(!r)break;t=r}return e},d=this.getBlocks(t);u(He(s)).forEach((function(t){return c(d,t,!0)}));var h=t,p=h.commonAncestorNode,f=n.card.find(p,!0),g=null===f||void 0===f?void 0:f.isEditable,m=g&&(null===f||void 0===f?void 0:f.getSelectionNodes)?f.getSelectionNodes():[];return 0===m.length&&(g=!1),t.collapsed&&!g||(u(He(l)).forEach((function(t){return c(d,t)})),m.forEach((function(t){t.traverse((function(t){t.isElement()&&!t.isCard()&&n.node.isBlock(t)&&c(d,t)}),!0,"editable")}))),d}},{key:"isFirstOffset",value:function(t,e){var n=t,r=n.startNode,i=n.endNode,o=n.startOffset,a=n.endOffset,s="start"===e?r:i,l="start"===e?o:a;t=t.cloneRange();var c=this.closest(s);t.select(c,!0),t.setEnd(s[0],l);var u=this.editor;u.node.isBlock(s)||t.enlargeToElementNode();var d=t.cloneContents();if(!d.firstChild)return!0;var h=u.node;if(1===d.childNodes.length&&"br"===He(d.firstChild).name)return!0;var p=He("<div />");return p.append(d),h.isEmpty(p)}},{key:"isLastOffset",value:function(t,e){var n=t,r=n.startNode,i=n.endNode,o=n.startOffset,a=n.endOffset,s="start"===e?r:i,l="start"===e?o:a;t=t.cloneRange();var c=this.closest(s);t.select(c,!0),t.setStart(s,l);var u=this.editor.node;u.isBlock(s)||t.enlargeToElementNode();var d=t.cloneContents();if(!d.firstChild)return!0;var h=He("<div />");return h.append(d),0>=h.find("br").length&&u.isEmpty(h)}},{key:"getBlocks",value:function(t){t=t.cloneRange(),t.shrinkToElementNode(),t.shrinkToTextNode();var e=this.editor,n=e.node,r=this.closest(t.startNode);t.startNode.isRoot()&&(r=He(t.getStartOffsetNode()));var i=this.closest(t.endNode);t.endNode.isRoot()&&(i=He(t.getEndOffsetNode()));var o=this.closest(t.commonAncestorNode),a=[],s=!1,l=t,c=l.commonAncestorNode,u=e.card.find(c,!0),d=null===u||void 0===u?void 0:u.isEditable,h=d?(null===u||void 0===u?void 0:u.getSelectionNodes)?u.getSelectionNodes():[]:[o];return 0===h.length&&(d=!1,h.push(o)),h.forEach((function(t){t.traverse((function(t){var n=He(t);if(n.equal(r)&&(s=!0),(s||d)&&e.node.isBlock(n)&&!n.isCard()&&n.inEditor()&&a.push(n),n.equal(i))return s=!1,!1}),!0,"editable")})),a.length>1&&this.isFirstOffset(t,"end")&&!n.isEmpty(i)&&a.pop(),a}},{key:"getBlockByRange",value:function(t){var e=t.block,n=t.range,r=t.isLeft,i=t.clone,o=void 0!==i&&i,a=t.keepDataId,s=void 0!==a&&a;ke(e)&&(e=He(e));var l=this.editor,c=cn.create(l,e.document);r?(c.select(e,!0),c.setEnd(n.startContainer,n.startOffset)):(c.select(e,!0),c.setStart(n.endContainer,n.endOffset));var u=o?c.cloneContents():c.extractContents(),d=s?e.clone(!1):l.node.clone(e,!1,!1);return d.append(u),o&&d.find(St).each((function(t){var e=He(t),n=e.attributes(bt);e.attributes(yt,n),e.removeAttributes(bt)})),d}},{key:"getLeftText",value:function(t,e){var n=this.editor;if(!pe(n))return"";e=e||n.change.range.get();var r=this.getBlockByRange({block:t,range:e,isLeft:!0,clone:!0});return r.text().replace(/\u200B/g,"")}},{key:"removeLeftText",value:function(t,e){var n=this.editor;if(pe(n)){e=e||n.change.range.get(),ke(t)&&(t=He(t)),e.createSelection();var r=t.find(mt),i=!1;t.traverse((function(t){var e=He(t);if(e.equal(r))return r.remove(),void(i=!0);i&&e.isText()&&e.remove()}),!1)}}},{key:"flat",value:function(t,e){var n=this.editor;if(pe(n)){var r=n.schema,i=n.node,o=r.getCanMergeTags(),a=t.parent(),s=e.fragment?e[0].parentNode:e.get();while(a&&s&&a.get()!==s&&a.inEditor()){if(t.isCard())a.before(t);else if(i.isList(a)&&"li"===t.name||o.indexOf(a.name)>-1&&i.isBlock(t)&&a.name!==t.name){var l=i.clone(a,!1,!1);l.append(t),t=l,a.before(t)}else t=i.replace(t,i.clone(this.findTop(a,t),!1,!1)),a.before(t);a.first()||a.remove(),a=t.parent()}}}},{key:"insertEmptyBlock",value:function(t,e){var n=this.editor;if(pe(n)){var r=n.change,i=r.blocks,o=r.marks,a=n.node;if(this.insert(e),i[0]){var s=i[0].css();e.css(s)}var l=e.find("br");o.forEach((function(t){var e=n.mark.findPlugin(t);t=a.clone(t,!1,!1),!1!==(null===e||void 0===e?void 0:e.copyOnEnter)&&!1!==(null===e||void 0===e?void 0:e.followStyle)&&(t=a.clone(t,!1,!1),l.before(t),t.append(l),l=t)})),l=e.find("br");var c=l.parent();c&&a.isMark(c)&&(l=a.replace(l,He("",null))),t.select(l).shrinkToTextNode(),t.collapse(!1),t.scrollIntoView(),r.range.select(t)}}},{key:"insertOrSplit",value:function(t,e){var n,r,i,o=t.cloneRange();if(o.enlargeFromTextNode(),this.isLastOffset(t,"end")||o.endNode.type===Node.ELEMENT_NODE&&((null===(n=e.get())||void 0===n?void 0:n.childNodes.length)||0)>0&&o.endContainer.childNodes[o.endOffset]===(null===(r=e.last())||void 0===r?void 0:r.get())&&"br"===(null===(i=e.first())||void 0===i?void 0:i.name)){var a=He("<p><br /></p>");if("p"===e.name){var s=e.attributes();Object.keys(s).forEach((function(t){t!==Q&&a.attributes(t,s[t])}))}this.insertEmptyBlock(t,a)}else this.split()}}]),t}(),oo=Object(_["a"])("_scrollNode"),ao=function(){function t(e,n){var r=this;Object(c["a"])(this,t),this.kind="editor",this.options={lang:"zh-CN",locale:{},plugins:[],cards:[],config:{},iconFonts:"url('//at.alicdn.com/t/font_1456030_lnqmc6a6ca.woff2?t=1638071536645') format('woff2'), url('//at.alicdn.com/t/font_1456030_lnqmc6a6ca.woff?t=1638071536645') format('woff'), url('//at.alicdn.com/t/font_1456030_lnqmc6a6ca.ttf?t=1638071536645') format('truetype')"},this.container=void 0,this.language=void 0,this.root=void 0,this.card=void 0,this.plugin=void 0,this.node=void 0,this.nodeId=void 0,this.list=void 0,this.mark=void 0,this.inline=void 0,this.block=void 0,this.event=void 0,this.schema=void 0,this.conversion=void 0,this.command=void 0,this.clipboard=void 0,this.request=void 0,Object.defineProperty(this,oo,{writable:!0,value:null}),this.options=Object(l["a"])(Object(l["a"])({},this.options),n);var i=this.options.iconFonts,o=document.querySelector("#am-iconfont");if(!o&&!1!==i){o=document.createElement("style"),o.setAttribute("type","text/css"),o.setAttribute("id","am-iconfont");var a='@font-face { font-family: "data-icon";';Array.isArray(i)&&(i=i.map((function(t){return"url('".concat(t.url,"') format('").concat(t.format,"')")})).join(",")),a+="src: ".concat(i,";}"),o.innerHTML=a,document.head.appendChild(o)}this.container=He(e),this.container.attributes(J,tt),this.language=new Gr(this.options.lang||"zh-CN",V()(Kr,null===n||void 0===n?void 0:n.locale)),this.event=new we,this.command=new ci(this),this.schema=new di,this.schema.add(qe),this.conversion=new fi(this),Ve.forEach((function(t){return r.conversion.add(t.from,t.to)})),this.card=new ki(this,this.options.lazyRender),this.clipboard=new Oi(this),this.request=new $i,this.plugin=new li(this),this.node=new Xe(this),this.nodeId=new Si(this.schema),this.list=new Xi(this),this.mark=new Zi(this),this.inline=new eo(this),this.block=new io(this),this.root=He(this.options.root||this.container.parent()||document.body);var s=this.root.css("position");s&&"static"!==s||this.root.css("position","relative")}return Object(u["a"])(t,[{key:"scrollNode",get:function(){if(Object(T["a"])(this,oo)[oo])return Object(T["a"])(this,oo)[oo];var t=this.options.scrollNode,e=t?"function"===typeof t?t():t:null,n=["auto","scroll"],r=this.container.parent();while(!e&&r&&r.length>0&&"body"!==r.name){if(n.includes(r.css("overflow"))||n.includes(r.css("overflow-y"))){e=r.get();break}r=r.parent()}return null===e&&(e=document.documentElement),Object(T["a"])(this,oo)[oo]=e?He(e):null,Object(T["a"])(this,oo)[oo]}},{key:"init",value:function(){this.mark.init(),this.inline.init(),this.block.init(),this.list.init();var t=this.options,e=t.plugins,n=t.cards,r=t.config;this.card.init(null!==n&&void 0!==n?n:[]);var i="function"===typeof r?r(this):null!==r&&void 0!==r?r:{};this.plugin.init(null!==e&&void 0!==e?e:[],i),this.nodeId.init()}},{key:"setScrollNode",value:function(t){Object(T["a"])(this,oo)[oo]=t?He(t):null}},{key:"on",value:function(t,e,n){return this.event.on(t,e,n),this}},{key:"off",value:function(t,e){return this.event.off(t,e),this}},{key:"trigger",value:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return(e=this.event).trigger.apply(e,[t].concat(r))}},{key:"messageSuccess",value:function(t,e){for(var n,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];(n=console).log.apply(n,[t,"success:".concat(e)].concat(i))}},{key:"messageError",value:function(t,e){for(var n,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];(n=console).error.apply(n,[t,"error:".concat(e)].concat(i))}},{key:"messageConfirm",value:function(t,e){for(var n,r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return(n=console).log.apply(n,[t,"confirm:".concat(e)].concat(i)),Promise.reject(!1)}},{key:"getSelectionData",value:function(t){var e,n,r=this;if(t||(t=null!==(e=cn.from(this))&&void 0!==e?e:void 0),t){t=t.cloneRange();var i=t.startNode.closest("[".concat(bt,"]"),(function(t){var e;return He(t).isEditable()?void 0:(null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode)||void 0}));if(i.length>0&&!t.collapsed&&0===t.endOffset&&(t.endContainer.previousSibling&&t.setEndAfter(t.endContainer.previousSibling),!t.collapsed&&t.endOffset>0&&t.endContainer.childNodes[t.endOffset-1]===i[0])){var o=t.startNode.closest("[".concat(Ct,'="center"]'),(function(t){var e;return He(t).isEditable()?void 0:(null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode)||void 0}));o.length>0?t.setEnd(o[0],o[0].childNodes.length):t.setEnd(i[0],i[0].childNodes.length)}var a=t.commonAncestorNode;if(i=a.closest("[".concat(bt,"]"),(function(t){var e;return He(t).isEditable()?void 0:(null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode)||void 0})),i.length>0){var s=a.closest("[".concat(Ct,'="center"]'),(function(t){var e;return He(t).isEditable()?void 0:(null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode)||void 0}));0===s.length&&(t.select(i),a=t.commonAncestorNode)}if((a.inEditor()||a.isRoot())&&!t.collapsed){var l=function(t){if(0===t.length)return{};for(var e=t.length-1;e>0;e--){var n=t[e];n.appendChild(t[e-1])}return{inner:t[0],outter:t[t.length-1]}};if(i=a.closest("[".concat(bt,"]"),(function(t){var e;return(null!==(e=t.parentElement)&&void 0!==e?e:t.parentNode)||void 0})),i.length>0){var c=this.card.find(i);if(c&&c.getSelectionNodes){var u=c.getSelectionNodes();if(u.length>0){var d=l(u.map((function(t){return t[0]}))),h=d.inner,p=d.outter,f=u.map((function(t){return t.html()})).join(""),g=new kn("<div>".concat(f,"</div>"),this);f=g.toHTML(h,p);var m=new kn(f,this).toText(this.schema,!0);return{html:f,text:m}}}else if(!(null===c||void 0===c?void 0:c.isEditable))return}var v,b=this.node,y=this.list,w=t.startNode.closest("li");if(w&&b.isCustomize(w)){var x=t.endNode.closest("li");if(!w.equal(x)||y.isLast(t)&&y.isFirst(t))if(y.isFirst(t)){var C=w.parent(),k=w.getIndex();C&&t.setStart(C,k<0?0:k)}else{var A,S,E=w.parent(),O=t.createSelection(),T=O.getNode(w,"center",!0);if(null===(A=O.anchor)||void 0===A||A.remove(),null===(S=O.focus)||void 0===S||S.remove(),pe(this)&&this.change.combinText(),T.length>0){var _=!1;T.each((function(t,e){var n=T.eq(e);_||"li"!==(null===n||void 0===n?void 0:n.name)?_&&(null===n||void 0===n||n.remove()):_=!0}));var M=w.first(),N=M?this.card.find(M):void 0;N&&(v=T,this.list.addCardToCustomize(v,N.name,N.getValue()),E&&b.wrap(v,null===E||void 0===E?void 0:E.clone()))}}}var P=t.enlargeToElementNode(!0).cloneContents(),L=[];if(a.isText()&&1===P.childNodes.length&&(null===(n=P.firstChild)||void 0===n?void 0:n.nodeType)===Node.TEXT_NODE){var D=a.parent();while(D&&(b.isMark(D)||b.isInline(D)))L.push(D.clone(!1).get()),D=D.parent()}P.querySelectorAll("li").forEach((function(t){var e,n,i=He(t),o=i.attributes(Q);if(o){var a=null===(e=r.container.get())||void 0===e?void 0:e.querySelector("[".concat(Q,"=").concat(o,"]"));b.isCustomize(i)&&!(null===(n=i.first())||void 0===n?void 0:n.isCard())&&(null===a||void 0===a?void 0:a.firstChild)&&i.prepend(b.clone(He(a.firstChild),!0,!1));var s=null===a||void 0===a?void 0:a.parentElement;s=s?He(s.cloneNode(!1)):null;var l=t.parentElement;!(a&&s&&b.isList(s))||l&&b.isList(l)||("ol"===s.name&&s.removeAttributes("start"),b.wrap(t,s))}}));var j=l(L),I=j.inner,R=j.outter,F=[];P.childNodes.forEach((function(t){var e=He(t);(b.isList(e)||"li"===e.name)&&F.push(e)})),this.nodeId.generateAll(He(P),!0),this.list.merge(F);var B=new kn(P,this),z=B.toHTML(I,R),H=new kn(z,this).toText(this.schema,!0);return{html:z,text:H}}}}},{key:"destroy",value:function(){this.container.removeAttributes(J),this.event.destroy(),this.plugin.destroy(),this.card.destroy(),this.container.empty()}}]),t}(),so=' .data-icon {\n font-family: "data-icon" !important;\n font-size: 16px;\n font-style: normal;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n .data-icon-block-image:before {\n content: "\\ea20";\n }\n\n .data-icon-inline-image:before {\n content: "\\e601";\n }\n\n .data-icon-no-border:before {\n content: "\\e608";\n }\n\n .data-icon-line-height:before {\n content: "\\e697";\n }\n\n .data-icon-text:before {\n content: "\\e600";\n }\n\n .data-icon-comment:before {\n content: "\\e73e";\n }\n\n .data-icon-huanyuan:before {\n content: "\\e60a";\n }\n\n .data-icon-label:before {\n content: "\\e714";\n }\n\n .data-icon-video:before {\n content: "\\e741";\n }\n\n .data-icon-table:before {\n content: "\\e6a8";\n }\n\n .data-icon-h:before {\n content: "\\e7a0";\n }\n\n .data-icon-collapse-subtree:before {\n content: "\\e754";\n }\n\n .data-icon-expand-subtree:before {\n content: "\\e792";\n }\n\n .data-icon-sub-node:before {\n content: "\\e78e";\n }\n\n .data-icon-sister-node:before {\n content: "\\e784";\n }\n\n .data-icon-sup:before {\n content: "\\e790";\n }\n\n .data-icon-sub:before {\n content: "\\e75a";\n }\n\n .data-icon-maximize:before {\n content: "\\e752";\n }\n\n .data-icon-codeblock:before {\n content: "\\e709";\n }\n\n .data-icon-emoji:before {\n content: "\\e73a";\n }\n\n .data-icon-h4:before {\n content: "\\e759";\n }\n\n .data-icon-h1:before {\n content: "\\e75b";\n }\n\n .data-icon-h5:before {\n content: "\\e75c";\n }\n\n .data-icon-h2:before {\n content: "\\e75d";\n }\n\n .data-icon-h3:before {\n content: "\\e760";\n }\n\n .data-icon-h6:before {\n content: "\\e761";\n }\n\n .data-icon-liuchengtu:before {\n content: "\\e61c";\n }\n\n .data-icon-website:before {\n content: "\\e694";\n }\n\n .data-icon-preferences:before {\n content: "\\e788";\n }\n\n .data-icon-hr:before {\n content: "\\e76a";\n }\n\n .data-icon-task-list:before {\n content: "\\e79f";\n }\n\n .data-icon-unordered-list:before {\n content: "\\e777";\n }\n\n .data-icon-ordered-list:before {\n content: "\\e795";\n }\n\n .data-icon-arrow-left:before {\n content: "\\e748";\n }\n\n .data-icon-arrow-up:before {\n content: "\\e769";\n }\n\n .data-icon-arrow-right:before {\n content: "\\e779";\n }\n\n .data-icon-arrow-down:before {\n content: "\\e79a";\n }\n\n .data-icon-moremark:before {\n content: "\\e772";\n }\n\n .data-icon-clean:before {\n content: "\\e74d";\n }\n\n .data-icon-paintformat:before {\n content: "\\e756";\n }\n\n .data-icon-lock:before {\n content: "\\e768";\n }\n\n .data-icon-loading:before {\n content: "\\e76b";\n }\n\n .data-icon-unlock:before {\n content: "\\e796";\n }\n\n .data-icon-collapse:before {\n content: "\\e79e";\n }\n\n .data-icon-align-bottom:before {\n content: "\\e72b";\n }\n\n .data-icon-attachment:before {\n content: "\\e72c";\n }\n\n .data-icon-bold:before {\n content: "\\e72d";\n }\n\n .data-icon-border-color:before {\n content: "\\e72e";\n }\n\n .data-icon-border-all:before {\n content: "\\e72f";\n }\n\n .data-icon-border-inner:before {\n content: "\\e730";\n }\n\n .data-icon-border-left:before {\n content: "\\e731";\n }\n\n .data-icon-border-bottom:before {\n content: "\\e732";\n }\n\n .data-icon-border-none:before {\n content: "\\e733";\n }\n\n .data-icon-box:before {\n content: "\\e734";\n }\n\n .data-icon-border-outer:before {\n content: "\\e735";\n }\n\n .data-icon-border-right:before {\n content: "\\e736";\n }\n\n .data-icon-clear:before {\n content: "\\e737";\n }\n\n .data-icon-close:before {\n content: "\\e738";\n }\n\n .data-icon-code-example:before {\n content: "\\e739";\n }\n\n .data-icon-clip:before {\n content: "\\e73b";\n }\n\n .data-icon-border-up:before {\n content: "\\e73c";\n }\n\n .data-icon-code:before {\n content: "\\e73d";\n }\n\n .data-icon-command:before {\n content: "\\e73f";\n }\n\n .data-icon-compact-display:before {\n content: "\\e740";\n }\n\n .data-icon-copy:before {\n content: "\\e742";\n }\n\n .data-icon-download:before {\n content: "\\e743";\n }\n\n .data-icon-deletecolumn:before {\n content: "\\e744";\n }\n\n .data-icon-cut:before {\n content: "\\e745";\n }\n\n .data-icon-decreasedecimalplace:before {\n content: "\\e746";\n }\n\n .data-icon-drag:before {\n content: "\\e747";\n }\n\n .data-icon-delete:before {\n content: "\\e749";\n }\n\n .data-icon-drag-circle:before {\n content: "\\e74a";\n }\n\n .data-icon-deleterow:before {\n content: "\\e74b";\n }\n\n .data-icon-edit:before {\n content: "\\e74c";\n }\n\n .data-icon-filter:before {\n content: "\\e74e";\n }\n\n .data-icon-expand:before {\n content: "\\e74f";\n }\n\n .data-icon-error:before {\n content: "\\e750";\n }\n\n .data-icon-freezerowcoloum:before {\n content: "\\e751";\n }\n\n .data-icon-freezefirstrow:before {\n content: "\\e753";\n }\n\n .data-icon-freezzecolumn:before {\n content: "\\e755";\n }\n\n .data-icon-border-style:before {\n content: "\\e757";\n }\n\n .data-icon-gotolink:before {\n content: "\\e758";\n }\n\n .data-icon-increasedecimalplace:before {\n content: "\\e75e";\n }\n\n .data-icon-insertrowbelow:before {\n content: "\\e75f";\n }\n\n .data-icon-image:before {\n content: "\\e762";\n }\n\n .data-icon-italic:before {\n content: "\\e763";\n }\n\n .data-icon-indent:before {\n content: "\\e764";\n }\n\n .data-icon-insertrowabove:before {\n content: "\\e765";\n }\n\n .data-icon-insertrowright:before {\n content: "\\e766";\n }\n\n .data-icon-left-circle-fill:before {\n content: "\\e767";\n }\n\n .data-icon-link:before {\n content: "\\e76c";\n }\n\n .data-icon-keyboard:before {\n content: "\\e76d";\n }\n\n .data-icon-more:before {\n content: "\\e76e";\n }\n\n .data-icon-merge-cells:before {\n content: "\\e76f";\n }\n\n .data-icon-outdent:before {\n content: "\\e770";\n }\n\n .data-icon-mention:before {\n content: "\\e771";\n }\n\n .data-icon-plus:before {\n content: "\\e773";\n }\n\n .data-icon-minus-circle-o:before {\n content: "\\e774";\n }\n\n .data-icon-highlight:before {\n content: "\\e775";\n }\n\n .data-icon-paste:before {\n content: "\\e776";\n }\n\n .data-icon-insertrowleft:before {\n content: "\\e778";\n }\n\n .data-icon-quote:before {\n content: "\\e77a";\n }\n\n .data-icon-plus-circle-o:before {\n content: "\\e77b";\n }\n\n .data-icon-right-circle-fill:before {\n content: "\\e77c";\n }\n\n .data-icon-question-circle-o:before {\n content: "\\e77d";\n }\n\n .data-icon-preview:before {\n content: "\\e77e";\n }\n\n .data-icon-reload:before {\n content: "\\e77f";\n }\n\n .data-icon-rotate-left:before {\n content: "\\e780";\n }\n\n .data-icon-math:before {\n content: "\\e781";\n }\n\n .data-icon-overflow:before {\n content: "\\e782";\n }\n\n .data-icon-redo:before {\n content: "\\e783";\n }\n\n .data-icon-searchreplace:before {\n content: "\\e785";\n }\n\n .data-icon-save:before {\n content: "\\e786";\n }\n\n .data-icon-singleselect:before {\n content: "\\e787";\n }\n\n .data-icon-rotate-right:before {\n content: "\\e789";\n }\n\n .data-icon-sort-ascending:before {\n content: "\\e78a";\n }\n\n .data-icon-sort-descending:before {\n content: "\\e78b";\n }\n\n .data-icon-toc:before {\n content: "\\e78c";\n }\n\n .data-icon-solit-cells:before {\n content: "\\e78d";\n }\n\n .data-icon-translate:before {\n content: "\\e78f";\n }\n\n .data-icon-successful:before {\n content: "\\e791";\n }\n\n .data-icon-strikethrough:before {\n content: "\\e793";\n }\n\n .data-icon-undo:before {\n content: "\\e794";\n }\n\n .data-icon-underline:before {\n content: "\\e797";\n }\n\n .data-icon-unlink:before {\n content: "\\e798";\n }\n\n .data-icon-wrap:before {\n content: "\\e799";\n }\n\n .data-icon-upload:before {\n content: "\\e79b";\n }\n\n .data-icon-zoom-out:before {\n content: "\\e79c";\n }\n\n .data-icon-zoom-in:before {\n content: "\\e79d";\n }\n\n .data-icon-align-center:before {\n content: "\\e725";\n }\n\n .data-icon-align-justify:before {\n content: "\\e726";\n }\n\n .data-icon-align-left:before {\n content: "\\e727";\n }\n\n .data-icon-align-top:before {\n content: "\\e728";\n }\n\n .data-icon-align-right:before {\n content: "\\e729";\n }\n\n .data-icon-align-middle:before {\n content: "\\e72a";\n }\n\n.data-anticon {\n display: inline-block;\n font-style: normal;\n vertical-align: -0.125em;\n text-align: center;\n text-transform: none;\n line-height: 0;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n}\n\n.data-anticon svg {\n display: inline-block;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes loadingCircle {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.data-anticon .data-anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n.data-anticon > * {\n line-height: 1;\n}\n\n.am-engine {\n position: relative;\n background-color: #FFFFFF;\n}\n\n.am-engine.am-engine-placeholder:before {\n content: attr(data-placeholder);\n pointer-events: none;\n position: absolute;\n color: #bbbfc4;\n height: 0;\n}\n\n.am-engine ::-moz-selection {\n background: rgba(180, 213, 254, 0.5) !important;\n color: inherit!important;\n}\n\n.am-engine ::selection {\n background: rgba(180, 213, 254, 0.5) !important;\n color: inherit!important;\n}\n\n.am-engine , .am-engine-view {\n font-family: \'Chinese Quote\', \'Segoe UI\', Roboto, \'PingFang SC\', \'Hiragino Sans GB\', \'Microsoft YaHei\', \'Helvetica Neue\', Helvetica, Arial, sans-serif, \'Apple Color Emoji\';\n\tword-wrap: break-word;\n\toutline-style: none;\n\twhite-space: pre-wrap;\n -webkit-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n font-size: 14px;\n line-height: 1.74;\n color: #262626;\n letter-spacing: .05em;\n /* pt / px 换算表https://websemantics.uk/articles/font-size-conversion/ */\n}\n\n.am-engine > *:first-child,.am-engine-view > *:first-child {\n\tmargin-top: 0 !important;\n}\n\n.am-engine p , .am-engine-view p {\n white-space: normal;\n margin: 0;\n line-height: 1.74;\n}\n\n.am-engine [contenteditable="true"],.am-engine-view [contenteditable="true"] {\n\toutline-style: none;\n}\n\n.am-engine .selection-transparent::-moz-selection,.am-engine-view .selection-transparent::-moz-selection {\n\tbackground: transparent;\n}\n\n.am-engine .selection-transparent::selection,.am-engine-view .selection-transparent::selection {\n\tbackground: transparent;\n}\n/*---------------------------卡片 begin-----------------------*/\n\n.am-engine [data-card-type], .am-engine-view [data-card-type] {\n white-space: normal;\n}\n.am-engine span[data-card-type="inline"],.am-engine-view span[data-card-type="inline"] {\n\tdisplay: inline-block;\n\ttext-indent: 0;\n\tvertical-align: baseline;\n\twhite-space: initial;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element],.am-engine-view span[data-card-type="inline"] span[data-card-element] {\n\tdisplay: inline-block;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="center"],.am-engine-view span[data-card-type="inline"] span[data-card-element="center"] {\n\tvertical-align: bottom;\n border-radius: 2px;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="left"],\n.am-engine-view span[data-card-type="inline"] span[data-card-element="left"],\n.am-engine span[data-card-type="inline"] span[data-card-element="right"],.am-engine-view span[data-card-type="inline"] span[data-card-element="right"] {\n\ttext-align: left;\n\t-webkit-user-select: text;\n\t -moz-user-select: text;\n\t user-select: text;\n min-width: 1px;\n background: transparent;\n bottom: 0;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="left"],\n.am-engine-view span[data-card-type="inline"] span[data-card-element="left"] {\n left: -1px;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="right"],.am-engine-view span[data-card-type="inline"] span[data-card-element="right"] {\n right: -1px;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="left"]::-moz-selection,\n.am-engine-view span[data-card-type="inline"] span[data-card-element="left"]::-moz-selection,\n.am-engine span[data-card-type="inline"] span[data-card-element="right"]::-moz-selection,.am-engine-view span[data-card-type="inline"] span[data-card-element="right"]::-moz-selection {\n background: transparent !important;\n}\n\n.am-engine span[data-card-type="inline"] span[data-card-element="left"]::selection,\n.am-engine-view span[data-card-type="inline"] span[data-card-element="left"]::selection,\n.am-engine span[data-card-type="inline"] span[data-card-element="right"]::selection,.am-engine-view span[data-card-type="inline"] span[data-card-element="right"]::selection {\n background: transparent !important;\n}\n\n.am-engine div[data-card-type="block"],.am-engine-view div[data-card-type="block"],.am-engine span[data-card-type="inline"].data-card-block,.am-engine-view span[data-card-type="inline"].data-card-block {\n\tdisplay: block;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"],.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"],.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"],.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"],.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"],.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"],.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"],.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"] {\n\tbottom: 0;\n\tposition: absolute;\n\twidth: 2px;\n\toverflow: hidden;\n\toutline: none;\n\ttext-align: left;\n\ttext-indent: 0;\n\t-webkit-box-flex: 0;\n\tflex: 0 0 auto;\n\t-webkit-user-select: text;\n\t-moz-user-select: text;\n\t user-select: text;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"],.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"],.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"],.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"] {\n\tleft: -2px;\n\ttext-align: left;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"],.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"],.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"],.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"] {\n\tright: -2px;\n\ttext-align: right;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"]::-moz-selection,\n.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"]::-moz-selection,\n.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"]::-moz-selection,\n.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"]::-moz-selection {\n background: transparent !important;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"]::selection,\n.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="left"]::selection,\n.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"]::selection,\n.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="left"]::selection {\n background: transparent !important;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"]::-moz-selection,\n.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"]::-moz-selection,\n.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"]::-moz-selection,\n.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"]::-moz-selection {\n\tbackground: transparent !important;\n}\n\n.am-engine div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"]::selection,\n.am-engine-view div[data-card-type="block"] > div[data-card-element="body"] > span[data-card-element="right"]::selection,\n.am-engine span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"]::selection,\n.am-engine-view span[data-card-type="inline"].data-card-block > div[data-card-element="body"] > span[data-card-element="right"]::selection {\n\tbackground: transparent !important;\n}\n\n.am-engine span[data-card-element="body"],.am-engine-view span[data-card-element="body"],.am-engine div[data-card-element="body"],.am-engine-view div[data-card-element="body"] {\n\tposition: relative;\n}\n\n.am-engine span[data-card-element="body"] [data-card-element="center"],.am-engine-view span[data-card-element="body"] [data-card-element="center"],.am-engine div[data-card-element="body"] [data-card-element="center"],.am-engine-view div[data-card-element="body"] [data-card-element="center"] {\n\t-webkit-user-select: text;\n\t-moz-user-select: text;\n\t user-select: text;\n}\n.am-engine span[data-card-element="body"] [data-element="editable"],.am-engine div[data-card-element="body"] [data-element="editable"]\n{\n cursor: text;\n}\n/*---------------------------卡片 end-----------------------*/\n';pn(so);var lo=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(t,r){var i;Object(c["a"])(this,n),i=e.call(this,t,r),i._readonly=!1,i._container=void 0,i.kind="engine",i.typing=void 0,i.ot=void 0,i.change=void 0,i.history=void 0,i.hotkey=void 0,i.options=Object(l["a"])(Object(l["a"])({},i.options),r),i.history=new wr(Object(d["a"])(i)),i._container=new $r(i.container,{engine:Object(d["a"])(i),lang:i.options.lang,className:i.options.className,tabIndex:i.options.tabIndex,placeholder:i.options.placeholder,autoPrepend:i.options.autoPrepend,autoAppend:i.options.autoAppend}),i.root=He(i.options.root||i.container.parent()||ce().body);var o=i.root.css("position");return o&&"static"!==o||i.root.css("position","relative"),i._container.init(),i.change=new Pn(Object(d["a"])(i),{onChange:function(t){return i.trigger("change",t)},onSelect:function(){return i.trigger("select")},onSelectStart:function(){return i.trigger("selectStart")},onSelectEnd:function(){return i.trigger("selectEnd")},onRealtimeChange:function(t){i.trigger("realtimeChange",t)},onSetValue:function(){return i.trigger("afterSetValue")}}),i.change.init(),i.typing=new qr(Object(d["a"])(i)),i._readonly=void 0!==i.options.readonly&&i.options.readonly,i._container.setReadonly(i._readonly),i.hotkey=new xr(Object(d["a"])(i)),i.init(),i.ot=new br(Object(d["a"])(i)),i.isEmpty()&&i._container.showPlaceholder(),i.ot.initLocal(),i}return Object(u["a"])(n,[{key:"readonly",get:function(){return this._readonly},set:function(t){this.readonly!==t&&(t?(this.hotkey.disable(),this._container.setReadonly(!0),this.ot.stopMutation()):(this.hotkey.enable(),this._container.setReadonly(!1),this.ot.startMutation()),this._readonly=t,this.card.reRender(),this.trigger("readonly",t))}},{key:"isFocus",value:function(){return this._container.isFocus()}},{key:"isEmpty",value:function(){return this.change.isEmpty()}},{key:"focus",value:function(t){this.change.range.focus(t)}},{key:"blur",value:function(){this.change.range.blur()}},{key:"getValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.change.getValue({ignoreCursor:t});return t?Ke.removeTags(e):e}},{key:"getValueAsync",value:function(){var t=Object(s["a"])(v.a.mark((function t(){var e,n,r=this,i=arguments;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]&&i[0],n=i.length>1?i[1]:void 0,t.abrupt("return",new Promise(function(){var t=Object(s["a"])(v.a.mark((function t(i,o){var s,l,c;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:s=v.a.mark((function t(e){var i,s;return v.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=r.plugin.components[e],t.next=3,new Promise((function(t){i.waiting?i.waiting(n).then((function(){return t(!0)})).catch(t):t(!0)}));case 3:if(s=t.sent,"object"!==Object(a["a"])(s)){t.next=7;break}return o(s),t.abrupt("return",{v:void 0});case 7:case"end":return t.stop()}}),t)})),t.t0=v.a.keys(r.plugin.components);case 2:if((t.t1=t.t0()).done){t.next=10;break}return l=t.t1.value,t.delegateYield(s(l),"t2",5);case 5:if(c=t.t2,"object"!==Object(a["a"])(c)){t.next=8;break}return t.abrupt("return",c.v);case 8:t.next=2;break;case 10:i(r.getValue(e));case 11:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()));case 3:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}()},{key:"getHtml",value:function(){var t=He(this.container[0].cloneNode(!0));return t.removeAttributes(Ue),t.removeAttributes("tabindex"),t.removeAttributes("autocorrect"),t.removeAttributes("autocomplete"),t.removeAttributes("spellcheck"),t.removeAttributes("data-gramm"),t.removeAttributes(Ur),t.removeClass(Wr),t.removeAttributes("role"),new kn(t,this).toHTML()}},{key:"initDocOnReadonly",value:function(){var t,e;this.readonly&&!this.ot.isRemote&&((null===(t=this.ot.doc)||void 0===t?void 0:t.type)?this.ot.doc.data=on(this.container):null===(e=this.ot.doc)||void 0===e||e.create(on(this.container)))}},{key:"setValue",value:function(t,e){return t=this.trigger("beforeSetValue",t)||t,this.change.setValue(t,void 0,e),this.normalize(),this.nodeId.generateAll(this.container),this.initDocOnReadonly(),this}},{key:"setHtml",value:function(t,e){var n=this;return this.change.setHtml(t,(function(t){n.normalize(),n.container.allChildren("editable").forEach((function(t){n.node.isInline(t)?n.inline.repairCursor(t):n.node.isMark(t)&&n.mark.repairCursor(t)})),e&&e(t)})),this.nodeId.generateAll(this.container),this.initDocOnReadonly(),this}},{key:"setMarkdown",value:function(t,e){var n=this;return this.change.setMarkdown(t,(function(t){n.normalize(),n.container.allChildren("editable").forEach((function(t){n.node.isInline(t)?n.inline.repairCursor(t):n.node.isMark(t)&&n.mark.repairCursor(t)})),e&&e(t)})),this.nodeId.generateAll(this.container),this.initDocOnReadonly(),this}},{key:"setJsonValue",value:function(t,e){var n=He(nn(t)),r=this.node.html(n);return this.change.setValue(r,void 0,e),this.normalize(),this.nodeId.generateAll(this.container),this.initDocOnReadonly(),this}},{key:"getJsonValue",value:function(){return on(this.container)}},{key:"getText",value:function(t){return new kn(this.container,this).toText(this.schema,t)}},{key:"normalize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.container,n=He("<p />"),r=e.children();r.each((function(e,i){var o=r.eq(i);o&&(t.node.isBlock(o)?(n.get().childNodes.length>0&&o.before(n),n=He("<p />")):o.isCursor()||n.append(o))})),n.get().childNodes.length>0&&e.append(n),r=e.children(),r.each((function(e,n){var i=r.eq(n);if(i&&(t.node.removeMinusStyle(i,"text-indent"),t.node.isRootBlock(i))){var o=i.get().childNodes.length;if(0===o)i.append(He("<br />"));else{var a=i.first();1===o&&"span"===(null===a||void 0===a?void 0:a.name)&&[pt,dt,ht].indexOf(a.attributes(J))>=0&&i.prepend(He("<br />"))}}}))}},{key:"showPlaceholder",value:function(){this._container.showPlaceholder()}},{key:"hidePlaceholder",value:function(){this._container.hidePlaceholder()}},{key:"destroy",value:function(){this._container.destroy(),this.change.destroy(),this.hotkey.destroy(),this.typing.destroy(),this.ot&&this.ot.destroy(),Object(h["a"])(Object(p["a"])(n.prototype),"destroy",this).call(this)}}]),n}(ao),co='.card-maximize-header {\r\n position: fixed !important;\r\n top: 0;\r\n right: 0;\r\n left: 0;\r\n z-index: 9999;\r\n height: 56px;\r\n background: #fff;\r\n border-bottom: 1px solid #e8e8e8;\r\n width: 100%;\r\n}\r\n\r\n.card-maximize-header .header-crumb {\r\n float: left;\r\n line-height: 32px;\r\n display: flex;\r\n height: 100%;\r\n align-items: center;\r\n -webkit-box-align: center;\r\n -ms-flex-align: center;\r\n}\r\n\r\n.card-maximize-header .header-crumb a\r\n{\r\n color: #595959 !important;\r\n font-size: 14px;\r\n cursor: pointer;\r\n}\r\n\r\n.card-maximize-header .header-crumb .split {\r\n display: inline-block;\r\n vertical-align: middle;\r\n padding: 0 15px;\r\n font-size: 20px;\r\n padding-right: 8px;\r\n font-weight: 200;\r\n margin: 0 8px;\r\n}\r\n\r\n.card-maximize-header .header-crumb .split + a {\r\n display: inline-block;\r\n vertical-align: middle;\r\n}\r\n\r\n.card-maximize-header .header-crumb .split + a:hover {\r\n\tcolor: #8C8C8C;\r\n}\r\n\r\n.data-card-block-max > [data-card-element="body"] > [data-card-element="center"], .data-card-block-max > [data-card-element="body"] > [data-card-element="center"].data-card-background-selected {\r\n top: 96px;\r\n background: #fafafa !important;\r\n position: fixed!important;\r\n right: 0;\r\n bottom: 0;\r\n left: 0;\r\n z-index: 124;\r\n overflow: auto;\r\n padding: 20px;\r\n}\r\n\r\n.am-engine-mobile .data-card-block-max > [data-card-element="body"] > [data-card-element="center"],.am-engine-view .data-card-block-max > [data-card-element="body"] > [data-card-element="center"] {\r\n top:56px;\r\n}';pn(co);var uo=function(){function t(e,n){Object(c["a"])(this,t),this.card=void 0,this.node=void 0,this.editor=void 0,this.editor=e,this.card=n}return Object(u["a"])(t,[{key:"restore",value:function(){this.card.root.removeClass("data-card-block-max"),this.node&&(this.node.remove(),this.node=void 0);var t=this.editor;pe(t)&&(t.trigger("card:minimize",this.card),t.history.reset())}},{key:"maximize",value:function(){var t=this;if(!this.node){var e=this.editor,n=e.language,r=n.get("maximize","back").toString(),i=He('<div class="card-maximize-header" '.concat(st,'="true" ').concat(J,'="').concat(nt,'">\n <div class="header-crumb">\n <a class="split">\n <span class="data-icon data-icon-arrow-left"></span>\n </a>\n <a>').concat(r,"</a>\n </div>\n </div>"));i.on("click",(function(t){t.stopPropagation()})),this.card.root.addClass("data-card-block-max");var o=i.find(".header-crumb");o.on("click",(function(){t.card.minimize()}));var a=this.card.findByKey("body");null===a||void 0===a||a.prepend(i),pe(e)&&(e.trigger("card:maximize",this.card),e.history.reset()),this.node=i}}}]),t}(),ho=".data-card-resize {\n position: absolute;\n bottom: -3px;\n right: 0px;\n left: 0px;\n margin: 0 auto;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.data-card-resize-btn{\n background: #d9dbdd;\n border-radius: 3px;\n height: 6px;\n padding: 0 50px;\n display: block;\n}\n\n.data-card-resize-btn svg {\n display: block;\n color: #999;\n}\n\n.data-card-resize-btn:hover {\n cursor: row-resize;\n}";pn(ho);var po=function(){function t(e,n){var r=this;Object(c["a"])(this,t),this.editor=void 0,this.card=void 0,this.point=void 0,this.options={},this.component=void 0,this.start=!1,this.touchStart=function(t){t.preventDefault(),t.cancelBubble=!0,r.point={x:t.targetTouches[0].clientX,y:t.targetTouches[0].clientY};var e=r.options.dragStart;e&&e(r.point)},this.dragStart=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0,r.point={x:t.clientX,y:t.clientY};var e=r.options.dragStart;e&&e(r.point)},this.dragMove=function(t){if(r.point){var e=r.options.dragMove;e&&e(t.clientY-r.point.y)}},this.touchMove=function(t){if(t.preventDefault(),r.point){var e=r.options.dragMove;e&&e(t.targetTouches[0].clientY-r.point.y)}},this.dragEnd=function(t){r.point=void 0;var e=r.options.dragEnd;e&&e()},this.editor=e,this.card=n}return Object(u["a"])(t,[{key:"create",value:function(t){this.options=t;var e=He('<div class="data-card-resize" '.concat(J,'="').concat(nt,'" draggable="true"><span class="data-card-resize-btn"><svg viewBox="0 0 3413 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="8px" height="6px"><path d="M341.333333 341.333333h2730.666667a170.666667 170.666667 0 0 0 0-341.333333H341.333333a170.666667 170.666667 0 1 0 0 341.333333zM341.333333 1024h2730.666667a170.666667 170.666667 0 0 0 0-341.333333H341.333333a170.666667 170.666667 0 0 0 0 341.333333z"></path></svg></span></div>'));Rt?(e.on("touchstart",this.touchStart),e.on("touchmove",this.touchMove),e.on("touchend",this.dragEnd),e.on("touchcancel",this.dragEnd)):(e.on("dragstart",this.dragStart),document.addEventListener("mousemove",this.dragMove),document.addEventListener("mouseup",this.dragEnd)),e.on("click",(function(t){t.stopPropagation()})),this.component=e}},{key:"render",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.card.root,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80;this.start=!1;var r=0,i=0,o=this.card;this.create({dragStart:function(){r=e.height(),t.start=!0,o.onActivate(!1)},dragMove:function(o){t.start&&(i=r+o,i=i<n?n:i,e.css("height","".concat(i,"px")))},dragEnd:function(){t.start&&(o.setValue({height:e.height()}),t.start=!1,o.onActivate(!0))}});var a=this.component;if(a){o.activated||a.hide(),e.append(a);var s=o.getValue()||{};s.height&&e.css("height","".concat(s.height,"px"))}}},{key:"show",value:function(){var t;null===(t=this.component)||void 0===t||t.show()}},{key:"hide",value:function(){var t;this.start||null===(t=this.component)||void 0===t||t.hide()}},{key:"destroy",value:function(){var t=this.component;if(Rt){if(!t)return;t.off("touchstart",this.touchStart),t.off("touchmove",this.touchMove),t.off("touchend",this.dragEnd),t.off("touchcancel",this.dragEnd)}else null===t||void 0===t||t.off("dragstart",this.dragStart),document.removeEventListener("mousemove",this.dragMove),document.removeEventListener("mouseup",this.dragEnd);null===t||void 0===t||t.remove()}}]),t}(),fo=Object(_["a"])("editor"),go=Object(_["a"])("container"),mo=Object(_["a"])("target"),vo=Object(_["a"])("align"),bo=Object(_["a"])("offset"),yo=Object(_["a"])("root"),wo=Object(_["a"])("onUpdate"),xo=Object(_["a"])("updateTimeout"),Co=Object(_["a"])("observer"),ko=function(){function t(e){var n=this;Object(c["a"])(this,t),Object.defineProperty(this,fo,{writable:!0,value:void 0}),Object.defineProperty(this,go,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,vo,{writable:!0,value:"bottomLeft"}),Object.defineProperty(this,bo,{writable:!0,value:[0,0]}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:void 0}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:void 0}),this.updateListener=function(){Object(T["a"])(n,xo)[xo]&&clearTimeout(Object(T["a"])(n,xo)[xo]),Object(T["a"])(n,xo)[xo]=setTimeout((function(){n.update()}),50)},this.update=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(Object(T["a"])(n,go)[go]&&0!==Object(T["a"])(n,go)[go].length&&Object(T["a"])(n,mo)[mo]&&0!==Object(T["a"])(n,mo)[mo].length){var e=Object(j["c"])(Object(T["a"])(n,go)[go].get(),Object(T["a"])(n,mo)[mo].get(),Object(l["a"])(Object(l["a"])({},jn[Object(T["a"])(n,vo)[vo]]),{},{targetOffset:Object(T["a"])(n,bo)[bo]}));if(Object(T["a"])(n,wo)[wo]&&t){var r=Object.keys(jn).find((function(t){var n=jn[t].points;return n[0]===e.points[0]&&n[1]===e.points[1]}));Object(T["a"])(n,go)[go].attributes("data-placement",r),Object(T["a"])(n,wo)[wo](Object(l["a"])(Object(l["a"])({},e),{},{align:r}))}}},Object(T["a"])(this,fo)[fo]=e}return Object(u["a"])(t,[{key:"bind",value:function(t,e){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(T["a"])(this,vo)[vo],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(T["a"])(this,bo)[bo],a=arguments.length>4?arguments[4]:void 0;(Object(T["a"])(this,go)[go]=t,Object(T["a"])(this,mo)[mo]=e,Object(T["a"])(this,vo)[vo]=i,Object(T["a"])(this,bo)[bo]=o,Object(T["a"])(this,yo)[yo]=He('<div style="position: absolute; top: 0px; left: 0px; width: 100%;"></div>'),Object(T["a"])(this,yo)[yo].append(Object(T["a"])(this,go)[go]),Object(T["a"])(this,fo)[fo].root.append(Object(T["a"])(this,yo)[yo]),Object(T["a"])(this,wo)[wo]=a,Rt||window.addEventListener("scroll",this.updateListener,{passive:!0}),window.addEventListener("resize",this.updateListener),pe(Object(T["a"])(this,fo)[fo])&&!Rt)&&(null===(n=Object(T["a"])(this,fo)[fo].scrollNode)||void 0===n||n.on("scroll",this.updateListener,{passive:!0}));if(e&&e.length>0){var s={width:e.width(),height:e.height()};"undefined"!==typeof ResizeObserver&&(Object(T["a"])(this,Co)[Co]=new ResizeObserver((function(){var t=e.width(),n=e.height();t===s.width&&n===s.height||(s={width:t,height:n},r.updateListener())})),Object(T["a"])(this,Co)[Co].observe(e.get()))}this.update()}},{key:"setOffset",value:function(t){Object(T["a"])(this,bo)[bo]=t}},{key:"destroy",value:function(){var t,e,n;(Object(T["a"])(this,wo)[wo]=void 0,Rt||window.removeEventListener("scroll",this.updateListener),window.removeEventListener("resize",this.updateListener),pe(Object(T["a"])(this,fo)[fo])&&!Rt)&&(null===(n=Object(T["a"])(this,fo)[fo].scrollNode)||void 0===n||n.off("scroll",this.updateListener));null===(t=Object(T["a"])(this,Co)[Co])||void 0===t||t.disconnect(),null===(e=Object(T["a"])(this,yo)[yo])||void 0===e||e.remove()}}]),t}(),Ao=".data-card-dnd {\n position: absolute;\n top: 0;\n left: -21px;\n right: auto;\n bottom: auto;\n width: 18px;\n height: 24px;\n line-height: 24px;\n font-size: 14px;\n font-weight: normal;\n display: none;\n opacity: 0;\n z-index: 125;\n transition: all 0.3s ease-in-out;\n background: rgba(255, 255, 255, 0.9);\n}\n\n.data-card-dnd-active {\n display: block;\n opacity: 1;\n cursor: pointer;\n}\n\n.data-card-dnd:hover {\n\tbackground: #f4f4f4;\n\tcolor: #595959;\n}\n\n.data-card-dnd-trigger {\n width: 18px;\n height: 24px;\n text-align: center;\n color: #BFBFBF;\n font-size: 16px;\n border-radius: 2px 2px;\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n\n.am-engine-view .data-toolbar-active {\n\tmin-width: 200px;\n}\n\n.data-card-toolbar.data-toolbar-block {\n\ttop: -48px;\n\tbottom: auto;\n\tdisplay: none;\n}\n\n.data-card-toolbar.data-card-toolbar-active {\n\tdisplay: block;\n}\n\n.data-card-toolbar.data-toolbar-active {\n\tdisplay: block;\n}";pn(Ao);var So=function(t){return-1===["button","input","dropdown","node","switch"].indexOf(t.type)},Eo=Object(_["a"])("hideTimeout"),Oo=Object(_["a"])("showTimeout"),To=Object(_["a"])("defaultAlign"),_o=Object(_["a"])("dndNode"),Mo=function(){function t(e,n){var r=this;Object(c["a"])(this,t),this.card=void 0,this.toolbar=void 0,this.editor=void 0,this.offset=void 0,this.position=void 0,this.dndPosition=void 0,Object.defineProperty(this,Eo,{writable:!0,value:null}),Object.defineProperty(this,Oo,{writable:!0,value:null}),Object.defineProperty(this,To,{writable:!0,value:"topLeft"}),Object.defineProperty(this,_o,{writable:!0,value:null}),this.clearHide=function(){Object(T["a"])(r,Eo)[Eo]&&clearTimeout(Object(T["a"])(r,Eo)[Eo]),Object(T["a"])(r,Eo)[Eo]=null},this.clearShow=function(){Object(T["a"])(r,Oo)[Oo]&&clearTimeout(Object(T["a"])(r,Oo)[Oo]),Object(T["a"])(r,Oo)[Oo]=null},this.enterHide=function(){r.clearShow(),Object(T["a"])(r,Eo)[Eo]=setTimeout((function(){var t,e;r.hide(),Object(T["a"])(r,Eo)[Eo]=null;var n=r.toolbar;null===n||void 0===n||null===(t=n.root)||void 0===t||t.off("mouseenter",r.clearHide),null===n||void 0===n||null===(e=n.root)||void 0===e||e.off("mouseleave",r.enterHide)}),200)},this.enterShow=function(){r.clearHide(),Object(T["a"])(r,Oo)[Oo]=setTimeout((function(){var t,e;Object(T["a"])(r,Oo)[Oo]=null,r.show();var n=r.toolbar;null===n||void 0===n||null===(t=n.root)||void 0===t||t.on("mouseenter",r.clearHide),null===n||void 0===n||null===(e=n.root)||void 0===e||e.on("mouseleave",r.enterHide)}),200)},this.editor=e,this.card=n,this.position=new ko(e),this.dndPosition=new ko(e),this.unbindEnterShow(),pe(e)&&!e.readonly||this.bindEnterShow()}return Object(u["a"])(t,[{key:"setDefaultAlign",value:function(t){Object(T["a"])(this,To)[To]=t}},{key:"bindEnterShow",value:function(){this.card.root.on("mouseenter",this.enterShow),this.card.root.on("mouseleave",this.enterHide)}},{key:"unbindEnterShow",value:function(){this.card.root.off("mouseenter",this.enterShow),this.card.root.off("mouseleave",this.enterHide)}},{key:"setOffset",value:function(t){this.offset=t}},{key:"getContainer",value:function(){var t;return null===(t=this.toolbar)||void 0===t?void 0:t.root}},{key:"getDefaultItem",value:function(t){var e=this,n=this.editor,r=n.language,i=n.clipboard,o=n.card;switch(t.type){case"separator":return{key:"separator",type:"node",node:t.node||He('<span class="data-toolbar-item-split"></span>')};case"copy":return{key:"copy",type:"button",content:t.content||'<span class="data-icon data-icon-copy"></span>',title:t.title||r.get("copy","title"),onClick:function(o,a){if(t.onClick)t.onClick(o,a);else{var s=i.copy(e.card.root[0],!0);s?n.messageSuccess("copy",r.get("copy","success")):n.messageError("copy",r.get("copy","error"))}}};case"delete":return{key:"delete",type:"button",content:t.content||'<span class="data-icon data-icon-delete"></span>',title:t.title||r.get("delete","title").toString(),onClick:function(n,r){t.onClick?t.onClick(n,r):o.remove(e.card.root)}};case"maximize":return{key:"maximize",type:"button",content:t.content||'<span class="data-icon data-icon-maximize"></span>',title:t.title||r.get("maximize","title").toString(),onClick:function(n,r){t.onClick?t.onClick(n,r):e.card.maximize()}};case"more":return{key:"more",type:"dropdown",content:t.content||'<span class="data-icon data-icon-more"></span>',title:t.title||r.get("more","title").toString(),items:t.items}}}},{key:"getItems",value:function(){var t=this;if(!this.card.toolbar)return[[],[]];var e=this.card.toolbar(),n=[];return e.forEach((function(e){if(So(e))switch(e.type){case"dnd":break;default:var r=t.getDefaultItem(e);r&&n.push(r)}else n.push(e)})),[n,e]}},{key:"create",value:function(){this.hide();var t=this.getItems(),e=Object(w["a"])(t,2),n=e[0],r=e[1];if(n.length>0){var i=r.find((function(t){return So(t)&&"dnd"===t.type}));if(i&&!Rt&&"dnd"===i.type){var o=this.editor,a=o.root,s=o.language,l=this.createDnd(i.content||'<span class="data-icon data-icon-drag"></span>',i.title||s.get("dnd","title").toString());a.append(l),Object(T["a"])(this,_o)[_o]=l}var c=new Qn({items:n});c.root.addClass("data-card-toolbar"),c.root.attributes(Mt,this.card.id),c.render(He(document.body)),c.hide(),this.toolbar=c}}},{key:"update",value:function(){var t,e=this.getItems(),n=Object(w["a"])(e,1),r=n[0];null===(t=this.toolbar)||void 0===t||t.update({items:r})}},{key:"hide",value:function(){var t;null===(t=Object(T["a"])(this,_o)[_o])||void 0===t||t.remove(),this.dndPosition.destroy(),this.hideCardToolbar()}},{key:"show",value:function(t){this.showCardToolbar(t)}},{key:"hideCardToolbar",value:function(){var t;null===(t=this.toolbar)||void 0===t||t.destroy(),this.position.destroy()}},{key:"showDnd",value:function(){var t=this;Object(T["a"])(this,_o)[_o]&&0!==Object(T["a"])(this,_o)[_o].length&&(this.card.isMaximize?Object(T["a"])(this,_o)[_o].removeClass("data-card-dnd-active"):Object(T["a"])(this,_o)[_o].length>0&&(Object(T["a"])(this,_o)[_o].addClass("data-card-dnd-active"),setTimeout((function(){t.dndPosition.bind(Object(T["a"])(t,_o)[_o],t.card.root,"leftTop",t.offset)}))))}},{key:"showCardToolbar",value:function(t){var e=this;this.create();var n=this.getContainer();if(n&&n.length>0){this.showDnd();var r=this.card;n.addClass("data-toolbar-active"),n.attributes("toolbar-trigger-key",r.constructor.cardName),this.toolbar&&this.toolbar.show();var i=Object(T["a"])(this,To)[To],o=this.position;setTimeout((function(){o.bind(n,r.isMaximize?r.getCenter().first():r.root,Object(T["a"])(e,To)[To],e.offset,(function(t){e.offset&&4===e.offset.length&&"bottomLeft"===t.align&&t.align!==i?(o.setOffset([e.offset[2],e.offset[3]]),i=t.align,o.update(!1)):e.offset&&t.align===Object(T["a"])(e,To)[To]&&t.align!==i&&(o.setOffset(e.offset),i=t.align,o.update(!1)),i=t.align}))}),10)}}},{key:"createDnd",value:function(t,e){var n=this,r=He("<div ".concat(J,'="').concat(nt,'" class="data-card-dnd" draggable="true" dnd-trigger-key="').concat(this.card.constructor.cardName,'" drag-card-trigger="').concat(this.card.id,'" ').concat(Ue,'="false">\n <div class="data-card-dnd-trigger">\n ').concat(t,"\n </div>\n </div>"));return r.on("mouseenter",(function(){Fn.show(r,e)})),r.on("mouseleave",(function(){Fn.hide()})),r.on("mousedown",(function(t){t.stopPropagation(),Fn.hide(),n.hideCardToolbar()})),r.on("mouseup",(function(){n.showCardToolbar()})),r}},{key:"destroy",value:function(){this.unbindEnterShow(),this.dndPosition.destroy(),this.position.destroy()}}]),t}(),No=function(){function t(e){var n,r=e.editor,i=e.value,o=e.root;Object(c["a"])(this,t),this.editor=void 0,this.root=void 0,this.toolbarModel=void 0,this.resizeModel=void 0,this.activatedByOther=!1,this.selectedByOther=!1,this.contenteditable=[],this.defaultMaximize=void 0,this.isMaximize=!1,this._id=void 0,this.resize=void 0,this.editor=r;var a=(null===(n=i)||void 0===n?void 0:n.type)||this.constructor.cardType,s="inline"===a?"span":"div";this.root=o||He("<".concat(s," />")),"string"===typeof i&&(i=ne(i)),i=i||{},i.id=this.getId(i.id),this._id=i.id,i.type=a,this.setValue(i),this.defaultMaximize=new uo(r,this)}return Object(u["a"])(t,[{key:"isEditable",get:function(){return this.contenteditable.length>0}},{key:"activated",get:function(){return this.root.hasClass("card-activated")}},{key:"setActivated",value:function(t){t?this.root.addClass("card-activated"):this.root.removeClass("card-activated")}},{key:"selected",get:function(){return this.root.hasClass("card-selected")}},{key:"setSelected",value:function(t){t?this.root.addClass("card-selected"):this.root.removeClass("card-selected")}},{key:"id",get:function(){if(this._id)return this._id;var t=this.root.attributes(xt);if(!t)return{};var e=ne(t);return"object"===Object(a["a"])(e)&&(null===e||void 0===e?void 0:e.id)||""}},{key:"name",get:function(){return this.root.attributes(bt)}},{key:"type",get:function(){var t=this.root.attributes(wt);if(!t){var e=this.root.attributes(xt),n=ne(e||"{}");t=(null===n||void 0===n?void 0:n.type)||this.constructor.cardType}return t},set:function(t){if(this.name&&t!==this.type){var e=this.editor.card,n=this.root.attributes(xt),r=ne(n||"{}"),i=e.replace(this,this.name,Object(l["a"])(Object(l["a"])({},r),{},{type:t}));e.render(i.root),i.activate(!1),e.activate(i.root)}}},{key:"loading",get:function(){return!!this.root.attributes(kt)}},{key:"init",value:function(){this.root.attributes(At,this.isEditable?"true":"false");var t=this.toolbarModel;null===t||void 0===t||t.hide(),null===t||void 0===t||t.destroy();var e=this.editor;this.toolbar&&(this.toolbarModel=new Mo(e,this)),this.resize&&(this.resizeModel=new po(e,this))}},{key:"getId",value:function(t){var e=[];if(this.editor.card.each((function(t){e.push(t.id)})),t&&e.indexOf(t)<0)return t;var n=Vt();while(e.indexOf(n)>=0)n=Vt();return n}},{key:"setValue",value:function(t){if(null!=t){var e=this.root.attributes(xt),n=ne(e||"{}");(null===n||void 0===n?void 0:n.id)&&delete t["id"],t=Object(l["a"])(Object(l["a"])({},n),t),t.type&&(null===n||void 0===n?void 0:n.type)!==t.type&&(this.type=t.type),this.root.attributes(xt,ee(t))}}},{key:"getValue",value:function(){var t=this.root.attributes(xt);return t?ne(t):{}}},{key:"find",value:function(t){return this.root.find(t)}},{key:"findByKey",value:function(t){var e=this.root.first()||He([]);if("body"===t||0===e.length)return e;var n=e.children(),r=["left","center","right"].indexOf(t);if(r>-1)return n.toArray().find((function(e){return e.attributes(Ct)===t}));var i=this.type===gn.BLOCK?"div":"span",o=this.find("".concat(i,"[").concat(Ct,"=").concat(t,"]"));return o.name===i&&o.attributes(Ct)===t?o:void 0}},{key:"activate",value:function(t){t?this.activated||(this.setActivated(t),this.onActivate(t)):this.activated&&(this.setActivated(t),this.onActivate(!1))}},{key:"select",value:function(t){pe(this.editor)&&!this.activatedByOther&&(t?this.selected||this.isMaximize||(this.setSelected(t),this.onSelect(t)):this.selected&&(this.setSelected(t),this.onSelect(!1)))}},{key:"getCenter",value:function(){var t=this.findByKey("center");return t||He([])}},{key:"isCenter",value:function(t){var e,n=t.closest(this.type===gn.BLOCK?"div[".concat(Ct,"=center]"):"span[".concat(Ct,"=center]"));return n.length>0&&!!(null===(e=this.findByKey("center"))||void 0===e?void 0:e.equal(n))}},{key:"isCursor",value:function(t){return this.isLeftCursor(t)||this.isRightCursor(t)}},{key:"isLeftCursor",value:function(t){var e;if(t.isElement()&&"left"!==t.attributes(Ct))return!1;var n=t.closest(Ot);return n.length>0&&!!(null===(e=this.findByKey("left"))||void 0===e?void 0:e.equal(n))}},{key:"isRightCursor",value:function(t){var e;if(t.isElement()&&"right"!==t.attributes(Ct))return!1;var n=t.closest(_t);return n.length>0&&!!(null===(e=this.findByKey("right"))||void 0===e?void 0:e.equal(n))}},{key:"focus",value:function(t,e){var n=this.findByKey("left"),r=this.findByKey("right");if(n&&0!==n.length&&r&&0!==r.length){var i=e?n:r;t.select(i,!0).shrinkToTextNode();var o=i.first();o&&(t.setStart(o,e?0:1),t.collapse(!0),pe(this.editor)&&this.editor.change.range.select(t),this.onFocus&&this.onFocus())}}},{key:"maximize",value:function(){var t;this.isMaximize=!0,this.defaultMaximize.maximize(),null===(t=this.toolbarModel)||void 0===t||t.show()}},{key:"minimize",value:function(){var t;this.isMaximize=!1,this.defaultMaximize.restore(),null===(t=this.toolbarModel)||void 0===t||t.show()}},{key:"onSelect",value:function(t){var e=this.constructor.selectStyleType;if(e!==vn.NONE){var n="data-card-".concat(e,"-selected"),r=this.getCenter();t?r.addClass(n):r.removeClass(n)}}},{key:"onSelectByOther",value:function(t,e){var n=this.getCenter(),r=this.constructor.selectStyleType;r===vn.BACKGROUND?n.css("background-color",t?e.rgb:""):n.css("outline",t?"2px solid "+e.color:"");var i="card-selected-other";return t?this.root.addClass(i):this.root.removeClass(i),n}},{key:"onActivate",value:function(t){var e,n;this.resize&&(t?null===(e=this.resizeModel)||void 0===e||e.show():null===(n=this.resizeModel)||void 0===n||n.hide())}},{key:"onActivateByOther",value:function(t,e){return this.onSelectByOther(t,e)}},{key:"initToolbar",value:function(){var t,e;this.toolbar?(this.toolbarModel||(this.toolbarModel=new Mo(this.editor,this)),this.activated&&this.toolbarModel.show()):(null===(t=this.toolbarModel)||void 0===t||t.hide(),null===(e=this.toolbarModel)||void 0===e||e.destroy(),this.toolbarModel=void 0)}},{key:"initResize",value:function(){if(this.resize){this.resizeModel||(this.resizeModel=new po(this.editor,this));var t,e="function"===typeof this.resize?this.resize():this.findByKey("body");if(e&&e.length>0)null===(t=this.resizeModel)||void 0===t||t.render(e)}}},{key:"didUpdate",value:function(){this.initResize(),this.initToolbar()}},{key:"beforeRender",value:function(){var t=this.getCenter(),e=He("<".concat(this.type===gn.BLOCK?"div":"span",' class="').concat(kt,'" ').concat(J,'="').concat(nt,'" />'));e.append('<svg viewBox="0 0 1024 1024" class="data-card-spin" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"> <path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg>'),t.empty().append(e)}},{key:"didRender",value:function(){var t=this;this.loading&&(this.find(".".concat(kt)).remove(),setTimeout((function(){t.root.removeAttributes(kt)}),200)),this.initResize(),this.initToolbar(),this.isEditable&&this.editor.nodeId.generateAll(this.getCenter().get())}},{key:"destroy",value:function(){var t,e,n,r;null===(t=this.toolbarModel)||void 0===t||t.hide(),null===(e=this.toolbarModel)||void 0===e||e.destroy(),this.toolbarModel=void 0,null===(n=this.resizeModel)||void 0===n||n.hide(),null===(r=this.resizeModel)||void 0===r||r.destroy(),this.resizeModel=void 0}}]),t}();No.cardName=void 0,No.cardType=void 0,No.autoActivate=void 0,No.autoSelected=!0,No.singleSelectable=void 0,No.collab=!0,No.focus=void 0,No.selectStyleType=vn.BORDER,No.lazyRender=!1;var Po=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(t,r){var i;return Object(c["a"])(this,n),i=e.call(this,t,r),i.kind="view",i.init(),i.container.hasClass(ut)||i.container.addClass(ut),i}return Object(u["a"])(n,[{key:"render",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=new kn(t,this),i=r.toValue(this.schema,this.conversion,!1,!0);this.container.html(i),this.card.render(this.container,(function(){n&&e.trigger("render",e.container)}))}}]),n}(ao),Lo=".data-scrollable::-webkit-scrollbar {\r\n display: none;\r\n overflow: hidden;\r\n }\r\n .data-scrollable.scroll-x {\r\n padding-bottom: 10px;\r\n overflow-x: hidden;\r\n }\r\n \r\n .data-scrollable.scroll-y {\r\n padding-right: 10px;\r\n overflow-y: hidden;\r\n }\r\n\r\n .data-scrollable:hover .data-scrollbar {\r\n display: block;\r\n }\r\n .data-scrollable.scrolling {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n }\r\n .data-scrollable.scrolling .data-scrollbar {\r\n display: block;\r\n }\r\n .data-scrollable .data-scrollbar {\r\n display: none;\r\n position: absolute;\r\n cursor: default;\r\n transition: opacity 0.3s ease-in-out;\r\n }\r\n .data-scrollable .data-scrollbar .data-scrollbar-trigger {\r\n position: absolute;\r\n background: #c1c1c1;\r\n border-radius: 10px;\r\n cursor: pointer;\r\n }\r\n .data-scrollable .data-scrollbar .data-scrollbar-trigger:hover {\r\n background: #888;\r\n }\r\n .data-scrollable .data-scrollbar.data-scrollbar-x {\r\n height: 8px;\r\n bottom: 0px;\r\n }\r\n .data-scrollable .data-scrollbar.data-scrollbar-x .data-scrollbar-trigger {\r\n height: 8px;\r\n min-width: 60px;\r\n }\r\n .data-scrollable .data-scrollbar.data-scrollbar-y {\r\n top: 0;\r\n width: 8px;\r\n height: 100%;\r\n right: 0px;\r\n }\r\n .data-scrollable .data-scrollbar.data-scrollbar-y .data-scrollbar-trigger {\r\n width: 8px;\r\n min-height: 60px;\r\n }\r\n .data-scrollable .scrollbar-shadow-left {\r\n position: absolute;\r\n z-index: 10;\r\n left: 0;\r\n top: 0;\r\n bottom: 0;\r\n width: 4px;\r\n opacity: 0.8;\r\n background: linear-gradient(270deg, rgba(99, 114, 130, 0) 0, rgba(99, 114, 130, 0.16));\r\n background: -webkit-linear-gradient(right, rgba(99, 114, 130, 0), rgba(99, 114, 130, 0.16));\r\n pointer-events: none;\r\n }\r\n .data-scrollable .scrollbar-shadow-right {\r\n position: absolute;\r\n z-index: 10;\r\n left: 0;\r\n top: 0;\r\n bottom: 0;\r\n width: 4px;\r\n opacity: 0.8;\r\n background: linear-gradient(90deg, rgba(99, 114, 130, 0) 0, rgba(99, 114, 130, 0.16));\r\n background: -webkit-linear-gradient(left, rgba(99, 114, 130, 0), rgba(99, 114, 130, 0.16));\r\n pointer-events: none;\r\n }";pn(Lo);var Do=Object(_["a"])("observer"),jo=Object(_["a"])("reverse"),Io=Object(_["a"])("content"),Ro=Object(_["a"])("enableScroll"),Fo=Object(_["a"])("scroll"),Bo=Object(_["a"])("isScrolling"),zo=function(t){Object(f["a"])(n,t);var e=Object(g["a"])(n);function n(t){var r,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4?arguments[4]:void 0;return Object(c["a"])(this,n),r=e.call(this),r.container=void 0,r.x=void 0,r.y=void 0,r.shadow=void 0,r.scrollBarX=void 0,r.slideX=void 0,r.slideXDragging=void 0,r.scrollBarY=void 0,r.slideY=void 0,r.slideYDragging=void 0,r.shadowLeft=void 0,r.shadowRight=void 0,r.oWidth=0,r.oHeight=0,r.sWidth=0,r.sHeight=0,r.xWidth=0,r.yHeight=0,Object.defineProperty(Object(d["a"])(r),Do,{writable:!0,value:void 0}),Object.defineProperty(Object(d["a"])(r),jo,{writable:!0,value:void 0}),Object.defineProperty(Object(d["a"])(r),Io,{writable:!0,value:void 0}),r.shadowTimer=void 0,Object.defineProperty(Object(d["a"])(r),Ro,{writable:!0,value:!0}),Object.defineProperty(Object(d["a"])(r),Fo,{writable:!0,value:void 0}),Object.defineProperty(Object(d["a"])(r),Bo,{writable:!0,value:!1}),r.refresh=function(){var t=r.container.get();if(t){var e,n,i=function(){setTimeout((function(){Object(T["a"])(Object(d["a"])(r),Bo)[Bo]=!1}),0)},o=t.scrollTop,a=null===(e=Object(T["a"])(Object(d["a"])(r),Io)[Io])||void 0===e?void 0:e.get(),s=te(r.container.css("padding-left")),l=te(r.container.css("padding-right")),c=te(r.container.css("padding-top")),u=te(r.container.css("padding-bottom")),h=a?Object(T["a"])(Object(d["a"])(r),Io)[Io].width()+s+l:t.scrollWidth,p=a?Object(T["a"])(Object(d["a"])(r),Io)[Io].height()+c+u:t.scrollHeight;if(r.oWidth=r.getWidth(),r.oHeight=r.container.height()-te(r.container.css("border-top-width"))-te(r.container.css("border-bottom-width")),r.sWidth=h,r.sHeight=p,r.xWidth=Math.floor(r.oWidth*r.oWidth/h),r.yHeight=Math.floor(r.oHeight*r.oHeight/p),r.x){var f,g,m,v;null===(f=r.slideX)||void 0===f||f.css("width",r.xWidth+"px");var b=Math.round(r.oWidth)-s-l===r.sWidth||a&&Math.round(Object(T["a"])(Object(d["a"])(r),Io)[Io].width())<=Math.round(r.oWidth-s-l)?"none":"block";null===(g=r.slideX)||void 0===g||g.css("display",b),r.emit("display",b),null===(m=r.shadowLeft)||void 0===m||m.css("display",b),null===(v=r.shadowRight)||void 0===v||v.css("display",b)}if(r.y){var y,w;null===(y=r.slideY)||void 0===y||y.css("height",r.yHeight+"px");var x=Math.round(r.oHeight)-c-u===r.sHeight||a&&Math.round(Object(T["a"])(Object(d["a"])(r),Io)[Io].height())<=Math.round(r.oHeight-c-u)?"none":"block";null===(w=r.slideY)||void 0===w||w.css("display",x),r.emit("display",x)}if(r.x&&a&&t.scrollWidth-s-l>Object(T["a"])(Object(d["a"])(r),Io)[Io].width()){Object(T["a"])(Object(d["a"])(r),Bo)[Bo]=!0;var C=t.scrollWidth-s-l-Object(T["a"])(Object(d["a"])(r),Io)[Io].width();if(Object(T["a"])(Object(d["a"])(r),Fo)[Fo]){var k=Object(T["a"])(Object(d["a"])(r),Fo)[Fo],A=k.onScrollX,S=k.getScrollLeft;if(C=S?S(-0)+t.scrollLeft-C:t.scrollLeft-C,C<0&&(C=0),A){var E=A(C);t.scrollLeft=E>0?E:0}r.scroll({left:C})}else t.scrollLeft-=C,i();return}if(r.y&&a&&t.scrollHeight-c-u!==Object(T["a"])(Object(d["a"])(r),Io)[Io].height())return Object(T["a"])(Object(d["a"])(r),Bo)[Bo]=!0,t.scrollTop-=t.scrollHeight-c-u-Object(T["a"])(Object(d["a"])(r),Io)[Io].height(),void i();var O=(null===(n=Object(T["a"])(Object(d["a"])(r),Fo)[Fo])||void 0===n?void 0:n.getScrollLeft)?Object(T["a"])(Object(d["a"])(r),Fo)[Fo].getScrollLeft(t.scrollLeft):t.scrollLeft;if(Object(T["a"])(Object(d["a"])(r),Fo)[Fo]){var _=Object(T["a"])(Object(d["a"])(r),Fo)[Fo].onScrollX;if(_){Object(T["a"])(Object(d["a"])(r),Bo)[Bo]=!0;var M=_(O);t.scrollLeft=M>0?M:0,i()}r.scroll({left:O})}else r.reRenderX(O);r.reRenderY(o)}},r.scroll=function(t){var e=0,n=0;if(!Object(T["a"])(Object(d["a"])(r),Fo)[Fo]&&t instanceof Event){var i=t.target,o=i.scrollTop,a=i.scrollLeft;e=o,n=a}else{if(t instanceof Event)return Object(T["a"])(Object(d["a"])(r),Bo)[Bo]?void 0:void r.refresh();var s,l;void 0===t.top&&(t.top=(null===(s=r.container.get())||void 0===s?void 0:s.scrollTop)||0);void 0===t.left&&(t.left=(null===(l=r.container.get())||void 0===l?void 0:l.scrollLeft)||0);e=t.top,n=t.left}r.reRenderX(n),r.reRenderY(e)},r.wheelXScroll=K()((function(t){var e,n;t.preventDefault();var i=(zt?t.wheelDeltaX:t.wheelDelta/120||-t.detail)>0?"up":"down",o=r.container.get();if(o){var a=r.container.width(),s=(null===(e=Object(T["a"])(Object(d["a"])(r),Fo)[Fo])||void 0===e?void 0:e.getOffsetWidth)?Object(T["a"])(Object(d["a"])(r),Fo)[Fo].getOffsetWidth(a):a,l=Math.max(s/(zt?20-Math.abs(t.wheelDelta):8),20),c=((null===(n=Object(T["a"])(Object(d["a"])(r),Fo)[Fo])||void 0===n?void 0:n.getScrollLeft)?Object(T["a"])(Object(d["a"])(r),Fo)[Fo].getScrollLeft(o.scrollLeft):o.scrollLeft)+("up"===i?-l:l);if(c="up"===i?Math.max(0,c):Math.min(c,r.sWidth-r.oWidth),Object(T["a"])(Object(d["a"])(r),Fo)[Fo]){var u=Object(T["a"])(Object(d["a"])(r),Fo)[Fo].onScrollX;if(u){var h=u(c);o.scrollLeft=h>0?h:0}r.scroll({left:c})}else o.scrollLeft=c}}),zt?50:0,{trailing:!0}),r.wheelYScroll=K()((function(t){t.preventDefault();var e=(zt?t.wheelDeltaX:t.wheelDelta/120||-t.detail)>0?"up":"down",n=r.container.get();if(n){var i=r.container.height(),o=Math.max(i/(zt?20-Math.abs(t.wheelDelta):8),20),a=n.scrollTop+("up"===e?-o:o);a="up"===e?Math.max(0,a):Math.min(a,r.sHeight-r.oHeight),n.scrollTop=a}}),zt?100:0,{trailing:!0}),r.bindWheelScroll=function(t){if(Object(T["a"])(Object(d["a"])(r),Ro)[Ro]){var e=r.x&&t.wheelDeltaX!==t.wheelDeltaY&&Math.abs(t.wheelDeltaX)>Math.abs(t.wheelDeltaY);e?r.slideX&&"none"!==r.slideX.css("display")&&r.wheelXScroll(t):r.y&&0!==t.wheelDeltaY&&r.slideY&&"none"!==r.slideY.css("display")&&r.wheelYScroll(t)}},r.bindContainerTouchX=function(t){t.target&&Object(T["a"])(Object(d["a"])(r),Ro)[Ro]&&(He(t.target).hasClass("data-scrollbar-trigger")||(Object(T["a"])(Object(d["a"])(r),jo)[jo]=!0,r.scrollXStart(t)))},r.bindContainerTouchY=function(t){t.target&&Object(T["a"])(Object(d["a"])(r),Ro)[Ro]&&(He(t.target).hasClass("data-scrollbar-trigger")||(Object(T["a"])(Object(d["a"])(r),jo)[jo]=!0,r.scrollYStart(t)))},r.getEventClientOffset=function(t){return t instanceof MouseEvent?{x:t.clientX,y:t.clientY}:{x:t.touches[0].clientX,y:t.touches[0].clientY}},r.scrollX=function(t){if(r.slideXDragging){var e,n=r.slideXDragging,i=n.point,o=n.position,a=r.getEventClientOffset(t),s=Object(T["a"])(Object(d["a"])(r),jo)[jo]?o-(a.x-i):o+(a.x-i);s=Math.max(0,Math.min(s,r.oWidth-r.xWidth)),null===(e=r.slideX)||void 0===e||e.css("left",s+"px");var l=s/(r.oWidth-r.xWidth);l=Math.min(1,l);var c=r.container.get(),u=(r.sWidth-r.oWidth)*l;if(Object(T["a"])(Object(d["a"])(r),Fo)[Fo]){var h=Object(T["a"])(Object(d["a"])(r),Fo)[Fo].onScrollX;if(h){var p=h(u);c.scrollLeft=p>0?p:0}r.scroll({left:u})}else c.scrollLeft=u}},r.scrollY=function(t){if(r.slideYDragging){var e,n=r.slideYDragging,i=n.point,o=n.position,a=r.getEventClientOffset(t),s=Object(T["a"])(Object(d["a"])(r),jo)[jo]?o-(a.y-i):o+(a.y-i);s=Math.max(0,Math.min(s,r.oHeight-r.yHeight)),null===(e=r.slideY)||void 0===e||e.css("top",s+"px");var l=s/(r.oHeight-r.yHeight);l=Math.min(1,l),r.container.get().scrollTop=(r.sHeight-r.oHeight)*l}},r.scrollXEnd=function(){r.slideXDragging=void 0,Object(T["a"])(Object(d["a"])(r),jo)[jo]=!1,document.body.removeEventListener(Rt?"touchmove":"mousemove",r.scrollX),document.body.removeEventListener(Rt?"touchend":"mouseup",r.scrollXEnd),r.container.removeClass("scrolling")},r.scrollYEnd=function(){r.slideYDragging=void 0,document.body.removeEventListener(Rt?"touchmove":"mousemove",r.scrollY),document.body.removeEventListener(Rt?"touchend":"mouseup",r.scrollYEnd),r.container.removeClass("scrolling")},r.scrollXStart=function(t){var e,n=r.getEventClientOffset(t);r.container.addClass("scrolling"),r.slideXDragging={point:n.x,position:parseInt((null===(e=r.slideX)||void 0===e?void 0:e.css("left"))||"0")},document.body.addEventListener(Rt?"touchmove":"mousemove",r.scrollX,{passive:!0}),document.body.addEventListener(Rt?"touchend":"mouseup",r.scrollXEnd,{passive:!0})},r.scrollYStart=function(t){var e,n=r.getEventClientOffset(t);r.container.addClass("scrolling"),r.slideYDragging={point:n.y,position:parseInt((null===(e=r.slideY)||void 0===e?void 0:e.css("top"))||"0")},document.body.addEventListener(Rt?"touchmove":"mousemove",r.scrollY,{passive:!0}),document.body.addEventListener(Rt?"touchend":"mouseup",r.scrollYEnd,{passive:!0})},r.bindXScrollEvent=function(){var t;r.x&&(null===(t=r.slideX)||void 0===t||t.on(Rt?"touchstart":"mousedown",r.scrollXStart,{passive:!0}))},r.bindYScrollEvent=function(){var t;r.y&&(null===(t=r.slideY)||void 0===t||t.on(Rt?"touchstart":"mousedown",r.scrollYStart,{passive:!0}))},r.reRenderShadow=function(t){if(r.shadow){var e,n,i=r.container.get();if(i)null===(n=r.shadowLeft)||void 0===n||n.css("left",(Object(T["a"])(Object(d["a"])(r),Fo)[Fo]?i.scrollLeft:t)+"px");null===(e=r.shadowRight)||void 0===e||e.css("left",t+r.oWidth-4+"px")}},r.reRenderX=function(t){if(r.x){var e,n,i;null===(e=r.scrollBarX)||void 0===e||e.css("left",t+"px");var o=r.sWidth-r.oWidth,a=o<=0?0:t/o;a=Math.min(1,a),null===(n=r.slideX)||void 0===n||n.css("left",(r.oWidth-r.xWidth)*a+"px"),r.emit("change",{x:t,y:te((null===(i=r.scrollBarY)||void 0===i?void 0:i.css("top"))||"0")}),r.oWidth=r.getWidth(),r.reRenderShadow(t)}},r.reRenderY=function(t){if(r.y){var e,n,i;null===(e=r.scrollBarY)||void 0===e||e.css("top",t+"px");var o=r.sHeight-r.oHeight,a=o<=0?0:t/o;a=Math.min(1,a),null===(n=r.slideY)||void 0===n||n.css("top",(r.oHeight-r.yHeight)*a+"px"),r.emit("change",{x:te((null===(i=r.scrollBarX)||void 0===i?void 0:i.css("left"))||"0"),y:t})}},r.container=ke(t)?He(t):t,r.x=i,r.y=o,r.shadow=a,Object(T["a"])(Object(d["a"])(r),Fo)[Fo]=s,r.init(),r}return Object(u["a"])(n,[{key:"setContentNode",value:function(t){Object(T["a"])(this,Io)[Io]=t&&ke(t)?He(t):t}},{key:"init",value:function(){var t=this.container.children(),e=!1;t.each((function(t){!e&&He(t).hasClass("data-scrollbar")&&(e=!0)})),e||(this.container.css("position","relative"),this.container.addClass("data-scrollable"),this.x&&(this.scrollBarX=He("<div ".concat(J,'="').concat(nt,'" class="data-scrollbar data-scrollbar-x"><div class="data-scrollbar-trigger"></div></div>')),this.slideX=this.scrollBarX.find(".data-scrollbar-trigger"),this.container.append(this.scrollBarX),this.container.addClass("scroll-x")),this.y&&(this.scrollBarY=He("<div ".concat(J,'="').concat(nt,'" class="data-scrollbar data-scrollbar-y"><div class="data-scrollbar-trigger"></div></div>')),this.slideY=this.scrollBarY.find(".data-scrollbar-trigger"),this.container.append(this.scrollBarY),this.container.addClass("scroll-y")),this.shadow&&(this.shadowLeft=He("<div ".concat(J,'="').concat(nt,'" class="scrollbar-shadow-left"></div>')),this.shadowRight=He("<div ".concat(J,'="').concat(nt,'" class="scrollbar-shadow-right"></div>')),this.container.append(this.shadowLeft),this.container.append(this.shadowRight)),this.refresh(),this.bindEvents())}},{key:"getWidth",value:function(){var t,e=this.container.get();if(!e)return 0;var n=this.container.width(),r=(null===(t=Object(T["a"])(this,Fo)[Fo])||void 0===t?void 0:t.getOffsetWidth)?Object(T["a"])(this,Fo)[Fo].getOffsetWidth(n):n;return r}},{key:"enableScroll",value:function(){Object(T["a"])(this,Ro)[Ro]=!0}},{key:"disableScroll",value:function(){Object(T["a"])(this,Ro)[Ro]=!1}},{key:"bindEvents",value:function(){Rt?(this.x&&this.container.on("touchstart",this.bindContainerTouchX,{passive:!0}),this.y&&this.container.on("touchstart",this.bindContainerTouchY,{passive:!0})):this.container.on(jt?"DOMMouseScroll":"mousewheel",this.bindWheelScroll),this.container.on("scroll",this.scroll,{passive:!0});var t=this.container.get();t&&(window.addEventListener("resize",this.refresh),this.bindXScrollEvent(),this.bindYScrollEvent())}},{key:"destroy",value:function(){var t,e,n,r,i,o,a;(null===(t=this.slideX)||void 0===t||t.off(Rt?"touchstart":"mousedown",this.scrollXStart),null===(e=this.slideY)||void 0===e||e.off(Rt?"touchstart":"mousedown",this.scrollYStart),Rt?(this.x&&this.container.off("touchstart",this.bindContainerTouchX),this.y&&this.container.off("touchstart",this.bindContainerTouchY)):this.container.off(jt?"DOMMouseScroll":"mousewheel",this.bindWheelScroll),this.container.off("scroll",this.scroll),this.container.removeClass("data-scrollable"),this.x)&&(null===(r=this.scrollBarX)||void 0===r||r.remove(),this.container.removeClass("scroll-x"));this.y&&(null===(i=this.scrollBarY)||void 0===i||i.remove(),this.container.removeClass("scroll-y"));this.shadow&&(null===(o=this.shadowLeft)||void 0===o||o.remove(),null===(a=this.shadowRight)||void 0===a||a.remove());null===(n=Object(T["a"])(this,Do)[Do])||void 0===n||n.disconnect(),window.removeEventListener("resize",this.refresh),window.removeEventListener("scroll",this.refresh)}}]),n}(D["EventEmitter2"]),Ho=".data-resizer {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n bottom: 0px;\n right: 0;\n z-index: 1;\n outline: 2px solid #1890FF;\n max-width: initial !important;\n}\n.data-resizer img {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n cursor: pointer;\n width: 100%;\n height: 100%;\n opacity: 0.3;\n}\n.data-resizer-holder {\n position: absolute;\n width: 14px;\n height: 14px;\n border: 2px solid #fff;\n border-radius: 50%;\n background: #1890FF;\n display: inline-block;\n}\n.data-resizer-holder-right-top {\n top: -6px;\n right: -6px;\n cursor: nesw-resize;\n}\n.data-resizer-holder-right-bottom {\n bottom: -6px;\n right: -6px;\n cursor: nwse-resize;\n}\n.data-resizer-holder-left-bottom {\n bottom: -6px;\n left: -6px;\n cursor: nesw-resize;\n}\n.data-resizer-holder-left-top {\n left: -6px;\n top: -6px;\n cursor: nwse-resize;\n}\n\n.data-resizer-number {\n position: absolute;\n display: inline-block;\n line-height: 24px;\n padding: 0 4px;\n font-size: 12px;\n border-radius: 3px 3px;\n background: rgba(0, 0, 0, 0.86);\n color: rgba(255, 255, 255, 0.96);\n font-family: 'Lucida Console', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease-in-out;\n transform: scale(0.8);\n}\n\n.data-resizer-number-right-top {\n top: 0px;\n right: -6px;\n transform: translateX(100%) scale(0.8);\n}\n\n.data-resizer-number-right-bottom {\n right: -6px;\n bottom: 0px;\n transform: translateX(100%) scale(0.8);\n}\n\n.data-resizer-number-left-bottom {\n left: -6px;\n bottom: 0px;\n transform: translateX(-100%) scale(0.8);\n}\n\n.data-resizer-number-left-top {\n left: -6px;\n top: 0px;\n transform: translateX(-100%) scale(0.8);\n}\n\n.data-resizer-number-active {\n opacity: 1;\n visibility: visible;\n}";pn(Ho);var Vo=function(){function t(e){var n,r=this;Object(c["a"])(this,t),this.options=void 0,this.root=void 0,this.image=void 0,this.resizerNumber=void 0,this.point={x:0,y:0},this.position=void 0,this.size=void 0,this.maxWidth=void 0,this.resizing=!1,this.onMouseMove=function(t){t.preventDefault(),t.stopPropagation();var e=window.TouchEvent&&t instanceof TouchEvent?t.touches[0]:t,n=e.clientX,i=e.clientY;if(n!==r.point.x||i!==r.point.y){var o=r.point.x-n,a=r.point.y-i;r.updateSize(o,a)}r.resizing=!0},this.onMouseUp=function(t){var e;t.preventDefault(),t.stopPropagation();var n=r.root.get();if(n){var i=n.clientWidth,o=n.clientHeight;r.size={width:i,height:o},r.resizerNumber.removeClass("data-resizer-number-".concat(r.position)),r.resizerNumber.removeClass("data-resizer-number-active"),r.position=void 0,r.resizing=!1,r.root.removeClass("data-resizing"),document.removeEventListener(Rt?"touchmove":"mousemove",r.onMouseMove),document.removeEventListener(Rt?"touchend":"mouseup",r.onMouseUp);var a=r.options.onChange;a&&a(r.size),null===(e=r.image)||void 0===e||e.hide()}},this.options=e,this.root=He(this.renderTemplate(e.imgUrl)),e.imgUrl&&(this.image=this.root.find("img")),null===(n=this.image)||void 0===n||n.hide(),this.resizerNumber=this.root.find(".data-resizer-number");var i=this.options,o=i.width,a=i.height;this.size={width:o,height:a},this.maxWidth=this.options.maxWidth}return Object(u["a"])(t,[{key:"renderTemplate",value:function(t){return'\n\t\t\t<span class="data-resizer">\n\t\t\t\t'.concat(t?'<img src="'.concat(t,'">'):"",'\n\t\t\t\t<span class="data-resizer-holder data-resizer-holder-right-top"></span>\n\t\t\t\t<span class="data-resizer-holder data-resizer-holder-right-bottom"></span>\n\t\t\t\t<span class="data-resizer-holder data-resizer-holder-left-bottom"></span>\n\t\t\t\t<span class="data-resizer-holder data-resizer-holder-left-top"></span>\n\t\t\t\t<span class="data-resizer-number"></span>\n\t\t\t</span>')}},{key:"onMouseDown",value:function(t,e){var n;this.resizing||(t.preventDefault(),t.stopPropagation(),this.root.css("top",["right-top","left-top"].indexOf(e)>-1?"auto":0),this.root.css("left",["left-top","left-bottom"].indexOf(e)>-1?"auto":0),this.root.css("bottom",["right-bottom","left-bottom"].indexOf(e)>-1?"auto":0),this.root.css("right",["right-top","right-bottom"].indexOf(e)>-1?"auto":0),this.point={x:window.TouchEvent&&t instanceof TouchEvent?t.touches[0].clientX:t.clientX,y:window.TouchEvent&&t instanceof TouchEvent?t.touches[0].clientY:t.clientY},this.position=e,this.resizing=!0,this.root.addClass("data-resizing"),this.resizerNumber.addClass("data-resizer-number-".concat(this.position)),this.resizerNumber.addClass("data-resizer-number-active"),null===(n=this.image)||void 0===n||n.show(),document.addEventListener(Rt?"touchmove":"mousemove",this.onMouseMove),document.addEventListener(Rt?"touchend":"mouseup",this.onMouseUp))}},{key:"updateSize",value:function(t,e){t=["right-top","right-bottom"].indexOf(this.position||"")>-1?this.size.width-t:this.size.width+t,this.setSize(t,e)}},{key:"setSize",value:function(t,e){t<24&&(t=24);var n=this.options.rate;t>this.maxWidth&&(t=this.maxWidth),e=t*n,e<24&&(e=24,t=e/n),t=Math.round(t),e=Math.round(e),this.root.css({width:t+"px",height:e+"px"}),this.resizerNumber.html("".concat(t,"·").concat(e))}},{key:"on",value:function(t,e){this.root.on(t,e)}},{key:"off",value:function(t,e){this.root.off(t,e)}},{key:"render",value:function(){var t=this,e=this.options,n=e.width,r=e.height;return this.setSize(n,r),this.root.find(".data-resizer-holder-right-top").on(Rt?"touchstart":"mousedown",(function(e){return t.onMouseDown(e,"right-top")})),this.root.find(".data-resizer-holder-right-bottom").on(Rt?"touchstart":"mousedown",(function(e){return t.onMouseDown(e,"right-bottom")})),this.root.find(".data-resizer-holder-left-bottom").on(Rt?"touchstart":"mousedown",(function(e){return t.onMouseDown(e,"left-bottom")})),this.root.find(".data-resizer-holder-left-top").on(Rt?"touchstart":"mousedown",(function(e){return t.onMouseDown(e,"left-top")})),this.root}},{key:"destroy",value:function(){this.root.remove(),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp)}}]),t}();e["default"]=lo}.call(this,n("c8ba"))},a65f:function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i,o;if(t.sCount[e]-t.blkIndent<4)return!1;i=r=e+1;while(r<n)if(t.isEmpty(r))r++;else{if(!(t.sCount[r]-t.blkIndent>=4))break;r++,i=r}return t.line=i,o=t.push("code_block","code",0),o.content=t.getLines(e,i,4+t.blkIndent,!1)+"\n",o.map=[e,t.line],!0}},a7bc:function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},a7be:function(t,e,n){},a7ef:function(t,e,n){"use strict";function r(t){var e=void 0;e="string"===typeof t?[t]:t.raw;for(var n="",r=0;r<e.length;r++)n+=e[r].replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`"),r<(arguments.length<=1?0:arguments.length-1)&&(n+=arguments.length<=r+1?void 0:arguments[r+1]);var i=n.split("\n"),o=null;return i.forEach((function(t){var e=t.match(/^(\s+)\S+/);if(e){var n=e[1].length;o=o?Math.min(o,n):n}})),null!==o&&(n=i.map((function(t){return" "===t[0]?t.slice(o):t})).join("\n")),n=n.trim(),n.replace(/\\n/g,"\n")}t.exports=r},a848:function(t,e,n){},a975:function(t,e,n){"use strict";var r=n("ebb5"),i=n("b727").every,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("every",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},aa1f:function(t,e,n){"use strict";var r=n("83ab"),i=n("d039"),o=n("825a"),a=n("7c73"),s=n("e391"),l=Error.prototype.toString,c=i((function(){if(r){var t=a(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==l.call(t))return!0}return"2: 1"!==l.call({message:1,name:2})||"Error"!==l.call({})}));t.exports=c?function(){var t=o(this),e=s(t.name,"Error"),n=s(t.message);return e?n?e+": "+n:e:n}:l},acac:function(t,e,n){"use strict";var r=n("e330"),i=n("6964"),o=n("f183").getWeakData,a=n("19aa"),s=n("825a"),l=n("7234"),c=n("861d"),u=n("2266"),d=n("b727"),h=n("1a2d"),p=n("69f3"),f=p.set,g=p.getterFor,m=d.find,v=d.findIndex,b=r([].splice),y=0,w=function(t){return t.frozen||(t.frozen=new x)},x=function(){this.entries=[]},C=function(t,e){return m(t.entries,(function(t){return t[0]===e}))};x.prototype={get:function(t){var e=C(this,t);if(e)return e[1]},has:function(t){return!!C(this,t)},set:function(t,e){var n=C(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=v(this.entries,(function(e){return e[0]===t}));return~e&&b(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,n,r){var d=t((function(t,i){a(t,p),f(t,{type:e,id:y++,frozen:void 0}),l(i)||u(i,t[r],{that:t,AS_ENTRIES:n})})),p=d.prototype,m=g(e),v=function(t,e,n){var r=m(t),i=o(s(e),!0);return!0===i?w(r).set(e,n):i[r.id]=n,t};return i(p,{delete:function(t){var e=m(this);if(!c(t))return!1;var n=o(t);return!0===n?w(e)["delete"](t):n&&h(n,e.id)&&delete n[e.id]},has:function(t){var e=m(this);if(!c(t))return!1;var n=o(t);return!0===n?w(e).has(t):n&&h(n,e.id)}}),i(p,n?{get:function(t){var e=m(this);if(c(t)){var n=o(t);return!0===n?w(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return v(this,t,e)}}:{add:function(t){return v(this,t,!0)}}),d}}},ace4:function(t,e,n){"use strict";var r=n("23e7"),i=n("e330"),o=n("d039"),a=n("621a"),s=n("825a"),l=n("23cb"),c=n("50c4"),u=n("4840"),d=a.ArrayBuffer,h=a.DataView,p=h.prototype,f=i(d.prototype.slice),g=i(p.getUint8),m=i(p.setUint8),v=o((function(){return!new d(2).slice(1,void 0).byteLength}));r({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:v},{slice:function(t,e){if(f&&void 0===e)return f(s(this),t);var n=s(this).byteLength,r=l(t,n),i=l(void 0===e?n:e,n),o=new(u(this,d))(c(i-r)),a=new h(this),p=new h(o),v=0;while(r<i)m(p,v++,g(a,r++));return o}})},aedd:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";function e(e){return function(n,r){var i=r.line,o=n.getLine(i);function a(e){for(var a,s=r.ch,l=0;;){var c=s<=0?-1:o.lastIndexOf(e[0],s-1);if(-1!=c){if(1==l&&c<r.ch)break;if(a=n.getTokenTypeAt(t.Pos(i,c+1)),!/^(comment|string)/.test(a))return{ch:c+1,tokenType:a,pair:e};s=c-1}else{if(1==l)break;l=1,s=o.length}}}function s(e){var r,o,a=1,s=n.lastLine(),l=e.ch;t:for(var c=i;c<=s;++c)for(var u=n.getLine(c),d=c==i?l:0;;){var h=u.indexOf(e.pair[0],d),p=u.indexOf(e.pair[1],d);if(h<0&&(h=u.length),p<0&&(p=u.length),d=Math.min(h,p),d==u.length)break;if(n.getTokenTypeAt(t.Pos(c,d+1))==e.tokenType)if(d==h)++a;else if(!--a){r=c,o=d;break t}++d}return null==r||i==r?null:{from:t.Pos(i,l),to:t.Pos(r,o)}}for(var l=[],c=0;c<e.length;c++){var u=a(e[c]);u&&l.push(u)}l.sort((function(t,e){return t.ch-e.ch}));for(c=0;c<l.length;c++){var d=s(l[c]);if(d)return d}return null}}t.registerHelper("fold","brace",e([["{","}"],["[","]"]])),t.registerHelper("fold","brace-paren",e([["{","}"],["[","]"],["(",")"]])),t.registerHelper("fold","import",(function(e,n){function r(n){if(n<e.firstLine()||n>e.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));if(/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(e.lastLine(),n+10);i<=o;++i){var a=e.getLine(i),s=a.indexOf(";");if(-1!=s)return{startCh:r.end,end:t.Pos(i,s)}}}var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var l=r(s.line+1);if(null==l)break;s=l.end}return{from:e.clipPos(t.Pos(o,a.startCh+1)),to:s}})),t.registerHelper("fold","include",(function(e,n){function r(n){if(n<e.firstLine()||n>e.lastLine())return null;var r=e.getTokenAt(t.Pos(n,1));return/\S/.test(r.string)||(r=e.getTokenAt(t.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;;){var s=r(a+1);if(null==s)break;++a}return{from:t.Pos(i,o+1),to:e.clipPos(t.Pos(a))}}))}))},aee6:function(t,e,n){},aeeb:function(t,e,n){"use strict";var r=n("ebfb"),i=[["table",n("f665"),["paragraph","reference"]],["code",n("a65f")],["fence",n("8a36"),["paragraph","reference","blockquote","list"]],["blockquote",n("646c"),["paragraph","reference","blockquote","list"]],["hr",n("f0e9"),["paragraph","reference","blockquote","list"]],["list",n("afc5"),["paragraph","reference","blockquote"]],["reference",n("c07d")],["html_block",n("f8b2"),["paragraph","reference","blockquote"]],["heading",n("ccf7"),["paragraph","reference","blockquote"]],["lheading",n("3fe1")],["paragraph",n("8714")]];function o(){this.ruler=new r;for(var t=0;t<i.length;t++)this.ruler.push(i[t][0],i[t][1],{alt:(i[t][2]||[]).slice()})}o.prototype.tokenize=function(t,e,n){var r,i,o=this.ruler.getRules(""),a=o.length,s=e,l=!1,c=t.md.options.maxNesting;while(s<n){if(t.line=s=t.skipEmptyLines(s),s>=n)break;if(t.sCount[s]<t.blkIndent)break;if(t.level>=c){t.line=n;break}for(i=0;i<a;i++)if(r=o[i](t,s,n,!1),r)break;t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),s=t.line,s<n&&t.isEmpty(s)&&(l=!0,s++,t.line=s)}},o.prototype.parse=function(t,e,n,r){var i;t&&(i=new this.State(t,e,n,r),this.tokenize(i,i.line,i.lineMax))},o.prototype.State=n("b3eb"),t.exports=o},afc5:function(t,e,n){"use strict";var r=n("55be").isSpace;function i(t,e){var n,i,o,a;return i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],n=t.src.charCodeAt(i++),42!==n&&45!==n&&43!==n||i<o&&(a=t.src.charCodeAt(i),!r(a))?-1:i}function o(t,e){var n,i=t.bMarks[e]+t.tShift[e],o=i,a=t.eMarks[e];if(o+1>=a)return-1;if(n=t.src.charCodeAt(o++),n<48||n>57)return-1;for(;;){if(o>=a)return-1;if(n=t.src.charCodeAt(o++),!(n>=48&&n<=57)){if(41===n||46===n)break;return-1}if(o-i>=10)return-1}return o<a&&(n=t.src.charCodeAt(o),!r(n))?-1:o}function a(t,e){var n,r,i=t.level+2;for(n=e+2,r=t.tokens.length-2;n<r;n++)t.tokens[n].level===i&&"paragraph_open"===t.tokens[n].type&&(t.tokens[n+2].hidden=!0,t.tokens[n].hidden=!0,n+=2)}t.exports=function(t,e,n,r){var s,l,c,u,d,h,p,f,g,m,v,b,y,w,x,C,k,A,S,E,O,T,_,M,N,P,L,D,j=!1,I=!0;if(t.sCount[e]-t.blkIndent>=4)return!1;if(t.listIndent>=0&&t.sCount[e]-t.listIndent>=4&&t.sCount[e]<t.blkIndent)return!1;if(r&&"paragraph"===t.parentType&&t.sCount[e]>=t.blkIndent&&(j=!0),(_=o(t,e))>=0){if(p=!0,N=t.bMarks[e]+t.tShift[e],y=Number(t.src.slice(N,_-1)),j&&1!==y)return!1}else{if(!((_=i(t,e))>=0))return!1;p=!1}if(j&&t.skipSpaces(_)>=t.eMarks[e])return!1;if(b=t.src.charCodeAt(_-1),r)return!0;v=t.tokens.length,p?(D=t.push("ordered_list_open","ol",1),1!==y&&(D.attrs=[["start",y]])):D=t.push("bullet_list_open","ul",1),D.map=m=[e,0],D.markup=String.fromCharCode(b),x=e,M=!1,L=t.md.block.ruler.getRules("list"),A=t.parentType,t.parentType="list";while(x<n){T=_,w=t.eMarks[x],h=C=t.sCount[x]+_-(t.bMarks[e]+t.tShift[e]);while(T<w){if(s=t.src.charCodeAt(T),9===s)C+=4-(C+t.bsCount[x])%4;else{if(32!==s)break;C++}T++}if(l=T,d=l>=w?1:C-h,d>4&&(d=1),u=h+d,D=t.push("list_item_open","li",1),D.markup=String.fromCharCode(b),D.map=f=[e,0],p&&(D.info=t.src.slice(N,_-1)),O=t.tight,E=t.tShift[e],S=t.sCount[e],k=t.listIndent,t.listIndent=t.blkIndent,t.blkIndent=u,t.tight=!0,t.tShift[e]=l-t.bMarks[e],t.sCount[e]=C,l>=w&&t.isEmpty(e+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,e,n,!0),t.tight&&!M||(I=!1),M=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=k,t.tShift[e]=E,t.sCount[e]=S,t.tight=O,D=t.push("list_item_close","li",-1),D.markup=String.fromCharCode(b),x=e=t.line,f[1]=x,l=t.bMarks[e],x>=n)break;if(t.sCount[x]<t.blkIndent)break;if(t.sCount[e]-t.blkIndent>=4)break;for(P=!1,c=0,g=L.length;c<g;c++)if(L[c](t,x,n,!0)){P=!0;break}if(P)break;if(p){if(_=o(t,x),_<0)break;N=t.bMarks[x]+t.tShift[x]}else if(_=i(t,x),_<0)break;if(b!==t.src.charCodeAt(_-1))break}return D=p?t.push("ordered_list_close","ol",-1):t.push("bullet_list_close","ul",-1),D.markup=String.fromCharCode(b),m[1]=x,t.line=x,t.parentType=A,I&&a(t,v),!0}},b22e:function(t,e,n){var r,i,o;
/*!
* jQuery Mousewheel 3.1.13
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*/(function(a){i=[n("1157")],r=a,o="function"===typeof r?r.apply(e,i):r,void 0===o||(t.exports=o)})((function(t){var e,n,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],o=Array.prototype.slice;if(t.event.fixHooks)for(var a=r.length;a;)t.event.fixHooks[r[--a]]=t.event.mouseHooks;var s=t.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=i.length;e;)this.addEventListener(i[--e],l,!1);else this.onmousewheel=l;t.data(this,"mousewheel-line-height",s.getLineHeight(this)),t.data(this,"mousewheel-page-height",s.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=i.length;e;)this.removeEventListener(i[--e],l,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var n=t(e),r=n["offsetParent"in t.fn?"offsetParent":"parent"]();return r.length||(r=t("body")),parseInt(r.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(r){var i=r||window.event,a=o.call(arguments,1),l=0,d=0,h=0,p=0,f=0,g=0;if(r=t.event.fix(i),r.type="mousewheel","detail"in i&&(h=-1*i.detail),"wheelDelta"in i&&(h=i.wheelDelta),"wheelDeltaY"in i&&(h=i.wheelDeltaY),"wheelDeltaX"in i&&(d=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(d=-1*h,h=0),l=0===h?d:h,"deltaY"in i&&(h=-1*i.deltaY,l=h),"deltaX"in i&&(d=i.deltaX,0===h&&(l=-1*d)),0!==h||0!==d){if(1===i.deltaMode){var m=t.data(this,"mousewheel-line-height");l*=m,h*=m,d*=m}else if(2===i.deltaMode){var v=t.data(this,"mousewheel-page-height");l*=v,h*=v,d*=v}if(p=Math.max(Math.abs(h),Math.abs(d)),(!n||p<n)&&(n=p,u(i,p)&&(n/=40)),u(i,p)&&(l/=40,d/=40,h/=40),l=Math[l>=1?"floor":"ceil"](l/n),d=Math[d>=1?"floor":"ceil"](d/n),h=Math[h>=1?"floor":"ceil"](h/n),s.settings.normalizeOffset&&this.getBoundingClientRect){var b=this.getBoundingClientRect();f=r.clientX-b.left,g=r.clientY-b.top}return r.deltaX=d,r.deltaY=h,r.deltaFactor=n,r.offsetX=f,r.offsetY=g,r.deltaMode=0,a.unshift(r,l,d,h),e&&clearTimeout(e),e=setTimeout(c,200),(t.event.dispatch||t.event.handle).apply(this,a)}}function c(){n=null}function u(t,e){return s.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120===0}t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}))},b2a3:function(t,e,n){},b39a:function(t,e,n){"use strict";var r=n("da84"),i=n("2ba4"),o=n("ebb5"),a=n("d039"),s=n("f36a"),l=r.Int8Array,c=o.aTypedArray,u=o.exportTypedArrayMethod,d=[].toLocaleString,h=!!l&&a((function(){d.call(new l(1))})),p=a((function(){return[1,2].toLocaleString()!=new l([1,2]).toLocaleString()}))||!a((function(){l.prototype.toLocaleString.call([1,2])}));u("toLocaleString",(function(){return i(d,h?s(c(this)):c(this),s(arguments))}),p)},b3eb:function(t,e,n){"use strict";var r=n("f483"),i=n("55be").isSpace;function o(t,e,n,r){var o,a,s,l,c,u,d,h;for(this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",a=this.src,h=!1,s=l=u=d=0,c=a.length;l<c;l++){if(o=a.charCodeAt(l),!h){if(i(o)){u++,9===o?d+=4-d%4:d++;continue}h=!0}10!==o&&l!==c-1||(10!==o&&l++,this.bMarks.push(s),this.eMarks.push(l),this.tShift.push(u),this.sCount.push(d),this.bsCount.push(0),h=!1,u=0,d=0,s=l+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}o.prototype.push=function(t,e,n){var i=new r(t,e,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i},o.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},o.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e;t++)if(this.bMarks[t]+this.tShift[t]<this.eMarks[t])break;return t},o.prototype.skipSpaces=function(t){for(var e,n=this.src.length;t<n;t++)if(e=this.src.charCodeAt(t),!i(e))break;return t},o.prototype.skipSpacesBack=function(t,e){if(t<=e)return t;while(t>e)if(!i(this.src.charCodeAt(--t)))return t+1;return t},o.prototype.skipChars=function(t,e){for(var n=this.src.length;t<n;t++)if(this.src.charCodeAt(t)!==e)break;return t},o.prototype.skipCharsBack=function(t,e,n){if(t<=n)return t;while(t>n)if(e!==this.src.charCodeAt(--t))return t+1;return t},o.prototype.getLines=function(t,e,n,r){var o,a,s,l,c,u,d,h=t;if(t>=e)return"";for(u=new Array(e-t),o=0;h<e;h++,o++){a=0,d=l=this.bMarks[h],c=h+1<e||r?this.eMarks[h]+1:this.eMarks[h];while(l<c&&a<n){if(s=this.src.charCodeAt(l),i(s))9===s?a+=4-(a+this.bsCount[h])%4:a++;else{if(!(l-d<this.tShift[h]))break;a++}l++}u[o]=a>n?new Array(a-n+1).join(" ")+this.src.slice(l,c):this.src.slice(l,c)}return u.join("")},o.prototype.Token=r,t.exports=o},b401:function(t,e,n){"use strict";function r(t,e){var n,r,i,o,a,s,l,c,u={},d=e.length;if(d){var h=0,p=-2,f=[];for(n=0;n<d;n++)if(i=e[n],f.push(0),e[h].marker===i.marker&&p===i.token-1||(h=n),p=i.token,i.length=i.length||0,i.close){for(u.hasOwnProperty(i.marker)||(u[i.marker]=[-1,-1,-1,-1,-1,-1]),a=u[i.marker][(i.open?3:0)+i.length%3],r=h-f[h]-1,s=r;r>a;r-=f[r]+1)if(o=e[r],o.marker===i.marker&&o.open&&o.end<0&&(l=!1,(o.close||i.open)&&(o.length+i.length)%3===0&&(o.length%3===0&&i.length%3===0||(l=!0)),!l)){c=r>0&&!e[r-1].open?f[r-1]+1:0,f[n]=n-r+c,f[r]=c,i.open=!1,o.end=n,o.close=!1,s=-1,p=-2;break}-1!==s&&(u[i.marker][(i.open?3:0)+(i.length||0)%3]=s)}}}t.exports=function(t){var e,n=t.tokens_meta,i=t.tokens_meta.length;for(r(t,t.delimiters),e=0;e<i;e++)n[e]&&n[e].delimiters&&r(t,n[e].delimiters)}},b4c9:function(t,e,n){"use strict";t.exports=n("c7dd6")},b680:function(t,e,n){"use strict";var r=n("23e7"),i=n("e330"),o=n("5926"),a=n("408a"),s=n("1148"),l=n("d039"),c=RangeError,u=String,d=Math.floor,h=i(s),p=i("".slice),f=i(1..toFixed),g=function(t,e,n){return 0===e?n:e%2===1?g(t,e-1,n*t):g(t*t,e/2,n)},m=function(t){var e=0,n=t;while(n>=4096)e+=12,n/=4096;while(n>=2)e+=1,n/=2;return e},v=function(t,e,n){var r=-1,i=n;while(++r<6)i+=e*t[r],t[r]=i%1e7,i=d(i/1e7)},b=function(t,e){var n=6,r=0;while(--n>=0)r+=t[n],t[n]=d(r/e),r=r%e*1e7},y=function(t){var e=6,n="";while(--e>=0)if(""!==n||0===e||0!==t[e]){var r=u(t[e]);n=""===n?r:n+h("0",7-r.length)+r}return n},w=l((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!l((function(){f({})}));r({target:"Number",proto:!0,forced:w},{toFixed:function(t){var e,n,r,i,s=a(this),l=o(t),d=[0,0,0,0,0,0],f="",w="0";if(l<0||l>20)throw c("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return u(s);if(s<0&&(f="-",s=-s),s>1e-21)if(e=m(s*g(2,69,1))-69,n=e<0?s*g(2,-e,1):s/g(2,e,1),n*=4503599627370496,e=52-e,e>0){v(d,0,n),r=l;while(r>=7)v(d,1e7,0),r-=7;v(d,g(10,r,1),0),r=e-1;while(r>=23)b(d,1<<23),r-=23;b(d,1<<r),v(d,1,1),b(d,2),w=y(d)}else v(d,0,n),v(d,1<<-e,0),w=y(d)+h("0",l);return l>0?(i=w.length,w=f+(i<=l?"0."+h("0",l-i)+w:p(w,0,i-l)+"."+p(w,i-l))):w=f+w,w}})},b6b7:function(t,e,n){var r=n("ebb5"),i=n("4840"),o=r.aTypedArrayConstructor,a=r.getTypedArrayConstructor;t.exports=function(t){return o(i(t,a(t)))}},b6fc:function(t,e,n){},b7ef:function(t,e,n){"use strict";var r=n("23e7"),i=n("da84"),o=n("d066"),a=n("5c6c"),s=n("9bf2").f,l=n("1a2d"),c=n("19aa"),u=n("7156"),d=n("e391"),h=n("cf98"),p=n("0d26"),f=n("83ab"),g=n("c430"),m="DOMException",v=o("Error"),b=o(m),y=function(){c(this,w);var t=arguments.length,e=d(t<1?void 0:arguments[0]),n=d(t<2?void 0:arguments[1],"Error"),r=new b(e,n),i=v(e);return i.name=m,s(r,"stack",a(1,p(i.stack,1))),u(r,this,y),r},w=y.prototype=b.prototype,x="stack"in v(m),C="stack"in new b(1,2),k=b&&f&&Object.getOwnPropertyDescriptor(i,m),A=!!k&&!(k.writable&&k.configurable),S=x&&!A&&!C;r({global:!0,constructor:!0,forced:g||S},{DOMException:S?y:b});var E=o(m),O=E.prototype;if(O.constructor!==E)for(var T in g||s(O,"constructor",a(1,E)),h)if(l(h,T)){var _=h[T],M=_.s;l(E,M)||s(E,M,a(6,_.c))}},b7fa:function(t,e,n){"use strict";n("546b")},b84e:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.drawArc=e.arcToCurves=e.drawPoints=e.isValid=void 0;var r=n("6762"),i=new RegExp("^[\\s\\dLMCZz,.]*$");function o(t){return"string"===typeof t&&i.test(t)}function a(t,e){return(t%e+e)%e}function s(t,e,n,i,o){var s=[],l=t[t.length-1],c=null!=e&&e>0,u=e||0;if(i&&c){t=t.slice();var d=t[0],h=new r.Point(l.x+(d.x-l.x)/2,l.y+(d.y-l.y)/2);t.splice(0,0,h)}var p=t[0],f=1;n?s.push("M",p.x,p.y):s.push("L",p.x,p.y);while(f<(i?t.length:t.length-1)){var g=t[a(f,t.length)],m=p.x-g.x,v=p.y-g.y;if(c&&(0!==m||0!==v)&&(null==o||o.indexOf(f-1)<0)){var b=Math.sqrt(m*m+v*v),y=m*Math.min(u,b/2)/b,w=v*Math.min(u,b/2)/b,x=g.x+y,C=g.y+w;s.push("L",x,C);var k=t[a(f+1,t.length)];while(f<t.length-2&&0===Math.round(k.x-g.x)&&0===Math.round(k.y-g.y))k=t[a(f+2,t.length)],f+=1;m=k.x-g.x,v=k.y-g.y,b=Math.max(1,Math.sqrt(m*m+v*v));var A=m*Math.min(u,b/2)/b,S=v*Math.min(u,b/2)/b,E=g.x+A,O=g.y+S;s.push("Q",g.x,g.y,E,O),g=new r.Point(E,O)}else s.push("L",g.x,g.y);p=g,f+=1}return i?s.push("Z"):s.push("L",l.x,l.y),s.map((function(t){return"string"===typeof t?t:+t.toFixed(3)})).join(" ")}function l(t,e){void 0===e&&(e={});var n=[];return t&&t.length&&t.forEach((function(t){Array.isArray(t)?n.push({x:t[0],y:t[1]}):n.push({x:t.x,y:t.y})})),s(n,e.round,null==e.initialMove||e.initialMove,e.close,e.exclude)}function c(t,e,n,r,i,o,a,s,l){if(void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0),0===n||0===r)return[];s-=t,l-=e,n=Math.abs(n),r=Math.abs(r);var c,u=-s/2,d=-l/2,h=Math.cos(i*Math.PI/180),p=Math.sin(i*Math.PI/180),f=h*u+p*d,g=-1*p*u+h*d,m=f*f,v=g*g,b=n*n,y=r*r,w=m/b+v/y;if(w>1)n=Math.sqrt(w)*n,r=Math.sqrt(w)*r,c=0;else{var x=1;o===a&&(x=-1),c=x*Math.sqrt((b*y-b*v-y*m)/(b*v+y*m))}var C=c*n*g/r,k=-1*c*r*f/n,A=h*C-p*k+s/2,S=p*C+h*k+l/2,E=Math.atan2((g-k)/r,(f-C)/n)-Math.atan2(0,1),O=E>=0?E:2*Math.PI+E;E=Math.atan2((-g-k)/r,(-f-C)/n)-Math.atan2((g-k)/r,(f-C)/n);var T=E>=0?E:2*Math.PI+E;0===a&&T>0?T-=2*Math.PI:0!==a&&T<0&&(T+=2*Math.PI);for(var _=2*T/Math.PI,M=Math.ceil(_<0?-1*_:_),N=T/M,P=8/3*Math.sin(N/4)*Math.sin(N/4)/Math.sin(N/2),L=h*n,D=h*r,j=p*n,I=p*r,R=Math.cos(O),F=Math.sin(O),B=-P*(L*F+I*R),z=-P*(j*F-D*R),H=0,V=0,q=[],U=0;U<M;U+=1){O+=N,R=Math.cos(O),F=Math.sin(O),H=L*R-I*F+A,V=j*R+D*F+S;var W=-P*(L*F+I*R),$=-P*(j*F-D*R),G=6*U;q[G]=Number(B+t),q[G+1]=Number(z+e),q[G+2]=Number(H-W+t),q[G+3]=Number(V-$+e),q[G+4]=Number(H+t),q[G+5]=Number(V+e),B=H+W,z=V+$}return q.map((function(t){return+t.toFixed(2)}))}function u(t,e,n,r,i,o,a,s,l){void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0);var u=[],d=c(t,e,n,r,i,o,a,s,l);if(null!=d)for(var h=0,p=d.length;h<p;h+=6)u.push("C",d[h],d[h+1],d[h+2],d[h+3],d[h+4],d[h+5]);return u.join(" ")}e.isValid=o,e.drawPoints=l,e.arcToCurves=c,e.drawArc=u},b866:function(t,e,n){},b8e7:function(t,e,n){},b917:function(t,e){for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r={},i=0;i<66;i++)r[n.charAt(i)]=i;t.exports={itoc:n,ctoi:r}},b933:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";var e,n,r=t.Pos;function i(t){var e=t.flags;return null!=e?e:(t.ignoreCase?"i":"")+(t.global?"g":"")+(t.multiline?"m":"")}function o(t,e){for(var n=i(t),r=n,o=0;o<e.length;o++)-1==r.indexOf(e.charAt(o))&&(r+=e.charAt(o));return n==r?t:new RegExp(t.source,r)}function a(t){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(t.source)}function s(t,e,n){e=o(e,"g");for(var i=n.line,a=n.ch,s=t.lastLine();i<=s;i++,a=0){e.lastIndex=a;var l=t.getLine(i),c=e.exec(l);if(c)return{from:r(i,c.index),to:r(i,c.index+c[0].length),match:c}}}function l(t,e,n){if(!a(e))return s(t,e,n);e=o(e,"gm");for(var i,l=1,c=n.line,u=t.lastLine();c<=u;){for(var d=0;d<l;d++){if(c>u)break;var h=t.getLine(c++);i=null==i?h:i+"\n"+h}l*=2,e.lastIndex=n.ch;var p=e.exec(i);if(p){var f=i.slice(0,p.index).split("\n"),g=p[0].split("\n"),m=n.line+f.length-1,v=f[f.length-1].length;return{from:r(m,v),to:r(m+g.length-1,1==g.length?v+g[0].length:g[g.length-1].length),match:p}}}}function c(t,e,n){var r,i=0;while(i<=t.length){e.lastIndex=i;var o=e.exec(t);if(!o)break;var a=o.index+o[0].length;if(a>t.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function u(t,e,n){e=o(e,"g");for(var i=n.line,a=n.ch,s=t.firstLine();i>=s;i--,a=-1){var l=t.getLine(i),u=c(l,e,a<0?0:l.length-a);if(u)return{from:r(i,u.index),to:r(i,u.index+u[0].length),match:u}}}function d(t,e,n){if(!a(e))return u(t,e,n);e=o(e,"gm");for(var i,s=1,l=t.getLine(n.line).length-n.ch,d=n.line,h=t.firstLine();d>=h;){for(var p=0;p<s&&d>=h;p++){var f=t.getLine(d--);i=null==i?f:f+"\n"+i}s*=2;var g=c(i,e,l);if(g){var m=i.slice(0,g.index).split("\n"),v=g[0].split("\n"),b=d+m.length,y=m[m.length-1].length;return{from:r(b,y),to:r(b+v.length-1,1==v.length?y+v[0].length:v[v.length-1].length),match:g}}}}function h(t,e,n,r){if(t.length==e.length)return n;for(var i=0,o=n+Math.max(0,t.length-e.length);;){if(i==o)return i;var a=i+o>>1,s=r(t.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function p(t,i,o,a){if(!i.length)return null;var s=a?e:n,l=s(i).split(/\r|\n\r?/);t:for(var c=o.line,u=o.ch,d=t.lastLine()+1-l.length;c<=d;c++,u=0){var p=t.getLine(c).slice(u),f=s(p);if(1==l.length){var g=f.indexOf(l[0]);if(-1==g)continue t;o=h(p,f,g,s)+u;return{from:r(c,h(p,f,g,s)+u),to:r(c,h(p,f,g+l[0].length,s)+u)}}var m=f.length-l[0].length;if(f.slice(m)==l[0]){for(var v=1;v<l.length-1;v++)if(s(t.getLine(c+v))!=l[v])continue t;var b=t.getLine(c+l.length-1),y=s(b),w=l[l.length-1];if(y.slice(0,w.length)==w)return{from:r(c,h(p,f,m,s)+u),to:r(c+l.length-1,h(b,y,w.length,s))}}}}function f(t,i,o,a){if(!i.length)return null;var s=a?e:n,l=s(i).split(/\r|\n\r?/);t:for(var c=o.line,u=o.ch,d=t.firstLine()-1+l.length;c>=d;c--,u=-1){var p=t.getLine(c);u>-1&&(p=p.slice(0,u));var f=s(p);if(1==l.length){var g=f.lastIndexOf(l[0]);if(-1==g)continue t;return{from:r(c,h(p,f,g,s)),to:r(c,h(p,f,g+l[0].length,s))}}var m=l[l.length-1];if(f.slice(0,m.length)==m){var v=1;for(o=c-l.length+1;v<l.length-1;v++)if(s(t.getLine(o+v))!=l[v])continue t;var b=t.getLine(c+1-l.length),y=s(b);if(y.slice(y.length-l[0].length)==l[0])return{from:r(c+1-l.length,h(b,y,b.length-l[0].length,s)),to:r(c,h(p,f,m.length,s))}}}}function g(t,e,n,i){var a;this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=t,n=n?t.clipPos(n):r(0,0),this.pos={from:n,to:n},"object"==typeof i?a=i.caseFold:(a=i,i=null),"string"==typeof e?(null==a&&(a=!1),this.matches=function(n,r){return(n?f:p)(t,e,r,a)}):(e=o(e,"gm"),i&&!1===i.multiline?this.matches=function(n,r){return(n?u:s)(t,e,r)}:this.matches=function(n,r){return(n?d:l)(t,e,r)})}String.prototype.normalize?(e=function(t){return t.normalize("NFD").toLowerCase()},n=function(t){return t.normalize("NFD")}):(e=function(t){return t.toLowerCase()},n=function(t){return t}),g.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){var n=this.doc.clipPos(e?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(n=r(n.line,n.ch),e?(n.ch--,n.ch<0&&(n.line--,n.ch=(this.doc.getLine(n.line)||"").length)):(n.ch++,n.ch>(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=t.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var i=this.matches(e,n);if(this.afterEmptyMatch=i&&0==t.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=r(e?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e,n){if(this.atOccurrence){var i=t.splitLines(e);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},t.defineExtension("getSearchCursor",(function(t,e,n){return new g(this.doc,t,e,n)})),t.defineDocExtension("getSearchCursor",(function(t,e,n){return new g(this,t,e,n)})),t.defineExtension("selectMatches",(function(e,n){var r=[],i=this.getSearchCursor(e,this.getCursor("from"),n);while(i.findNext()){if(t.cmpPos(i.to(),this.getCursor("to"))>0)break;r.push({anchor:i.from(),head:i.to()})}r.length&&this.setSelections(r,0)}))}))},bab4:function(t,e,n){
/*!
* Cropper.js v1.5.12
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2021-06-12T08:00:17.411Z
*/
(function(e,n){t.exports=n()})(0,(function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function n(t){return n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function a(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(t){return l(t)||c(t)||u(t)||h()}function l(t){if(Array.isArray(t))return d(t)}function c(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t,e){if(t){if("string"===typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var p="undefined"!==typeof window&&"undefined"!==typeof window.document,f=p?window:{},g=!(!p||!f.document.documentElement)&&"ontouchstart"in f.document.documentElement,m=!!p&&"PointerEvent"in f,v="cropper",b="all",y="crop",w="move",x="zoom",C="e",k="w",A="s",S="n",E="ne",O="nw",T="se",_="sw",M="".concat(v,"-crop"),N="".concat(v,"-disabled"),P="".concat(v,"-hidden"),L="".concat(v,"-hide"),D="".concat(v,"-invisible"),j="".concat(v,"-modal"),I="".concat(v,"-move"),R="".concat(v,"Action"),F="".concat(v,"Preview"),B="crop",z="move",H="none",V="crop",q="cropend",U="cropmove",W="cropstart",$="dblclick",G=g?"touchstart":"mousedown",Y=g?"touchmove":"mousemove",X=g?"touchend touchcancel":"mouseup",K=m?"pointerdown":G,Z=m?"pointermove":Y,J=m?"pointerup pointercancel":X,Q="ready",tt="resize",et="wheel",nt="zoom",rt="image/jpeg",it=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,ot=/^data:/,at=/^data:image\/jpeg;base64,/,st=/^img|canvas$/i,lt=200,ct=100,ut={viewMode:0,dragMode:B,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:lt,minContainerHeight:ct,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},dt='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',ht=Number.isNaN||f.isNaN;function pt(t){return"number"===typeof t&&!ht(t)}var ft=function(t){return t>0&&t<1/0};function gt(t){return"undefined"===typeof t}function mt(t){return"object"===n(t)&&null!==t}var vt=Object.prototype.hasOwnProperty;function bt(t){if(!mt(t))return!1;try{var e=t.constructor,n=e.prototype;return e&&n&&vt.call(n,"isPrototypeOf")}catch(r){return!1}}function yt(t){return"function"===typeof t}var wt=Array.prototype.slice;function xt(t){return Array.from?Array.from(t):wt.call(t)}function Ct(t,e){return t&&yt(e)&&(Array.isArray(t)||pt(t.length)?xt(t).forEach((function(n,r){e.call(t,n,r,t)})):mt(t)&&Object.keys(t).forEach((function(n){e.call(t,t[n],n,t)}))),t}var kt=Object.assign||function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return mt(t)&&n.length>0&&n.forEach((function(e){mt(e)&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t},At=/\.\d*(?:0|9){12}\d*$/;function St(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return At.test(t)?Math.round(t*e)/e:t}var Et=/^width|height|left|top|marginLeft|marginTop$/;function Ot(t,e){var n=t.style;Ct(e,(function(t,e){Et.test(e)&&pt(t)&&(t="".concat(t,"px")),n[e]=t}))}function Tt(t,e){return t.classList?t.classList.contains(e):t.className.indexOf(e)>-1}function _t(t,e){if(e)if(pt(t.length))Ct(t,(function(t){_t(t,e)}));else if(t.classList)t.classList.add(e);else{var n=t.className.trim();n?n.indexOf(e)<0&&(t.className="".concat(n," ").concat(e)):t.className=e}}function Mt(t,e){e&&(pt(t.length)?Ct(t,(function(t){Mt(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Nt(t,e,n){e&&(pt(t.length)?Ct(t,(function(t){Nt(t,e,n)})):n?_t(t,e):Mt(t,e))}var Pt=/([a-z\d])([A-Z])/g;function Lt(t){return t.replace(Pt,"$1-$2").toLowerCase()}function Dt(t,e){return mt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Lt(e)))}function jt(t,e,n){mt(n)?t[e]=n:t.dataset?t.dataset[e]=n:t.setAttribute("data-".concat(Lt(e)),n)}function It(t,e){if(mt(t[e]))try{delete t[e]}catch(n){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(n){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(Lt(e)))}var Rt=/\s\s*/,Ft=function(){var t=!1;if(p){var e=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});f.addEventListener("test",n,r),f.removeEventListener("test",n,r)}return t}();function Bt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n;e.trim().split(Rt).forEach((function(e){if(!Ft){var o=t.listeners;o&&o[e]&&o[e][n]&&(i=o[e][n],delete o[e][n],0===Object.keys(o[e]).length&&delete o[e],0===Object.keys(o).length&&delete t.listeners)}t.removeEventListener(e,i,r)}))}function zt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n;e.trim().split(Rt).forEach((function(e){if(r.once&&!Ft){var o=t.listeners,a=void 0===o?{}:o;i=function(){delete a[e][n],t.removeEventListener(e,i,r);for(var o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];n.apply(t,s)},a[e]||(a[e]={}),a[e][n]&&t.removeEventListener(e,a[e][n],r),a[e][n]=i,t.listeners=a}t.addEventListener(e,i,r)}))}function Ht(t,e,n){var r;return yt(Event)&&yt(CustomEvent)?r=new CustomEvent(e,{detail:n,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(e,!0,!0,n)),t.dispatchEvent(r)}function Vt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var qt=f.location,Ut=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Wt(t){var e=t.match(Ut);return null!==e&&(e[1]!==qt.protocol||e[2]!==qt.hostname||e[3]!==qt.port)}function $t(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function Gt(t){var e=t.rotate,n=t.scaleX,r=t.scaleY,i=t.translateX,o=t.translateY,a=[];pt(i)&&0!==i&&a.push("translateX(".concat(i,"px)")),pt(o)&&0!==o&&a.push("translateY(".concat(o,"px)")),pt(e)&&0!==e&&a.push("rotate(".concat(e,"deg)")),pt(n)&&1!==n&&a.push("scaleX(".concat(n,")")),pt(r)&&1!==r&&a.push("scaleY(".concat(r,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Yt(t){var n=e({},t),r=0;return Ct(t,(function(t,e){delete n[e],Ct(n,(function(e){var n=Math.abs(t.startX-e.startX),i=Math.abs(t.startY-e.startY),o=Math.abs(t.endX-e.endX),a=Math.abs(t.endY-e.endY),s=Math.sqrt(n*n+i*i),l=Math.sqrt(o*o+a*a),c=(l-s)/s;Math.abs(c)>Math.abs(r)&&(r=c)}))})),r}function Xt(t,n){var r=t.pageX,i=t.pageY,o={endX:r,endY:i};return n?o:e({startX:r,startY:i},o)}function Kt(t){var e=0,n=0,r=0;return Ct(t,(function(t){var i=t.startX,o=t.startY;e+=i,n+=o,r+=1})),e/=r,n/=r,{pageX:e,pageY:n}}function Zt(t){var e=t.aspectRatio,n=t.height,r=t.width,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",o=ft(r),a=ft(n);if(o&&a){var s=n*e;"contain"===i&&s>r||"cover"===i&&s<r?n=r/e:r=n*e}else o?n=r/e:a&&(r=n*e);return{width:r,height:n}}function Jt(t){var e=t.width,n=t.height,r=t.degree;if(r=Math.abs(r)%180,90===r)return{width:n,height:e};var i=r%90*Math.PI/180,o=Math.sin(i),a=Math.cos(i),s=e*a+n*o,l=e*o+n*a;return r>90?{width:l,height:s}:{width:s,height:l}}function Qt(t,e,n,r){var i=e.aspectRatio,o=e.naturalWidth,a=e.naturalHeight,l=e.rotate,c=void 0===l?0:l,u=e.scaleX,d=void 0===u?1:u,h=e.scaleY,p=void 0===h?1:h,f=n.aspectRatio,g=n.naturalWidth,m=n.naturalHeight,v=r.fillColor,b=void 0===v?"transparent":v,y=r.imageSmoothingEnabled,w=void 0===y||y,x=r.imageSmoothingQuality,C=void 0===x?"low":x,k=r.maxWidth,A=void 0===k?1/0:k,S=r.maxHeight,E=void 0===S?1/0:S,O=r.minWidth,T=void 0===O?0:O,_=r.minHeight,M=void 0===_?0:_,N=document.createElement("canvas"),P=N.getContext("2d"),L=Zt({aspectRatio:f,width:A,height:E}),D=Zt({aspectRatio:f,width:T,height:M},"cover"),j=Math.min(L.width,Math.max(D.width,g)),I=Math.min(L.height,Math.max(D.height,m)),R=Zt({aspectRatio:i,width:A,height:E}),F=Zt({aspectRatio:i,width:T,height:M},"cover"),B=Math.min(R.width,Math.max(F.width,o)),z=Math.min(R.height,Math.max(F.height,a)),H=[-B/2,-z/2,B,z];return N.width=St(j),N.height=St(I),P.fillStyle=b,P.fillRect(0,0,j,I),P.save(),P.translate(j/2,I/2),P.rotate(c*Math.PI/180),P.scale(d,p),P.imageSmoothingEnabled=w,P.imageSmoothingQuality=C,P.drawImage.apply(P,[t].concat(s(H.map((function(t){return Math.floor(St(t))}))))),P.restore(),N}var te=String.fromCharCode;function ee(t,e,n){var r="";n+=e;for(var i=e;i<n;i+=1)r+=te(t.getUint8(i));return r}var ne=/^data:.*,/;function re(t){var e=t.replace(ne,""),n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r);return Ct(i,(function(t,e){i[e]=n.charCodeAt(e)})),r}function ie(t,e){var n=[],r=8192,i=new Uint8Array(t);while(i.length>0)n.push(te.apply(null,xt(i.subarray(0,r)))),i=i.subarray(r);return"data:".concat(e,";base64,").concat(btoa(n.join("")))}function oe(t){var e,n=new DataView(t);try{var r,i,o;if(255===n.getUint8(0)&&216===n.getUint8(1)){var a=n.byteLength,s=2;while(s+1<a){if(255===n.getUint8(s)&&225===n.getUint8(s+1)){i=s;break}s+=1}}if(i){var l=i+4,c=i+10;if("Exif"===ee(n,l,4)){var u=n.getUint16(c);if(r=18761===u,(r||19789===u)&&42===n.getUint16(c+2,r)){var d=n.getUint32(c+4,r);d>=8&&(o=c+d)}}}if(o){var h,p,f=n.getUint16(o,r);for(p=0;p<f;p+=1)if(h=o+12*p+2,274===n.getUint16(h,r)){h+=8,e=n.getUint16(h,r),n.setUint16(h,1,r);break}}}catch(g){e=1}return e}function ae(t){var e=0,n=1,r=1;switch(t){case 2:n=-1;break;case 3:e=-180;break;case 4:r=-1;break;case 5:e=90,r=-1;break;case 6:e=90;break;case 7:e=90,n=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:n,scaleY:r}}var se={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,n=this.container,r=this.cropper,i=Number(e.minContainerWidth),o=Number(e.minContainerHeight);_t(r,P),Mt(t,P);var a={width:Math.max(n.offsetWidth,i>=0?i:lt),height:Math.max(n.offsetHeight,o>=0?o:ct)};this.containerData=a,Ot(r,{width:a.width,height:a.height}),_t(t,P),Mt(r,P)},initCanvas:function(){var t=this.containerData,e=this.imageData,n=this.options.viewMode,r=Math.abs(e.rotate)%180===90,i=r?e.naturalHeight:e.naturalWidth,o=r?e.naturalWidth:e.naturalHeight,a=i/o,s=t.width,l=t.height;t.height*a>t.width?3===n?s=t.height*a:l=t.width/a:3===n?l=t.width/a:s=t.height*a;var c={aspectRatio:a,naturalWidth:i,naturalHeight:o,width:s,height:l};this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=kt({},c)},limitCanvas:function(t,e){var n=this.options,r=this.containerData,i=this.canvasData,o=this.cropBoxData,a=n.viewMode,s=i.aspectRatio,l=this.cropped&&o;if(t){var c=Number(n.minCanvasWidth)||0,u=Number(n.minCanvasHeight)||0;a>1?(c=Math.max(c,r.width),u=Math.max(u,r.height),3===a&&(u*s>c?c=u*s:u=c/s)):a>0&&(c?c=Math.max(c,l?o.width:0):u?u=Math.max(u,l?o.height:0):l&&(c=o.width,u=o.height,u*s>c?c=u*s:u=c/s));var d=Zt({aspectRatio:s,width:c,height:u});c=d.width,u=d.height,i.minWidth=c,i.minHeight=u,i.maxWidth=1/0,i.maxHeight=1/0}if(e)if(a>(l?0:1)){var h=r.width-i.width,p=r.height-i.height;i.minLeft=Math.min(0,h),i.minTop=Math.min(0,p),i.maxLeft=Math.max(0,h),i.maxTop=Math.max(0,p),l&&this.limited&&(i.minLeft=Math.min(o.left,o.left+(o.width-i.width)),i.minTop=Math.min(o.top,o.top+(o.height-i.height)),i.maxLeft=o.left,i.maxTop=o.top,2===a&&(i.width>=r.width&&(i.minLeft=Math.min(0,h),i.maxLeft=Math.max(0,h)),i.height>=r.height&&(i.minTop=Math.min(0,p),i.maxTop=Math.max(0,p))))}else i.minLeft=-i.width,i.minTop=-i.height,i.maxLeft=r.width,i.maxTop=r.height},renderCanvas:function(t,e){var n=this.canvasData,r=this.imageData;if(e){var i=Jt({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),o=i.width,a=i.height,s=n.width*(o/n.naturalWidth),l=n.height*(a/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(l-n.height)/2,n.width=s,n.height=l,n.aspectRatio=o/a,n.naturalWidth=o,n.naturalHeight=a,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,Ot(this.canvas,kt({width:n.width,height:n.height},Gt({translateX:n.left,translateY:n.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,n=this.imageData,r=n.naturalWidth*(e.width/e.naturalWidth),i=n.naturalHeight*(e.height/e.naturalHeight);kt(n,{width:r,height:i,left:(e.width-r)/2,top:(e.height-i)/2}),Ot(this.image,kt({width:n.width,height:n.height},Gt(kt({translateX:n.left,translateY:n.top},n)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,n=t.aspectRatio||t.initialAspectRatio,r=Number(t.autoCropArea)||.8,i={width:e.width,height:e.height};n&&(e.height*n>e.width?i.height=i.width/n:i.width=i.height*n),this.cropBoxData=i,this.limitCropBox(!0,!0),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),i.width=Math.max(i.minWidth,i.width*r),i.height=Math.max(i.minHeight,i.height*r),i.left=e.left+(e.width-i.width)/2,i.top=e.top+(e.height-i.height)/2,i.oldLeft=i.left,i.oldTop=i.top,this.initialCropBoxData=kt({},i)},limitCropBox:function(t,e){var n=this.options,r=this.containerData,i=this.canvasData,o=this.cropBoxData,a=this.limited,s=n.aspectRatio;if(t){var l=Number(n.minCropBoxWidth)||0,c=Number(n.minCropBoxHeight)||0,u=a?Math.min(r.width,i.width,i.width+i.left,r.width-i.left):r.width,d=a?Math.min(r.height,i.height,i.height+i.top,r.height-i.top):r.height;l=Math.min(l,r.width),c=Math.min(c,r.height),s&&(l&&c?c*s>l?c=l/s:l=c*s:l?c=l/s:c&&(l=c*s),d*s>u?d=u/s:u=d*s),o.minWidth=Math.min(l,u),o.minHeight=Math.min(c,d),o.maxWidth=u,o.maxHeight=d}e&&(a?(o.minLeft=Math.max(0,i.left),o.minTop=Math.max(0,i.top),o.maxLeft=Math.min(r.width,i.left+i.width)-o.width,o.maxTop=Math.min(r.height,i.top+i.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=r.width-o.width,o.maxTop=r.height-o.height))},renderCropBox:function(){var t=this.options,e=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,t.movable&&t.cropBoxMovable&&jt(this.face,R,n.width>=e.width&&n.height>=e.height?w:b),Ot(this.cropBox,kt({width:n.width,height:n.height},Gt({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Ht(this.element,V,this.getData())}},le={initPreview:function(){var t=this.element,e=this.crossOrigin,n=this.options.preview,r=e?this.crossOriginUrl:this.url,i=t.alt||"The image to preview",o=document.createElement("img");if(e&&(o.crossOrigin=e),o.src=r,o.alt=i,this.viewBox.appendChild(o),this.viewBoxImage=o,n){var a=n;"string"===typeof n?a=t.ownerDocument.querySelectorAll(n):n.querySelector&&(a=[n]),this.previews=a,Ct(a,(function(t){var n=document.createElement("img");jt(t,F,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(n.crossOrigin=e),n.src=r,n.alt=i,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(n)}))}},resetPreview:function(){Ct(this.previews,(function(t){var e=Dt(t,F);Ot(t,{width:e.width,height:e.height}),t.innerHTML=e.html,It(t,F)}))},preview:function(){var t=this.imageData,e=this.canvasData,n=this.cropBoxData,r=n.width,i=n.height,o=t.width,a=t.height,s=n.left-e.left-t.left,l=n.top-e.top-t.top;this.cropped&&!this.disabled&&(Ot(this.viewBoxImage,kt({width:o,height:a},Gt(kt({translateX:-s,translateY:-l},t)))),Ct(this.previews,(function(e){var n=Dt(e,F),c=n.width,u=n.height,d=c,h=u,p=1;r&&(p=c/r,h=i*p),i&&h>u&&(p=u/i,d=r*p,h=u),Ot(e,{width:d,height:h}),Ot(e.getElementsByTagName("img")[0],kt({width:o*p,height:a*p},Gt(kt({translateX:-s*p,translateY:-l*p},t))))})))}},ce={bind:function(){var t=this.element,e=this.options,n=this.cropper;yt(e.cropstart)&&zt(t,W,e.cropstart),yt(e.cropmove)&&zt(t,U,e.cropmove),yt(e.cropend)&&zt(t,q,e.cropend),yt(e.crop)&&zt(t,V,e.crop),yt(e.zoom)&&zt(t,nt,e.zoom),zt(n,K,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&zt(n,et,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&zt(n,$,this.onDblclick=this.dblclick.bind(this)),zt(t.ownerDocument,Z,this.onCropMove=this.cropMove.bind(this)),zt(t.ownerDocument,J,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&zt(window,tt,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,n=this.cropper;yt(e.cropstart)&&Bt(t,W,e.cropstart),yt(e.cropmove)&&Bt(t,U,e.cropmove),yt(e.cropend)&&Bt(t,q,e.cropend),yt(e.crop)&&Bt(t,V,e.crop),yt(e.zoom)&&Bt(t,nt,e.zoom),Bt(n,K,this.onCropStart),e.zoomable&&e.zoomOnWheel&&Bt(n,et,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Bt(n,$,this.onDblclick),Bt(t.ownerDocument,Z,this.onCropMove),Bt(t.ownerDocument,J,this.onCropEnd),e.responsive&&Bt(window,tt,this.onResize)}},ue={resize:function(){if(!this.disabled){var t,e,n=this.options,r=this.container,i=this.containerData,o=r.offsetWidth/i.width,a=r.offsetHeight/i.height,s=Math.abs(o-1)>Math.abs(a-1)?o:a;if(1!==s)n.restore&&(t=this.getCanvasData(),e=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(Ct(t,(function(e,n){t[n]=e*s}))),this.setCropBoxData(Ct(e,(function(t,n){e[n]=t*s}))))}},dblclick:function(){this.disabled||this.options.dragMode===H||this.setDragMode(Tt(this.dragBox,M)?z:B)},wheel:function(t){var e=this,n=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50),t.deltaY?r=t.deltaY>0?1:-1:t.wheelDelta?r=-t.wheelDelta/120:t.detail&&(r=t.detail>0?1:-1),this.zoom(-r*n,t)))},cropStart:function(t){var e=t.buttons,n=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(pt(e)&&1!==e||pt(n)&&0!==n||t.ctrlKey))){var r,i=this.options,o=this.pointers;t.changedTouches?Ct(t.changedTouches,(function(t){o[t.identifier]=Xt(t)})):o[t.pointerId||0]=Xt(t),r=Object.keys(o).length>1&&i.zoomable&&i.zoomOnTouch?x:Dt(t.target,R),it.test(r)&&!1!==Ht(this.element,W,{originalEvent:t,action:r})&&(t.preventDefault(),this.action=r,this.cropping=!1,r===y&&(this.cropping=!0,_t(this.dragBox,j)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var n=this.pointers;t.preventDefault(),!1!==Ht(this.element,U,{originalEvent:t,action:e})&&(t.changedTouches?Ct(t.changedTouches,(function(t){kt(n[t.identifier]||{},Xt(t,!0))})):kt(n[t.pointerId||0]||{},Xt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,n=this.pointers;t.changedTouches?Ct(t.changedTouches,(function(t){delete n[t.identifier]})):delete n[t.pointerId||0],e&&(t.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,Nt(this.dragBox,j,this.cropped&&this.options.modal)),Ht(this.element,q,{originalEvent:t,action:e}))}}},de={change:function(t){var e,n=this.options,r=this.canvasData,i=this.containerData,o=this.cropBoxData,a=this.pointers,s=this.action,l=n.aspectRatio,c=o.left,u=o.top,d=o.width,h=o.height,p=c+d,f=u+h,g=0,m=0,v=i.width,M=i.height,N=!0;!l&&t.shiftKey&&(l=d&&h?d/h:1),this.limited&&(g=o.minLeft,m=o.minTop,v=g+Math.min(i.width,r.width,r.left+r.width),M=m+Math.min(i.height,r.height,r.top+r.height));var L=a[Object.keys(a)[0]],D={x:L.endX-L.startX,y:L.endY-L.startY},j=function(t){switch(t){case C:p+D.x>v&&(D.x=v-p);break;case k:c+D.x<g&&(D.x=g-c);break;case S:u+D.y<m&&(D.y=m-u);break;case A:f+D.y>M&&(D.y=M-f);break}};switch(s){case b:c+=D.x,u+=D.y;break;case C:if(D.x>=0&&(p>=v||l&&(u<=m||f>=M))){N=!1;break}j(C),d+=D.x,d<0&&(s=k,d=-d,c-=d),l&&(h=d/l,u+=(o.height-h)/2);break;case S:if(D.y<=0&&(u<=m||l&&(c<=g||p>=v))){N=!1;break}j(S),h-=D.y,u+=D.y,h<0&&(s=A,h=-h,u-=h),l&&(d=h*l,c+=(o.width-d)/2);break;case k:if(D.x<=0&&(c<=g||l&&(u<=m||f>=M))){N=!1;break}j(k),d-=D.x,c+=D.x,d<0&&(s=C,d=-d,c-=d),l&&(h=d/l,u+=(o.height-h)/2);break;case A:if(D.y>=0&&(f>=M||l&&(c<=g||p>=v))){N=!1;break}j(A),h+=D.y,h<0&&(s=S,h=-h,u-=h),l&&(d=h*l,c+=(o.width-d)/2);break;case E:if(l){if(D.y<=0&&(u<=m||p>=v)){N=!1;break}j(S),h-=D.y,u+=D.y,d=h*l}else j(S),j(C),D.x>=0?p<v?d+=D.x:D.y<=0&&u<=m&&(N=!1):d+=D.x,D.y<=0?u>m&&(h-=D.y,u+=D.y):(h-=D.y,u+=D.y);d<0&&h<0?(s=_,h=-h,d=-d,u-=h,c-=d):d<0?(s=O,d=-d,c-=d):h<0&&(s=T,h=-h,u-=h);break;case O:if(l){if(D.y<=0&&(u<=m||c<=g)){N=!1;break}j(S),h-=D.y,u+=D.y,d=h*l,c+=o.width-d}else j(S),j(k),D.x<=0?c>g?(d-=D.x,c+=D.x):D.y<=0&&u<=m&&(N=!1):(d-=D.x,c+=D.x),D.y<=0?u>m&&(h-=D.y,u+=D.y):(h-=D.y,u+=D.y);d<0&&h<0?(s=T,h=-h,d=-d,u-=h,c-=d):d<0?(s=E,d=-d,c-=d):h<0&&(s=_,h=-h,u-=h);break;case _:if(l){if(D.x<=0&&(c<=g||f>=M)){N=!1;break}j(k),d-=D.x,c+=D.x,h=d/l}else j(A),j(k),D.x<=0?c>g?(d-=D.x,c+=D.x):D.y>=0&&f>=M&&(N=!1):(d-=D.x,c+=D.x),D.y>=0?f<M&&(h+=D.y):h+=D.y;d<0&&h<0?(s=E,h=-h,d=-d,u-=h,c-=d):d<0?(s=T,d=-d,c-=d):h<0&&(s=O,h=-h,u-=h);break;case T:if(l){if(D.x>=0&&(p>=v||f>=M)){N=!1;break}j(C),d+=D.x,h=d/l}else j(A),j(C),D.x>=0?p<v?d+=D.x:D.y>=0&&f>=M&&(N=!1):d+=D.x,D.y>=0?f<M&&(h+=D.y):h+=D.y;d<0&&h<0?(s=O,h=-h,d=-d,u-=h,c-=d):d<0?(s=_,d=-d,c-=d):h<0&&(s=E,h=-h,u-=h);break;case w:this.move(D.x,D.y),N=!1;break;case x:this.zoom(Yt(a),t),N=!1;break;case y:if(!D.x||!D.y){N=!1;break}e=Vt(this.cropper),c=L.startX-e.left,u=L.startY-e.top,d=o.minWidth,h=o.minHeight,D.x>0?s=D.y>0?T:E:D.x<0&&(c-=d,s=D.y>0?_:O),D.y<0&&(u-=h),this.cropped||(Mt(this.cropBox,P),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}N&&(o.width=d,o.height=h,o.left=c,o.top=u,this.action=s,this.renderCropBox()),Ct(a,(function(t){t.startX=t.endX,t.startY=t.endY}))}},he={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&_t(this.dragBox,j),Mt(this.cropBox,P),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=kt({},this.initialImageData),this.canvasData=kt({},this.initialCanvasData),this.cropBoxData=kt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(kt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Mt(this.dragBox,j),_t(this.cropBox,P)),this},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,Ct(this.previews,(function(e){e.getElementsByTagName("img")[0].src=t})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Mt(this.cropper,N)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,_t(this.cropper,N)),this},destroy:function(){var t=this.element;return t[v]?(t[v]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,r=n.left,i=n.top;return this.moveTo(gt(t)?t:r+Number(t),gt(e)?e:i+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,r=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(pt(t)&&(n.left=t,r=!0),pt(e)&&(n.top=e,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(t,e){var n=this.canvasData;return t=Number(t),t=t<0?1/(1-t):1+t,this.zoomTo(n.width*t/n.naturalWidth,null,e)},zoomTo:function(t,e,n){var r=this.options,i=this.canvasData,o=i.width,a=i.height,s=i.naturalWidth,l=i.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&r.zoomable){var c=s*t,u=l*t;if(!1===Ht(this.element,nt,{ratio:t,oldRatio:o/s,originalEvent:n}))return this;if(n){var d=this.pointers,h=Vt(this.cropper),p=d&&Object.keys(d).length?Kt(d):{pageX:n.pageX,pageY:n.pageY};i.left-=(c-o)*((p.pageX-h.left-i.left)/o),i.top-=(u-a)*((p.pageY-h.top-i.top)/a)}else bt(e)&&pt(e.x)&&pt(e.y)?(i.left-=(c-o)*((e.x-i.left)/o),i.top-=(u-a)*((e.y-i.top)/a)):(i.left-=(c-o)/2,i.top-=(u-a)/2);i.width=c,i.height=u,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),pt(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,pt(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(pt(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.imageData,r=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(pt(t)&&(n.scaleX=t,r=!0),pt(e)&&(n.scaleY=e,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,r=this.imageData,i=this.canvasData,o=this.cropBoxData;if(this.ready&&this.cropped){t={x:o.left-i.left,y:o.top-i.top,width:o.width,height:o.height};var a=r.width/r.naturalWidth;if(Ct(t,(function(e,n){t[n]=e/a})),e){var s=Math.round(t.y+t.height),l=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=l-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return n.rotatable&&(t.rotate=r.rotate||0),n.scalable&&(t.scaleX=r.scaleX||1,t.scaleY=r.scaleY||1),t},setData:function(t){var e=this.options,n=this.imageData,r=this.canvasData,i={};if(this.ready&&!this.disabled&&bt(t)){var o=!1;e.rotatable&&pt(t.rotate)&&t.rotate!==n.rotate&&(n.rotate=t.rotate,o=!0),e.scalable&&(pt(t.scaleX)&&t.scaleX!==n.scaleX&&(n.scaleX=t.scaleX,o=!0),pt(t.scaleY)&&t.scaleY!==n.scaleY&&(n.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var a=n.width/n.naturalWidth;pt(t.x)&&(i.left=t.x*a+r.left),pt(t.y)&&(i.top=t.y*a+r.top),pt(t.width)&&(i.width=t.width*a),pt(t.height)&&(i.height=t.height*a),this.setCropBoxData(i)}return this},getContainerData:function(){return this.ready?kt({},this.containerData):{}},getImageData:function(){return this.sized?kt({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&Ct(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){e[n]=t[n]})),e},setCanvasData:function(t){var e=this.canvasData,n=e.aspectRatio;return this.ready&&!this.disabled&&bt(t)&&(pt(t.left)&&(e.left=t.left),pt(t.top)&&(e.top=t.top),pt(t.width)?(e.width=t.width,e.height=t.width/n):pt(t.height)&&(e.height=t.height,e.width=t.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,n,r=this.cropBoxData,i=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&bt(t)&&(pt(t.left)&&(r.left=t.left),pt(t.top)&&(r.top=t.top),pt(t.width)&&t.width!==r.width&&(e=!0,r.width=t.width),pt(t.height)&&t.height!==r.height&&(n=!0,r.height=t.height),i&&(e?r.height=r.width/i:n&&(r.width=r.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,n=Qt(this.image,this.imageData,e,t);if(!this.cropped)return n;var r=this.getData(),i=r.x,o=r.y,a=r.width,l=r.height,c=n.width/Math.floor(e.naturalWidth);1!==c&&(i*=c,o*=c,a*=c,l*=c);var u=a/l,d=Zt({aspectRatio:u,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),h=Zt({aspectRatio:u,width:t.minWidth||0,height:t.minHeight||0},"cover"),p=Zt({aspectRatio:u,width:t.width||(1!==c?n.width:a),height:t.height||(1!==c?n.height:l)}),f=p.width,g=p.height;f=Math.min(d.width,Math.max(h.width,f)),g=Math.min(d.height,Math.max(h.height,g));var m=document.createElement("canvas"),v=m.getContext("2d");m.width=St(f),m.height=St(g),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,f,g);var b=t.imageSmoothingEnabled,y=void 0===b||b,w=t.imageSmoothingQuality;v.imageSmoothingEnabled=y,w&&(v.imageSmoothingQuality=w);var x,C,k,A,S,E,O=n.width,T=n.height,_=i,M=o;_<=-a||_>O?(_=0,x=0,k=0,S=0):_<=0?(k=-_,_=0,x=Math.min(O,a+_),S=x):_<=O&&(k=0,x=Math.min(a,O-_),S=x),x<=0||M<=-l||M>T?(M=0,C=0,A=0,E=0):M<=0?(A=-M,M=0,C=Math.min(T,l+M),E=C):M<=T&&(A=0,C=Math.min(l,T-M),E=C);var N=[_,M,x,C];if(S>0&&E>0){var P=f/a;N.push(k*P,A*P,S*P,E*P)}return v.drawImage.apply(v,[n].concat(s(N.map((function(t){return Math.floor(St(t))}))))),m},setAspectRatio:function(t){var e=this.options;return this.disabled||gt(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,n=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var i=t===B,o=e.movable&&t===z;t=i||o?t:H,e.dragMode=t,jt(n,R,t),Nt(n,M,i),Nt(n,I,o),e.cropBoxMovable||(jt(r,R,t),Nt(r,M,i),Nt(r,I,o))}return this}},pe=f.Cropper,fe=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,t),!e||!st.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=kt({},ut,bt(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return o(t,[{key:"init",value:function(){var t,e=this.element,n=e.tagName.toLowerCase();if(!e[v]){if(e[v]=this,"img"===n){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===n&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var n=this.element,r=this.options;if(r.rotatable||r.scalable||(r.checkOrientation=!1),r.checkOrientation&&window.ArrayBuffer)if(ot.test(t))at.test(t)?this.read(re(t)):this.clone();else{var i=new XMLHttpRequest,o=this.clone.bind(this);this.reloading=!0,this.xhr=i,i.onabort=o,i.onerror=o,i.ontimeout=o,i.onprogress=function(){i.getResponseHeader("content-type")!==rt&&i.abort()},i.onload=function(){e.read(i.response)},i.onloadend=function(){e.reloading=!1,e.xhr=null},r.checkCrossOrigin&&Wt(t)&&n.crossOrigin&&(t=$t(t)),i.open("GET",t,!0),i.responseType="arraybuffer",i.withCredentials="use-credentials"===n.crossOrigin,i.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,n=this.imageData,r=oe(t),i=0,o=1,a=1;if(r>1){this.url=ie(t,rt);var s=ae(r);i=s.rotate,o=s.scaleX,a=s.scaleY}e.rotatable&&(n.rotate=i),e.scalable&&(n.scaleX=o,n.scaleY=a),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,n=t.crossOrigin,r=e;this.options.checkCrossOrigin&&Wt(e)&&(n||(n="anonymous"),r=$t(e)),this.crossOrigin=n,this.crossOriginUrl=r;var i=document.createElement("img");n&&(i.crossOrigin=n),i.src=r||e,i.alt=t.alt||"The image to crop",this.image=i,i.onload=this.start.bind(this),i.onerror=this.stop.bind(this),_t(i,L),t.parentNode.insertBefore(i,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var n=f.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(f.navigator.userAgent),r=function(e,n){kt(t.imageData,{naturalWidth:e,naturalHeight:n,aspectRatio:e/n}),t.initialImageData=kt({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||n){var i=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=i,i.onload=function(){r(i.width,i.height),n||o.removeChild(i)},i.src=e.src,n||(i.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(i))}else r(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,n=this.image,r=t.parentNode,i=document.createElement("div");i.innerHTML=dt;var o=i.querySelector(".".concat(v,"-container")),a=o.querySelector(".".concat(v,"-canvas")),s=o.querySelector(".".concat(v,"-drag-box")),l=o.querySelector(".".concat(v,"-crop-box")),c=l.querySelector(".".concat(v,"-face"));this.container=r,this.cropper=o,this.canvas=a,this.dragBox=s,this.cropBox=l,this.viewBox=o.querySelector(".".concat(v,"-view-box")),this.face=c,a.appendChild(n),_t(t,P),r.insertBefore(o,t.nextSibling),this.isImg||Mt(n,L),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,_t(l,P),e.guides||_t(l.getElementsByClassName("".concat(v,"-dashed")),P),e.center||_t(l.getElementsByClassName("".concat(v,"-center")),P),e.background&&_t(o,"".concat(v,"-bg")),e.highlight||_t(c,D),e.cropBoxMovable&&(_t(c,I),jt(c,R,b)),e.cropBoxResizable||(_t(l.getElementsByClassName("".concat(v,"-line")),P),_t(l.getElementsByClassName("".concat(v,"-point")),P)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),yt(e.ready)&&zt(t,Q,e.ready,{once:!0}),Ht(t,Q)}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Mt(this.element,P))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=pe,t}},{key:"setDefaults",value:function(t){kt(ut,bt(t)&&t)}}]),t}();return kt(fe.prototype,se,le,ce,ue,de,he),fe}))},bb57:function(t,e,n){"use strict";var r=n("b4c9"),i=n("55be").has,o=n("55be").isValidEntityCode,a=n("55be").fromCodePoint,s=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,l=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var n,c,u,d,h=t.pos,p=t.posMax;if(38!==t.src.charCodeAt(h))return!1;if(h+1>=p)return!1;if(n=t.src.charCodeAt(h+1),35===n){if(u=t.src.slice(h).match(s),u)return e||(c="x"===u[1][0].toLowerCase()?parseInt(u[1].slice(1),16):parseInt(u[1],10),d=t.push("text_special","",0),d.content=o(c)?a(c):a(65533),d.markup=u[0],d.info="entity"),t.pos+=u[0].length,!0}else if(u=t.src.slice(h).match(l),u&&i(r,u[1]))return e||(d=t.push("text_special","",0),d.content=r[u[1]],d.markup=u[0],d.info="entity"),t.pos+=u[0].length,!0;return!1}},bc8c:function(t,e,n){"use strict";n("7bb6")},bc99:function(t,e,n){"use strict";for(var r=n("55be").isSpace,i=[],o=0;o<256;o++)i.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(t){i[t.charCodeAt(0)]=1})),t.exports=function(t,e){var n,o,a,s,l,c=t.pos,u=t.posMax;if(92!==t.src.charCodeAt(c))return!1;if(c++,c>=u)return!1;if(n=t.src.charCodeAt(c),10===n){e||t.push("hardbreak","br",0),c++;while(c<u){if(n=t.src.charCodeAt(c),!r(n))break;c++}return t.pos=c,!0}return s=t.src[c],n>=55296&&n<=56319&&c+1<u&&(o=t.src.charCodeAt(c+1),o>=56320&&o<=57343&&(s+=t.src[c+1],c++)),a="\\"+s,e||(l=t.push("text_special","",0),n<256&&0!==i[n]?l.content=s:l.content=a,l.markup=a,l.info="escape"),t.pos=c+1,!0}},bee2:function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}n.d(e,"a",(function(){return i}))},bf19:function(t,e,n){"use strict";var r=n("23e7"),i=n("c65b");r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},c058:function(t,e,n){"use strict";var r=n("55be").unescapeAll;t.exports=function(t,e,n){var i,o,a=0,s=e,l={ok:!1,pos:0,lines:0,str:""};if(60===t.charCodeAt(e)){e++;while(e<n){if(i=t.charCodeAt(e),10===i)return l;if(60===i)return l;if(62===i)return l.pos=e+1,l.str=r(t.slice(s+1,e)),l.ok=!0,l;92===i&&e+1<n?e+=2:e++}return l}o=0;while(e<n){if(i=t.charCodeAt(e),32===i)break;if(i<32||127===i)break;if(92===i&&e+1<n){if(32===t.charCodeAt(e+1))break;e+=2}else{if(40===i&&(o++,o>32))return l;if(41===i){if(0===o)break;o--}e++}}return s===e||0!==o||(l.str=r(t.slice(s,e)),l.lines=a,l.pos=e,l.ok=!0),l}},c07d:function(t,e,n){"use strict";var r=n("55be").normalizeReference,i=n("55be").isSpace;t.exports=function(t,e,n,o){var a,s,l,c,u,d,h,p,f,g,m,v,b,y,w,x,C=0,k=t.bMarks[e]+t.tShift[e],A=t.eMarks[e],S=e+1;if(t.sCount[e]-t.blkIndent>=4)return!1;if(91!==t.src.charCodeAt(k))return!1;while(++k<A)if(93===t.src.charCodeAt(k)&&92!==t.src.charCodeAt(k-1)){if(k+1===A)return!1;if(58!==t.src.charCodeAt(k+1))return!1;break}for(c=t.lineMax,w=t.md.block.ruler.getRules("reference"),g=t.parentType,t.parentType="reference";S<c&&!t.isEmpty(S);S++)if(!(t.sCount[S]-t.blkIndent>3)&&!(t.sCount[S]<0)){for(y=!1,d=0,h=w.length;d<h;d++)if(w[d](t,S,c,!0)){y=!0;break}if(y)break}for(b=t.getLines(e,S,t.blkIndent,!1).trim(),A=b.length,k=1;k<A;k++){if(a=b.charCodeAt(k),91===a)return!1;if(93===a){f=k;break}10===a?C++:92===a&&(k++,k<A&&10===b.charCodeAt(k)&&C++)}if(f<0||58!==b.charCodeAt(f+1))return!1;for(k=f+2;k<A;k++)if(a=b.charCodeAt(k),10===a)C++;else if(!i(a))break;if(m=t.md.helpers.parseLinkDestination(b,k,A),!m.ok)return!1;if(u=t.md.normalizeLink(m.str),!t.md.validateLink(u))return!1;for(k=m.pos,C+=m.lines,s=k,l=C,v=k;k<A;k++)if(a=b.charCodeAt(k),10===a)C++;else if(!i(a))break;m=t.md.helpers.parseLinkTitle(b,k,A),k<A&&v!==k&&m.ok?(x=m.str,k=m.pos,C+=m.lines):(x="",k=s,C=l);while(k<A){if(a=b.charCodeAt(k),!i(a))break;k++}if(k<A&&10!==b.charCodeAt(k)&&x){x="",k=s,C=l;while(k<A){if(a=b.charCodeAt(k),!i(a))break;k++}}return!(k<A&&10!==b.charCodeAt(k))&&(p=r(b.slice(1,f)),!!p&&(o||("undefined"===typeof t.env.references&&(t.env.references={}),"undefined"===typeof t.env.references[p]&&(t.env.references[p]={title:x,href:u}),t.parentType=g,t.line=e+C+1),!0))}},c1ac:function(t,e,n){"use strict";var r=n("ebb5"),i=n("b727").filter,o=n("1448"),a=r.aTypedArray,s=r.exportTypedArrayMethod;s("filter",(function(t){var e=i(a(this),t,arguments.length>1?arguments[1]:void 0);return o(this,e)}))},c345a:function(t,e,n){(function(e){!function(e,n){t.exports=n()}("undefined"!=typeof self&&self,(function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=60)}([function(t,e){function n(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var o=r(i);return[n].concat(i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}))).concat([o]).join("\n")}return[n].join("\n")}function r(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=n(e,t);return e[2]?"@media "+e[2]+"{"+r+"}":r})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){function r(t){for(var e=0;e<t.length;e++){var n=t[e],r=u[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(o(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i<n.parts.length;i++)a.push(o(n.parts[i]));u[n.id]={id:n.id,refs:1,parts:a}}}}function i(){var t=document.createElement("style");return t.type="text/css",d.appendChild(t),t}function o(t){var e,n,r=document.querySelector("style["+v+'~="'+t.id+'"]');if(r){if(f)return g;r.parentNode.removeChild(r)}if(b){var o=p++;r=h||(h=i()),e=a.bind(null,r,o,!1),n=a.bind(null,r,o,!0)}else r=i(),e=s.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}function a(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=y(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function s(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),m.ssrId&&t.setAttribute(v,e.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var l="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!l)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var c=n(64),u={},d=l&&(document.head||document.getElementsByTagName("head")[0]),h=null,p=0,f=!1,g=function(){},m=null,v="data-vue-ssr-id",b="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n,i){f=n,m=i||{};var o=c(t,e);return r(o),function(e){for(var n=[],i=0;i<o.length;i++){var a=o[i],s=u[a.id];s.refs--,n.push(s)}e?(o=c(t,e),r(o)):o=[];for(i=0;i<n.length;i++){s=n[i];if(0===s.refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete u[s.id]}}}};var y=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t,e,n,r,i,o){var a,s=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(a=t,s=t.default);var c,u="function"==typeof s?s.options:s;if(e&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),i&&(u._scopeId=i),o?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},u._ssrRegister=c):r&&(c=r),c){var d=u.functional,h=d?u.render:u.beforeCreate;d?(u._injectStyles=c,u.render=function(t,e){return c.call(e),h(t,e)}):u.beforeCreate=h?[].concat(h,c):[c]}return{esModule:a,exports:s,options:u}}},function(t,e,n){"use strict";function r(t,e){var n,r=t&&t.a;!(n=t&&t.hsl?(0,o.default)(t.hsl):t&&t.hex&&t.hex.length>0?(0,o.default)(t.hex):t&&t.hsv?(0,o.default)(t.hsv):t&&t.rgba?(0,o.default)(t.rgba):t&&t.rgb?(0,o.default)(t.rgb):(0,o.default)(t))||void 0!==n._a&&null!==n._a||n.setAlpha(r||1);var i=n.toHsl(),a=n.toHsv();return 0===i.s&&(a.h=i.h=t.h||t.hsl&&t.hsl.h||e||0),{hsl:i,hex:n.toHexString().toUpperCase(),hex8:n.toHex8String().toUpperCase(),rgba:n.toRgb(),hsv:a,oldHue:t.h||e||i.h,source:t.source,a:t.a||n.getAlpha()}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(65),o=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default={props:["value"],data:function(){return{val:r(this.value)}},computed:{colors:{get:function(){return this.val},set:function(t){this.val=t,this.$emit("input",t)}}},watch:{value:function(t){this.val=r(t)}},methods:{colorChange:function(t,e){this.oldHue=this.colors.hsl.h,this.colors=r(t,e||this.oldHue)},isValidHex:function(t){return(0,o.default)(t).isValid()},simpleCheckForValidColor:function(t){for(var e=["r","g","b","a","h","s","l","v"],n=0,r=0,i=0;i<e.length;i++){var o=e[i];t[o]&&(n++,isNaN(t[o])||r++)}if(n===r)return t},paletteUpperCase:function(t){return t.map((function(t){return t.toUpperCase()}))},isTransparent:function(t){return 0===(0,o.default)(t).getAlpha()}}}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){"use strict";function r(t){l||n(66)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(36),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(68),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/common/EditableInput.vue",e.default=d.exports},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(8),i=n(18);t.exports=n(9)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(16),i=n(42),o=n(25),a=Object.defineProperty;e.f=n(9)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(17)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(90),i=n(24);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(29)("wks"),i=n(19),o=n(4).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";function r(t){l||n(111)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(51),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(113),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/common/Hue.vue",e.default=d.exports},function(t,e){t.exports=!0},function(t,e){var n=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(12);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";function r(t){l||n(123)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(54),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(127),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/common/Saturation.vue",e.default=d.exports},function(t,e,n){"use strict";function r(t){l||n(128)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(55),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(133),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/common/Alpha.vue",e.default=d.exports},function(t,e,n){"use strict";function r(t){l||n(130)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(56),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(132),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/common/Checkboard.vue",e.default=d.exports},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(12);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports={}},function(t,e,n){var r=n(46),i=n(30);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(29)("keys"),i=n(19);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(15),i=n(4),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(14)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(8).f,i=n(6),o=n(11)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){e.f=n(11)},function(t,e,n){var r=n(4),i=n(15),o=n(14),a=n(32),s=n(8).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(5),s=r(a),l=["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#CCCCCC","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"];e.default={name:"Compact",mixins:[o.default],props:{palette:{type:Array,default:function(){return l}}},components:{"ed-in":s.default},computed:{pick:function(){return this.colors.hex.toUpperCase()}},methods:{handlerClick:function(t){this.colorChange({hex:t,source:"hex"})}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"editableInput",props:{label:String,labelText:String,desc:String,value:[String,Number],max:Number,min:Number,arrowOffset:{type:Number,default:1}},computed:{val:{get:function(){return this.value},set:function(t){if(!(void 0!==this.max&&+t>this.max))return t;this.$refs.input.value=this.max}},labelId:function(){return"input__label__"+this.label+"__"+Math.random().toString().slice(2,5)},labelSpanText:function(){return this.labelText||this.label}},methods:{update:function(t){this.handleChange(t.target.value)},handleChange:function(t){var e={};e[this.label]=t,(void 0===e.hex&&void 0===e["#"]||t.length>5)&&this.$emit("change",e)},handleKeyDown:function(t){var e=this.val,n=Number(e);if(n){var r=this.arrowOffset||1;38===t.keyCode&&(e=n+r,this.handleChange(e),t.preventDefault()),40===t.keyCode&&(e=n-r,this.handleChange(e),t.preventDefault())}}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=function(t){return t&&t.__esModule?t:{default:t}}(r),o=["#FFFFFF","#F2F2F2","#E6E6E6","#D9D9D9","#CCCCCC","#BFBFBF","#B3B3B3","#A6A6A6","#999999","#8C8C8C","#808080","#737373","#666666","#595959","#4D4D4D","#404040","#333333","#262626","#0D0D0D","#000000"];e.default={name:"Grayscale",mixins:[i.default],props:{palette:{type:Array,default:function(){return o}}},components:{},computed:{pick:function(){return this.colors.hex.toUpperCase()}},methods:{handlerClick:function(t){this.colorChange({hex:t,source:"hex"})}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(3),s=r(a);e.default={name:"Material",mixins:[s.default],components:{"ed-in":o.default},methods:{onChange:function(t){t&&(t.hex?this.isValidHex(t.hex)&&this.colorChange({hex:t.hex,source:"hex"}):(t.r||t.g||t.b)&&this.colorChange({r:t.r||this.colors.rgba.r,g:t.g||this.colors.rgba.g,b:t.b||this.colors.rgba.b,a:t.a||this.colors.rgba.a,source:"rgba"}))}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(81),o=r(i),a=n(3),s=r(a),l=n(13),c=r(l);e.default={name:"Slider",mixins:[s.default],props:{swatches:{type:Array,default:function(){return[{s:.5,l:.8},{s:.5,l:.65},{s:.5,l:.5},{s:.5,l:.35},{s:.5,l:.2}]}}},components:{hue:c.default},computed:{normalizedSwatches:function(){return this.swatches.map((function(t){return"object"!==(void 0===t?"undefined":(0,o.default)(t))?{s:.5,l:t}:t}))}},methods:{isActive:function(t,e){var n=this.colors.hsl;return 1===n.l&&1===t.l||0===n.l&&0===t.l||Math.abs(n.l-t.l)<.01&&Math.abs(n.s-t.s)<.01},hueChange:function(t){this.colorChange(t)},handleSwClick:function(t,e){this.colorChange({h:this.colors.hsl.h,s:e.s,l:e.l,source:"hsl"})}}}},function(t,e,n){"use strict";var r=n(14),i=n(41),o=n(44),a=n(7),s=n(26),l=n(88),c=n(31),u=n(95),d=n(11)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,f,g,m,v){l(n,e,f);var b,y,w,x=function(t){if(!h&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},C=e+" Iterator",k="values"==g,A=!1,S=t.prototype,E=S[d]||S["@@iterator"]||g&&S[g],O=E||x(g),T=g?k?x("entries"):O:void 0,_="Array"==e&&S.entries||E;if(_&&(w=u(_.call(new t)))!==Object.prototype&&w.next&&(c(w,C,!0),r||"function"==typeof w[d]||a(w,d,p)),k&&E&&"values"!==E.name&&(A=!0,O=function(){return E.call(this)}),r&&!v||!h&&!A&&S[d]||a(S,d,O),s[e]=O,s[C]=p,g)if(b={values:k?O:x("values"),keys:m?O:x("keys"),entries:T},v)for(y in b)y in S||o(S,y,b[y]);else i(i.P+i.F*(h||A),e,b);return b}},function(t,e,n){var r=n(4),i=n(15),o=n(86),a=n(7),s=n(6),l=function(t,e,n){var c,u,d,h=t&l.F,p=t&l.G,f=t&l.S,g=t&l.P,m=t&l.B,v=t&l.W,b=p?i:i[e]||(i[e]={}),y=b.prototype,w=p?r:f?r[e]:(r[e]||{}).prototype;for(c in p&&(n=e),n)(u=!h&&w&&void 0!==w[c])&&s(b,c)||(d=u?w[c]:n[c],b[c]=p&&"function"!=typeof w[c]?n[c]:m&&u?o(d,r):v&&w[c]==d?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(d):g&&"function"==typeof d?o(Function.call,d):d,g&&((b.virtual||(b.virtual={}))[c]=d,t&l.R&&y&&!y[c]&&a(y,c,d)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e,n){t.exports=!n(9)&&!n(17)((function(){return 7!=Object.defineProperty(n(43)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(12),i=n(4).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){t.exports=n(7)},function(t,e,n){var r=n(16),i=n(89),o=n(30),a=n(28)("IE_PROTO"),s=function(){},l=function(){var t,e=n(43)("iframe"),r=o.length;for(e.style.display="none",n(94).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;r--;)delete l.prototype[o[r]];return l()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=l(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(6),i=n(10),o=n(91)(!1),a=n(28)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),l=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;e.length>l;)r(s,n=e[l++])&&(~o(c,n)||c.push(n));return c}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(24);t.exports=function(t){return Object(r(t))}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(46),i=n(30).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"Hue",props:{value:Object,direction:{type:String,default:"horizontal"}},data:function(){return{oldHue:0,pullDirection:""}},computed:{colors:function(){var t=this.value.hsl.h;return 0!==t&&t-this.oldHue>0&&(this.pullDirection="right"),0!==t&&t-this.oldHue<0&&(this.pullDirection="left"),this.oldHue=t,this.value},directionClass:function(){return{"vc-hue--horizontal":"horizontal"===this.direction,"vc-hue--vertical":"vertical"===this.direction}},pointerTop:function(){return"vertical"===this.direction?0===this.colors.hsl.h&&"right"===this.pullDirection?0:-100*this.colors.hsl.h/360+100+"%":0},pointerLeft:function(){return"vertical"===this.direction?0:0===this.colors.hsl.h&&"right"===this.pullDirection?"100%":100*this.colors.hsl.h/360+"%"}},methods:{handleChange:function(t,e){!e&&t.preventDefault();var n=this.$refs.container;if(n){var r,i,o=n.clientWidth,a=n.clientHeight,s=n.getBoundingClientRect().left+window.pageXOffset,l=n.getBoundingClientRect().top+window.pageYOffset,c=t.pageX||(t.touches?t.touches[0].pageX:0),u=t.pageY||(t.touches?t.touches[0].pageY:0),d=c-s,h=u-l;"vertical"===this.direction?(h<0?r=360:h>a?r=0:(i=-100*h/a+100,r=360*i/100),this.colors.hsl.h!==r&&this.$emit("change",{h:r,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:"hsl"})):(d<0?r=0:d>o?r=360:(i=100*d/o,r=360*i/100),this.colors.hsl.h!==r&&this.$emit("change",{h:r,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:"hsl"}))}},handleMouseDown:function(t){this.handleChange(t,!0),window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp:function(t){this.unbindEventListeners()},unbindEventListeners:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(118),o=r(i),a=n(3),s=r(a),l=["red","pink","purple","deepPurple","indigo","blue","lightBlue","cyan","teal","green","lightGreen","lime","yellow","amber","orange","deepOrange","brown","blueGrey","black"],c=["900","700","500","300","100"],u=function(){var t=[];return l.forEach((function(e){var n=[];"black"===e.toLowerCase()||"white"===e.toLowerCase()?n=n.concat(["#000000","#FFFFFF"]):c.forEach((function(t){var r=o.default[e][t];n.push(r.toUpperCase())})),t.push(n)})),t}();e.default={name:"Swatches",mixins:[s.default],props:{palette:{type:Array,default:function(){return u}}},computed:{pick:function(){return this.colors.hex}},methods:{equal:function(t){return t.toLowerCase()===this.colors.hex.toLowerCase()},handlerClick:function(t){this.colorChange({hex:t,source:"hex"})}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(5),s=r(a),l=n(20),c=r(l),u=n(13),d=r(u),h=n(21),p=r(h);e.default={name:"Photoshop",mixins:[o.default],props:{head:{type:String,default:"Color Picker"},disableFields:{type:Boolean,default:!1},hasResetButton:{type:Boolean,default:!1},acceptLabel:{type:String,default:"OK"},cancelLabel:{type:String,default:"Cancel"},resetLabel:{type:String,default:"Reset"},newLabel:{type:String,default:"new"},currentLabel:{type:String,default:"current"}},components:{saturation:c.default,hue:d.default,alpha:p.default,"ed-in":s.default},data:function(){return{currentColor:"#FFF"}},computed:{hsv:function(){var t=this.colors.hsv;return{h:t.h.toFixed(),s:(100*t.s).toFixed(),v:(100*t.v).toFixed()}},hex:function(){var t=this.colors.hex;return t&&t.replace("#","")}},created:function(){this.currentColor=this.colors.hex},methods:{childChange:function(t){this.colorChange(t)},inputChange:function(t){t&&(t["#"]?this.isValidHex(t["#"])&&this.colorChange({hex:t["#"],source:"hex"}):t.r||t.g||t.b||t.a?this.colorChange({r:t.r||this.colors.rgba.r,g:t.g||this.colors.rgba.g,b:t.b||this.colors.rgba.b,a:t.a||this.colors.rgba.a,source:"rgba"}):(t.h||t.s||t.v)&&this.colorChange({h:t.h||this.colors.hsv.h,s:t.s/100||this.colors.hsv.s,v:t.v/100||this.colors.hsv.v,source:"hsv"}))},clickCurrentColor:function(){this.colorChange({hex:this.currentColor,source:"hex"})},handleAccept:function(){this.$emit("ok")},handleCancel:function(){this.$emit("cancel")},handleReset:function(){this.$emit("reset")}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(125),o=r(i),a=n(126),s=r(a);e.default={name:"Saturation",props:{value:Object},computed:{colors:function(){return this.value},bgColor:function(){return"hsl("+this.colors.hsv.h+", 100%, 50%)"},pointerTop:function(){return-100*this.colors.hsv.v+1+100+"%"},pointerLeft:function(){return 100*this.colors.hsv.s+"%"}},methods:{throttle:(0,s.default)((function(t,e){t(e)}),20,{leading:!0,trailing:!1}),handleChange:function(t,e){!e&&t.preventDefault();var n=this.$refs.container;if(n){var r=n.clientWidth,i=n.clientHeight,a=n.getBoundingClientRect().left+window.pageXOffset,s=n.getBoundingClientRect().top+window.pageYOffset,l=t.pageX||(t.touches?t.touches[0].pageX:0),c=t.pageY||(t.touches?t.touches[0].pageY:0),u=(0,o.default)(l-a,0,r),d=(0,o.default)(c-s,0,i),h=u/r,p=(0,o.default)(-d/i+1,0,1);this.throttle(this.onChange,{h:this.colors.hsv.h,s:h,v:p,a:this.colors.hsv.a,source:"hsva"})}},onChange:function(t){this.$emit("change",t)},handleMouseDown:function(t){window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp:function(t){this.unbindEventListeners()},unbindEventListeners:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(22),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.default={name:"Alpha",props:{value:Object,onChange:Function},components:{checkboard:i.default},computed:{colors:function(){return this.value},gradientColor:function(){var t=this.colors.rgba,e=[t.r,t.g,t.b].join(",");return"linear-gradient(to right, rgba("+e+", 0) 0%, rgba("+e+", 1) 100%)"}},methods:{handleChange:function(t,e){!e&&t.preventDefault();var n=this.$refs.container;if(n){var r,i=n.clientWidth,o=n.getBoundingClientRect().left+window.pageXOffset,a=t.pageX||(t.touches?t.touches[0].pageX:0),s=a-o;r=s<0?0:s>i?1:Math.round(100*s/i)/100,this.colors.a!==r&&this.$emit("change",{h:this.colors.hsl.h,s:this.colors.hsl.s,l:this.colors.hsl.l,a:r,source:"rgba"})}},handleMouseDown:function(t){this.handleChange(t,!0),window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp:function(){this.unbindEventListeners()},unbindEventListeners:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}}},function(t,e,n){"use strict";function r(t,e,n){if("undefined"==typeof document)return null;var r=document.createElement("canvas");r.width=r.height=2*n;var i=r.getContext("2d");return i?(i.fillStyle=t,i.fillRect(0,0,r.width,r.height),i.fillStyle=e,i.fillRect(0,0,n,n),i.translate(n,n),i.fillRect(0,0,n,n),r.toDataURL()):null}function i(t,e,n){var i=t+","+e+","+n;if(o[i])return o[i];var a=r(t,e,n);return o[i]=a,a}Object.defineProperty(e,"__esModule",{value:!0});var o={};e.default={name:"Checkboard",props:{size:{type:[Number,String],default:8},white:{type:String,default:"#fff"},grey:{type:String,default:"#e6e6e6"}},computed:{bgStyle:function(){return{"background-image":"url("+i(this.white,this.grey,this.size)+")"}}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(5),s=r(a),l=n(20),c=r(l),u=n(13),d=r(u),h=n(21),p=r(h),f=n(22),g=r(f),m=["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF","rgba(0,0,0,0)"];e.default={name:"Sketch",mixins:[o.default],components:{saturation:c.default,hue:d.default,alpha:p.default,"ed-in":s.default,checkboard:g.default},props:{presetColors:{type:Array,default:function(){return m}},disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1}},computed:{hex:function(){var t=void 0;return t=this.colors.a<1?this.colors.hex8:this.colors.hex,t.replace("#","")},activeColor:function(){var t=this.colors.rgba;return"rgba("+[t.r,t.g,t.b,t.a].join(",")+")"}},methods:{handlePreset:function(t){this.colorChange({hex:t,source:"hex"})},childChange:function(t){this.colorChange(t)},inputChange:function(t){t&&(t.hex?this.isValidHex(t.hex)&&this.colorChange({hex:t.hex,source:"hex"}):(t.r||t.g||t.b||t.a)&&this.colorChange({r:t.r||this.colors.rgba.r,g:t.g||this.colors.rgba.g,b:t.b||this.colors.rgba.b,a:t.a||this.colors.rgba.a,source:"rgba"}))}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(5),s=r(a),l=n(20),c=r(l),u=n(13),d=r(u),h=n(21),p=r(h),f=n(22),g=r(f);e.default={name:"Chrome",mixins:[o.default],props:{disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1}},components:{saturation:c.default,hue:d.default,alpha:p.default,"ed-in":s.default,checkboard:g.default},data:function(){return{fieldsIndex:0,highlight:!1}},computed:{hsl:function(){var t=this.colors.hsl,e=t.h,n=t.s,r=t.l;return{h:e.toFixed(),s:(100*n).toFixed()+"%",l:(100*r).toFixed()+"%"}},activeColor:function(){var t=this.colors.rgba;return"rgba("+[t.r,t.g,t.b,t.a].join(",")+")"},hasAlpha:function(){return this.colors.a<1}},methods:{childChange:function(t){this.colorChange(t)},inputChange:function(t){if(t)if(t.hex)this.isValidHex(t.hex)&&this.colorChange({hex:t.hex,source:"hex"});else if(t.r||t.g||t.b||t.a)this.colorChange({r:t.r||this.colors.rgba.r,g:t.g||this.colors.rgba.g,b:t.b||this.colors.rgba.b,a:t.a||this.colors.rgba.a,source:"rgba"});else if(t.h||t.s||t.l){var e=t.s?t.s.replace("%","")/100:this.colors.hsl.s,n=t.l?t.l.replace("%","")/100:this.colors.hsl.l;this.colorChange({h:t.h||this.colors.hsl.h,s:e,l:n,source:"hsl"})}},toggleViews:function(){this.fieldsIndex>=2?this.fieldsIndex=0:this.fieldsIndex++},showHighlight:function(){this.highlight=!0},hideHighlight:function(){this.highlight=!1}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(5),o=r(i),a=n(3),s=r(a),l=["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"];e.default={name:"Twitter",mixins:[s.default],components:{editableInput:o.default},props:{width:{type:[String,Number],default:276},defaultColors:{type:Array,default:function(){return l}},triangle:{default:"top-left",validator:function(t){return["hide","top-left","top-right"].includes(t)}}},computed:{hsv:function(){var t=this.colors.hsv;return{h:t.h.toFixed(),s:(100*t.s).toFixed(),v:(100*t.v).toFixed()}},hex:function(){var t=this.colors.hex;return t&&t.replace("#","")}},methods:{equal:function(t){return t.toLowerCase()===this.colors.hex.toLowerCase()},handlerClick:function(t){this.colorChange({hex:t,source:"hex"})},inputChange:function(t){t&&(t["#"]?this.isValidHex(t["#"])&&this.colorChange({hex:t["#"],source:"hex"}):t.r||t.g||t.b||t.a?this.colorChange({r:t.r||this.colors.rgba.r,g:t.g||this.colors.rgba.g,b:t.b||this.colors.rgba.b,a:t.a||this.colors.rgba.a,source:"rgba"}):(t.h||t.s||t.v)&&this.colorChange({h:t.h||this.colors.hsv.h,s:t.s/100||this.colors.hsv.s,v:t.v/100||this.colors.hsv.v,source:"hsv"}))}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=n(61),o=r(i),a=n(70),s=r(a),l=n(74),c=r(l),u=n(78),d=r(u),h=n(115),p=r(h),f=n(120),g=r(f),m=n(135),v=r(m),b=n(139),y=r(b),w=n(143),x=r(w),C=n(21),k=r(C),A=n(22),S=r(A),E=n(5),O=r(E),T=n(13),_=r(T),M=n(20),N=r(M),P=n(3),L=r(P),D={version:"2.8.1",Compact:o.default,Grayscale:s.default,Twitter:x.default,Material:c.default,Slider:d.default,Swatches:p.default,Photoshop:g.default,Sketch:v.default,Chrome:y.default,Alpha:k.default,Checkboard:S.default,EditableInput:O.default,Hue:_.default,Saturation:N.default,ColorMixin:L.default};t.exports=D},function(t,e,n){"use strict";function r(t){l||n(62)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(35),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(69),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/Compact.vue",e.default=d.exports},function(t,e,n){var r=n(63);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("6ce8a5a8",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-compact {\n padding-top: 5px;\n padding-left: 5px;\n width: 245px;\n border-radius: 2px;\n box-sizing: border-box;\n box-shadow: 0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16);\n background-color: #fff;\n}\n.vc-compact-colors {\n overflow: hidden;\n padding: 0;\n margin: 0;\n}\n.vc-compact-color-item {\n list-style: none;\n width: 15px;\n height: 15px;\n float: left;\n margin-right: 5px;\n margin-bottom: 5px;\n position: relative;\n cursor: pointer;\n}\n.vc-compact-color-item--white {\n box-shadow: inset 0 0 0 1px #ddd;\n}\n.vc-compact-color-item--white .vc-compact-dot {\n background: #000;\n}\n.vc-compact-dot {\n position: absolute;\n top: 5px;\n right: 5px;\n bottom: 5px;\n left: 5px;\n border-radius: 50%;\n opacity: 1;\n background: #fff;\n}\n",""])},function(t,e){t.exports=function(t,e){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=o[0],s=o[1],l=o[2],c=o[3],u={id:t+":"+i,css:s,media:l,sourceMap:c};r[a]?r[a].parts.push(u):n.push(r[a]={id:a,parts:[u]})}return n}},function(t,e,n){var r;!function(i){function o(t,e){if(t=t||"",e=e||{},t instanceof o)return t;if(!(this instanceof o))return new o(t,e);var n=a(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=U(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=U(this._r)),this._g<1&&(this._g=U(this._g)),this._b<1&&(this._b=U(this._b)),this._ok=n.ok,this._tc_id=q++}function a(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,l=!1;return"string"==typeof t&&(t=B(t)),"object"==typeof t&&(F(t.r)&&F(t.g)&&F(t.b)?(e=s(t.r,t.g,t.b),a=!0,l="%"===String(t.r).substr(-1)?"prgb":"rgb"):F(t.h)&&F(t.s)&&F(t.v)?(r=j(t.s),i=j(t.v),e=d(t.h,r,i),a=!0,l="hsv"):F(t.h)&&F(t.s)&&F(t.l)&&(r=j(t.s),o=j(t.l),e=c(t.h,r,o),a=!0,l="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=T(n),{ok:a,format:t.format||l,r:W(255,$(e.r,0)),g:W(255,$(e.g,0)),b:W(255,$(e.b,0)),a:n}}function s(t,e,n){return{r:255*_(t,255),g:255*_(e,255),b:255*_(n,255)}}function l(t,e,n){t=_(t,255),e=_(e,255),n=_(n,255);var r,i,o=$(t,e,n),a=W(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,l:s}}function c(t,e,n){function r(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var i,o,a;if(t=_(t,360),e=_(e,100),n=_(n,100),0===e)i=o=a=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;i=r(l,s,t+1/3),o=r(l,s,t),a=r(l,s,t-1/3)}return{r:255*i,g:255*o,b:255*a}}function u(t,e,n){t=_(t,255),e=_(e,255),n=_(n,255);var r,i,o=$(t,e,n),a=W(t,e,n),s=o,l=o-a;if(i=0===o?0:l/o,o==a)r=0;else{switch(o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return{h:r,s:i,v:s}}function d(t,e,n){t=6*_(t,360),e=_(e,100),n=_(n,100);var r=i.floor(t),o=t-r,a=n*(1-e),s=n*(1-o*e),l=n*(1-(1-o)*e),c=r%6;return{r:255*[n,s,a,a,l,n][c],g:255*[l,n,n,s,a,a][c],b:255*[a,a,l,n,n,s][c]}}function h(t,e,n,r){var i=[D(U(t).toString(16)),D(U(e).toString(16)),D(U(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function p(t,e,n,r,i){var o=[D(U(t).toString(16)),D(U(e).toString(16)),D(U(n).toString(16)),D(I(r))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function f(t,e,n,r){return[D(I(r)),D(U(t).toString(16)),D(U(e).toString(16)),D(U(n).toString(16))].join("")}function g(t,e){e=0===e?0:e||10;var n=o(t).toHsl();return n.s-=e/100,n.s=M(n.s),o(n)}function m(t,e){e=0===e?0:e||10;var n=o(t).toHsl();return n.s+=e/100,n.s=M(n.s),o(n)}function v(t){return o(t).desaturate(100)}function b(t,e){e=0===e?0:e||10;var n=o(t).toHsl();return n.l+=e/100,n.l=M(n.l),o(n)}function y(t,e){e=0===e?0:e||10;var n=o(t).toRgb();return n.r=$(0,W(255,n.r-U(-e/100*255))),n.g=$(0,W(255,n.g-U(-e/100*255))),n.b=$(0,W(255,n.b-U(-e/100*255))),o(n)}function w(t,e){e=0===e?0:e||10;var n=o(t).toHsl();return n.l-=e/100,n.l=M(n.l),o(n)}function x(t,e){var n=o(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,o(n)}function C(t){var e=o(t).toHsl();return e.h=(e.h+180)%360,o(e)}function k(t){var e=o(t).toHsl(),n=e.h;return[o(t),o({h:(n+120)%360,s:e.s,l:e.l}),o({h:(n+240)%360,s:e.s,l:e.l})]}function A(t){var e=o(t).toHsl(),n=e.h;return[o(t),o({h:(n+90)%360,s:e.s,l:e.l}),o({h:(n+180)%360,s:e.s,l:e.l}),o({h:(n+270)%360,s:e.s,l:e.l})]}function S(t){var e=o(t).toHsl(),n=e.h;return[o(t),o({h:(n+72)%360,s:e.s,l:e.l}),o({h:(n+216)%360,s:e.s,l:e.l})]}function E(t,e,n){e=e||6,n=n||30;var r=o(t).toHsl(),i=360/n,a=[o(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(o(r));return a}function O(t,e){e=e||6;for(var n=o(t).toHsv(),r=n.h,i=n.s,a=n.v,s=[],l=1/e;e--;)s.push(o({h:r,s:i,v:a})),a=(a+l)%1;return s}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _(t,e){P(t)&&(t="100%");var n=L(t);return t=W(e,$(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),i.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function M(t){return W(1,$(0,t))}function N(t){return parseInt(t,16)}function P(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function L(t){return"string"==typeof t&&-1!=t.indexOf("%")}function D(t){return 1==t.length?"0"+t:""+t}function j(t){return t<=1&&(t=100*t+"%"),t}function I(t){return i.round(255*parseFloat(t)).toString(16)}function R(t){return N(t)/255}function F(t){return!!K.CSS_UNIT.exec(t)}function B(t){t=t.replace(H,"").replace(V,"").toLowerCase();var e,n=!1;if(Y[t])t=Y[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=K.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=K.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=K.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=K.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=K.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=K.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=K.hex8.exec(t))?{r:N(e[1]),g:N(e[2]),b:N(e[3]),a:R(e[4]),format:n?"name":"hex8"}:(e=K.hex6.exec(t))?{r:N(e[1]),g:N(e[2]),b:N(e[3]),format:n?"name":"hex"}:(e=K.hex4.exec(t))?{r:N(e[1]+""+e[1]),g:N(e[2]+""+e[2]),b:N(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:n?"name":"hex8"}:!!(e=K.hex3.exec(t))&&{r:N(e[1]+""+e[1]),g:N(e[2]+""+e[2]),b:N(e[3]+""+e[3]),format:n?"name":"hex"}}function z(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==n&&"large"!==n&&(n="small"),{level:e,size:n}}var H=/^\s+/,V=/\s+$/,q=0,U=i.round,W=i.min,$=i.max,G=i.random;o.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r,o,a,s=this.toRgb();return t=s.r/255,e=s.g/255,n=s.b/255,r=t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4),o=e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4),a=n<=.03928?n/12.92:i.pow((n+.055)/1.055,2.4),.2126*r+.7152*o+.0722*a},setAlpha:function(t){return this._a=T(t),this._roundA=U(100*this._a)/100,this},toHsv:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=u(this._r,this._g,this._b),e=U(360*t.h),n=U(100*t.s),r=U(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=l(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=l(this._r,this._g,this._b),e=U(360*t.h),n=U(100*t.s),r=U(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return p(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:U(this._r),g:U(this._g),b:U(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+U(this._r)+", "+U(this._g)+", "+U(this._b)+")":"rgba("+U(this._r)+", "+U(this._g)+", "+U(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:U(100*_(this._r,255))+"%",g:U(100*_(this._g,255))+"%",b:U(100*_(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+U(100*_(this._r,255))+"%, "+U(100*_(this._g,255))+"%, "+U(100*_(this._b,255))+"%)":"rgba("+U(100*_(this._r,255))+"%, "+U(100*_(this._g,255))+"%, "+U(100*_(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(X[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=o(t);n="#"+f(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return o(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(E,arguments)},complement:function(){return this._applyCombination(C,arguments)},monochromatic:function(){return this._applyCombination(O,arguments)},splitcomplement:function(){return this._applyCombination(S,arguments)},triad:function(){return this._applyCombination(k,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},o.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:j(t[r]));t=n}return o(t,e)},o.equals=function(t,e){return!(!t||!e)&&o(t).toRgbString()==o(e).toRgbString()},o.random=function(){return o.fromRatio({r:G(),g:G(),b:G()})},o.mix=function(t,e,n){n=0===n?0:n||50;var r=o(t).toRgb(),i=o(e).toRgb(),a=n/100;return o({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},o.readability=function(t,e){var n=o(t),r=o(e);return(i.max(n.getLuminance(),r.getLuminance())+.05)/(i.min(n.getLuminance(),r.getLuminance())+.05)},o.isReadable=function(t,e,n){var r,i,a=o.readability(t,e);switch(i=!1,r=z(n),r.level+r.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},o.mostReadable=function(t,e,n){var r,i,a,s,l=null,c=0;n=n||{},i=n.includeFallbackColors,a=n.level,s=n.size;for(var u=0;u<e.length;u++)(r=o.readability(t,e[u]))>c&&(c=r,l=o(e[u]));return o.isReadable(t,l,{level:a,size:s})||!i?l:(n.includeFallbackColors=!1,o.mostReadable(t,["#fff","#000"],n))};var Y=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},X=o.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Y),K=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();void 0!==t&&t.exports?t.exports=o:void 0!==(r=function(){return o}.call(e,n,e,t))&&(t.exports=r)}(Math)},function(t,e,n){var r=n(67);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("0f73e73c",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-editable-input {\n position: relative;\n}\n.vc-input__input {\n padding: 0;\n border: 0;\n outline: none;\n}\n.vc-input__label {\n text-transform: capitalize;\n}\n",""])},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vc-editable-input"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.val,expression:"val"}],ref:"input",staticClass:"vc-input__input",attrs:{"aria-labelledby":t.labelId},domProps:{value:t.val},on:{keydown:t.handleKeyDown,input:[function(e){e.target.composing||(t.val=e.target.value)},t.update]}}),t._v(" "),n("span",{staticClass:"vc-input__label",attrs:{for:t.label,id:t.labelId}},[t._v(t._s(t.labelSpanText))]),t._v(" "),n("span",{staticClass:"vc-input__desc"},[t._v(t._s(t.desc))])])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vc-compact",attrs:{role:"application","aria-label":"Compact color picker"}},[n("ul",{staticClass:"vc-compact-colors",attrs:{role:"listbox"}},t._l(t.paletteUpperCase(t.palette),(function(e){return n("li",{key:e,staticClass:"vc-compact-color-item",class:{"vc-compact-color-item--white":"#FFFFFF"===e},style:{background:e},attrs:{role:"option","aria-label":"color:"+e,"aria-selected":e===t.pick},on:{click:function(n){return t.handlerClick(e)}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e===t.pick,expression:"c === pick"}],staticClass:"vc-compact-dot"})])})),0)])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){l||n(71)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(37),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(73),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/Grayscale.vue",e.default=d.exports},function(t,e,n){var r=n(72);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("21ddbb74",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-grayscale {\n width: 125px;\n border-radius: 2px;\n box-shadow: 0 2px 15px rgba(0,0,0,.12), 0 2px 10px rgba(0,0,0,.16);\n background-color: #fff;\n}\n.vc-grayscale-colors {\n border-radius: 2px;\n overflow: hidden;\n padding: 0;\n margin: 0;\n}\n.vc-grayscale-color-item {\n list-style: none;\n width: 25px;\n height: 25px;\n float: left;\n position: relative;\n cursor: pointer;\n}\n.vc-grayscale-color-item--white .vc-grayscale-dot {\n background: #000;\n}\n.vc-grayscale-dot {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 6px;\n height: 6px;\n margin: -3px 0 0 -2px;\n border-radius: 50%;\n opacity: 1;\n background: #fff;\n}\n",""])},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vc-grayscale",attrs:{role:"application","aria-label":"Grayscale color picker"}},[n("ul",{staticClass:"vc-grayscale-colors",attrs:{role:"listbox"}},t._l(t.paletteUpperCase(t.palette),(function(e){return n("li",{key:e,staticClass:"vc-grayscale-color-item",class:{"vc-grayscale-color-item--white":"#FFFFFF"==e},style:{background:e},attrs:{role:"option","aria-label":"Color:"+e,"aria-selected":e===t.pick},on:{click:function(n){return t.handlerClick(e)}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e===t.pick,expression:"c === pick"}],staticClass:"vc-grayscale-dot"})])})),0)])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){l||n(75)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(38),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(77),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/Material.vue",e.default=d.exports},function(t,e,n){var r=n(76);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("1ff3af73",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,'\n.vc-material {\n width: 98px;\n height: 98px;\n padding: 16px;\n font-family: "Roboto";\n position: relative;\n border-radius: 2px;\n box-shadow: 0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16);\n background-color: #fff;\n}\n.vc-material .vc-input__input {\n width: 100%;\n margin-top: 12px;\n font-size: 15px;\n color: #333;\n height: 30px;\n}\n.vc-material .vc-input__label {\n position: absolute;\n top: 0;\n left: 0;\n font-size: 11px;\n color: #999;\n text-transform: capitalize;\n}\n.vc-material-hex {\n border-bottom-width: 2px;\n border-bottom-style: solid;\n}\n.vc-material-split {\n display: flex;\n margin-right: -10px;\n padding-top: 11px;\n}\n.vc-material-third {\n flex: 1;\n padding-right: 10px;\n}\n',""])},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vc-material",attrs:{role:"application","aria-label":"Material color picker"}},[n("ed-in",{staticClass:"vc-material-hex",style:{borderColor:t.colors.hex},attrs:{label:"hex"},on:{change:t.onChange},model:{value:t.colors.hex,callback:function(e){t.$set(t.colors,"hex",e)},expression:"colors.hex"}}),t._v(" "),n("div",{staticClass:"vc-material-split"},[n("div",{staticClass:"vc-material-third"},[n("ed-in",{attrs:{label:"r"},on:{change:t.onChange},model:{value:t.colors.rgba.r,callback:function(e){t.$set(t.colors.rgba,"r",e)},expression:"colors.rgba.r"}})],1),t._v(" "),n("div",{staticClass:"vc-material-third"},[n("ed-in",{attrs:{label:"g"},on:{change:t.onChange},model:{value:t.colors.rgba.g,callback:function(e){t.$set(t.colors.rgba,"g",e)},expression:"colors.rgba.g"}})],1),t._v(" "),n("div",{staticClass:"vc-material-third"},[n("ed-in",{attrs:{label:"b"},on:{change:t.onChange},model:{value:t.colors.rgba.b,callback:function(e){t.$set(t.colors.rgba,"b",e)},expression:"colors.rgba.b"}})],1)])],1)},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){l||n(79)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(39),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(114),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/Slider.vue",e.default=d.exports},function(t,e,n){var r=n(80);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("7982aa43",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-slider {\n position: relative;\n width: 410px;\n}\n.vc-slider-hue-warp {\n height: 12px;\n position: relative;\n}\n.vc-slider-hue-warp .vc-hue-picker {\n width: 14px;\n height: 14px;\n border-radius: 6px;\n transform: translate(-7px, -2px);\n background-color: rgb(248, 248, 248);\n box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);\n}\n.vc-slider-swatches {\n display: flex;\n margin-top: 20px;\n}\n.vc-slider-swatch {\n margin-right: 1px;\n flex: 1;\n width: 20%;\n}\n.vc-slider-swatch:first-child {\n margin-right: 1px;\n}\n.vc-slider-swatch:first-child .vc-slider-swatch-picker {\n border-radius: 2px 0px 0px 2px;\n}\n.vc-slider-swatch:last-child {\n margin-right: 0;\n}\n.vc-slider-swatch:last-child .vc-slider-swatch-picker {\n border-radius: 0px 2px 2px 0px;\n}\n.vc-slider-swatch-picker {\n cursor: pointer;\n height: 12px;\n}\n.vc-slider-swatch:nth-child(n) .vc-slider-swatch-picker.vc-slider-swatch-picker--active {\n transform: scaleY(1.8);\n border-radius: 3.6px/2px;\n}\n.vc-slider-swatch-picker--white {\n box-shadow: inset 0 0 0 1px #ddd;\n}\n.vc-slider-swatch-picker--active.vc-slider-swatch-picker--white {\n box-shadow: inset 0 0 0 0.6px #ddd;\n}\n",""])},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(82),o=r(i),a=n(100),s=r(a),l="function"==typeof s.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":typeof t};e.default="function"==typeof s.default&&"symbol"===l(o.default)?function(t){return void 0===t?"undefined":l(t)}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":void 0===t?"undefined":l(t)}},function(t,e,n){t.exports={default:n(83),__esModule:!0}},function(t,e,n){n(84),n(96),t.exports=n(32).f("iterator")},function(t,e,n){"use strict";var r=n(85)(!0);n(40)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},function(t,e,n){var r=n(23),i=n(24);t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),l=r(n),c=s.length;return l<0||l>=c?t?"":void 0:(o=s.charCodeAt(l),o<55296||o>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):o:t?s.slice(l,l+2):a-56320+(o-55296<<10)+65536)}}},function(t,e,n){var r=n(87);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){"use strict";var r=n(45),i=n(18),o=n(31),a={};n(7)(a,n(11)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(8),i=n(16),o=n(27);t.exports=n(9)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),s=a.length,l=0;s>l;)r.f(t,n=a[l++],e[n]);return t}},function(t,e,n){var r=n(47);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(10),i=n(92),o=n(93);t.exports=function(t){return function(e,n,a){var s,l=r(e),c=i(l.length),u=o(a,c);if(t&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}}},function(t,e,n){var r=n(23),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(23),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(4).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(6),i=n(48),o=n(28)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){n(97);for(var r=n(4),i=n(7),o=n(26),a=n(11)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var c=s[l],u=r[c],d=u&&u.prototype;d&&!d[a]&&i(d,a,c),o[c]=o.Array}},function(t,e,n){"use strict";var r=n(98),i=n(99),o=n(26),a=n(10);t.exports=n(40)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){t.exports={default:n(101),__esModule:!0}},function(t,e,n){n(102),n(108),n(109),n(110),t.exports=n(15).Symbol},function(t,e,n){"use strict";var r=n(4),i=n(6),o=n(9),a=n(41),s=n(44),l=n(103).KEY,c=n(17),u=n(29),d=n(31),h=n(19),p=n(11),f=n(32),g=n(33),m=n(104),v=n(105),b=n(16),y=n(12),w=n(48),x=n(10),C=n(25),k=n(18),A=n(45),S=n(106),E=n(107),O=n(49),T=n(8),_=n(27),M=E.f,N=T.f,P=S.f,L=r.Symbol,D=r.JSON,j=D&&D.stringify,I=p("_hidden"),R=p("toPrimitive"),F={}.propertyIsEnumerable,B=u("symbol-registry"),z=u("symbols"),H=u("op-symbols"),V=Object.prototype,q="function"==typeof L&&!!O.f,U=r.QObject,W=!U||!U.prototype||!U.prototype.findChild,$=o&&c((function(){return 7!=A(N({},"a",{get:function(){return N(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=M(V,e);r&&delete V[e],N(t,e,n),r&&t!==V&&N(V,e,r)}:N,G=function(t){var e=z[t]=A(L.prototype);return e._k=t,e},Y=q&&"symbol"==typeof L.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof L},X=function(t,e,n){return t===V&&X(H,e,n),b(t),e=C(e,!0),b(n),i(z,e)?(n.enumerable?(i(t,I)&&t[I][e]&&(t[I][e]=!1),n=A(n,{enumerable:k(0,!1)})):(i(t,I)||N(t,I,k(1,{})),t[I][e]=!0),$(t,e,n)):N(t,e,n)},K=function(t,e){b(t);for(var n,r=m(e=x(e)),i=0,o=r.length;o>i;)X(t,n=r[i++],e[n]);return t},Z=function(t,e){return void 0===e?A(t):K(A(t),e)},J=function(t){var e=F.call(this,t=C(t,!0));return!(this===V&&i(z,t)&&!i(H,t))&&(!(e||!i(this,t)||!i(z,t)||i(this,I)&&this[I][t])||e)},Q=function(t,e){if(t=x(t),e=C(e,!0),t!==V||!i(z,e)||i(H,e)){var n=M(t,e);return!n||!i(z,e)||i(t,I)&&t[I][e]||(n.enumerable=!0),n}},tt=function(t){for(var e,n=P(x(t)),r=[],o=0;n.length>o;)i(z,e=n[o++])||e==I||e==l||r.push(e);return r},et=function(t){for(var e,n=t===V,r=P(n?H:x(t)),o=[],a=0;r.length>a;)!i(z,e=r[a++])||n&&!i(V,e)||o.push(z[e]);return o};q||(L=function(){if(this instanceof L)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===V&&e.call(H,n),i(this,I)&&i(this[I],t)&&(this[I][t]=!1),$(this,t,k(1,n))};return o&&W&&$(V,t,{configurable:!0,set:e}),G(t)},s(L.prototype,"toString",(function(){return this._k})),E.f=Q,T.f=X,n(50).f=S.f=tt,n(34).f=J,O.f=et,o&&!n(14)&&s(V,"propertyIsEnumerable",J,!0),f.f=function(t){return G(p(t))}),a(a.G+a.W+a.F*!q,{Symbol:L});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;nt.length>rt;)p(nt[rt++]);for(var it=_(p.store),ot=0;it.length>ot;)g(it[ot++]);a(a.S+a.F*!q,"Symbol",{for:function(t){return i(B,t+="")?B[t]:B[t]=L(t)},keyFor:function(t){if(!Y(t))throw TypeError(t+" is not a symbol!");for(var e in B)if(B[e]===t)return e},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!q,"Object",{create:Z,defineProperty:X,defineProperties:K,getOwnPropertyDescriptor:Q,getOwnPropertyNames:tt,getOwnPropertySymbols:et});var at=c((function(){O.f(1)}));a(a.S+a.F*at,"Object",{getOwnPropertySymbols:function(t){return O.f(w(t))}}),D&&a(a.S+a.F*(!q||c((function(){var t=L();return"[null]"!=j([t])||"{}"!=j({a:t})||"{}"!=j(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(y(e)||void 0!==t)&&!Y(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Y(e))return e}),r[1]=e,j.apply(D,r)}}),L.prototype[R]||n(7)(L.prototype,R,L.prototype.valueOf),d(L,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},function(t,e,n){var r=n(19)("meta"),i=n(12),o=n(6),a=n(8).f,s=0,l=Object.isExtensible||function(){return!0},c=!n(17)((function(){return l(Object.preventExtensions({}))})),u=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},d=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!l(t))return"F";if(!e)return"E";u(t)}return t[r].i},h=function(t,e){if(!o(t,r)){if(!l(t))return!0;if(!e)return!1;u(t)}return t[r].w},p=function(t){return c&&f.NEED&&l(t)&&!o(t,r)&&u(t),t},f=t.exports={KEY:r,NEED:!1,fastKey:d,getWeak:h,onFreeze:p}},function(t,e,n){var r=n(27),i=n(49),o=n(34);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),l=o.f,c=0;s.length>c;)l.call(t,a=s[c++])&&e.push(a);return e}},function(t,e,n){var r=n(47);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(10),i=n(50).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return i(t)}catch(t){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?s(t):i(r(t))}},function(t,e,n){var r=n(34),i=n(18),o=n(10),a=n(25),s=n(6),l=n(42),c=Object.getOwnPropertyDescriptor;e.f=n(9)?c:function(t,e){if(t=o(t),e=a(e,!0),l)try{return c(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e){},function(t,e,n){n(33)("asyncIterator")},function(t,e,n){n(33)("observable")},function(t,e,n){var r=n(112);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("7c5f1a1c",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-hue {\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n border-radius: 2px;\n}\n.vc-hue--horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n}\n.vc-hue--vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n}\n.vc-hue-container {\n cursor: pointer;\n margin: 0 2px;\n position: relative;\n height: 100%;\n}\n.vc-hue-pointer {\n z-index: 2;\n position: absolute;\n}\n.vc-hue-picker {\n cursor: pointer;\n margin-top: 1px;\n width: 4px;\n border-radius: 1px;\n height: 8px;\n box-shadow: 0 0 2px rgba(0, 0, 0, .6);\n background: #fff;\n transform: translateX(-2px) ;\n}\n",""])},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["vc-hue",t.directionClass]},[n("div",{ref:"container",staticClass:"vc-hue-container",attrs:{role:"slider","aria-valuenow":t.colors.hsl.h,"aria-valuemin":"0","aria-valuemax":"360"},on:{mousedown:t.handleMouseDown,touchmove:t.handleChange,touchstart:t.handleChange}},[n("div",{staticClass:"vc-hue-pointer",style:{top:t.pointerTop,left:t.pointerLeft},attrs:{role:"presentation"}},[n("div",{staticClass:"vc-hue-picker"})])])])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vc-slider",attrs:{role:"application","aria-label":"Slider color picker"}},[n("div",{staticClass:"vc-slider-hue-warp"},[n("hue",{on:{change:t.hueChange},model:{value:t.colors,callback:function(e){t.colors=e},expression:"colors"}})],1),t._v(" "),n("div",{staticClass:"vc-slider-swatches",attrs:{role:"group"}},t._l(t.normalizedSwatches,(function(e,r){return n("div",{key:r,staticClass:"vc-slider-swatch",attrs:{"data-index":r,"aria-label":"color:"+t.colors.hex,role:"button"},on:{click:function(n){return t.handleSwClick(r,e)}}},[n("div",{staticClass:"vc-slider-swatch-picker",class:{"vc-slider-swatch-picker--active":t.isActive(e,r),"vc-slider-swatch-picker--white":1===e.l},style:{background:"hsl("+t.colors.hsl.h+", "+100*e.s+"%, "+100*e.l+"%)"}})])})),0)])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){l||n(116)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(52),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(119),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/Swatches.vue",e.default=d.exports},function(t,e,n){var r=n(117);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("10f839a2",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-swatches {\n width: 320px;\n height: 240px;\n overflow-y: scroll;\n background-color: #fff;\n box-shadow: 0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16);\n}\n.vc-swatches-box {\n padding: 16px 0 6px 16px;\n overflow: hidden;\n}\n.vc-swatches-color-group {\n padding-bottom: 10px;\n width: 40px;\n float: left;\n margin-right: 10px;\n}\n.vc-swatches-color-it {\n box-sizing: border-box;\n width: 40px;\n height: 24px;\n cursor: pointer;\n background: #880e4f;\n margin-bottom: 1px;\n overflow: hidden;\n -ms-border-radius: 2px 2px 0 0;\n -moz-border-radius: 2px 2px 0 0;\n -o-border-radius: 2px 2px 0 0;\n -webkit-border-radius: 2px 2px 0 0;\n border-radius: 2px 2px 0 0;\n}\n.vc-swatches-color--white {\n border: 1px solid #DDD;\n}\n.vc-swatches-pick {\n fill: rgb(255, 255, 255);\n margin-left: 8px;\n display: block;\n}\n.vc-swatches-color--white .vc-swatches-pick {\n fill: rgb(51, 51, 51);\n}\n",""])},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"red",(function(){return r})),n.d(e,"pink",(function(){return i})),n.d(e,"purple",(function(){return o})),n.d(e,"deepPurple",(function(){return a})),n.d(e,"indigo",(function(){return s})),n.d(e,"blue",(function(){return l})),n.d(e,"lightBlue",(function(){return c})),n.d(e,"cyan",(function(){return u})),n.d(e,"teal",(function(){return d})),n.d(e,"green",(function(){return h})),n.d(e,"lightGreen",(function(){return p})),n.d(e,"lime",(function(){return f})),n.d(e,"yellow",(function(){return g})),n.d(e,"amber",(function(){return m})),n.d(e,"orange",(function(){return v})),n.d(e,"deepOrange",(function(){return b})),n.d(e,"brown",(function(){return y})),n.d(e,"grey",(function(){return w})),n.d(e,"blueGrey",(function(){return x})),n.d(e,"darkText",(function(){return C})),n.d(e,"lightText",(function(){return k})),n.d(e,"darkIcons",(function(){return A})),n.d(e,"lightIcons",(function(){return S})),n.d(e,"white",(function(){return E})),n.d(e,"black",(function(){return O}));var r={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000"},i={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162"},o={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff"},a={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea"},s={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe"},l={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff"},c={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea"},u={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4"},d={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5"},h={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853"},p={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17"},f={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00"},g={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600"},m={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00"},v={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00"},b={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00"},y={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723"},w={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121"},x={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238"},C={primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",dividers:"rgba(0, 0, 0, 0.12)"},k={primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",dividers:"rgba(255, 255, 255, 0.12)"},A={active:"rgba(0, 0, 0, 0.54)",inactive:"rgba(0, 0, 0, 0.38)"},S={active:"rgba(255, 255, 255, 1)",inactive:"rgba(255, 255, 255, 0.5)"},E="#ffffff",O="#000000";e.default={red:r,pink:i,purple:o,deepPurple:a,indigo:s,blue:l,lightBlue:c,cyan:u,teal:d,green:h,lightGreen:p,lime:f,yellow:g,amber:m,orange:v,deepOrange:b,brown:y,grey:w,blueGrey:x,darkText:C,lightText:k,darkIcons:A,lightIcons:S,white:E,black:O}},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vc-swatches",attrs:{role:"application","aria-label":"Swatches color picker","data-pick":t.pick}},[n("div",{staticClass:"vc-swatches-box",attrs:{role:"listbox"}},t._l(t.palette,(function(e,r){return n("div",{key:r,staticClass:"vc-swatches-color-group"},t._l(e,(function(e){return n("div",{key:e,class:["vc-swatches-color-it",{"vc-swatches-color--white":"#FFFFFF"===e}],style:{background:e},attrs:{role:"option","aria-label":"Color:"+e,"aria-selected":t.equal(e),"data-color":e},on:{click:function(n){return t.handlerClick(e)}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.equal(e),expression:"equal(c)"}],staticClass:"vc-swatches-pick"},[n("svg",{staticStyle:{width:"24px",height:"24px"},attrs:{viewBox:"0 0 24 24"}},[n("path",{attrs:{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}})])])])})),0)})),0)])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){l||n(121)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(53),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(134),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/Photoshop.vue",e.default=d.exports},function(t,e,n){var r=n(122);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("080365d4",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,'\n.vc-photoshop {\n background: #DCDCDC;\n border-radius: 4px;\n box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15);\n box-sizing: initial;\n width: 513px;\n font-family: Roboto;\n}\n.vc-photoshop__disable-fields {\n width: 390px;\n}\n.vc-ps-head {\n background-image: linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%);\n border-bottom: 1px solid #B1B1B1;\n box-shadow: inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02);\n height: 23px;\n line-height: 24px;\n border-radius: 4px 4px 0 0;\n font-size: 13px;\n color: #4D4D4D;\n text-align: center;\n}\n.vc-ps-body {\n padding: 15px;\n display: flex;\n}\n.vc-ps-saturation-wrap {\n width: 256px;\n height: 256px;\n position: relative;\n border: 2px solid #B3B3B3;\n border-bottom: 2px solid #F0F0F0;\n overflow: hidden;\n}\n.vc-ps-saturation-wrap .vc-saturation-circle {\n width: 12px;\n height: 12px;\n}\n.vc-ps-hue-wrap {\n position: relative;\n height: 256px;\n width: 19px;\n margin-left: 10px;\n border: 2px solid #B3B3B3;\n border-bottom: 2px solid #F0F0F0;\n}\n.vc-ps-hue-pointer {\n position: relative;\n}\n.vc-ps-hue-pointer--left,\n.vc-ps-hue-pointer--right {\n position: absolute;\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 5px 0 5px 8px;\n border-color: transparent transparent transparent #555;\n}\n.vc-ps-hue-pointer--left:after,\n.vc-ps-hue-pointer--right:after {\n content: "";\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 4px 0 4px 6px;\n border-color: transparent transparent transparent #fff;\n position: absolute;\n top: 1px;\n left: 1px;\n transform: translate(-8px, -5px);\n}\n.vc-ps-hue-pointer--left {\n transform: translate(-13px, -4px);\n}\n.vc-ps-hue-pointer--right {\n transform: translate(20px, -4px) rotate(180deg);\n}\n.vc-ps-controls {\n width: 180px;\n margin-left: 10px;\n display: flex;\n}\n.vc-ps-controls__disable-fields {\n width: auto;\n}\n.vc-ps-actions {\n margin-left: 20px;\n flex: 1;\n}\n.vc-ps-ac-btn {\n cursor: pointer;\n background-image: linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%);\n border: 1px solid #878787;\n border-radius: 2px;\n height: 20px;\n box-shadow: 0 1px 0 0 #EAEAEA;\n font-size: 14px;\n color: #000;\n line-height: 20px;\n text-align: center;\n margin-bottom: 10px;\n}\n.vc-ps-previews {\n width: 60px;\n}\n.vc-ps-previews__swatches {\n border: 1px solid #B3B3B3;\n border-bottom: 1px solid #F0F0F0;\n margin-bottom: 2px;\n margin-top: 1px;\n}\n.vc-ps-previews__pr-color {\n height: 34px;\n box-shadow: inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000;\n}\n.vc-ps-previews__label {\n font-size: 14px;\n color: #000;\n text-align: center;\n}\n.vc-ps-fields {\n padding-top: 5px;\n padding-bottom: 9px;\n width: 80px;\n position: relative;\n}\n.vc-ps-fields .vc-input__input {\n margin-left: 40%;\n width: 40%;\n height: 18px;\n border: 1px solid #888888;\n box-shadow: inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC;\n margin-bottom: 5px;\n font-size: 13px;\n padding-left: 3px;\n margin-right: 10px;\n}\n.vc-ps-fields .vc-input__label, .vc-ps-fields .vc-input__desc {\n top: 0;\n text-transform: uppercase;\n font-size: 13px;\n height: 18px;\n line-height: 22px;\n position: absolute;\n}\n.vc-ps-fields .vc-input__label {\n left: 0;\n width: 34px;\n}\n.vc-ps-fields .vc-input__desc {\n right: 0;\n width: 0;\n}\n.vc-ps-fields__divider {\n height: 5px;\n}\n.vc-ps-fields__hex .vc-input__input {\n margin-left: 20%;\n width: 80%;\n height: 18px;\n border: 1px solid #888888;\n box-shadow: inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC;\n margin-bottom: 6px;\n font-size: 13px;\n padding-left: 3px;\n}\n.vc-ps-fields__hex .vc-input__label {\n position: absolute;\n top: 0;\n left: 0;\n width: 14px;\n text-transform: uppercase;\n font-size: 13px;\n height: 18px;\n line-height: 22px;\n}\n',""])},function(t,e,n){var r=n(124);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("b5380e52",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-saturation,\n.vc-saturation--white,\n.vc-saturation--black {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.vc-saturation--white {\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n}\n.vc-saturation--black {\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n}\n.vc-saturation-pointer {\n cursor: pointer;\n position: absolute;\n}\n.vc-saturation-circle {\n cursor: head;\n width: 4px;\n height: 4px;\n box-shadow: 0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3), 0 0 1px 2px rgba(0,0,0,.4);\n border-radius: 50%;\n transform: translate(-2px, -2px);\n}\n",""])},function(t,e){function n(t,e,n){return e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}t.exports=n},function(t,n){function r(t,e,n){function r(e){var n=g,r=m;return g=m=void 0,x=e,b=t.apply(r,n)}function i(t){return x=t,y=setTimeout(u,e),S?r(t):b}function a(t){var n=t-w,r=t-x,i=e-n;return E?k(i,v-r):i}function s(t){var n=t-w,r=t-x;return void 0===w||n>=e||n<0||E&&r>=v}function u(){var t=A();if(s(t))return d(t);y=setTimeout(u,a(t))}function d(t){return y=void 0,O&&g?r(t):(g=m=void 0,b)}function h(){void 0!==y&&clearTimeout(y),x=0,g=w=m=y=void 0}function p(){return void 0===y?b:d(A())}function f(){var t=A(),n=s(t);if(g=arguments,m=this,w=t,n){if(void 0===y)return i(w);if(E)return y=setTimeout(u,e),r(w)}return void 0===y&&(y=setTimeout(u,e)),b}var g,m,v,b,y,w,x=0,S=!1,E=!1,O=!0;if("function"!=typeof t)throw new TypeError(c);return e=l(e)||0,o(n)&&(S=!!n.leading,E="maxWait"in n,v=E?C(l(n.maxWait)||0,e):v,O="trailing"in n?!!n.trailing:O),f.cancel=h,f.flush=p,f}function i(t,e,n){var i=!0,a=!0;if("function"!=typeof t)throw new TypeError(c);return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:i,maxWait:e,trailing:a})}function o(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function a(t){return!!t&&"object"==typeof t}function s(t){return"symbol"==typeof t||a(t)&&x.call(t)==d}function l(t){if("number"==typeof t)return t;if(s(t))return u;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(h,"");var n=f.test(t);return n||g.test(t)?m(t.slice(2),n?2:8):p.test(t)?u:+t}var c="Expected a function",u=NaN,d="[object Symbol]",h=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,g=/^0o[0-7]+$/i,m=parseInt,v="object"==typeof e&&e&&e.Object===Object&&e,b="object"==typeof self&&self&&self.Object===Object&&self,y=v||b||Function("return this")(),w=Object.prototype,x=w.toString,C=Math.max,k=Math.min,A=function(){return y.Date.now()};t.exports=i},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"container",staticClass:"vc-saturation",style:{background:t.bgColor},on:{mousedown:t.handleMouseDown,touchmove:t.handleChange,touchstart:t.handleChange}},[n("div",{staticClass:"vc-saturation--white"}),t._v(" "),n("div",{staticClass:"vc-saturation--black"}),t._v(" "),n("div",{staticClass:"vc-saturation-pointer",style:{top:t.pointerTop,left:t.pointerLeft}},[n("div",{staticClass:"vc-saturation-circle"})])])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){var r=n(129);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("4dc1b086",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-alpha {\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n}\n.vc-alpha-checkboard-wrap {\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n overflow: hidden;\n}\n.vc-alpha-gradient {\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n}\n.vc-alpha-container {\n cursor: pointer;\n position: relative;\n z-index: 2;\n height: 100%;\n margin: 0 3px;\n}\n.vc-alpha-pointer {\n z-index: 2;\n position: absolute;\n}\n.vc-alpha-picker {\n cursor: pointer;\n width: 4px;\n border-radius: 1px;\n height: 8px;\n box-shadow: 0 0 2px rgba(0, 0, 0, .6);\n background: #fff;\n margin-top: 1px;\n transform: translateX(-2px);\n}\n",""])},function(t,e,n){var r=n(131);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("7e15c05b",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-checkerboard {\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n background-size: contain;\n}\n",""])},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"vc-checkerboard",style:t.bgStyle})},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vc-alpha"},[n("div",{staticClass:"vc-alpha-checkboard-wrap"},[n("checkboard")],1),t._v(" "),n("div",{staticClass:"vc-alpha-gradient",style:{background:t.gradientColor}}),t._v(" "),n("div",{ref:"container",staticClass:"vc-alpha-container",on:{mousedown:t.handleMouseDown,touchmove:t.handleChange,touchstart:t.handleChange}},[n("div",{staticClass:"vc-alpha-pointer",style:{left:100*t.colors.a+"%"}},[n("div",{staticClass:"vc-alpha-picker"})])])])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["vc-photoshop",t.disableFields?"vc-photoshop__disable-fields":""],attrs:{role:"application","aria-label":"PhotoShop color picker"}},[n("div",{staticClass:"vc-ps-head",attrs:{role:"heading"}},[t._v(t._s(t.head))]),t._v(" "),n("div",{staticClass:"vc-ps-body"},[n("div",{staticClass:"vc-ps-saturation-wrap"},[n("saturation",{on:{change:t.childChange},model:{value:t.colors,callback:function(e){t.colors=e},expression:"colors"}})],1),t._v(" "),n("div",{staticClass:"vc-ps-hue-wrap"},[n("hue",{attrs:{direction:"vertical"},on:{change:t.childChange},model:{value:t.colors,callback:function(e){t.colors=e},expression:"colors"}},[n("div",{staticClass:"vc-ps-hue-pointer"},[n("i",{staticClass:"vc-ps-hue-pointer--left"}),n("i",{staticClass:"vc-ps-hue-pointer--right"})])])],1),t._v(" "),n("div",{class:["vc-ps-controls",t.disableFields?"vc-ps-controls__disable-fields":""]},[n("div",{staticClass:"vc-ps-previews"},[n("div",{staticClass:"vc-ps-previews__label"},[t._v(t._s(t.newLabel))]),t._v(" "),n("div",{staticClass:"vc-ps-previews__swatches"},[n("div",{staticClass:"vc-ps-previews__pr-color",style:{background:t.colors.hex},attrs:{"aria-label":"New color is "+t.colors.hex}}),t._v(" "),n("div",{staticClass:"vc-ps-previews__pr-color",style:{background:t.currentColor},attrs:{"aria-label":"Current color is "+t.currentColor},on:{click:t.clickCurrentColor}})]),t._v(" "),n("div",{staticClass:"vc-ps-previews__label"},[t._v(t._s(t.currentLabel))])]),t._v(" "),t.disableFields?t._e():n("div",{staticClass:"vc-ps-actions"},[n("div",{staticClass:"vc-ps-ac-btn",attrs:{role:"button","aria-label":t.acceptLabel},on:{click:t.handleAccept}},[t._v(t._s(t.acceptLabel))]),t._v(" "),n("div",{staticClass:"vc-ps-ac-btn",attrs:{role:"button","aria-label":t.cancelLabel},on:{click:t.handleCancel}},[t._v(t._s(t.cancelLabel))]),t._v(" "),n("div",{staticClass:"vc-ps-fields"},[n("ed-in",{attrs:{label:"h",desc:"°",value:t.hsv.h},on:{change:t.inputChange}}),t._v(" "),n("ed-in",{attrs:{label:"s",desc:"%",value:t.hsv.s,max:100},on:{change:t.inputChange}}),t._v(" "),n("ed-in",{attrs:{label:"v",desc:"%",value:t.hsv.v,max:100},on:{change:t.inputChange}}),t._v(" "),n("div",{staticClass:"vc-ps-fields__divider"}),t._v(" "),n("ed-in",{attrs:{label:"r",value:t.colors.rgba.r},on:{change:t.inputChange}}),t._v(" "),n("ed-in",{attrs:{label:"g",value:t.colors.rgba.g},on:{change:t.inputChange}}),t._v(" "),n("ed-in",{attrs:{label:"b",value:t.colors.rgba.b},on:{change:t.inputChange}}),t._v(" "),n("div",{staticClass:"vc-ps-fields__divider"}),t._v(" "),n("ed-in",{staticClass:"vc-ps-fields__hex",attrs:{label:"#",value:t.hex},on:{change:t.inputChange}})],1),t._v(" "),t.hasResetButton?n("div",{staticClass:"vc-ps-ac-btn",attrs:{"aria-label":"reset"},on:{click:t.handleReset}},[t._v(t._s(t.resetLabel))]):t._e()])])])])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){l||n(136)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(57),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(138),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/Sketch.vue",e.default=d.exports},function(t,e,n){var r=n(137);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("612c6604",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-sketch {\n position: relative;\n width: 200px;\n padding: 10px 10px 0;\n box-sizing: initial;\n background: #fff;\n border-radius: 4px;\n box-shadow: 0 0 0 1px rgba(0, 0, 0, .15), 0 8px 16px rgba(0, 0, 0, .15);\n}\n.vc-sketch-saturation-wrap {\n width: 100%;\n padding-bottom: 75%;\n position: relative;\n overflow: hidden;\n}\n.vc-sketch-controls {\n display: flex;\n}\n.vc-sketch-sliders {\n padding: 4px 0;\n flex: 1;\n}\n.vc-sketch-sliders .vc-hue,\n.vc-sketch-sliders .vc-alpha-gradient {\n border-radius: 2px;\n}\n.vc-sketch-hue-wrap {\n position: relative;\n height: 10px;\n}\n.vc-sketch-alpha-wrap {\n position: relative;\n height: 10px;\n margin-top: 4px;\n overflow: hidden;\n}\n.vc-sketch-color-wrap {\n width: 24px;\n height: 24px;\n position: relative;\n margin-top: 4px;\n margin-left: 4px;\n border-radius: 3px;\n}\n.vc-sketch-active-color {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-radius: 2px;\n box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), inset 0 0 4px rgba(0, 0, 0, .25);\n z-index: 2;\n}\n.vc-sketch-color-wrap .vc-checkerboard {\n background-size: auto;\n}\n.vc-sketch-field {\n display: flex;\n padding-top: 4px;\n}\n.vc-sketch-field .vc-input__input {\n width: 90%;\n padding: 4px 0 3px 10%;\n border: none;\n box-shadow: inset 0 0 0 1px #ccc;\n font-size: 10px;\n}\n.vc-sketch-field .vc-input__label {\n display: block;\n text-align: center;\n font-size: 11px;\n color: #222;\n padding-top: 3px;\n padding-bottom: 4px;\n text-transform: capitalize;\n}\n.vc-sketch-field--single {\n flex: 1;\n padding-left: 6px;\n}\n.vc-sketch-field--double {\n flex: 2;\n}\n.vc-sketch-presets {\n margin-right: -10px;\n margin-left: -10px;\n padding-left: 10px;\n padding-top: 10px;\n border-top: 1px solid #eee;\n}\n.vc-sketch-presets-color {\n border-radius: 3px;\n overflow: hidden;\n position: relative;\n display: inline-block;\n margin: 0 10px 10px 0;\n vertical-align: top;\n cursor: pointer;\n width: 16px;\n height: 16px;\n box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);\n}\n.vc-sketch-presets-color .vc-checkerboard {\n box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);\n border-radius: 3px;\n}\n.vc-sketch__disable-alpha .vc-sketch-color-wrap {\n height: 10px;\n}\n",""])},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["vc-sketch",t.disableAlpha?"vc-sketch__disable-alpha":""],attrs:{role:"application","aria-label":"Sketch color picker"}},[n("div",{staticClass:"vc-sketch-saturation-wrap"},[n("saturation",{on:{change:t.childChange},model:{value:t.colors,callback:function(e){t.colors=e},expression:"colors"}})],1),t._v(" "),n("div",{staticClass:"vc-sketch-controls"},[n("div",{staticClass:"vc-sketch-sliders"},[n("div",{staticClass:"vc-sketch-hue-wrap"},[n("hue",{on:{change:t.childChange},model:{value:t.colors,callback:function(e){t.colors=e},expression:"colors"}})],1),t._v(" "),t.disableAlpha?t._e():n("div",{staticClass:"vc-sketch-alpha-wrap"},[n("alpha",{on:{change:t.childChange},model:{value:t.colors,callback:function(e){t.colors=e},expression:"colors"}})],1)]),t._v(" "),n("div",{staticClass:"vc-sketch-color-wrap"},[n("div",{staticClass:"vc-sketch-active-color",style:{background:t.activeColor},attrs:{"aria-label":"Current color is "+t.activeColor}}),t._v(" "),n("checkboard")],1)]),t._v(" "),t.disableFields?t._e():n("div",{staticClass:"vc-sketch-field"},[n("div",{staticClass:"vc-sketch-field--double"},[n("ed-in",{attrs:{label:"hex",value:t.hex},on:{change:t.inputChange}})],1),t._v(" "),n("div",{staticClass:"vc-sketch-field--single"},[n("ed-in",{attrs:{label:"r",value:t.colors.rgba.r},on:{change:t.inputChange}})],1),t._v(" "),n("div",{staticClass:"vc-sketch-field--single"},[n("ed-in",{attrs:{label:"g",value:t.colors.rgba.g},on:{change:t.inputChange}})],1),t._v(" "),n("div",{staticClass:"vc-sketch-field--single"},[n("ed-in",{attrs:{label:"b",value:t.colors.rgba.b},on:{change:t.inputChange}})],1),t._v(" "),t.disableAlpha?t._e():n("div",{staticClass:"vc-sketch-field--single"},[n("ed-in",{attrs:{label:"a",value:t.colors.a,"arrow-offset":.01,max:1},on:{change:t.inputChange}})],1)]),t._v(" "),n("div",{staticClass:"vc-sketch-presets",attrs:{role:"group","aria-label":"A color preset, pick one to set as current color"}},[t._l(t.presetColors,(function(e){return[t.isTransparent(e)?n("div",{key:e,staticClass:"vc-sketch-presets-color",attrs:{"aria-label":"Color:"+e},on:{click:function(n){return t.handlePreset(e)}}},[n("checkboard")],1):n("div",{key:e,staticClass:"vc-sketch-presets-color",style:{background:e},attrs:{"aria-label":"Color:"+e},on:{click:function(n){return t.handlePreset(e)}}})]}))],2)])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){l||n(140)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(58),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(142),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/Chrome.vue",e.default=d.exports},function(t,e,n){var r=n(141);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("1cd16048",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-chrome {\n background: #fff;\n border-radius: 2px;\n box-shadow: 0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3);\n box-sizing: initial;\n width: 225px;\n font-family: Menlo;\n background-color: #fff;\n}\n.vc-chrome-controls {\n display: flex;\n}\n.vc-chrome-color-wrap {\n position: relative;\n width: 36px;\n}\n.vc-chrome-active-color {\n position: relative;\n width: 30px;\n height: 30px;\n border-radius: 15px;\n overflow: hidden;\n z-index: 1;\n}\n.vc-chrome-color-wrap .vc-checkerboard {\n width: 30px;\n height: 30px;\n border-radius: 15px;\n background-size: auto;\n}\n.vc-chrome-sliders {\n flex: 1;\n}\n.vc-chrome-fields-wrap {\n display: flex;\n padding-top: 16px;\n}\n.vc-chrome-fields {\n display: flex;\n margin-left: -6px;\n flex: 1;\n}\n.vc-chrome-field {\n padding-left: 6px;\n width: 100%;\n}\n.vc-chrome-toggle-btn {\n width: 32px;\n text-align: right;\n position: relative;\n}\n.vc-chrome-toggle-icon {\n margin-right: -4px;\n margin-top: 12px;\n cursor: pointer;\n position: relative;\n z-index: 2;\n}\n.vc-chrome-toggle-icon-highlight {\n position: absolute;\n width: 24px;\n height: 28px;\n background: #eee;\n border-radius: 4px;\n top: 10px;\n left: 12px;\n}\n.vc-chrome-hue-wrap {\n position: relative;\n height: 10px;\n margin-bottom: 8px;\n}\n.vc-chrome-alpha-wrap {\n position: relative;\n height: 10px;\n}\n.vc-chrome-hue-wrap .vc-hue {\n border-radius: 2px;\n}\n.vc-chrome-alpha-wrap .vc-alpha-gradient {\n border-radius: 2px;\n}\n.vc-chrome-hue-wrap .vc-hue-picker, .vc-chrome-alpha-wrap .vc-alpha-picker {\n width: 12px;\n height: 12px;\n border-radius: 6px;\n transform: translate(-6px, -2px);\n background-color: rgb(248, 248, 248);\n box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);\n}\n.vc-chrome-body {\n padding: 16px 16px 12px;\n background-color: #fff;\n}\n.vc-chrome-saturation-wrap {\n width: 100%;\n padding-bottom: 55%;\n position: relative;\n border-radius: 2px 2px 0 0;\n overflow: hidden;\n}\n.vc-chrome-saturation-wrap .vc-saturation-circle {\n width: 12px;\n height: 12px;\n}\n.vc-chrome-fields .vc-input__input {\n font-size: 11px;\n color: #333;\n width: 100%;\n border-radius: 2px;\n border: none;\n box-shadow: inset 0 0 0 1px #dadada;\n height: 21px;\n text-align: center;\n}\n.vc-chrome-fields .vc-input__label {\n text-transform: uppercase;\n font-size: 11px;\n line-height: 11px;\n color: #969696;\n text-align: center;\n display: block;\n margin-top: 12px;\n}\n.vc-chrome__disable-alpha .vc-chrome-active-color {\n width: 18px;\n height: 18px;\n}\n.vc-chrome__disable-alpha .vc-chrome-color-wrap {\n width: 30px;\n}\n.vc-chrome__disable-alpha .vc-chrome-hue-wrap {\n margin-top: 4px;\n margin-bottom: 4px;\n}\n",""])},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["vc-chrome",t.disableAlpha?"vc-chrome__disable-alpha":""],attrs:{role:"application","aria-label":"Chrome color picker"}},[n("div",{staticClass:"vc-chrome-saturation-wrap"},[n("saturation",{on:{change:t.childChange},model:{value:t.colors,callback:function(e){t.colors=e},expression:"colors"}})],1),t._v(" "),n("div",{staticClass:"vc-chrome-body"},[n("div",{staticClass:"vc-chrome-controls"},[n("div",{staticClass:"vc-chrome-color-wrap"},[n("div",{staticClass:"vc-chrome-active-color",style:{background:t.activeColor},attrs:{"aria-label":"current color is "+t.colors.hex}}),t._v(" "),t.disableAlpha?t._e():n("checkboard")],1),t._v(" "),n("div",{staticClass:"vc-chrome-sliders"},[n("div",{staticClass:"vc-chrome-hue-wrap"},[n("hue",{on:{change:t.childChange},model:{value:t.colors,callback:function(e){t.colors=e},expression:"colors"}})],1),t._v(" "),t.disableAlpha?t._e():n("div",{staticClass:"vc-chrome-alpha-wrap"},[n("alpha",{on:{change:t.childChange},model:{value:t.colors,callback:function(e){t.colors=e},expression:"colors"}})],1)])]),t._v(" "),t.disableFields?t._e():n("div",{staticClass:"vc-chrome-fields-wrap"},[n("div",{directives:[{name:"show",rawName:"v-show",value:0===t.fieldsIndex,expression:"fieldsIndex === 0"}],staticClass:"vc-chrome-fields"},[n("div",{staticClass:"vc-chrome-field"},[t.hasAlpha?t._e():n("ed-in",{attrs:{label:"hex",value:t.colors.hex},on:{change:t.inputChange}}),t._v(" "),t.hasAlpha?n("ed-in",{attrs:{label:"hex",value:t.colors.hex8},on:{change:t.inputChange}}):t._e()],1)]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:1===t.fieldsIndex,expression:"fieldsIndex === 1"}],staticClass:"vc-chrome-fields"},[n("div",{staticClass:"vc-chrome-field"},[n("ed-in",{attrs:{label:"r",value:t.colors.rgba.r},on:{change:t.inputChange}})],1),t._v(" "),n("div",{staticClass:"vc-chrome-field"},[n("ed-in",{attrs:{label:"g",value:t.colors.rgba.g},on:{change:t.inputChange}})],1),t._v(" "),n("div",{staticClass:"vc-chrome-field"},[n("ed-in",{attrs:{label:"b",value:t.colors.rgba.b},on:{change:t.inputChange}})],1),t._v(" "),t.disableAlpha?t._e():n("div",{staticClass:"vc-chrome-field"},[n("ed-in",{attrs:{label:"a",value:t.colors.a,"arrow-offset":.01,max:1},on:{change:t.inputChange}})],1)]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:2===t.fieldsIndex,expression:"fieldsIndex === 2"}],staticClass:"vc-chrome-fields"},[n("div",{staticClass:"vc-chrome-field"},[n("ed-in",{attrs:{label:"h",value:t.hsl.h},on:{change:t.inputChange}})],1),t._v(" "),n("div",{staticClass:"vc-chrome-field"},[n("ed-in",{attrs:{label:"s",value:t.hsl.s},on:{change:t.inputChange}})],1),t._v(" "),n("div",{staticClass:"vc-chrome-field"},[n("ed-in",{attrs:{label:"l",value:t.hsl.l},on:{change:t.inputChange}})],1),t._v(" "),t.disableAlpha?t._e():n("div",{staticClass:"vc-chrome-field"},[n("ed-in",{attrs:{label:"a",value:t.colors.a,"arrow-offset":.01,max:1},on:{change:t.inputChange}})],1)]),t._v(" "),n("div",{staticClass:"vc-chrome-toggle-btn",attrs:{role:"button","aria-label":"Change another color definition"},on:{click:t.toggleViews}},[n("div",{staticClass:"vc-chrome-toggle-icon"},[n("svg",{staticStyle:{width:"24px",height:"24px"},attrs:{viewBox:"0 0 24 24"},on:{mouseover:t.showHighlight,mouseenter:t.showHighlight,mouseout:t.hideHighlight}},[n("path",{attrs:{fill:"#333",d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}})])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.highlight,expression:"highlight"}],staticClass:"vc-chrome-toggle-icon-highlight"})])])])])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){l||n(144)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(59),o=n.n(i);for(var a in i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);var s=n(146),l=!1,c=n(2),u=r,d=c(o.a,s.a,!1,u,null,null);d.options.__file="src/components/Twitter.vue",e.default=d.exports},function(t,e,n){var r=n(145);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals),n(1)("669a48a5",r,!1,{})},function(t,e,n){e=t.exports=n(0)(!1),e.push([t.i,"\n.vc-twitter {\n background: #fff;\n border: 0 solid rgba(0,0,0,0.25);\n box-shadow: 0 1px 4px rgba(0,0,0,0.25);\n border-radius: 4px;\n position: relative;\n}\n.vc-twitter-triangle {\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 0 9px 10px 9px;\n border-color: transparent transparent #fff transparent;\n position: absolute;\n}\n.vc-twitter-triangle-shadow {\n width: 0px;\n height: 0px;\n border-style: solid;\n border-width: 0 9px 10px 9px;\n border-color: transparent transparent rgba(0, 0, 0, .1) transparent;\n position: absolute;\n}\n.vc-twitter-body {\n padding: 15px 9px 9px 15px;\n}\n.vc-twitter .vc-editable-input {\n position: relative;\n}\n.vc-twitter .vc-editable-input input {\n width: 100px;\n font-size: 14px;\n color: #666;\n border: 0px;\n outline: none;\n height: 28px;\n box-shadow: inset 0 0 0 1px #F0F0F0;\n box-sizing: content-box;\n border-radius: 0 4px 4px 0;\n float: left;\n padding: 1px;\n padding-left: 8px;\n}\n.vc-twitter .vc-editable-input span {\n display: none;\n}\n.vc-twitter-hash {\n background: #F0F0F0;\n height: 30px;\n width: 30px;\n border-radius: 4px 0 0 4px;\n float: left;\n color: #98A1A4;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.vc-twitter-swatch {\n width: 30px;\n height: 30px;\n float: left;\n border-radius: 4px;\n margin: 0 6px 6px 0;\n cursor: pointer;\n position: relative;\n outline: none;\n}\n.vc-twitter-clear {\n clear: both;\n}\n.vc-twitter-hide-triangle .vc-twitter-triangle {\n display: none;\n}\n.vc-twitter-hide-triangle .vc-twitter-triangle-shadow {\n display: none;\n}\n.vc-twitter-top-left-triangle .vc-twitter-triangle{\n top: -10px;\n left: 12px;\n}\n.vc-twitter-top-left-triangle .vc-twitter-triangle-shadow{\n top: -11px;\n left: 12px;\n}\n.vc-twitter-top-right-triangle .vc-twitter-triangle{\n top: -10px;\n right: 12px;\n}\n.vc-twitter-top-right-triangle .vc-twitter-triangle-shadow{\n top: -11px;\n right: 12px;\n}\n",""])},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vc-twitter",class:{"vc-twitter-hide-triangle ":"hide"===t.triangle,"vc-twitter-top-left-triangle ":"top-left"===t.triangle,"vc-twitter-top-right-triangle ":"top-right"===t.triangle},style:{width:"number"==typeof t.width?t.width+"px":t.width}},[n("div",{staticClass:"vc-twitter-triangle-shadow"}),t._v(" "),n("div",{staticClass:"vc-twitter-triangle"}),t._v(" "),n("div",{staticClass:"vc-twitter-body"},[t._l(t.defaultColors,(function(e,r){return n("span",{key:r,staticClass:"vc-twitter-swatch",style:{background:e,boxShadow:"0 0 4px "+(t.equal(e)?e:"transparent")},on:{click:function(n){return t.handlerClick(e)}}})})),t._v(" "),n("div",{staticClass:"vc-twitter-hash"},[t._v("#")]),t._v(" "),n("editable-input",{attrs:{label:"#",value:t.hex},on:{change:t.inputChange}}),t._v(" "),n("div",{staticClass:"vc-twitter-clear"})],2)])},i=[];r._withStripped=!0;var o={render:r,staticRenderFns:i};e.a=o}])}))}).call(this,n("c8ba"))},c3ba:function(t,e,n){"use strict";var r=n("7037").default;n("b64b"),n("a4d3"),n("4de4"),n("d3b7"),n("e439"),n("159b"),n("dbb4"),n("e01a"),n("d28b"),n("3ca3"),n("ddb0"),n("b636"),n("944a"),n("0c47"),n("23dc"),n("d9e2"),n("3410"),n("b0c0"),n("131a"),n("fb6a"),n("f8c9"),n("4ae1"),n("5d41"),n("99af"),n("7db0"),n("ac1f"),n("1276"),n("498a"),n("a15b"),n("07ac"),n("5319"),n("25f0"),n("b680"),Object.defineProperty(e,"__esModule",{value:!0}),n("2733");var i=n("a57f");function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
s=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(T){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,o=Object.create(i.prototype),a=new S(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=C(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=d(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(T){return{type:"throw",arg:T}}}t.wrap=u;var h={};function p(){}function f(){}function g(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(E([])));b&&b!==e&&n.call(b,o)&&(m=b);var y=g.prototype=p.prototype=Object.create(m);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function i(o,a,s,l){var c=d(t[o],t,a);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==r(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,l)}),(function(t){i("throw",t,s,l)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return i("throw",t,s,l)}))}l(c.arg)}var o;this._invoke=function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}}function C(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,C(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=d(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=g,c(y,"constructor",g),c(g,"constructor",f),f.displayName=c(g,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,l,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},w(x.prototype),c(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(y),c(y,l,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=E,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function c(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){c(o,r,i,a,s,"next",t)}function s(t){c(o,r,i,a,s,"throw",t)}a(void 0)}))}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}function b(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t,e){if(e&&("object"===r(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return y(t)}function x(t){var e=b();return function(){var n,r=m(t);if(e){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return w(this,n)}}function C(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=m(t),null===t)break;return t}function k(){return k="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=C(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},k.apply(this,arguments)}function A(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var S=".data-video {\r\n margin: 0 auto;\r\n position: relative;\r\n cursor: pointer;\r\n}\r\n .data-video-content {\r\n position: relative;\r\n height: 420px;\r\n background: #f7f7f7;\r\n }\r\n .data-video-content video {\r\n width: 100%;\r\n height: 100%;\r\n outline: none;\r\n position: relative;\r\n z-index: 1;\r\n background: #000;\r\n }\r\n .data-video-uploading,\r\n .data-video-uploaded,\r\n .data-video-error {\r\n border: 1px solid #e6e6e6;\r\n background: #f6f6f6;\r\n }\r\n .data-video-content .data-video-mask {\r\n width: 100%;\r\n height: 100%;\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n z-index: 1;\r\n }\r\n .data-video-done {\r\n height: auto;\r\n border: none;\r\n background: none;\r\n line-height: 0;\r\n }\r\n .data-video-active {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n }\r\n .data-video-center {\r\n position: absolute;\r\n top: 50%;\r\n margin-top: -48px;\r\n width: 100%;\r\n height: 96px;\r\n }\r\n .data-video-center .data-video-icon,\r\n .data-video-center .data-video-name,\r\n .data-video-center .data-video-message,\r\n .data-video-center .data-video-progress,\r\n .data-video-center .data-video-transcoding {\r\n text-align: center;\r\n }\r\n .data-video-center .data-video-icon {\r\n font-size: 24px;\r\n color: #BFBFBF;\r\n margin-bottom: 12px;\r\n }\r\n .data-video-center .data-video-name {\r\n color: #595959;\r\n margin-bottom: 12px;\r\n }\r\n .data-video-center .data-video-message {\r\n color: #595959;\r\n }\r\n .data-video-center .data-video-anticon {\r\n display: inline-block;\r\n font-style: normal;\r\n vertical-align: -0.125em;\r\n text-align: center;\r\n text-transform: none;\r\n line-height: 0;\r\n text-rendering: optimizeLegibility;\r\n -webkit-font-smoothing: antialiased;\r\n margin-right: 5px;\r\n }\r\n .data-video-center .data-video-anticon .data-video-anticon-spin {\r\n display: inline-block;\r\n -webkit-animation: loadingCircle 1s infinite linear;\r\n animation: loadingCircle 1s infinite linear;\r\n }\r\n .data-video-center .data-error-icon {\r\n width: 16px;\r\n height: 16px;\r\n display: inline-block;\r\n background: #F5222D;\r\n text-align: center;\r\n font-size: 12px;\r\n color: #ffffff;\r\n padding: 1px 0 0 0;\r\n line-height: 16px;\r\n border-radius: 100%;\r\n vertical-align: middle;\r\n margin: -2px 5px 0 0;\r\n }\r\n\r\n.data-video-title {\r\n text-align: center;\r\n}\r\n.data-video-title::-moz-selection {\r\n background: transparent\r\n}\r\n.data-video-title::selection {\r\n background: transparent\r\n}\r\n.data-video .data-resizer {\r\n z-index: inherit;\r\n}\r\n.data-video .data-resizer .data-resizer-holder {\r\n z-index: 2;\r\n}\r\n\r\n.data-video .data-resizing {\r\n z-index: 3;\r\n}";A(S);var E=function(t){g(n,t);var e=x(n);function n(){var t;d(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),t.maxWidth=0,t.resizer=void 0,t.video=void 0,t.isLoad=!1,t.container=void 0,t.videoContainer=void 0,t.title=void 0,t.mask=void 0,t.rate=1,t._fullWidth=void 0,t._naturalSize={width:0,height:0},t.onBeforeRender=function(e,n){var r=t.editor.plugin.findPlugin("video");if(r){var i=r.options||{},o=i.onBeforeRender;if(o)return o(e,n,t.editor)}return n},t.downloadFile=function(){var e=t.getValue();(null===e||void 0===e?void 0:e.download)&&window.open(i.sanitizeUrl(t.onBeforeRender("download",e.url)))},t.onWindowResize=function(){var e,n;i.isEngine(t.editor)&&(t.maxWidth=t.getMaxWidth(),t.resetSize(),t.resizer&&(t.resizer.maxWidth=t.maxWidth,t.resizer.setSize((null===(e=t.videoContainer)||void 0===e?void 0:e.width())||0,(null===(n=t.videoContainer)||void 0===n?void 0:n.height())||0)))},t.handleClick=function(e){var n=t.editor;i.isEngine(n)&&!t.activated&&n.card.activate(t.root,i.CardActiveTrigger.MOUSE_DOWN,e)},t}return p(n,[{key:"getLocales",value:function(){return this.editor.language.get("video")}},{key:"renderTemplate",value:function(t){var e=t.name,n=t.status,r=t.size,o=t.message,a=t.percent,s=this.getLocales(),l={video:'<div class="data-video-icon">\n <svg width="32px" height="24px" viewBox="0 0 32 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" fill-opacity="0.25"><g transform="translate(-704.000000, -550.000000)" fill="#000000" fill-rule="nonzero"> <g transform="translate(704.000000, 550.000000)"> <g> <path d="M13.09375,17.30625 L20.65625,12.375 C20.95,12.16875 20.95,11.809375 20.65625,11.603125 L13.09375,6.696875 C12.66875,6.4 12,6.6375 12,7.084375 L12,16.921875 C12,17.365625 12.671875,17.603125 13.09375,17.30625 Z" id="Path"></path> <path d="M30,0 L2,0 C0.896875,0 0,0.896875 0,2 L0,22 C0,23.103125 0.896875,24 2,24 L30,24 C31.103125,24 32,23.103125 32,22 L32,2 C32,0.896875 31.103125,0 30,0 Z M5.25,21.25 C5.25,21.525 5.025,21.75 4.75,21.75 L2.5,21.75 C2.225,21.75 2,21.525 2,21.25 L2,18.5 C2,18.225 2.225,18 2.5,18 L4.75,18 C5.025,18 5.25,18.225 5.25,18.5 L5.25,21.25 Z M5.25,13.375 C5.25,13.65 5.025,13.875 4.75,13.875 L2.5,13.875 C2.225,13.875 2,13.65 2,13.375 L2,10.625 C2,10.35 2.225,10.125 2.5,10.125 L4.75,10.125 C5.025,10.125 5.25,10.35 5.25,10.625 L5.25,13.375 Z M5.25,5.5 C5.25,5.775 5.025,6 4.75,6 L2.5,6 C2.225,6 2,5.775 2,5.5 L2,2.75 C2,2.475 2.225,2.25 2.5,2.25 L4.75,2.25 C5.025,2.25 5.25,2.475 5.25,2.75 L5.25,5.5 Z M24.75,21.75 L7.25,21.75 L7.25,2.25 L24.75,2.25 L24.75,21.75 Z M30,21.25 C30,21.525 29.775,21.75 29.5,21.75 L27.25,21.75 C26.975,21.75 26.75,21.525 26.75,21.25 L26.75,18.5 C26.75,18.225 26.975,18 27.25,18 L29.5,18 C29.775,18 30,18.225 30,18.5 L30,21.25 Z M30,13.375 C30,13.65 29.775,13.875 29.5,13.875 L27.25,13.875 C26.975,13.875 26.75,13.65 26.75,13.375 L26.75,10.625 C26.75,10.35 26.975,10.125 27.25,10.125 L29.5,10.125 C29.775,10.125 30,10.35 30,10.625 L30,13.375 Z M30,5.5 C30,5.775 29.775,6 29.5,6 L27.25,6 C26.975,6 26.75,5.775 26.75,5.5 L26.75,2.75 C26.75,2.475 26.975,2.25 27.25,2.25 L29.5,2.25 C29.775,2.25 30,2.475 30,2.75 L30,5.5 Z" id="Shape"></path> </g> </g></g> </g></svg></div>',spin:'<i class="data-video-anticon"><svg viewBox="0 0 1024 1024" class="data-video-anticon-spin" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"> <path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9 437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></i>',warn:'<div class="data-video-icon"><svg width="41px" height="29px" viewBox="0 0 41 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-704.000000, -550.000000)"> <g id="Group-2" transform="translate(704.000000, 550.000000)"> <g id="video" fill="#000000" fill-rule="nonzero" opacity="0.449999988"> <path d="M13.09375,17.30625 C12.671875,17.603125 12,17.365625 12,16.921875 L12,7.084375 C12,6.6375 12.66875,6.4 13.09375,6.696875 L20.65625,11.603125 C20.95,11.809375 20.95,12.16875 20.65625,12.375 L13.09375,17.30625 Z M30,0 C31.103125,0 32,0.896875 32,2 L32,22 C32,23.103125 31.103125,24 30,24 L2,24 C0.896875,24 0,23.103125 0,22 L0,2 C0,0.896875 0.896875,0 2,0 L30,0 Z M5.25,21.25 L5.25,18.5 C5.25,18.225 5.025,18 4.75,18 L2.5,18 C2.225,18 2,18.225 2,18.5 L2,21.25 C2,21.525 2.225,21.75 2.5,21.75 L4.75,21.75 C5.025,21.75 5.25,21.525 5.25,21.25 Z M5.25,13.375 L5.25,10.625 C5.25,10.35 5.025,10.125 4.75,10.125 L2.5,10.125 C2.225,10.125 2,10.35 2,10.625 L2,13.375 C2,13.65 2.225,13.875 2.5,13.875 L4.75,13.875 C5.025,13.875 5.25,13.65 5.25,13.375 Z M5.25,5.5 L5.25,2.75 C5.25,2.475 5.025,2.25 4.75,2.25 L2.5,2.25 C2.225,2.25 2,2.475 2,2.75 L2,5.5 C2,5.775 2.225,6 2.5,6 L4.75,6 C5.025,6 5.25,5.775 5.25,5.5 Z M24.75,21.75 L24.75,2.25 L7.25,2.25 L7.25,21.75 L24.75,21.75 Z M30,21.25 L30,18.5 C30,18.225 29.775,18 29.5,18 L27.25,18 C26.975,18 26.75,18.225 26.75,18.5 L26.75,21.25 C26.75,21.525 26.975,21.75 27.25,21.75 L29.5,21.75 C29.775,21.75 30,21.525 30,21.25 Z M30,13.375 L30,10.625 C30,10.35 29.775,10.125 29.5,10.125 L27.25,10.125 C26.975,10.125 26.75,10.35 26.75,10.625 L26.75,13.375 C26.75,13.65 26.975,13.875 27.25,13.875 L29.5,13.875 C29.775,13.875 30,13.65 30,13.375 Z M30,5.5 L30,2.75 C30,2.475 29.775,2.25 29.5,2.25 L27.25,2.25 C26.975,2.25 26.75,2.475 26.75,2.75 L26.75,5.5 C26.75,5.775 26.975,6 27.25,6 L29.5,6 C29.775,6 30,5.775 30,5.5 Z" id="Combined-Shape"></path> </g> <g id="error-fill" transform="translate(21.000000, 10.000000)"> <rect id="Rectangle" fill="#000000" opacity="0" x="0" y="0" width="20" height="20"></rect> <path d="M19.0267927,16.510301 L19.0272631,16.5111171 C19.4269215,17.2064579 18.9263267,18.0729167 18.125,18.0729167 L1.875,18.0729167 C1.07367326,18.0729167 0.573078461,17.2064579 0.973207261,16.510301 L9.0970084,2.44988987 C9.28650026,2.11750251 9.63068515,1.92708333 10,1.92708333 C10.368224,1.92708333 10.7098796,2.11659543 10.9017927,2.447801 L19.0267927,16.510301 Z" id="Path" stroke="#FFFFFF" stroke-width="0.833333333" fill="#FFFFFF"></path> <path d="M18.6660156,16.71875 L10.5410156,2.65625 C10.4199219,2.44726562 10.2109375,2.34375 10,2.34375 C9.7890625,2.34375 9.578125,2.44726562 9.45898438,2.65625 L1.33398438,16.71875 C1.09375,17.1367188 1.39453125,17.65625 1.875,17.65625 L18.125,17.65625 C18.6054688,17.65625 18.90625,17.1367188 18.6660156,16.71875 Z M9.375,8.125 C9.375,8.0390625 9.4453125,7.96875 9.53125,7.96875 L10.46875,7.96875 C10.5546875,7.96875 10.625,8.0390625 10.625,8.125 L10.625,11.71875 C10.625,11.8046875 10.5546875,11.875 10.46875,11.875 L9.53125,11.875 C9.4453125,11.875 9.375,11.8046875 9.375,11.71875 L9.375,8.125 Z M10,15 C9.48242188,15 9.0625,14.5800781 9.0625,14.0625 C9.0625,13.5449219 9.48242188,13.125 10,13.125 C10.5175781,13.125 10.9375,13.5449219 10.9375,14.0625 C10.9375,14.5800781 10.5175781,15 10,15 Z" id="Shape" fill="#FAAD14" fill-rule="nonzero"></path></g></g></g> </g></svg></div>',error:'<span class="data-error-icon">X</span>'};if("error"===n)return'\n <div class="data-video">\n <div class="data-video-content data-video-error">\n <div class="data-video-center">\n <div class="data-video-name">'.concat(i.escape(e),'</div>\n <div class="data-video-message">\n ').concat(l.error,"\n ").concat(o||s["loadError"],"\n </div>\n </div>\n </div>\n </div>");var c=r?i.getFileSize(r):"";if("uploading"===n)return'\n <div class="data-video">\n <div class="data-video-content data-video-uploading">\n <div class="data-video-center">\n '.concat(l.video,'\n <div class="data-video-name">\n ').concat(i.escape(e)," (").concat(i.escape(c),')\n </div>\n <div class="data-video-progress">\n ').concat(l.spin,'\n <span class="percent">').concat(a||0,"%<span>\n </div>\n </div>\n </div>\n </div>");var u="undefined"===typeof n;if("transcoding"===n||u)return'\n <div class="data-video">\n <div class="data-video-content data-video-uploaded">\n <div class="data-video-center">\n '.concat(l.video,'\n <div class="data-video-name">\n ').concat(i.escape(e)," (").concat(i.escape(c),')\n </div>\n <div class="data-video-transcoding">\n ').concat(l.spin,'\n <span class="transcoding">').concat(u?s["loading"]:s["transcoding"],"%<span>\n </div>\n </div>\n </div>\n </div>\n ");this.editor.plugin.components["video"];return'\n <div class="data-video">\n <div class="data-video-content data-video-done"></div>\n\t\t\t'.concat("\n </div>\n ")}},{key:"initPlayer",value:function(){var t,e,n,r=this,o=this.getValue();if(o){var a=i.sanitizeUrl(this.onBeforeRender("query",o.url)),s=document.createElement("video");s.preload="metadata",s.setAttribute("src",window.$fileLinkTransfer(a)),s.setAttribute("webkit-playsinline","webkit-playsinline"),s.setAttribute("playsinline","playsinline");var l=o.cover;l&&(s.poster=i.sanitizeUrl(this.onBeforeRender("cover",l))),this.maxWidth=this.getMaxWidth();var c=null===(t=this.container)||void 0===t?void 0:t.find(".data-video-content");if(c){c.append(s),this.mask=i.$('<div class="data-video-mask" />'),c.append(this.mask),this.videoContainer=null===(e=this.container)||void 0===e?void 0:e.find(".data-video-content"),c[0].style.width=o.width,s.oncontextmenu=function(){return!1};var u=this.editor.plugin.findPlugin("video"),d=null===u||void 0===u?void 0:u.options.fullEditor,h=this.editor;s.onloadedmetadata=function(){o.naturalWidth&&o.naturalHeight||(o.naturalWidth=s.videoWidth,o.naturalHeight=s.videoHeight,r.setValue({naturalWidth:o.naturalWidth,naturalHeight:o.naturalHeight})),d&&r._fullWidth&&(o.naturalWidth<r._fullWidth||"number"===typeof d)?("boolean"===typeof d?(r.rate=s.videoHeight/s.videoWidth,d=r._fullWidth*r.rate):r.rate=d/r._fullWidth,r._naturalSize={width:r._fullWidth,height:d}):(r._naturalSize={width:o.naturalWidth||s.videoWidth,height:o.naturalHeight||s.videoHeight},r.rate=r._naturalSize.height/r._naturalSize.width),r.resetSize()},this.video=i.$(s),this.title=null===(n=this.container)||void 0===n?void 0:n.find(".data-video-title"),o.width&&o.height&&(this.rate=o.height/o.width),this._naturalSize={width:o.naturalWidth||s.videoWidth,height:o.naturalHeight||s.videoHeight},this.resetSize(),setTimeout((function(){s.controls=!0,i.isEngine(h)||(s["controlsList"]="nodownload")}),0)}}}},{key:"toolbar",value:function(){var t,e=this,n=this.editor,r=function(){var t=[],r=e.getValue();if(!r)return t;var o=r.status,a=r.download,s=e.getLocales();return"done"===o&&(a&&t.push({key:"dropdown",type:"button",content:'<span class="data-icon data-icon-download" />',title:s.download,onClick:e.downloadFile}),i.isEngine(n)&&!n.readonly&&(t.push({key:"copy",type:"copy"}),t.push({key:"separator",type:"separator"}))),i.isEngine(n)&&!n.readonly&&t.push({key:"delete",type:"delete"}),t},o=null===(t=n.plugin.findPlugin("video"))||void 0===t?void 0:t.options;return(null===o||void 0===o?void 0:o.cardToolbars)?o.cardToolbars(r(),this.editor):r()}},{key:"setProgressPercent",value:function(t){var e;null===(e=this.container)||void 0===e||e.find(".percent").html("".concat(t,"%")),this.setValue({percent:t})}},{key:"getMaxWidth",value:function(){var t=document.getElementById("article-contents");return t?812:0}},{key:"resetSize",value:function(){var t,e,n;if(this.videoContainer){var r=this.getValue();if(r){this.videoContainer.css({width:"",height:""}),null===(t=this.container)||void 0===t||t.css({width:""});var i=this.editor.plugin.findPlugin("video"),o=null===i||void 0===i?void 0:i.options.fullEditor,a=null===(e=this.video)||void 0===e?void 0:e.get();if(a){var s=r.width,l=r.height;l?s?s&&l?l=Math.round(this.rate*s):(s=this._naturalSize.width,l=this._naturalSize.height):(l=this._naturalSize.height,s=Math.round(l/this.rate)):(s=this._naturalSize.width,l=Math.round(this.rate*s)),s>this.maxWidth&&(s=this.maxWidth,l=Math.round(s*this.rate)),0!==s&&0!==l&&(null===(n=this.container)||void 0===n||n.css({width:s>0?"".concat(s,"px"):""}),this.videoContainer.css("width",s>0?"".concat(s,"px"):""),"number"===typeof o&&this.videoContainer.css("height",l>0?"".concat(l,"px"):""))}}}}},{key:"changeSize",value:function(t,e){var n,r,i;t<24&&(t=24,e=t*this.rate),t>this.maxWidth&&(t=this.maxWidth,e=t*this.rate),e<24&&(e=24,t=e/this.rate),t=Math.round(t),e=Math.round(e),null===(n=this.videoContainer)||void 0===n||n.css({width:t>0?"".concat(t,"px"):""});var o,a=this.editor.plugin.findPlugin("video"),s=null===a||void 0===a?void 0:a.options.fullEditor;"number"===typeof s&&(null===(o=this.videoContainer)||void 0===o||o.css({height:"".concat(e,"px")}));null===(r=this.container)||void 0===r||r.css({width:t>0?"".concat(t,"px"):""}),this.setValue({width:t,height:e}),null===(i=this.resizer)||void 0===i||i.destroy(),this.initResizer()}},{key:"initResizer",value:function(){var t,e=this,n=this.getValue();if(n){var r=n.status;if("done"===r){var o=n.width,a=n.height,s=n.cover;this.maxWidth=this.getMaxWidth();var l=new i.Resizer({imgUrl:s,width:o||this._naturalSize.width,height:a||this._naturalSize.height,rate:this.rate,maxWidth:this.maxWidth,onChange:function(t){var n=t.width,r=t.height;return e.changeSize(n,r)}});this.resizer=l;var c=l.render();null===(t=this.videoContainer)||void 0===t||t.append(c)}}}},{key:"onActivate",value:function(t){var e,r,i,o,a;(k(m(n.prototype),"onActivate",this).call(this,t),t)?(null===(e=this.container)||void 0===e||e.addClass("data-video-active"),null===(r=this.mask)||void 0===r||r.hide(),this.initResizer()):(null===(i=this.container)||void 0===i||i.removeClass("data-video-active"),null===(o=this.mask)||void 0===o||o.show(),null===(a=this.resizer)||void 0===a||a.destroy())}},{key:"onSelectByOther",value:function(t,e){var n;null===(n=this.container)||void 0===n||n.css("outline",t?"2px solid "+e.color:"");var r="card-selected-other";return t?this.root.addClass(r):this.root.removeClass(r),this.container}},{key:"writeHistoryOnValueChange",value:function(){if(this.loading)return!1}},{key:"checker",value:function(t,e,n){var r=this.editor.command,i=function i(){r.executeMethod("video-uploader","query",t,(function(t){t&&"done"!==t.status?setTimeout(i,3e3):e(t)}),(function(t){n(t)}))};i()}},{key:"render",value:function(){var t=this,e=this,n=this.getValue(),r=this.getCenter(),o=this.editor;if(this._fullWidth=o.container.width()-i.removeUnit(o.container.css("padding-left"))-i.removeUnit(o.container.css("padding-right")),!n||this.container&&this.container.inEditor())return this.container=i.$(this.renderTemplate(a({},n))),r.empty(),r.append(this.container),void this.initPlayer();r.empty();var s=o.command,l=o.plugin,c=n.video_id,u=n.status,d=this.getLocales();if(this.maxWidth=this.getMaxWidth(),i.isEngine(o))if("transcoding"===u){if(this.container=i.$(this.renderTemplate(n)),!c)throw"video id is undefined";this.checker(c,(function(t){var o=a(a({},n),{},{url:(null===t||void 0===t?void 0:t.url)?t.url:n.url,name:(null===t||void 0===t?void 0:t.name)?t.name:n.name,cover:(null===t||void 0===t?void 0:t.cover)?t.cover:n.cover,download:(null===t||void 0===t?void 0:t.download)?t.download:n.download,status:"done"});e.setValue(o),e.container=i.$(e.renderTemplate(o)),r.empty(),r.append(e.container),e.initPlayer()}),(function(t){var o=a(a({},n),{},{status:"error",message:t||d["loadError"]});e.setValue(o),e.container=i.$(e.renderTemplate(o)),r.empty(),r.append(e.container)}))}else"done"===u?(this.container=i.$(this.renderTemplate(a(a({},n),{},{status:void 0}))),s.executeMethod("video-uploader","query",c,(function(t){var o=a(a({},n),{},{url:(null===t||void 0===t?void 0:t.url)?t.url:n.url,name:(null===t||void 0===t?void 0:t.name)?t.name:n.name,cover:(null===t||void 0===t?void 0:t.cover)?t.cover:n.cover,download:(null===t||void 0===t?void 0:t.download)?t.download:n.download});e.container=i.$(e.renderTemplate(o)),e.video=e.container.find("video"),r.empty(),r.append(e.container),e.initPlayer()}),(function(t){e.container=i.$(e.renderTemplate(a(a({},n),{},{status:"error",message:t||d["loadError"]}))),r.empty(),r.append(e.container)}))):this.container=i.$(this.renderTemplate(n));else if("done"===u){this.container=i.$(this.renderTemplate(a(a({},n),{},{status:void 0})));var h=function(t){var o=a(a({},n),{},{url:(null===t||void 0===t?void 0:t.url)?t.url:n.url,name:(null===t||void 0===t?void 0:t.name)?t.name:n.name,cover:(null===t||void 0===t?void 0:t.cover)?t.cover:n.cover,download:(null===t||void 0===t?void 0:t.download)?t.download:n.download});e.container=i.$(e.renderTemplate(o)),r.empty(),r.append(e.container),e.initPlayer()};l.components["video-uploader"]?s.executeMethod("video-uploader","query",c,(function(t){h(t)}),(function(t){e.container=i.$(e.renderTemplate(a(a({},n),{},{status:"error",message:t||d["loadError"]}))),r.empty(),r.append(e.container)})):h()}else if("error"===u)return i.$(this.renderTemplate(a(a({},n),{},{message:n.message||d["loadError"]})));var p=document.createElement("div");p.classList.add("video-name-box");var f='<div class="data-video-title">'.concat(i.escape(n.name),"</div>");if(this.editor._readonly){var g=document.createElement("span");g.innerHTML=f,p.append(g.firstChild),this.container.append(p)}else{var m=document.createElement("input");m.value=n.name,m.onblur=function(e){n.name=m.value,t.setValue(n)},this.container.append(p),p.append(m)}var v=this.editor.card.components.filter((function(t){return"video"===t.name}));if(v&&v[v.length-1].id==this.id){var b=this.editor.root[0].querySelectorAll(".data-video");b.forEach((function(t,e){var n=document.createElement("div");n.className="data-video-title data-video-number",n.innerHTML="视频-".concat(e+1),setTimeout((function(){var e=t.querySelector(".data-video-title.data-video-number");e&&t.removeChild(e),t.appendChild(n)}),100)}))}return this.container}},{key:"didUpdate",value:function(){var t;k(m(n.prototype),"didUpdate",this).call(this),null===(t=this.toolbarModel)||void 0===t||t.setDefaultAlign("top")}},{key:"didRender",value:function(){var t,e,r=this.getValue();"done"===r.status&&k(m(n.prototype),"didRender",this).call(this),this.onWindowResize();var o,a=this.editor;(window.addEventListener("resize",this.onWindowResize),a.on("editor:resize",this.onWindowResize),null===(t=this.toolbarModel)||void 0===t||t.setDefaultAlign("top"),null===(e=this.container)||void 0===e||e.on("mousedown",this.handleClick),!i.isEngine(a)||a.readonly)&&(null===(o=this.mask)||void 0===o||o.hide())}},{key:"destroy",value:function(){var t;k(m(n.prototype),"destroy",this).call(this),null===(t=this.container)||void 0===t||t.off("mousedown",this.handleClick),window.removeEventListener("resize",this.onWindowResize),this.editor.off("editor:resize",this.onWindowResize)}}],[{key:"cardName",get:function(){return"video"}},{key:"cardType",get:function(){return i.CardType.BLOCK}},{key:"autoSelected",get:function(){return!1}}]),n}(i.Card),O="drop:files",T="paste:event",_="paste:each",M=function(t){g(n,t);var e=x(n);function n(){var t;d(this,n);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),t.cardComponents={},t.extensionNames={mp4:"video/mp4"},t.dropFiles=function(e){var n=t.editor;if(i.isEngine(n)&&(e=e.filter((function(e){return t.isVideo(e)})),0!==e.length))return n.command.execute("video-uploader",e),!1},t.pasteFiles=function(e){var n=e.files,r=t.editor;if(i.isEngine(r)&&(n=n.filter((function(e){return t.isVideo(e)})),0!==n.length))return r.command.execute("video-uploader",n.filter((function(e){return t.isVideo(e)})),n),!1},t.pasteEach=function(t){if(t.isCard()&&t.attributes(i.READY_CARD_KEY)){if("video"!==t.attributes(i.READY_CARD_KEY))return;var e=i.decodeCardValue(t.attributes(i.CARD_VALUE_KEY));return e&&e.url?void("uploading"===e.status&&(e.percent=0,t.attributes(i.CARD_VALUE_KEY,i.encodeCardValue(a(a({},e),{},{status:"done"}))))):void t.remove()}},t}return p(n,[{key:"init",value:function(){var t=this.editor;i.isEngine(t)&&(t.on(O,this.dropFiles),t.on(T,this.pasteFiles),t.on(_,this.pasteEach));var e=this.options.file||{},n=e.accept;if("string"===typeof n&&(n=n.split(",")),Array.isArray(n)){var r=[];(n||[]).forEach((function(t){t=t.trim();var e=t.split(".").pop();e&&r.push(e)})),r.length>0&&(this.extensionNames=r)}else"object"===l(n)&&(this.extensionNames=n)}},{key:"isVideo",value:function(t){var e=i.getExtensionName(t),n=Array.isArray(this.extensionNames)?this.extensionNames:Object.keys(this.extensionNames);return n.indexOf("*")>=0||n.indexOf(e)>=0}},{key:"execute",value:function(){var t=u(s().mark((function t(e){var n,r,o,l,c,u,d,h,p,f,g,m,v,b,y,w,x,C=this,k=arguments;return s().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if("string"!==typeof e){t.next=6;break}t.t0=e,t.next="query"===t.t0?4:5;break;case 4:return t.abrupt("return",this.query(k.length<=1?void 0:k[1],k.length<=2?void 0:k[2],k.length<=3?void 0:k[3]));case 5:return t.abrupt("return");case 6:if(n=this.editor,r=n.request,o=n.card,l=n.language,c=this.options,u=c.action,d=c.data,h=c.type,p=c.contentType,f=c.multiple,g=c.crossOrigin,m=c.withCredentials,v=c.headers,b=c.name,y=this.options.parse,w=this.options.limitSize||5242880,Array.isArray(e)){t.next=16;break}return x=Array.isArray(this.extensionNames)?"."+this.extensionNames.join(",."):Object.values(this.extensionNames).join(","),t.next=15,r.getFiles({event:e,accept:i.isAndroid?"video/*":x.length>0?x:"",multiple:f});case 15:e=t.sent;case 16:if(0!==e.length){t.next=18;break}return t.abrupt("return");case 18:return r.upload({url:u,data:d,type:h,contentType:p,crossOrigin:g,withCredentials:m,headers:v,onBefore:function(t){return!(t.size>w)||(n.messageError("upload-limit",l.get("video","uploadLimitError").toString().replace("$size",(w/1024/1024).toFixed(0)+"M")),!1)},onReady:function(t){if(i.isEngine(n)&&!C.cardComponents[t.uid]){var e=o.insert("video",{status:"uploading",name:t.name,size:t.size});C.cardComponents[t.uid]=e}},onUploading:function(t,e){var n=e.percent,r=C.cardComponents[t.uid||""];r&&r.setProgressPercent(n)},onSuccess:function(t,e){var r=C.cardComponents[e.uid||""];if(r){var i=t.id||t.data&&t.data.id,s=t.url||t.data&&t.data.url,c=t.cover||t.data&&t.data.cover,u=t.download||t.data&&t.data.download,d=t.width||t.data&&t.data.width,h=t.height||t.data&&t.data.height,p=t.status||t.data&&t.data.status;p="transcoding"===p?"transcoding":"done";var f={result:!0,data:{video_id:i,url:s,cover:c,download:u,status:p,width:d,height:h}};if(y){var g=y(t);if(g.result){var m=f.data;"string"===typeof g.data?f.data=a(a({},m),{},{url:g.data}):(m.url=g.data.url,void 0!==g.data.status&&(m=a(a({},m),{},{status:g.data.status})),void 0!==g.data.id&&(m=a(a({},m),{},{video_id:g.data.id})),void 0!==g.data.cover&&(m=a(a({},m),{},{cover:g.data.cover})),void 0!==g.data.width&&(m=a(a({},m),{},{width:g.data.width})),void 0!==g.data.height&&(m=a(a({},m),{},{height:g.data.height})),f.data=a({},m))}else f={result:!1,data:g.data.toString()}}else s||(f={result:!1,data:t.data});f.result?n.card.update(r.id,"string"===typeof f.data?{url:f.data}:a(a({},f.data),{},{naturalWidth:f.data.width,naturalHeight:f.data.height})):o.update(r.id,{status:"error",message:"string"===typeof f.data?f.data:l.get("video","uploadError")}),delete C.cardComponents[e.uid||""]}},onError:function(t,e){var n=C.cardComponents[e.uid||""];n&&(o.update(n.id,{status:"error",message:t.message||l.get("video","uploadError")}),delete C.cardComponents[e.uid||""])}},e,b),t.abrupt("return");case 20:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"query",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=this.editor,i=r.request,o=r.language,l=this.options,c=l.query,d=l.parse;if(!c||!t)return e();var h=c.action,p=c.type,f=c.contentType,g=c.data,m=c.headers;i.ajax({url:h,contentType:f||"",type:void 0===p?"json":p,headers:m,data:"function"===typeof g?u(s().mark((function e(){var n;return s().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,g();case 2:return n=e.sent,e.abrupt("return",a(a({},n),{},{id:t}));case 4:case"end":return e.stop()}}),e)}))):a(a({},g),{},{id:t}),success:function(t){var r=t.result,i=t.data;if(r){var s=d?d(t):t;!1===s.result?n(s.data||o.get("video","loadError")):e(a(a({},s.data),{},{status:"transcoding"!==s.data.status?"done":"transcoding"}))}else n(i)},error:function(t){n(t.message||o.get("video","loadError"))},method:"GET"})}},{key:"destroy",value:function(){var t=this.editor;t.off(O,this.dropFiles),t.off(T,this.pasteFiles),t.off(_,this.pasteEach)}}],[{key:"pluginName",get:function(){return"video-uploader"}}]),n}(i.Plugin),N={video:{errorMessageCopy:"Copy error message",loadError:"The video failed to load!",uploadError:"The video failed to upload!",uploadLimitError:"Upload video size is limited to $size",download:"Download",preview:"Preview",loading:"Loading...",transcoding:"Transcoding..."}},P={video:{errorMessageCopy:"复制错误信息",loadError:"视频加载失败!",uploadError:"上传视频失败!",uploadLimitError:"上传视频大小限制为 $size",download:"下载",preview:"预览",loading:"加载中...",transcoding:"转码中..."}},L={"en-US":N,"zh-CN":P},D="parse:html",j="paste:each",I="paste:schema",R=function(t){g(n,t);var e=x(n);function n(){var t;d(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),t.pasteSchema=function(t){t.add({type:"block",name:"div",attributes:{"data-value":"*","data-type":{required:!0,value:E.cardName}}})},t.pasteHtml=function(e){var n=t.editor;if(i.isEngine(n)){if(e.isElement()){var r=e.attributes("data-type");if(r===E.cardName){var o=e.attributes("data-value"),a=i.decodeCardValue(o);if(!a.url)return;return n.card.replaceNode(e,E.cardName,a),e.remove(),!1}}return!0}},t.parseHtml=function(e,n){var r=[];return e.find("[".concat(i.CARD_KEY,'="').concat(E.cardName,'"],[').concat(i.READY_CARD_KEY,'="').concat(E.cardName,'"]')).each((function(e){var o=i.$(e),a=t.editor.card.find(o),s=(null===a||void 0===a?void 0:a.getValue())||i.decodeCardValue(o.attributes(i.CARD_VALUE_KEY));if((null===s||void 0===s?void 0:s.url)&&"done"===s.status){var l=t.options.onBeforeRender,c=s.cover,u=s.url,d='<div data-type="'.concat(E.cardName,'" data-value="').concat(i.encodeCardValue(s),'"><video controls src="').concat(i.sanitizeUrl(l?l("query",u,t.editor):u),'" poster="').concat(c?i.sanitizeUrl(l?l("cover",c,t.editor):c):"none",'" webkit-playsinline="webkit-playsinline" playsinline="playsinline" style="outline:none;" /></div>');o.empty();var h=i.$(d);n&&(h=n(h,s)),o.replaceWith(h),r.push(h)}else o.remove()})),r},t}return p(n,[{key:"init",value:function(){var t=this.editor;t.language.add(L),t.on(D,this.parseHtml),t.on(j,this.pasteHtml),t.on(I,this.pasteSchema)}},{key:"execute",value:function(t,e,n,r,i,o,a,s,l,c,u){var d={status:t,video_id:r,cover:i,url:e,name:n||e,size:o,download:a,width:c,height:u,naturalWidth:s,naturalHeight:l};"error"===t&&(d.url="",d.message=e),this.editor.card.insert("video",d)}},{key:"waiting",value:function(){var t=u(s().mark((function t(e){var n,r,i,o,a=this;return s().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=this.editor.card,r=function(t){var e;return t.root.inEditor()&&t.name===E.cardName&&"uploading"===(null===(e=t.getValue())||void 0===e?void 0:e.status)},i=function(){return n.components.find(r)},o=function(t){var n=6e4;return new Promise((function(i,o){if(e){var s=e(a.constructor.pluginName,t);if(!1===s)return o({name:a.constructor.pluginName,card:t});"number"===typeof s&&(n=s)}var l=(new Date).getTime(),c=(new Date).getTime(),u=function e(){if(c-l>=n)return i();setTimeout((function(){r(t)?e():i()}),10)};u()}))},t.abrupt("return",new Promise(function(){var t=u(s().mark((function t(e,n){var r,a;return s().wrap((function(t){while(1)switch(t.prev=t.next){case 0:r=i(),a=function t(r){o(r).then((function(){var n=i();n?t(n):e()})).catch(n)},r?a(r):e();case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()));case 5:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"destroy",value:function(){var t=this.editor;t.off(D,this.parseHtml),t.off(j,this.pasteHtml),t.off(I,this.pasteSchema)}}],[{key:"pluginName",get:function(){return"video"}}]),n}(i.Plugin);e.VideoComponent=E,e.VideoUploader=M,e.default=R},c421:function(t,e,n){"use strict";var r=n("f483"),i=n("55be").isWhiteSpace,o=n("55be").isPunctChar,a=n("55be").isMdAsciiPunct;function s(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}s.prototype.pushPending=function(){var t=new r("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},s.prototype.push=function(t,e,n){this.pending&&this.pushPending();var i=new r(t,e,n),o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i},s.prototype.scanDelims=function(t,e){var n,r,s,l,c,u,d,h,p,f=t,g=!0,m=!0,v=this.posMax,b=this.src.charCodeAt(t);n=t>0?this.src.charCodeAt(t-1):32;while(f<v&&this.src.charCodeAt(f)===b)f++;return s=f-t,r=f<v?this.src.charCodeAt(f):32,d=a(n)||o(String.fromCharCode(n)),p=a(r)||o(String.fromCharCode(r)),u=i(n),h=i(r),h?g=!1:p&&(u||d||(g=!1)),u?m=!1:d&&(h||p||(m=!1)),e?(l=g,c=m):(l=g&&(!m||d),c=m&&(!g||p)),{can_open:l,can_close:c,length:s}},s.prototype.Token=r,t.exports=s},c464:function(t,e,n){"use strict";var r={};function i(t){var e,n,i=r[t];if(i)return i;for(i=r[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),/^[0-9a-z]$/i.test(n)?i.push(n):i.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e<t.length;e++)i[t.charCodeAt(e)]=t[e];return i}function o(t,e,n){var r,a,s,l,c,u="";for("string"!==typeof e&&(n=e,e=o.defaultChars),"undefined"===typeof n&&(n=!0),c=i(e),r=0,a=t.length;r<a;r++)if(s=t.charCodeAt(r),n&&37===s&&r+2<a&&/^[0-9a-f]{2}$/i.test(t.slice(r+1,r+3)))u+=t.slice(r,r+3),r+=2;else if(s<128)u+=c[s];else if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&r+1<a&&(l=t.charCodeAt(r+1),l>=56320&&l<=57343)){u+=encodeURIComponent(t[r]+t[r+1]),r++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(t[r]);return u}o.defaultChars=";/?:@&=+$,-_.!~*'()#",o.componentChars="-_.!~*'()",t.exports=o},c5d0:function(t,e,n){"use strict";var r=n("23e7"),i=n("857a"),o=n("af03");r({target:"String",proto:!0,forced:o("italics")},{italics:function(){return i(this,"i","","")}})},c60d:function(t,e,n){var r=n("1a2d");t.exports=function(t){return void 0!==t&&(r(t,"value")||r(t,"writable"))}},c7dd6:function(t){t.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"","backsim":"∽","backsimeq":"⋍","Backslash":"","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"","Bernoullis":"","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"","caps":"∩︀","caret":"","caron":"ˇ","Cayleys":"","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"","dd":"","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":"","emsp14":"","emsp":"","ENG":"Ŋ","eng":"ŋ","ensp":"","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"","Escr":"","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"","exponentiale":"","ExponentialE":"","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"","frown":"⌢","fscr":"𝒻","Fscr":"","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":"","half":"½","hamilt":"","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"","HilbertSpace":"","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"","hyphen":"","Iacute":"Í","iacute":"í","ic":"","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"","Igrave":"Ì","igrave":"ì","ii":"","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"","ImaginaryI":"","imagline":"","imagpart":"","imath":"ı","Im":"","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"","lscr":"𝓁","Lscr":"","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"","lsquor":"","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":"","Mellintrf":"","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"","middot":"·","minusb":"⊟","minus":"","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":"","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"","ord":"⩝","order":"","orderof":"","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"","pointint":"⨕","popf":"𝕡","Popf":"","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"","Prime":"″","primes":"","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":"","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"","rationals":"","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"","realine":"","realpart":"","reals":"","Re":"","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"","rscr":"𝓇","Rscr":"","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"","rsquor":"","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"","setmn":"","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"","smashp":"⨳","smeparsl":"⧤","smid":"","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"","ThickSpace":"","ThinSpace":"","thinsp":"","thkap":"≈","thksim":"","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"","Vee":"","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":"","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"","Zscr":"𝒵","zscr":"𝓏","zwj":"","zwnj":""}')},ca8e:function(t,e,n){"use strict";function r(t,e){return void 0===e&&(e=0),Number.isInteger(t)?t:+t.toFixed(e)}function i(t,e){var n,r;if(null==e?(r=null==t?1:t,n=0):(r=e,n=null==t?0:t),r<n){var i=n;n=r,r=i}return Math.floor(Math.random()*(r-n+1)+n)}function o(t,e,n){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(n)?0:e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}function a(t,e){return e*Math.round(t/e)}function s(t,e){return null!=e&&null!=t&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function l(t,e){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}Object.defineProperty(e,"__esModule",{value:!0}),e.squaredLength=e.containsPoint=e.snapToGrid=e.clamp=e.random=e.round=void 0,e.round=r,e.random=i,e.clamp=o,e.snapToGrid=a,e.containsPoint=s,e.squaredLength=l},ca91:function(t,e,n){"use strict";var r=n("ebb5"),i=n("d58f").left,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("reduce",(function(t){var e=arguments.length;return i(o(this),t,e,e>1?arguments[1]:void 0)}))},cbc7:function(t,e){t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},cbc8:function(t,e,n){(function(t){t(n("56b3"),n("4895"))})((function(t){"use strict";t.defineOption("foldGutter",!1,(function(e,i,o){o&&o!=t.Init&&(e.clearGutter(e.state.foldGutter.options.gutter),e.state.foldGutter=null,e.off("gutterClick",c),e.off("changes",d),e.off("viewportChange",h),e.off("fold",p),e.off("unfold",p),e.off("swapDoc",d),e.off("optionChange",u)),i&&(e.state.foldGutter=new n(r(i)),l(e),e.on("gutterClick",c),e.on("changes",d),e.on("viewportChange",h),e.on("fold",p),e.on("unfold",p),e.on("swapDoc",d),e.on("optionChange",u))}));var e=t.Pos;function n(t){this.options=t,this.from=this.to=0}function r(t){return!0===t&&(t={}),null==t.gutter&&(t.gutter="CodeMirror-foldgutter"),null==t.indicatorOpen&&(t.indicatorOpen="CodeMirror-foldgutter-open"),null==t.indicatorFolded&&(t.indicatorFolded="CodeMirror-foldgutter-folded"),t}function i(t,n){for(var r=t.findMarks(e(n,0),e(n+1,0)),i=0;i<r.length;++i)if(r[i].__isFold){var o=r[i].find(-1);if(o&&o.line===n)return r[i]}}function o(t){if("string"==typeof t){var e=document.createElement("div");return e.className=t+" CodeMirror-guttermarker-subtle",e}return t.cloneNode(!0)}function a(t,n,r){var a=t.state.foldGutter.options,l=n-1,c=t.foldOption(a,"minFoldSize"),u=t.foldOption(a,"rangeFinder"),d="string"==typeof a.indicatorFolded&&s(a.indicatorFolded),h="string"==typeof a.indicatorOpen&&s(a.indicatorOpen);t.eachLine(n,r,(function(n){++l;var r=null,s=n.gutterMarkers;if(s&&(s=s[a.gutter]),i(t,l)){if(d&&s&&d.test(s.className))return;r=o(a.indicatorFolded)}else{var p=e(l,0),f=u&&u(t,p);if(f&&f.to.line-f.from.line>=c){if(h&&s&&h.test(s.className))return;r=o(a.indicatorOpen)}}(r||s)&&t.setGutterMarker(n,a.gutter,r)}))}function s(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}function l(t){var e=t.getViewport(),n=t.state.foldGutter;n&&(t.operation((function(){a(t,e.from,e.to)})),n.from=e.from,n.to=e.to)}function c(t,n,r){var o=t.state.foldGutter;if(o){var a=o.options;if(r==a.gutter){var s=i(t,n);s?s.clear():t.foldCode(e(n,0),a)}}}function u(t,e){"mode"==e&&d(t)}function d(t){var e=t.state.foldGutter;if(e){var n=e.options;e.from=e.to=0,clearTimeout(e.changeUpdate),e.changeUpdate=setTimeout((function(){l(t)}),n.foldOnChangeTimeSpan||600)}}function h(t){var e=t.state.foldGutter;if(e){var n=e.options;clearTimeout(e.changeUpdate),e.changeUpdate=setTimeout((function(){var n=t.getViewport();e.from==e.to||n.from-e.to>20||e.from-n.to>20?l(t):t.operation((function(){n.from<e.from&&(a(t,n.from,e.from),e.from=n.from),n.to>e.to&&(a(t,e.to,n.to),e.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function p(t,e){var n=t.state.foldGutter;if(n){var r=e.line;r>=n.from&&r<n.to&&a(t,r,r+1)}}}))},cc71:function(t,e,n){"use strict";var r=n("23e7"),i=n("857a"),o=n("af03");r({target:"String",proto:!0,forced:o("bold")},{bold:function(){return i(this,"b","","")}})},ccf7:function(t,e,n){"use strict";var r=n("55be").isSpace;t.exports=function(t,e,n,i){var o,a,s,l,c=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(o=t.src.charCodeAt(c),35!==o||c>=u)return!1;a=1,o=t.src.charCodeAt(++c);while(35===o&&c<u&&a<=6)a++,o=t.src.charCodeAt(++c);return!(a>6||c<u&&!r(o))&&(i||(u=t.skipSpacesBack(u,c),s=t.skipCharsBack(u,35,c),s>c&&r(t.src.charCodeAt(s-1))&&(u=s),t.line=e+1,l=t.push("heading_open","h"+String(a),1),l.markup="########".slice(0,a),l.map=[e,t.line],l=t.push("inline","",0),l.content=t.src.slice(c,u).trim(),l.map=[e,t.line],l.children=[],l=t.push("heading_close","h"+String(a),-1),l.markup="########".slice(0,a)),!0)}},cd26:function(t,e,n){"use strict";var r=n("ebb5"),i=r.aTypedArray,o=r.exportTypedArrayMethod,a=Math.floor;o("reverse",(function(){var t,e=this,n=i(e).length,r=a(n/2),o=0;while(o<r)t=e[o],e[o++]=e[--n],e[n]=t;return e}))},cda8:function(t,e){function n(t,e,n,r){var i=function(t,n,r,i){e(r,t,n,"left"),e(i,n,t,"right")},o=t.transformX=function(t,e){n(t),n(e);for(var a=[],s=0;s<e.length;s++){var l=e[s],c=[],u=0;while(u<t.length){var d=[];if(i(t[u],l,c,d),u++,1!==d.length){if(0===d.length){for(var h=u;h<t.length;h++)r(c,t[h]);l=null;break}for(var p=o(t.slice(u),d),f=0;f<p[0].length;f++)r(c,p[0][f]);for(var g=0;g<p[1].length;g++)r(a,p[1][g]);l=null;break}l=d[0]}null!=l&&r(a,l),t=c}return[t,a]};t.transform=function(t,n,r){if("left"!==r&&"right"!==r)throw new Error("type must be 'left' or 'right'");return 0===n.length?t:1===t.length&&1===n.length?e([],t[0],n[0],r):"left"===r?o(t,n)[0]:o(n,t)[1]}}t.exports=n},cee5:function(t,e,n){
/*!
2020 Jason Mulligan <jason.mulligan@avoidwork.com>
@version 6.4.0
*/
!function(e,n){t.exports=n()}(0,(function(){"use strict";var t=/^(b|B)$/,e={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},n={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]},r={floor:Math.floor,ceil:Math.ceil};function i(i){var o,a,s,l,c,u,d,h,p,f,g,m,v,b,y,w,x,C,k,A,S,E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},O=[],T=0;if(isNaN(i))throw new TypeError("Invalid number");if(s=!0===E.bits,y=!0===E.unix,m=!0===E.pad,a=E.base||2,v=void 0!==E.round?E.round:y?1:2,d=void 0!==E.locale?E.locale:"",h=E.localeOptions||{},w=void 0!==E.separator?E.separator:"",x=void 0!==E.spacer?E.spacer:y?"":" ",k=E.symbols||{},C=2===a&&E.standard||"jedec",g=E.output||"string",c=!0===E.fullform,u=E.fullforms instanceof Array?E.fullforms:[],o=void 0!==E.exponent?E.exponent:-1,A=r[E.roundingMethod]||Math.round,p=(f=Number(i))<0,l=a>2?1e3:1024,S=!1===isNaN(E.precision)?parseInt(E.precision,10):0,p&&(f=-f),(-1===o||isNaN(o))&&(o=Math.floor(Math.log(f)/Math.log(l)))<0&&(o=0),o>8&&(S>0&&(S+=8-o),o=8),"exponent"===g)return o;if(0===f)O[0]=0,b=O[1]=y?"":e[C][s?"bits":"bytes"][o];else{T=f/(2===a?Math.pow(2,10*o):Math.pow(1e3,o)),s&&(T*=8)>=l&&o<8&&(T/=l,o++);var _=Math.pow(10,o>0?v:0);O[0]=A(T*_)/_,O[0]===l&&o<8&&void 0===E.exponent&&(O[0]=1,o++),b=O[1]=10===a&&1===o?s?"kb":"kB":e[C][s?"bits":"bytes"][o],y&&(O[1]="jedec"===C?O[1].charAt(0):o>0?O[1].replace(/B$/,""):O[1],t.test(O[1])&&(O[0]=Math.floor(O[0]),O[1]=""))}if(p&&(O[0]=-O[0]),S>0&&(O[0]=O[0].toPrecision(S)),O[1]=k[O[1]]||O[1],!0===d?O[0]=O[0].toLocaleString():d.length>0?O[0]=O[0].toLocaleString(d,h):w.length>0&&(O[0]=O[0].toString().replace(".",w)),m&&!1===Number.isInteger(O[0])&&v>0){var M=w||".",N=O[0].toString().split(M),P=N[1]||"",L=P.length,D=v-L;O[0]="".concat(N[0]).concat(M).concat(P.padEnd(L+D,"0"))}return c&&(O[1]=u[o]?u[o]:n[C][o]+(s?"bit":"byte")+(1===O[0]?"":"s")),"array"===g?O:"object"===g?{value:O[0],symbol:O[1],exponent:o,unit:b}:O.join(x)}return i.partial=function(t){return function(e){return i(e,t)}},i}))},cf51:function(t,e,n){"use strict";n("e026")},cf98:function(t,e){t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},cfce:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.MoveTo=void 0;var i=n("5c2e"),o=n("35fe"),a=n("6762"),s=n("2d61"),l=n("f8f8"),c=function(t){function e(e,n){var r=t.call(this)||this;return r.isVisible=!1,r.isSubpathStart=!0,i.Line.isLine(e)||o.Curve.isCurve(e)?r.endPoint=e.end.clone().round(2):r.endPoint=a.Point.create(e,n).round(2),r}return r(e,t),Object.defineProperty(e.prototype,"start",{get:function(){throw new Error("Illegal access. Moveto segments should not need a start property.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return"M"},enumerable:!1,configurable:!0}),e.prototype.bbox=function(){return null},e.prototype.closestPoint=function(){return this.end.clone()},e.prototype.closestPointLength=function(){return 0},e.prototype.closestPointNormalizedLength=function(){return 0},e.prototype.closestPointT=function(){return 1},e.prototype.closestPointTangent=function(){return null},e.prototype.length=function(){return 0},e.prototype.lengthAtT=function(){return 0},e.prototype.divideAt=function(){return[this.clone(),this.clone()]},e.prototype.divideAtLength=function(){return[this.clone(),this.clone()]},e.prototype.getSubdivisions=function(){return[]},e.prototype.pointAt=function(){return this.end.clone()},e.prototype.pointAtLength=function(){return this.end.clone()},e.prototype.pointAtT=function(){return this.end.clone()},e.prototype.tangentAt=function(){return null},e.prototype.tangentAtLength=function(){return null},e.prototype.tangentAtT=function(){return null},e.prototype.isDifferentiable=function(){return!1},e.prototype.scale=function(t,e,n){return this.end.scale(t,e,n),this},e.prototype.rotate=function(t,e){return this.end.rotate(t,e),this},e.prototype.translate=function(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this},e.prototype.clone=function(){return new e(this.end)},e.prototype.equals=function(t){return this.type===t.type&&this.end.equals(t.end)},e.prototype.toJSON=function(){return{type:this.type,end:this.end.toJSON()}},e.prototype.serialize=function(){var t=this.end;return this.type+" "+t.x+" "+t.y},e}(l.Segment);e.MoveTo=c,function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length,l=e[0];if(i.Line.isLine(l))return new t(l);if(o.Curve.isCurve(l))return new t(l);if(a.Point.isPointLike(l)){if(1===r)return new t(l);for(var c=[],u=0;u<r;u+=1)0===u?c.push(new t(e[u])):c.push(new s.LineTo(e[u]));return c}if(2===r)return new t(+e[0],+e[1]);var d=[];for(u=0;u<r;u+=2){var h=+e[u],p=+e[u+1];0===u?d.push(new t(h,p)):d.push(new s.LineTo(h,p))}return d}t.create=e}(c=e.MoveTo||(e.MoveTo={})),e.MoveTo=c},cff7:function(t,e,n){"use strict";t.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},d084:function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i,o,a,s=-1,l=t.posMax,c=t.pos;t.pos=e+1,r=1;while(t.pos<l){if(o=t.src.charCodeAt(t.pos),93===o&&(r--,0===r)){i=!0;break}if(a=t.pos,t.md.inline.skipToken(t),91===o)if(a===t.pos-1)r++;else if(n)return t.pos=c,-1}return i&&(s=t.pos),t.pos=c,s}},d0847:function(t,e,n){"use strict";var r=n("55be").assign,i=n("55be").unescapeAll,o=n("55be").escapeHtml,a={};function s(){this.rules=r({},a)}a.code_inline=function(t,e,n,r,i){var a=t[e];return"<code"+i.renderAttrs(a)+">"+o(t[e].content)+"</code>"},a.code_block=function(t,e,n,r,i){var a=t[e];return"<pre"+i.renderAttrs(a)+"><code>"+o(t[e].content)+"</code></pre>\n"},a.fence=function(t,e,n,r,a){var s,l,c,u,d,h=t[e],p=h.info?i(h.info).trim():"",f="",g="";return p&&(c=p.split(/(\s+)/g),f=c[0],g=c.slice(2).join("")),s=n.highlight&&n.highlight(h.content,f,g)||o(h.content),0===s.indexOf("<pre")?s+"\n":p?(l=h.attrIndex("class"),u=h.attrs?h.attrs.slice():[],l<0?u.push(["class",n.langPrefix+f]):(u[l]=u[l].slice(),u[l][1]+=" "+n.langPrefix+f),d={attrs:u},"<pre><code"+a.renderAttrs(d)+">"+s+"</code></pre>\n"):"<pre><code"+a.renderAttrs(h)+">"+s+"</code></pre>\n"},a.image=function(t,e,n,r,i){var o=t[e];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(t,e,n)},a.hardbreak=function(t,e,n){return n.xhtmlOut?"<br />\n":"<br>\n"},a.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},a.text=function(t,e){return o(t[e].content)},a.html_block=function(t,e){return t[e].content},a.html_inline=function(t,e){return t[e].content},s.prototype.renderAttrs=function(t){var e,n,r;if(!t.attrs)return"";for(r="",e=0,n=t.attrs.length;e<n;e++)r+=" "+o(t.attrs[e][0])+'="'+o(t.attrs[e][1])+'"';return r},s.prototype.renderToken=function(t,e,n){var r,i="",o=!1,a=t[e];return a.hidden?"":(a.block&&-1!==a.nesting&&e&&t[e-1].hidden&&(i+="\n"),i+=(-1===a.nesting?"</":"<")+a.tag,i+=this.renderAttrs(a),0===a.nesting&&n.xhtmlOut&&(i+=" /"),a.block&&(o=!0,1===a.nesting&&e+1<t.length&&(r=t[e+1],("inline"===r.type||r.hidden||-1===r.nesting&&r.tag===a.tag)&&(o=!1))),i+=o?">\n":">",i)},s.prototype.renderInline=function(t,e,n){for(var r,i="",o=this.rules,a=0,s=t.length;a<s;a++)r=t[a].type,"undefined"!==typeof o[r]?i+=o[r](t,a,e,n,this):i+=this.renderToken(t,a,e);return i},s.prototype.renderInlineAsText=function(t,e,n){for(var r="",i=0,o=t.length;i<o;i++)"text"===t[i].type?r+=t[i].content:"image"===t[i].type?r+=this.renderInlineAsText(t[i].children,e,n):"softbreak"===t[i].type&&(r+="\n");return r},s.prototype.render=function(t,e,n){var r,i,o,a="",s=this.rules;for(r=0,i=t.length;r<i;r++)o=t[r].type,"inline"===o?a+=this.renderInline(t[r].children,e,n):"undefined"!==typeof s[o]?a+=s[t[r].type](t,r,e,n,this):a+=this.renderToken(t,r,e,n);return a},t.exports=s},d139:function(t,e,n){"use strict";var r=n("ebb5"),i=n("b727").find,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("find",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},d2a3:function(t,e,n){"use strict";n.r(e);n("8b79")},d459:function(t,e,n){},d4ec:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n("d9e2");function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},d58f:function(t,e,n){var r=n("59ed"),i=n("7b0b"),o=n("44ad"),a=n("07fa"),s=TypeError,l=function(t){return function(e,n,l,c){r(n);var u=i(e),d=o(u),h=a(u),p=t?h-1:0,f=t?-1:1;if(l<2)while(1){if(p in d){c=d[p],p+=f;break}if(p+=f,t?p<0:h<=p)throw s("Reduce of empty array with no initial value")}for(;t?p>=0:h>p;p+=f)p in d&&(c=n(c,d[p],p,u));return c}};t.exports={left:l(!1),right:l(!0)}},d5d1:function(t,e,n){"use strict";e.Any=n("cbc7"),e.Cc=n("a7bc"),e.Cf=n("6fd1"),e.P=n("7ca0"),e.Z=n("4fc2")},d5d6:function(t,e,n){"use strict";var r=n("ebb5"),i=n("b727").forEach,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("forEach",(function(t){i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},d5e0:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function d(t,e){function n(n){return e.tokenize=n,n(t,e)}var r,i=t.next();return"<"==i?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(f("atom","]]>")):null:t.match("--")?n(f("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(g(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=f("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=h,"tag bracket"):"&"==i?(r=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"),r?"atom":"error"):(t.eatWhile(/[^&<]/),null)}function h(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){e.tokenize=d,e.state=w,e.tagName=e.tagStart=null;var r=e.tokenize(t,e);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=p(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(t){var e=function(e,n){while(!e.eol())if(e.next()==t){n.tokenize=h;break}return"string"};return e.isInAttribute=!0,e}function f(t,e){return function(n,r){while(!n.eol()){if(n.match(e)){r.tokenize=d;break}n.next()}return t}}function g(t){return function(e,n){var r;while(null!=(r=e.next())){if("<"==r)return n.tokenize=g(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=d;break}return n.tokenize=g(t-1),n.tokenize(e,n)}}return"meta"}}function m(t){return t&&t.toLowerCase()}function v(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function b(t){t.context&&(t.context=t.context.prev)}function y(t,e){var n;while(1){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(m(n))||!l.contextGrabbers[m(n)].hasOwnProperty(m(e)))return;b(t)}}function w(t,e,n){return"openTag"==t?(n.tagStart=e.column(),x):"closeTag"==t?C:w}function x(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",S):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",S(t,e,n)):(a="error",x)}function C(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(m(n.context.tagName))&&b(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",k):(a="tag error",A)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",k(t,e,n)):(a="error",A)}function k(t,e,n){return"endTag"!=t?(a="error",k):(b(n),w)}function A(t,e,n){return a="error",k(t,e,n)}function S(t,e,n){if("word"==t)return a="attribute",E;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(m(r))?y(n,r):(y(n,r),n.context=new v(n,r,i==n.indented)),w}return a="error",S}function E(t,e,n){return"equals"==t?O:(l.allowMissing||(a="error"),S(t,e,n))}function O(t,e,n){return"string"==t?T:"word"==t&&l.allowUnquoted?(a="string",S):(a="error",S(t,e,n))}function T(t,e,n){return"string"==t?T:S(t,e,n)}return d.isInText=!0,{startState:function(t){var e={tokenize:d,state:w,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(e,n,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=h&&e.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])while(i){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(m(i.tagName)))break;i=i.prev}else if(o)while(i){var a=l.contextGrabbers[m(i.tagName)];if(!a||!a.hasOwnProperty(m(o[2])))break;i=i.prev}while(i&&i.prev&&!i.startOfLine)i=i.prev;return i?i.indent+s:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==O&&(t.state=S)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}))},d69f:function(t,e,n){(function(t){t(n("56b3"),n("d5e0"),n("f9d4"),n("7b00"))})((function(t){"use strict";var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function n(t,e,n){var r=t.current(),i=r.search(e);return i>-1?t.backUp(r.length-i):r.match(/<\/?$/)&&(t.backUp(r.length),t.match(e,!1)||t.match(r)),n}var r={};function i(t){var e=r[t];return e||(r[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function o(t,e){var n=t.match(i(e));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function a(t,e){return new RegExp((e?"^":"")+"</\\s*"+t+"\\s*>","i")}function s(t,e){for(var n in t)for(var r=e[n]||(e[n]=[]),i=t[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function l(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(!r[0]||r[1].test(o(e,r[0])))return r[2]}}t.defineMode("htmlmixed",(function(r,i){var o=t.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:i.multilineTagIndentFactor,multilineTagIndentPastTag:i.multilineTagIndentPastTag,allowMissingTagName:i.allowMissingTagName}),c={},u=i&&i.tags,d=i&&i.scriptTypes;if(s(e,c),u&&s(u,c),d)for(var h=d.length-1;h>=0;h--)c.script.unshift(["type",d[h].matches,d[h].mode]);function p(e,i){var s,u=o.token(e,i.htmlState),d=/\btag\b/.test(u);if(d&&!/[<>\s\/]/.test(e.current())&&(s=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(s))i.inTag=s+" ";else if(i.inTag&&d&&/>$/.test(e.current())){var h=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var f=">"==e.current()&&l(c[h[1]],h[2]),g=t.getMode(r,f),m=a(h[1],!0),v=a(h[1],!1);i.token=function(t,e){return t.match(m,!1)?(e.token=p,e.localState=e.localMode=null,null):n(t,v,e.localMode.token(t,e.localState))},i.localMode=g,i.localState=t.startState(g,o.indent(i.htmlState,"",""))}else i.inTag&&(i.inTag+=e.current(),e.eol()&&(i.inTag+=" "));return u}return{startState:function(){var e=t.startState(o);return{token:p,inTag:null,localMode:null,localState:null,htmlState:e}},copyState:function(e){var n;return e.localState&&(n=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:n,htmlState:t.copyState(o,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,r){return!e.localMode||/^\s*<\//.test(n)?o.indent(e.htmlState,n,r):e.localMode.indent?e.localMode.indent(e.localState,n,r):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||o}}}}),"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}))},d72f:function(t,e,n){},d746:function(t,e,n){},d88e:function(t,e,n){},d8a6:function(t,e,n){"use strict";t.exports.encode=n("c464"),t.exports.decode=n("8f37"),t.exports.format=n("43e0"),t.exports.parse=n("da5f")},d8b4:function(t,e,n){"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},da5f:function(t,e,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var i=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,s=["<",">",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(s),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),d=["/","?","#"],h=255,p=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function v(t,e){if(t&&t instanceof r)return t;var n=new r;return n.parse(t,e),n}r.prototype.parse=function(t,e){var n,r,o,s,l,c=t;if(c=c.trim(),!e&&1===t.split("#").length){var v=a.exec(c);if(v)return this.pathname=v[1],v[2]&&(this.search=v[2]),this}var b=i.exec(c);if(b&&(b=b[0],o=b.toLowerCase(),this.protocol=b,c=c.substr(b.length)),(e||b||c.match(/^\/\/[^@\/]+@[^@\/]+/))&&(l="//"===c.substr(0,2),!l||b&&g[b]||(c=c.substr(2),this.slashes=!0)),!g[b]&&(l||b&&!m[b])){var y,w,x=-1;for(n=0;n<d.length;n++)s=c.indexOf(d[n]),-1!==s&&(-1===x||s<x)&&(x=s);for(w=-1===x?c.lastIndexOf("@"):c.lastIndexOf("@",x),-1!==w&&(y=c.slice(0,w),c=c.slice(w+1),this.auth=y),x=-1,n=0;n<u.length;n++)s=c.indexOf(u[n]),-1!==s&&(-1===x||s<x)&&(x=s);-1===x&&(x=c.length),":"===c[x-1]&&x--;var C=c.slice(0,x);c=c.slice(x),this.parseHost(C),this.hostname=this.hostname||"";var k="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!k){var A=this.hostname.split(/\./);for(n=0,r=A.length;n<r;n++){var S=A[n];if(S&&!S.match(p)){for(var E="",O=0,T=S.length;O<T;O++)S.charCodeAt(O)>127?E+="x":E+=S[O];if(!E.match(p)){var _=A.slice(0,n),M=A.slice(n+1),N=S.match(f);N&&(_.push(N[1]),M.unshift(N[2])),M.length&&(c=M.join(".")+c),this.hostname=_.join(".");break}}}}this.hostname.length>h&&(this.hostname=""),k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var P=c.indexOf("#");-1!==P&&(this.hash=c.substr(P),c=c.slice(0,P));var L=c.indexOf("?");return-1!==L&&(this.search=c.substr(L),c=c.slice(0,L)),c&&(this.pathname=c),m[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this},r.prototype.parseHost=function(t){var e=o.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.exports=v},dac9:function(t,e,n){},daf4:function(t,e,n){"use strict";var r=n("55be").unescapeAll;t.exports=function(t,e,n){var i,o,a=0,s=e,l={ok:!1,pos:0,lines:0,str:""};if(e>=n)return l;if(o=t.charCodeAt(e),34!==o&&39!==o&&40!==o)return l;e++,40===o&&(o=41);while(e<n){if(i=t.charCodeAt(e),i===o)return l.pos=e+1,l.lines=a,l.str=r(t.slice(s+1,e)),l.ok=!0,l;if(40===i&&41===o)return l;10===i?a++:92===i&&e+1<n&&(e++,10===t.charCodeAt(e)&&a++),e++}return l}},db4a:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalize=void 0;var r=n("774c");function i(t,e,n){var i,o;"object"===typeof e?(i=e.x,o=e.y):(i=e,o=n);var a=r.Path.parse(t),s=a.bbox();if(s){var l=-s.height/2-s.y,c=-s.width/2-s.x;"number"===typeof i&&(c-=i),"number"===typeof o&&(l-=o),a.translate(c,l)}return a.serialize()}e.normalize=i},dc08:function(t,e,n){"use strict";var r="[a-zA-Z_:][a-zA-Z0-9:._-]*",i="[^\"'=<>`\\x00-\\x20]+",o="'[^']*'",a='"[^"]*"',s="(?:"+i+"|"+o+"|"+a+")",l="(?:\\s+"+r+"(?:\\s*=\\s*"+s+")?)",c="<[A-Za-z][A-Za-z0-9\\-]*"+l+"*\\s*\\/?>",u="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",d="\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e",h="<[?][\\s\\S]*?[?]>",p="<![A-Z]+\\s+[^>]*>",f="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",g=new RegExp("^(?:"+c+"|"+u+"|"+d+"|"+h+"|"+p+"|"+f+")"),m=new RegExp("^(?:"+c+"|"+u+")");t.exports.HTML_TAG_RE=g,t.exports.HTML_OPEN_CLOSE_TAG_RE=m},dd71:function(t,e,n){t.exports={type:n("63df")}},ddf1:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)},i=this&&this.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};Object.defineProperty(e,"__esModule",{value:!0}),e.async=void 0;var o=n("774c"),a=n("db4a"),s=function(t){var e=t.width,n=t.height,s=t.offset,l=t.open,c=t.flip,u=i(t,["width","height","offset","open","flip"]),d=n||6,h=e||10,p=!0===l,f=!0===c,g=r(r({},u),{tagName:"path"});f&&(d=-d);var m=new o.Path;return m.moveTo(0,d).lineTo(h,0),p?g.fill="none":(m.lineTo(h,d),m.close()),g.d=(0,a.normalize)(m.serialize(),{x:s||-h/2,y:d/2}),g};e.async=s},df6c:function(t,e,n){"use strict";var r=n("f483");function i(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}i.prototype.Token=r,t.exports=i},dfb9:function(t,e,n){var r=n("07fa");t.exports=function(t,e){var n=0,i=r(e),o=new t(i);while(i>n)o[n]=e[n++];return o}},e026:function(t,e,n){},e15d:function(t,e,n){"use strict";t.exports=function(t){var e={};t=t||{},e.src_Any=n("cbc7").source,e.src_Cc=n("a7bc").source,e.src_Z=n("4fc2").source,e.src_P=n("7ca0").source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");var r="[><]";return e.src_pseudo_letter="(?:(?!"+r+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+r+"|"+e.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+r+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+r+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|]|"+e.src_ZPCc+"))((?![$+<=>^`|])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|]|"+e.src_ZPCc+"))((?![$+<=>^`|])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}},e1de:function(t,e,n){(function(t){t(n("56b3"),n("76ae"),n("eb0c"))})((function(t){"use strict";t.defineSimpleMode("handlebars-tags",{start:[{regex:/\{\{\{/,push:"handlebars_raw",token:"tag"},{regex:/\{\{!--/,push:"dash_comment",token:"comment"},{regex:/\{\{!/,push:"comment",token:"comment"},{regex:/\{\{/,push:"handlebars",token:"tag"}],handlebars_raw:[{regex:/\}\}\}/,pop:!0,token:"tag"}],handlebars:[{regex:/\}\}/,pop:!0,token:"tag"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"},{regex:/'(?:[^\\']|\\.)*'?/,token:"string"},{regex:/>|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],meta:{blockCommentStart:"{{--",blockCommentEnd:"--}}"}}),t.defineMode("handlebars",(function(e,n){var r=t.getMode(e,"handlebars-tags");return n&&n.base?t.multiplexingMode(t.getMode(e,n.base),{open:"{{",close:/\}\}\}?/,mode:r,parseDelimiters:!0}):r})),t.defineMIME("text/x-handlebars-template","handlebars")}))},e308:function(t,e,n){"use strict";var r=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;t.exports=function(t,e){var n,i,o,a,s,l,c,u;return!!t.md.options.linkify&&(!(t.linkLevel>0)&&(n=t.pos,i=t.posMax,!(n+3>i)&&(58===t.src.charCodeAt(n)&&(47===t.src.charCodeAt(n+1)&&(47===t.src.charCodeAt(n+2)&&(o=t.pending.match(r),!!o&&(a=o[1],s=t.md.linkify.matchAtStart(t.src.slice(n-a.length)),!!s&&(l=s.url,l=l.replace(/\*+$/,""),c=t.md.normalizeLink(l),!!t.md.validateLink(c)&&(e||(t.pending=t.pending.slice(0,-a.length),u=t.push("link_open","a",1),u.attrs=[["href",c]],u.markup="linkify",u.info="auto",u=t.push("text","",0),u.content=t.md.normalizeLinkText(l),u=t.push("link_close","a",-1),u.markup="linkify",u.info="auto"),t.pos+=l.length-a.length,!0)))))))))}},e58c:function(t,e,n){"use strict";var r=n("2ba4"),i=n("fc6a"),o=n("5926"),a=n("07fa"),s=n("a640"),l=Math.min,c=[].lastIndexOf,u=!!c&&1/[1].lastIndexOf(1,-0)<0,d=s("lastIndexOf"),h=u||!d;t.exports=h?function(t){if(u)return r(c,this,arguments)||0;var e=i(this),n=a(e),s=n-1;for(arguments.length>1&&(s=l(s,o(arguments[1]))),s<0&&(s=n+s);s>=0;s--)if(s in e&&e[s]===t)return s||0;return-1}:c},e679:function(t,e,n){},e8b0:function(t,e,n){},e91f:function(t,e,n){"use strict";var r=n("ebb5"),i=n("4d64").indexOf,o=r.aTypedArray,a=r.exportTypedArrayMethod;a("indexOf",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},e947:function(t,e,n){},eac50:function(t,e,n){var r=n("861d"),i=Math.floor;t.exports=Number.isInteger||function(t){return!r(t)&&isFinite(t)&&i(t)===t}},eb0c:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";t.multiplexingMode=function(e){var n=Array.prototype.slice.call(arguments,1);function r(t,e,n,r){if("string"==typeof e){var i=t.indexOf(e,n);return r&&i>-1?i+e.length:i}var o=e.exec(n?t.slice(n):t);return o?o.index+n+(r?o[0].length:0):-1}return{startState:function(){return{outer:t.startState(e),innerActive:null,inner:null,startingInner:!1}},copyState:function(n){return{outer:t.copyState(e,n.outer),innerActive:n.innerActive,inner:n.innerActive&&t.copyState(n.innerActive.mode,n.inner),startingInner:n.startingInner}},token:function(i,o){if(o.innerActive){var a=o.innerActive;c=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);h=a.close&&!o.startingInner?r(c,a.close,i.pos,a.parseDelimiters):-1;if(h==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";h>-1&&(i.string=c.slice(0,h));var s=a.mode.token(i,o.inner);return h>-1?i.string=c:i.pos>i.start&&(o.startingInner=!1),h==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(s=s?s+" "+a.innerStyle:a.innerStyle),s}for(var l=1/0,c=i.string,u=0;u<n.length;++u){var d=n[u],h=r(c,d.open,i.pos);if(h==i.pos){d.parseDelimiters||i.match(d.open),o.startingInner=!!d.parseDelimiters,o.innerActive=d;var p=0;if(e.indent){var f=e.indent(o.outer,"","");f!==t.Pass&&(p=f)}return o.inner=t.startState(d.mode,p),d.delimStyle&&d.delimStyle+" "+d.delimStyle+"-open"}-1!=h&&h<l&&(l=h)}l!=1/0&&(i.string=c.slice(0,l));var g=e.token(i,o.outer);return l!=1/0&&(i.string=c),g},indent:function(n,r,i){var o=n.innerActive?n.innerActive.mode:e;return o.indent?o.indent(n.innerActive?n.inner:n.outer,r,i):t.Pass},blankLine:function(r){var i=r.innerActive?r.innerActive.mode:e;if(i.blankLine&&i.blankLine(r.innerActive?r.inner:r.outer),r.innerActive)"\n"===r.innerActive.close&&(r.innerActive=r.inner=null);else for(var o=0;o<n.length;++o){var a=n[o];"\n"===a.open&&(r.innerActive=a,r.inner=t.startState(a.mode,i.indent?i.indent(r.outer,"",""):0))}},electricChars:e.electricChars,innerMode:function(t){return t.inner?{state:t.inner,mode:t.innerActive.mode}:{state:t.outer,mode:e}}}}}))},ebb5:function(t,e,n){"use strict";var r,i,o,a=n("4b11"),s=n("83ab"),l=n("da84"),c=n("1626"),u=n("861d"),d=n("1a2d"),h=n("f5df"),p=n("0d51"),f=n("9112"),g=n("cb2d"),m=n("9bf2").f,v=n("3a9b"),b=n("e163"),y=n("d2bb"),w=n("b622"),x=n("90e3"),C=n("69f3"),k=C.enforce,A=C.get,S=l.Int8Array,E=S&&S.prototype,O=l.Uint8ClampedArray,T=O&&O.prototype,_=S&&b(S),M=E&&b(E),N=Object.prototype,P=l.TypeError,L=w("toStringTag"),D=x("TYPED_ARRAY_TAG"),j="TypedArrayConstructor",I=a&&!!y&&"Opera"!==h(l.opera),R=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},B={BigInt64Array:8,BigUint64Array:8},z=function(t){if(!u(t))return!1;var e=h(t);return"DataView"===e||d(F,e)||d(B,e)},H=function(t){var e=b(t);if(u(e)){var n=A(e);return n&&d(n,j)?n[j]:H(e)}},V=function(t){if(!u(t))return!1;var e=h(t);return d(F,e)||d(B,e)},q=function(t){if(V(t))return t;throw P("Target is not a typed array")},U=function(t){if(c(t)&&(!y||v(_,t)))return t;throw P(p(t)+" is not a typed array constructor")},W=function(t,e,n,r){if(s){if(n)for(var i in F){var o=l[i];if(o&&d(o.prototype,t))try{delete o.prototype[t]}catch(a){try{o.prototype[t]=e}catch(c){}}}M[t]&&!n||g(M,t,n?e:I&&E[t]||e,r)}},$=function(t,e,n){var r,i;if(s){if(y){if(n)for(r in F)if(i=l[r],i&&d(i,t))try{delete i[t]}catch(o){}if(_[t]&&!n)return;try{return g(_,t,n?e:I&&_[t]||e)}catch(o){}}for(r in F)i=l[r],!i||i[t]&&!n||g(i,t,e)}};for(r in F)i=l[r],o=i&&i.prototype,o?k(o)[j]=i:I=!1;for(r in B)i=l[r],o=i&&i.prototype,o&&(k(o)[j]=i);if((!I||!c(_)||_===Function.prototype)&&(_=function(){throw P("Incorrect invocation")},I))for(r in F)l[r]&&y(l[r],_);if((!I||!M||M===N)&&(M=_.prototype,I))for(r in F)l[r]&&y(l[r].prototype,M);if(I&&b(T)!==M&&y(T,M),s&&!d(M,L))for(r in R=!0,m(M,L,{get:function(){return u(this)?this[D]:void 0}}),F)l[r]&&f(l[r],D,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_TAG:R&&D,aTypedArray:q,aTypedArrayConstructor:U,exportTypedArrayMethod:W,exportTypedArrayStaticMethod:$,getTypedArrayConstructor:H,isView:z,isTypedArray:V,TypedArray:_,TypedArrayPrototype:M}},ebfb:function(t,e,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},r.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach((function(t){t.enabled&&t.alt.forEach((function(t){e.indexOf(t)<0&&e.push(t)}))})),t.__cache__={},e.forEach((function(e){t.__cache__[e]=[],t.__rules__.forEach((function(n){n.enabled&&(e&&n.alt.indexOf(e)<0||t.__cache__[e].push(n.fn))}))}))},r.prototype.at=function(t,e,n){var r=this.__find__(t),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null},r.prototype.before=function(t,e,n,r){var i=this.__find__(t),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},r.prototype.after=function(t,e,n,r){var i=this.__find__(t),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},r.prototype.push=function(t,e,n){var r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null},r.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach((function(t){var r=this.__find__(t);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[r].enabled=!0,n.push(t)}),this),this.__cache__=null,n},r.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach((function(t){t.enabled=!1})),this.enable(t,e)},r.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach((function(t){var r=this.__find__(t);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[r].enabled=!1,n.push(t)}),this),this.__cache__=null,n},r.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},t.exports=r},ef66:function(t,e,n){"use strict";n("129e")},f0e9:function(t,e,n){"use strict";var r=n("55be").isSpace;t.exports=function(t,e,n,i){var o,a,s,l,c=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(o=t.src.charCodeAt(c++),42!==o&&45!==o&&95!==o)return!1;a=1;while(c<u){if(s=t.src.charCodeAt(c++),s!==o&&!r(s))return!1;s===o&&a++}return!(a<3)&&(i||(t.line=e+1,l=t.push("hr","hr",0),l.map=[e,t.line],l.markup=Array(a+1).join(String.fromCharCode(o))),!0)}},f190:function(t,e,n){},f483:function(t,e,n){"use strict";function r(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}r.prototype.attrIndex=function(t){var e,n,r;if(!this.attrs)return-1;for(e=this.attrs,n=0,r=e.length;n<r;n++)if(e[n][0]===t)return n;return-1},r.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},r.prototype.attrSet=function(t,e){var n=this.attrIndex(t),r=[t,e];n<0?this.attrPush(r):this.attrs[n]=r},r.prototype.attrGet=function(t){var e=this.attrIndex(t),n=null;return e>=0&&(n=this.attrs[e][1]),n},r.prototype.attrJoin=function(t,e){var n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e},t.exports=r},f495:function(t,e,n){var r=n("c04e"),i=TypeError;t.exports=function(t){var e=r(t,"number");if("number"==typeof e)throw i("Can't convert number to bigint");return BigInt(e)}},f665:function(t,e,n){"use strict";var r=n("55be").isSpace;function i(t,e){var n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function o(t){var e,n=[],r=0,i=t.length,o=!1,a=0,s="";e=t.charCodeAt(r);while(r<i)124===e&&(o?(s+=t.substring(a,r-1),a=r):(n.push(s+t.substring(a,r)),s="",a=r+1)),o=92===e,r++,e=t.charCodeAt(r);return n.push(s+t.substring(a)),n}t.exports=function(t,e,n,a){var s,l,c,u,d,h,p,f,g,m,v,b,y,w,x,C,k,A;if(e+2>n)return!1;if(h=e+1,t.sCount[h]<t.blkIndent)return!1;if(t.sCount[h]-t.blkIndent>=4)return!1;if(c=t.bMarks[h]+t.tShift[h],c>=t.eMarks[h])return!1;if(k=t.src.charCodeAt(c++),124!==k&&45!==k&&58!==k)return!1;if(c>=t.eMarks[h])return!1;if(A=t.src.charCodeAt(c++),124!==A&&45!==A&&58!==A&&!r(A))return!1;if(45===k&&r(A))return!1;while(c<t.eMarks[h]){if(s=t.src.charCodeAt(c),124!==s&&45!==s&&58!==s&&!r(s))return!1;c++}for(l=i(t,e+1),p=l.split("|"),m=[],u=0;u<p.length;u++){if(v=p[u].trim(),!v){if(0===u||u===p.length-1)continue;return!1}if(!/^:?-+:?$/.test(v))return!1;58===v.charCodeAt(v.length-1)?m.push(58===v.charCodeAt(0)?"center":"right"):58===v.charCodeAt(0)?m.push("left"):m.push("")}if(l=i(t,e).trim(),-1===l.indexOf("|"))return!1;if(t.sCount[e]-t.blkIndent>=4)return!1;if(p=o(l),p.length&&""===p[0]&&p.shift(),p.length&&""===p[p.length-1]&&p.pop(),f=p.length,0===f||f!==m.length)return!1;if(a)return!0;for(w=t.parentType,t.parentType="table",C=t.md.block.ruler.getRules("blockquote"),g=t.push("table_open","table",1),g.map=b=[e,0],g=t.push("thead_open","thead",1),g.map=[e,e+1],g=t.push("tr_open","tr",1),g.map=[e,e+1],u=0;u<p.length;u++)g=t.push("th_open","th",1),m[u]&&(g.attrs=[["style","text-align:"+m[u]]]),g=t.push("inline","",0),g.content=p[u].trim(),g.children=[],g=t.push("th_close","th",-1);for(g=t.push("tr_close","tr",-1),g=t.push("thead_close","thead",-1),h=e+2;h<n;h++){if(t.sCount[h]<t.blkIndent)break;for(x=!1,u=0,d=C.length;u<d;u++)if(C[u](t,h,n,!0)){x=!0;break}if(x)break;if(l=i(t,h).trim(),!l)break;if(t.sCount[h]-t.blkIndent>=4)break;for(p=o(l),p.length&&""===p[0]&&p.shift(),p.length&&""===p[p.length-1]&&p.pop(),h===e+2&&(g=t.push("tbody_open","tbody",1),g.map=y=[e+2,0]),g=t.push("tr_open","tr",1),g.map=[h,h+1],u=0;u<f;u++)g=t.push("td_open","td",1),m[u]&&(g.attrs=[["style","text-align:"+m[u]]]),g=t.push("inline","",0),g.content=p[u]?p[u].trim():"",g.children=[],g=t.push("td_close","td",-1);g=t.push("tr_close","tr",-1)}return y&&(g=t.push("tbody_close","tbody",-1),y[1]=h),g=t.push("table_close","table",-1),b[1]=h,t.parentType=w,t.line=h,!0}},f724:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeSides=e.parseCssNumeric=e.normalizePercentage=e.isPercentage=e.random=e.mod=e.isNumeric=e.parseInt=e.toSafeInteger=e.toInteger=e.toNumber=e.toFinite=e.inRange=e.clamp=e.isSafeInteger=e.isInteger=e.isFinite=e.isNumber=e.isNaN=void 0;var r=n("4fcf");Object.defineProperty(e,"isNaN",{enumerable:!0,get:function(){return r.isNaN}}),Object.defineProperty(e,"isNumber",{enumerable:!0,get:function(){return r.isNumber}}),Object.defineProperty(e,"isFinite",{enumerable:!0,get:function(){return r.isFinite}}),Object.defineProperty(e,"isInteger",{enumerable:!0,get:function(){return r.isInteger}}),Object.defineProperty(e,"isSafeInteger",{enumerable:!0,get:function(){return r.isSafeInteger}}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return r.clamp}}),Object.defineProperty(e,"inRange",{enumerable:!0,get:function(){return r.inRange}}),Object.defineProperty(e,"toFinite",{enumerable:!0,get:function(){return r.toFinite}}),Object.defineProperty(e,"toNumber",{enumerable:!0,get:function(){return r.toNumber}}),Object.defineProperty(e,"toInteger",{enumerable:!0,get:function(){return r.toInteger}}),Object.defineProperty(e,"toSafeInteger",{enumerable:!0,get:function(){return r.toSafeInteger}}),Object.defineProperty(e,"parseInt",{enumerable:!0,get:function(){return r.parseInt}});var i=n("fc35");function o(t,e){return(t%e+e)%e}function a(t,e){if(null==e)e=null==t?1:t,t=0;else if(e<t){var n=t;t=e,e=n}return Math.floor(Math.random()*(e-t+1)+t)}function s(t){return"string"===typeof t&&"%"===t.slice(-1)}function l(t,e){if(null==t)return 0;var n;if("string"===typeof t){if(n=parseFloat(t),s(t)&&(n/=100,Number.isFinite(n)))return n*e}else n=t;return Number.isFinite(n)?n>0&&n<1?n*e:n:0}function c(t,e){function n(e){var n=new RegExp("(?:\\d+(?:\\.\\d+)*)("+e+")$").exec(t);return n?n[1]:null}var r,i=parseFloat(t);if(Number.isNaN(i))return null;if(null==e)r="[A-Za-z]*";else if(Array.isArray(e)){if(0===e.length)return null;r=e.join("|")}else"string"===typeof e&&(r=e);var o=n(r);return null===o?null:{unit:o,value:i}}function u(t){if("object"===typeof t){var e=0,n=0,r=0,i=0;return null!=t.vertical&&Number.isFinite(t.vertical)&&(n=i=t.vertical),null!=t.horizontal&&Number.isFinite(t.horizontal)&&(r=e=t.horizontal),null!=t.left&&Number.isFinite(t.left)&&(e=t.left),null!=t.top&&Number.isFinite(t.top)&&(n=t.top),null!=t.right&&Number.isFinite(t.right)&&(r=t.right),null!=t.bottom&&Number.isFinite(t.bottom)&&(i=t.bottom),{top:n,right:r,bottom:i,left:e}}var o=0;return null!=t&&Number.isFinite(t)&&(o=t),{top:o,right:o,bottom:o,left:o}}Object.defineProperty(e,"isNumeric",{enumerable:!0,get:function(){return i.isNumeric}}),e.mod=o,e.random=a,e.isPercentage=s,e.normalizePercentage=l,e.parseCssNumeric=c,e.normalizeSides=u},f744:function(t,e,n){"use strict";var r=n("7ec2").default,i=n("7037").default;n("d3b7"),n("d9e2"),n("131a"),n("3410"),n("f8c9"),n("4ae1"),n("5d41"),n("e439"),n("a4d3"),n("e01a"),n("d28b"),n("3ca3"),n("ddb0"),n("a630"),n("159b"),n("7039"),n("b64b"),n("b0c0"),n("99af"),n("9911"),n("498a"),n("ac1f"),n("5319"),n("7db0"),n("00b4");var o=n("a57f"),a=n("2b0e");n("6ba6");var s=n("5efb");n("d2a3");var l=n("4df5");n("5704");var c=n("b558");n("9a33");var u=n("f933");function d(t){return t&&"object"===i(t)&&"default"in t?t:{default:t}}var h=d(a),p=d(s),f=d(l),g=d(c),m=d(u);function v(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function b(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){v(o,r,i,a,s,"next",t)}function s(t){v(o,r,i,a,s,"throw",t)}a(void 0)}))}}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function x(t,e,n){return e&&w(t.prototype,e),n&&w(t,n),t}function C(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&A(t,e)}function k(t){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},k(t)}function A(t,e){return A=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},A(t,e)}function S(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function E(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O(t,e){if(e&&("object"===i(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return E(t)}function T(t){var e=S();return function(){var n,r=k(t);if(e){var i=k(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O(this,n)}}function _(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=k(t),null===t)break;return t}function M(){return M="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=_(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},M.apply(this,arguments)}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function N(t,e,n,r){var o,a=arguments.length,s=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"===("undefined"===typeof Reflect?"undefined":i(Reflect))&&"function"===typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(e,n,s):o(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s
/**
* vue-class-component v7.2.6
* (c) 2015-present Evan You
* @license MIT
*/}function P(t){return P="function"===typeof Symbol&&"symbol"===i(Symbol.iterator)?function(t){return i(t)}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":i(t)},P(t)}function L(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D(t){return j(t)||I(t)||R()}function j(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function I(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function R(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function F(){return"undefined"!==typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function B(t,e){z(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){z(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){z(t,e,n)}))}function z(t,e,n){var r=n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e);r.forEach((function(r){var i=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,i,t,n):Reflect.defineMetadata(r,i,t)}))}var H={__proto__:[]},V=H instanceof Array;function q(t){return function(e,n,r){var i="function"===typeof e?e:e.constructor;i.__decorators__||(i.__decorators__=[]),"number"!==typeof r&&(r=void 0),i.__decorators__.push((function(e){return t(e,n,r)}))}}function U(t){var e=P(t);return null==t||"object"!==e&&"function"!==e}function W(t,e){var n=e.prototype._init;e.prototype._init=function(){var e=this,n=Object.getOwnPropertyNames(t);if(t.$options.props)for(var r in t.$options.props)t.hasOwnProperty(r)||n.push(r);n.forEach((function(n){Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){t[n]=e},configurable:!0})}))};var r=new e;e.prototype._init=n;var i={};return Object.keys(r).forEach((function(t){void 0!==r[t]&&(i[t]=r[t])})),i}var $=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function G(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=e.name||t._componentTag||t.name;var n=t.prototype;Object.getOwnPropertyNames(n).forEach((function(t){if("constructor"!==t)if($.indexOf(t)>-1)e[t]=n[t];else{var r=Object.getOwnPropertyDescriptor(n,t);void 0!==r.value?"function"===typeof r.value?(e.methods||(e.methods={}))[t]=r.value:(e.mixins||(e.mixins=[])).push({data:function(){return L({},t,r.value)}}):(r.get||r.set)&&((e.computed||(e.computed={}))[t]={get:r.get,set:r.set})}})),(e.mixins||(e.mixins=[])).push({data:function(){return W(this,t)}});var r=t.__decorators__;r&&(r.forEach((function(t){return t(e)})),delete t.__decorators__);var i=Object.getPrototypeOf(t.prototype),o=i instanceof h["default"]?i.constructor:h["default"],a=o.extend(e);return X(a,t,o),F()&&B(a,t),a}var Y={prototype:!0,arguments:!0,callee:!0,caller:!0};function X(t,e,n){Object.getOwnPropertyNames(e).forEach((function(r){if(!Y[r]){var i=Object.getOwnPropertyDescriptor(t,r);if(!i||i.configurable){var o=Object.getOwnPropertyDescriptor(e,r);if(!V){if("cid"===r)return;var a=Object.getOwnPropertyDescriptor(n,r);if(!U(o.value)&&a&&a.value===o.value)return}0,Object.defineProperty(t,r,o)}}}))}function K(t){return"function"===typeof t?G(t):function(e){return G(e,t)}}K.registerHooks=function(t){$.push.apply($,D(t))};var Z="undefined"!==typeof Reflect&&"undefined"!==typeof Reflect.getMetadata;function J(t,e,n){if(Z&&!Array.isArray(t)&&"function"!==typeof t&&!t.hasOwnProperty("type")&&"undefined"===typeof t.type){var r=Reflect.getMetadata("design:type",e,n);r!==Object&&(t.type=r)}}function Q(t){return void 0===t&&(t={}),function(e,n){J(t,e,n),q((function(e,n){(e.props||(e.props={}))[n]=t}))(e,n)}}h["default"].use(g["default"]),h["default"].use(f["default"]),h["default"].use(p["default"]);var tt=function(t){C(n,t);var e=T(n);function n(){var t;return y(this,n),t=e.apply(this,arguments),t.text="",t.link="",t.textTitle="",t.textPlaceholder="",t.linkTitle="",t.linkPlaceholder="",t.buttonTitle="",t}return x(n,[{key:"mounted",value:function(){var t=this;this.text=this.defaultText||"",this.link=this.defaultLink||"",this.textTitle=this.language.get("link","text"),this.textPlaceholder=this.language.get("link","text_placeholder"),this.linkTitle=this.language.get("link","link"),this.linkPlaceholder=this.language.get("link","link_placeholder"),this.buttonTitle=this.language.get("link","ok_button"),setTimeout((function(){var e=t.$refs.linkRef;e&&e.focus(),t.onLoad&&t.onLoad()}),200)}},{key:"onTextChange",value:function(t){this.text=t}},{key:"onLinkChange",value:function(t){this.link=t}}]),n}(h["default"]);N([Q({type:Object,required:!0})],tt.prototype,"language",void 0),N([Q(String)],tt.prototype,"defaultText",void 0),N([Q(String)],tt.prototype,"defaultLink",void 0),N([Q(String)],tt.prototype,"className",void 0),N([Q(Function)],tt.prototype,"onLoad",void 0),N([Q(Function)],tt.prototype,"onOk",void 0),tt=N([K({components:{"a-config-provider":f["default"],"a-input":g["default"],"a-button":p["default"]}})],tt);var et=tt;function nt(t,e,n,r,i,o,a,s,l,c){"boolean"!==typeof a&&(l=s,s=a,a=!1);var u,d="function"===typeof n?n.options:n;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),r&&(d._scopeId=r),o?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=u):e&&(u=a?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),u)if(d.functional){var h=d.render;d.render=function(t,e){return u.call(e),h(t,e)}}else{var p=d.beforeCreate;d.beforeCreate=p?[].concat(p,u):[u]}return n}var rt=et,it=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("a-config-provider",{attrs:{"auto-insert-space-in-button":!1}},[n("div",{class:["data-link-editor",t.className],attrs:{"data-element":"ui"}},[n("p",[t._v(t._s(t.textTitle))]),t._v(" "),n("p",[n("a-input",{staticClass:"data-link-input",attrs:{value:t.text,placeholder:t.textPlaceholder},on:{change:function(e){return t.onTextChange(e.target.value)}}})],1),t._v(" "),n("p",[t._v(t._s(t.linkTitle))]),t._v(" "),n("p",[n("a-input",{ref:"linkRef",staticClass:"data-link-input",attrs:{value:t.link,placeholder:t.linkPlaceholder},on:{change:function(e){return t.onLinkChange(e.target.value)}}})],1),t._v(" "),n("p",[n("a-button",{staticClass:"data-link-button",attrs:{disabled:""===t.link.trim()},on:{click:function(e){t.onOk&&t.onOk(t.text,t.link)}}},[t._v("\n "+t._s(t.buttonTitle)+"\n ")])],1)])])},ot=[];it._withStripped=!0;var at=void 0,st=void 0,lt=void 0,ct=!1,ut=nt({render:it,staticRenderFns:ot},at,rt,st,ct,lt,!1,void 0,void 0,void 0),dt=function(t){C(n,t);var e=T(n);function n(){var t;return y(this,n),t=e.apply(this,arguments),t.openTitle="",t.editTitle="",t.removeTitle="",t}return x(n,[{key:"mounted",value:function(){this.openTitle=this.language.get("link","link_open"),this.editTitle=this.language.get("link","link_edit"),this.removeTitle=this.language.get("link","link_remove"),this.onLoad&&this.onLoad()}}]),n}(h["default"]);N([Q({type:Object,required:!0})],dt.prototype,"language",void 0),N([Q(String)],dt.prototype,"href",void 0),N([Q(String)],dt.prototype,"className",void 0),N([Q(Function)],dt.prototype,"onEdit",void 0),N([Q(Function)],dt.prototype,"onRemove",void 0),N([Q(Function)],dt.prototype,"onLoad",void 0),N([Q(Boolean)],dt.prototype,"readonly",void 0),dt=N([K({components:{"a-tooltip":m["default"]}})],dt);var ht=dt,pt=ht,ft=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"data-link-preview",attrs:{"data-element":"ui"}},[n("a-tooltip",{attrs:{title:t.openTitle}},[n("a",{staticClass:"data-icon data-icon-link data-link-preview-open",attrs:{href:t.href,target:"_blank"}},[t._v("\n "+t._s(t.href)+"\n ")])]),t._v(" "),t.readonly?t._e():n("div",{staticClass:"data-link-op"},[n("a-tooltip",{attrs:{title:t.editTitle}},[n("a",{staticClass:"data-icon data-icon-edit",on:{click:t.onEdit}})]),t._v(" "),n("a-tooltip",{attrs:{title:t.removeTitle}},[n("a",{staticClass:"data-icon data-icon-unlink",on:{click:t.onRemove}})])],1)],1)},gt=[];ft._withStripped=!0;var mt=void 0,vt=void 0,bt=void 0,yt=!1,wt=nt({render:ft,staticRenderFns:gt},mt,pt,vt,yt,bt,!1,void 0,void 0,void 0),xt=function(){function t(e,n){var r=this;y(this,t),this.mouseInContainer=!1,this.engine=e;var i=this.engine.change;this.options=n,this.position=new o.Position(this.engine),i.event.onWindow("mousedown",(function(t){if(t.target){var e=o.$(t.target),n=e.closest(".data-link-container");r.mouseInContainer=n&&n.length>0,e.inEditor()||r.mouseInContainer||r.hide()}}))}return x(t,[{key:"create",value:function(){var t;if(this.target){var e=o.$(".data-link-container");0===e.length&&(e=o.$('<div class="data-link-container'.concat(o.isMobile?" data-link-container-mobile":"",'"></div>'))),this.root=e;var n=null===(t=this.target.get())||void 0===t?void 0:t.getBoundingClientRect();n&&this.root.css({top:"".concat(window.pageYOffset+n.bottom+4,"px"),left:"".concat(window.pageXOffset,"px"),position:"absolute","z-index":125})}}},{key:"onOk",value:function(){var t=b(r().mark((function t(e,n){var i,o,a,s,l,c,u,d,h,p,f;return r().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(this.target){t.next=2;break}return t.abrupt("return");case 2:if(i=this.engine.change,o=i.range.get(),i.rangePathBeforeCommand||(o.startNode.inEditor()||(o.select(this.target,!0),i.range.select(o)),i.cacheRangeBeforeCommand()),a=this.options||{},s=a.onConfirm,!s){t.next=12;break}return t.next=9,s(e,n);case 9:l=t.sent,e=l.text,n=l.link;case 12:if(this.target.attributes("href",n),e=""===e.trim()?n:e,c=this.target.text(),c===e){t.next=45;break}if(d=this.target.children(),!(d.length<3)){t.next=21;break}this.target.text(e),t.next=45;break;case 21:if(3!==d.length||!(null===(u=d.eq(1))||void 0===u?void 0:u.isText())){t.next=25;break}this.target.text(e),t.next=45;break;case 25:if(3!==d.length){t.next=44;break}h=d.eq(1);case 27:if(!h){t.next=42;break}if(f=h.children(),!(f.length>1||0===f.length)){t.next=34;break}return h.text(e),t.abrupt("break",42);case 34:if(!(null===(p=f.eq(0))||void 0===p?void 0:p.isText())){t.next=39;break}return h.text(e),t.abrupt("break",42);case 39:h=f;case 40:t.next=27;break;case 42:t.next=45;break;case 44:this.target.text(e);case 45:this.engine.inline.repairCursor(this.target),o.setStart(this.target.next(),1),o.setEnd(this.target.next(),1),i.apply(o),this.mouseInContainer=!1,this.hide();case 51:case"end":return t.stop()}}),t,this)})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"editor",value:function(t,e,n){var r=this,i=new h["default"]({render:function(i){return i(ut,{props:{language:r.engine.language,defaultText:t,defaultLink:e,onLoad:function(){r.mouseInContainer=!0,n&&n()},onOk:function(t,e){return r.onOk(t,e)}}})}});return i}},{key:"preview",value:function(t,e){var n=this,r=this.engine,i=r.change,o=r.inline,a=r.language,s=new h["default"]({render:function(r){return r(wt,{props:{language:a,href:t,readonly:n.engine.readonly,onLoad:function(){e&&e()},onEdit:function(){n.target&&(n.mouseInContainer=!1,n.hide(void 0,!1),n.show(n.target,!0))},onRemove:function(){if(n.target){var t=i.range.get();t.select(n.target,!0),o.repairRange(t),i.range.select(t),i.cacheRangeBeforeCommand(),o.unwrap(),n.mouseInContainer=!1,n.target=void 0,n.hide()}}}})}});return s}},{key:"show",value:function(t,e){var n,r,i,a=this;if(!(null===(n=this.target)||void 0===n?void 0:n.equal(t))||!(null===(r=this.root)||void 0===r||null===(i=r.parent())||void 0===i?void 0:i.length)){this.target=t,this.create();var s,l=t.text().replace(/\u200B/g,""),c=t.attributes("href"),u=this.root.get(),d=c&&!e||this.engine.readonly?"data-link-preview":"data-link-editor";if(this.vm&&o.$(this.vm.$el).hasClass(d)){var h,p;if(!this.root||!this.target)return;return null===(h=this.position)||void 0===h||h.destroy(),void(null===(p=this.position)||void 0===p||p.bind(this.root,this.target))}this.vm&&(this.vm.$destroy(),this.vm=void 0,null===(s=this.position)||void 0===s||s.destroy()),setTimeout((function(){var t,n;null===(t=a.position)||void 0===t||t.destroy(),null===(n=a.position)||void 0===n||n.bind(a.root,a.target),a.vm=c&&!e||a.engine.readonly?a.preview(c,(function(){var t;null===(t=a.position)||void 0===t||t.update()})):a.editor(l,c,(function(){var t;null===(t=a.position)||void 0===t||t.update()})),u.append(a.vm.$mount().$el)}),20)}}},{key:"hide",value:function(t,e){var n;if(!(t&&this.target&&t.equal(this.target))){var r=null===(n=this.root)||void 0===n?void 0:n.get();if(r&&!this.mouseInContainer){var i;if(this.vm)this.vm.$destroy(),this.vm=void 0,null===(i=this.position)||void 0===i||i.destroy();if(this.root=void 0,this.target&&!this.target.attributes("href")){var o=this.engine,a=o.change,s=o.inline,l=a.range.get();l.select(this.target,!0),s.unwrap(l),a.apply(l.collapse(!0))}!1!==e&&(this.target=void 0)}}}}]),t}(),Ct={link:{text:"Text",link:"Link",text_placeholder:"Description text",link_placeholder:"Link address",link_open:"Open link",link_edit:"Edit link",link_remove:"Remove link",ok_button:"OK"}},kt={link:{text:"文本",link:"链接",text_placeholder:"描述文本",link_placeholder:"链接地址",link_open:"打开链接",link_edit:"编辑链接",link_remove:"移除链接",ok_button:"确定"}},At={"en-US":Ct,"zh-CN":kt};function St(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var Et=".data-link-container {\n max-width: 398px;\n display: inline-block;\n border: 1px solid #E8E8E8;\n border-radius: 4px;\n box-shadow: rgba(221, 221, 221, 0.5) 0px 1px 3px;\n background: white;\n}\n\n.data-link-container-mobile {\n max-width: calc(100vw - 20px);;\n}\n\n.data-link-container .data-link-editor {\n min-width: 365px;\n padding: 16px 12px;\n padding-bottom: 4px;\n}\n\n.data-link-container-mobile .data-link-editor {\n min-width: calc(100vw - 40px);\n padding: 8px 6px;\n}\n\n.data-link-container p {\n margin-top: 0;\n margin-bottom: 14px;\n}\n\n.data-link-container .itellyou-icon {\n color: #8590A6;\n font-size: 16px;\n}\n.data-link-preview {\n line-height: 16px;\n padding: 6px 8px;\n vertical-align: middle;\n white-space: nowrap;\n display: flex;\n justify-content:space-between;\n}\n.data-link-preview > * {\n display: block;\n}\n\n.data-link-preview a {\n display: inline-block;\n color: #595959;\n margin: 0px 0px 0px 8px;\n padding: 4px;\n}\n.data-link-preview a:hover {\n background: #F4F4F4;\n cursor: pointer;\n}\n.data-link-preview a.data-link-preview-open {\n color: #1890FF;\n max-width: 292px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-decoration: none;\n font-size: 14px;\n letter-spacing: 1.2px;\n vertical-align: middle;\n margin: 0;\n}\n.data-link-container-mobile .data-link-preview a.data-link-preview-open {\n max-width: 70%;\n}\n.data-link-preview a.data-link-preview-open::before\n{\n vertical-align: middle;\n margin-right: 2px;\n}\n\n.data-link-preview a.data-link-preview-open:hover{\n background: transparent;\n}";St(Et);var Ot=function(t){C(n,t);var e=T(n);function n(){var t;return y(this,n),t=e.apply(this,arguments),t.attributes={target:"@var0",href:"@var1"},t.variable={"@var0":["_blank","_parent","_top","_self"],"@var1":{required:!0,value:"*"}},t.tagName="a",t.handleClick=function(e){if(e.target){var n=t.options.onLinkClick;if(n){var r=o.$(e.target).closest("".concat(t.tagName));r.name===t.tagName&&n(e,r.attributes("href"))}}},t.bindQuery=function(){t.query()},t.query=function(){var e;if(o.isEngine(t.editor)){var n=t.editor.change,r=n.inlines.find((function(e){return t.isSelf(e)}));if(null===(e=t.toolbar)||void 0===e||e.hide(r),r&&r.length>0&&!r.isCard()){var i,a,s=n.range.get();if(s.collapsed||r.contains(s.startNode)&&r.contains(s.endNode))return null===(i=t.toolbar)||void 0===i||i.show(r),!0;null===(a=t.toolbar)||void 0===a||a.hide()}return!1}},t.markdownIt=function(e){!1!==t.options.markdown&&(e.enable("link"),e.enable("linkify"))},t.pasteHtml=function(e){if(e.isText()){var n=e.text(),r=t.editor,i=r.node,a=r.inline;if(/^https?:\/\/\S+$/.test(n.toLowerCase().trim())&&a.closest(e).equal(e)){var s=i.wrap(e,o.$("<".concat(t.tagName,' target="_blank" href="').concat(n,'"></a>')));return a.repairCursor(s),!1}}else if("a"===e.name){var l=e.attributes("href");e.attributes("target","_blank"),e.attributes("href",decodeURI(l).trim().replace(/\u200b/g,""))}return!0},t.parseHtml=function(e){e.find(t.tagName).css({"font-family":"monospace","font-size":"inherit","background-color":"rgba(0,0,0,.06)",padding:"0 2px",border:"1px solid rgba(0,0,0,.08)","border-radius":"2px 2px","line-height":"inherit","overflow-wrap":"break-word","text-indent":"0"})},t}return x(n,[{key:"init",value:function(){M(k(n.prototype),"init",this).call(this);var t=this.editor;o.isEngine(t)&&(!1!==this.options.enableToolbar&&(this.toolbar=new xt(t,{onConfirm:this.options.onConfirm})),t.container.on("click",this.handleClick),t.on("markdown-it",this.markdownIt),t.on("paste:each",this.pasteHtml)),t.on("parse:html",this.parseHtml),t.on("select",this.bindQuery),t.language.add(At)}},{key:"hotkey",value:function(){return this.options.hotkey||{key:"mod+k",args:["_blank"]}}},{key:"execute",value:function(){var t=this;if(o.isEngine(this.editor)){var e=this.editor,n=e.inline,r=e.change;if(this.queryState()){var i=r.inlines.find((function(e){return t.isSelf(e)}));i&&i.length>0&&n.unwrap(i)}else{for(var a=o.$("<".concat(this.tagName," />")),s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];this.setStyle.apply(this,[a].concat(l)),this.setAttributes.apply(this,[a].concat(l));var u=l.length>2?l[2]:"";u?(a.text(u),n.insert(a)):n.wrap(a);var d,h=r.range.get();if(!h.collapsed&&r.inlines.length>0)null===(d=this.toolbar)||void 0===d||d.show(r.inlines[0])}}}},{key:"queryState",value:function(){return this.query()}},{key:"destroy",value:function(){var t=this.editor;t.container.off("click",this.handleClick),t.off("paste:each",this.pasteHtml),t.off("parse:html",this.parseHtml),t.off("select",this.bindQuery),t.off("markdown-it",this.markdownIt)}}],[{key:"pluginName",get:function(){return"link"}}]),n}(o.InlinePlugin);t.exports=Ot},f7ca:function(t,e,n){"use strict";var r=/\r\n?|\n/g,i=/\0/g;t.exports=function(t){var e;e=t.src.replace(r,"\n"),e=e.replace(i,"<22>"),t.src=e}},f8b2:function(t,e,n){"use strict";var r=n("cff7"),i=n("dc08").HTML_OPEN_CLOSE_TAG_RE,o=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(i.source+"\\s*$"),/^$/,!1]];t.exports=function(t,e,n,r){var i,a,s,l,c=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(c))return!1;for(l=t.src.slice(c,u),i=0;i<o.length;i++)if(o[i][0].test(l))break;if(i===o.length)return!1;if(r)return o[i][2];if(a=e+1,!o[i][1].test(l))for(;a<n;a++){if(t.sCount[a]<t.blkIndent)break;if(c=t.bMarks[a]+t.tShift[a],u=t.eMarks[a],l=t.src.slice(c,u),o[i][1].test(l)){0!==l.length&&a++;break}}return t.line=a,s=t.push("html_block","",0),s.map=[e,a],s.content=t.getLines(e,a,t.blkIndent,!0),!0}},f8c9:function(t,e,n){var r=n("23e7"),i=n("da84"),o=n("d44e");r({global:!0},{Reflect:{}}),o(i.Reflect,"Reflect",!0)},f8cd:function(t,e,n){var r=n("5926"),i=RangeError;t.exports=function(t){var e=r(t);if(e<0)throw i("The argument can't be less than 0");return e}},f8db:function(t,e,n){(function(e,n){t.exports=n()})(0,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return r.AnnotationLayerBuilder}}),Object.defineProperty(e,"DefaultAnnotationLayerFactory",{enumerable:!0,get:function(){return r.DefaultAnnotationLayerFactory}}),Object.defineProperty(e,"DefaultTextLayerFactory",{enumerable:!0,get:function(){return i.DefaultTextLayerFactory}}),Object.defineProperty(e,"TextLayerBuilder",{enumerable:!0,get:function(){return i.TextLayerBuilder}}),Object.defineProperty(e,"EventBus",{enumerable:!0,get:function(){return o.EventBus}}),Object.defineProperty(e,"NullL10n",{enumerable:!0,get:function(){return o.NullL10n}}),Object.defineProperty(e,"ProgressBar",{enumerable:!0,get:function(){return o.ProgressBar}}),Object.defineProperty(e,"PDFLinkService",{enumerable:!0,get:function(){return a.PDFLinkService}}),Object.defineProperty(e,"SimpleLinkService",{enumerable:!0,get:function(){return a.SimpleLinkService}}),Object.defineProperty(e,"DownloadManager",{enumerable:!0,get:function(){return s.DownloadManager}}),Object.defineProperty(e,"GenericL10n",{enumerable:!0,get:function(){return l.GenericL10n}}),Object.defineProperty(e,"PDFFindController",{enumerable:!0,get:function(){return c.PDFFindController}}),Object.defineProperty(e,"PDFHistory",{enumerable:!0,get:function(){return u.PDFHistory}}),Object.defineProperty(e,"PDFPageView",{enumerable:!0,get:function(){return d.PDFPageView}}),Object.defineProperty(e,"PDFSinglePageViewer",{enumerable:!0,get:function(){return h.PDFSinglePageViewer}}),Object.defineProperty(e,"PDFViewer",{enumerable:!0,get:function(){return p.PDFViewer}});var r=n(1),i=n(8),o=n(3),a=n(7),s=n(9),l=n(11),c=n(13),u=n(15),d=n(16),h=n(18),p=n(20)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultAnnotationLayerFactory=e.AnnotationLayerBuilder=void 0;var r=n(2),i=n(3),o=n(7);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}var c=function(){function t(e){var n=e.pageDiv,r=e.pdfPage,o=e.linkService,s=e.downloadManager,l=e.annotationStorage,c=void 0===l?null:l,u=e.imageResourcesPath,d=void 0===u?"":u,h=e.renderInteractiveForms,p=void 0===h||h,f=e.l10n,g=void 0===f?i.NullL10n:f;a(this,t),this.pageDiv=n,this.pdfPage=r,this.linkService=o,this.downloadManager=s,this.imageResourcesPath=d,this.renderInteractiveForms=p,this.l10n=g,this.annotationStorage=c,this.div=null,this._cancelled=!1}return l(t,[{key:"render",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"display";return this.pdfPage.getAnnotations({intent:n}).then((function(n){if(!e._cancelled&&0!==n.length){var i={viewport:t.clone({dontFlip:!0}),div:e.div,annotations:n,page:e.pdfPage,imageResourcesPath:e.imageResourcesPath,renderInteractiveForms:e.renderInteractiveForms,linkService:e.linkService,downloadManager:e.downloadManager,annotationStorage:e.annotationStorage};e.div?r.AnnotationLayer.update(i):(e.div=document.createElement("div"),e.div.className="annotationLayer",e.pageDiv.appendChild(e.div),i.div=e.div,r.AnnotationLayer.render(i),e.l10n.translate(e.div))}}))}},{key:"cancel",value:function(){this._cancelled=!0}},{key:"hide",value:function(){this.div&&this.div.setAttribute("hidden","true")}}]),t}();e.AnnotationLayerBuilder=c;var u=function(){function t(){a(this,t)}return l(t,[{key:"createAnnotationLayerBuilder",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:i.NullL10n;return new c({pageDiv:t,pdfPage:e,imageResourcesPath:r,renderInteractiveForms:a,linkService:new o.SimpleLinkService,l10n:s,annotationStorage:n})}}]),t}();e.DefaultAnnotationLayerFactory=u},function(t,e,r){"use strict";var i;i="undefined"!==typeof window&&window["pdfjs-dist/build/pdf"]?window["pdfjs-dist/build/pdf"]:n("4383"),t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isValidRotation=X,e.isValidScrollMode=K,e.isValidSpreadMode=Z,e.isPortraitOrientation=J,e.clamp=rt,e.getPDFFileNameFromURL=$,e.noContextMenuHandler=U,e.parseQueryString=R,e.backtrackBeforeAllVisibleElements=V,e.getVisibleElements=q,e.roundToDivide=z,e.getPageSizeInches=H,e.approximateFraction=B,e.getOutputScale=D,e.scrollIntoView=j,e.watchScroll=I,e.binarySearchFirstItem=F,e.normalizeWheelEventDirection=G,e.normalizeWheelEventDelta=Y,e.waitOnEventOrTimeout=tt,e.moveToEndOfArray=ot,e.WaitOnType=e.animationStarted=e.ProgressBar=e.EventBus=e.NullL10n=e.SpreadMode=e.ScrollMode=e.TextLayerMode=e.RendererType=e.PresentationModeState=e.VERTICAL_PADDING=e.SCROLLBAR_PADDING=e.MAX_AUTO_SCALE=e.UNKNOWN_SCALE=e.MAX_SCALE=e.MIN_SCALE=e.DEFAULT_SCALE=e.DEFAULT_SCALE_VALUE=e.CSS_UNITS=e.AutoPrintRegExp=void 0;var r=i(n(4));function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}function l(t){return l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function c(t,e){return f(t)||p(t,e)||d(t,e)||u()}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(t,e){if(t){if("string"===typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function p(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(l){i=!0,o=l}finally{try{r||null==s["return"]||s["return"]()}finally{if(i)throw o}}return n}}function f(t){if(Array.isArray(t))return t}function g(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function m(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){g(o,r,i,a,s,"next",t)}function s(t){g(o,r,i,a,s,"throw",t)}a(void 0)}))}}var v=96/72;e.CSS_UNITS=v;var b="auto";e.DEFAULT_SCALE_VALUE=b;var y=1;e.DEFAULT_SCALE=y;var w=.1;e.MIN_SCALE=w;var x=10;e.MAX_SCALE=x;var C=0;e.UNKNOWN_SCALE=C;var k=1.25;e.MAX_AUTO_SCALE=k;var A=40;e.SCROLLBAR_PADDING=A;var S=5;e.VERTICAL_PADDING=S;var E={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};e.PresentationModeState=E;var O={CANVAS:"canvas",SVG:"svg"};e.RendererType=O;var T={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};e.TextLayerMode=T;var _={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2};e.ScrollMode=_;var M={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};e.SpreadMode=M;var N=/\bprint\s*\(/;function P(t,e){return e?t.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(t,n){return n in e?e[n]:"{{"+n+"}}"})):t}e.AutoPrintRegExp=N;var L={getLanguage:function(){return m(r["default"].mark((function t(){return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return","en-us");case 1:case"end":return t.stop()}}),t)})))()},getDirection:function(){return m(r["default"].mark((function t(){return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return","ltr");case 1:case"end":return t.stop()}}),t)})))()},get:function(t,e,n){return m(r["default"].mark((function t(){return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",P(n,e));case 1:case"end":return t.stop()}}),t)})))()},translate:function(t){return m(r["default"].mark((function t(){return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))()}};function D(t){var e=window.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1,r=e/n;return{sx:r,sy:r,scaled:1!==r}}function j(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.offsetParent;if(r){var i=t.offsetTop+t.clientTop,o=t.offsetLeft+t.clientLeft;while(r.clientHeight===r.scrollHeight&&r.clientWidth===r.scrollWidth||n&&"hidden"===getComputedStyle(r).overflow)if(r.dataset._scaleY&&(i/=r.dataset._scaleY,o/=r.dataset._scaleX),i+=r.offsetTop,o+=r.offsetLeft,r=r.offsetParent,!r)return;e&&(void 0!==e.top&&(i+=e.top),void 0!==e.left&&(o+=e.left,r.scrollLeft=o)),r.scrollTop=i}else console.error("offsetParent is not set -- cannot scroll")}function I(t,e){var n=function(n){i||(i=window.requestAnimationFrame((function(){i=null;var n=t.scrollLeft,o=r.lastX;n!==o&&(r.right=n>o),r.lastX=n;var a=t.scrollTop,s=r.lastY;a!==s&&(r.down=a>s),r.lastY=a,e(r)})))},r={right:!0,down:!0,lastX:t.scrollLeft,lastY:t.scrollTop,_eventHandler:n},i=null;return t.addEventListener("scroll",n,!0),r}function R(t){for(var e=t.split("&"),n=Object.create(null),r=0,i=e.length;r<i;++r){var o=e[r].split("="),a=o[0].toLowerCase(),s=o.length>1?o[1]:null;n[decodeURIComponent(a)]=decodeURIComponent(s)}return n}function F(t,e){var n=0,r=t.length-1;if(r<0||!e(t[r]))return t.length;if(e(t[n]))return n;while(n<r){var i=n+r>>1,o=t[i];e(o)?r=i:n=i+1}return n}function B(t){if(Math.floor(t)===t)return[t,1];var e=1/t,n=8;if(e>n)return[1,n];if(Math.floor(e)===e)return[1,e];var r,i=t>1?e:t,o=0,a=1,s=1,l=1;while(1){var c=o+s,u=a+l;if(u>n)break;i<=c/u?(s=c,l=u):(o=c,a=u)}return r=i-o/a<s/l-i?i===t?[o,a]:[a,o]:i===t?[s,l]:[l,s],r}function z(t,e){var n=t%e;return 0===n?t:Math.round(t-n+e)}function H(t){var e=t.view,n=t.userUnit,r=t.rotate,i=c(e,4),o=i[0],a=i[1],s=i[2],l=i[3],u=r%180!==0,d=(s-o)/72*n,h=(l-a)/72*n;return{width:u?h:d,height:u?d:h}}function V(t,e,n){if(t<2)return t;var r=e[t].div,i=r.offsetTop+r.clientTop;i>=n&&(r=e[t-1].div,i=r.offsetTop+r.clientTop);for(var o=t-2;o>=0;--o){if(r=e[o].div,r.offsetTop+r.clientTop+r.clientHeight<=i)break;t=o}return t}function q(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=t.scrollTop,o=i+t.clientHeight,a=t.scrollLeft,s=a+t.clientWidth;function l(t){var e=t.div,n=e.offsetTop+e.clientTop+e.clientHeight;return n>i}function c(t){var e=t.div,n=e.offsetLeft+e.clientLeft+e.clientWidth;return n>a}var u=[],d=e.length,h=0===d?0:F(e,r?c:l);h>0&&h<d&&!r&&(h=V(h,e,i));for(var p=r?s:-1,f=h;f<d;f++){var g=e[f],m=g.div,v=m.offsetLeft+m.clientLeft,b=m.offsetTop+m.clientTop,y=m.clientWidth,w=m.clientHeight,x=v+y,C=b+w;if(-1===p)C>=o&&(p=C);else if((r?v:b)>p)break;if(!(C<=i||b>=o||x<=a||v>=s)){var k=Math.max(0,i-b)+Math.max(0,C-o),A=Math.max(0,a-v)+Math.max(0,x-s),S=(w-k)*(y-A)*100/w/y|0;u.push({id:g.id,x:v,y:b,view:g,percent:S})}}var E=u[0],O=u[u.length-1];return n&&u.sort((function(t,e){var n=t.percent-e.percent;return Math.abs(n)>.001?-n:t.id-e.id})),{first:E,last:O,views:u}}function U(t){t.preventDefault()}function W(t){var e=0,n=t.length;while(e<n&&""===t[e].trim())e++;return"data:"===t.substring(e,e+5).toLowerCase()}function $(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(W(t))return console.warn('getPDFFileNameFromURL: ignoring "data:" URL for performance reasons.'),e;var n=/^(?:(?:[^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=n.exec(t),o=r.exec(i[1])||r.exec(i[2])||r.exec(i[3]);if(o&&(o=o[0],o.includes("%")))try{o=r.exec(decodeURIComponent(o))[0]}catch(a){}return o||e}function G(t){var e=Math.sqrt(t.deltaX*t.deltaX+t.deltaY*t.deltaY),n=Math.atan2(t.deltaY,t.deltaX);return-.25*Math.PI<n&&n<.75*Math.PI&&(e=-e),e}function Y(t){var e=G(t),n=0,r=1,i=30,o=30;return t.deltaMode===n?e/=i*o:t.deltaMode===r&&(e/=o),e}function X(t){return Number.isInteger(t)&&t%90===0}function K(t){return Number.isInteger(t)&&Object.values(_).includes(t)&&t!==_.UNKNOWN}function Z(t){return Number.isInteger(t)&&Object.values(M).includes(t)&&t!==M.UNKNOWN}function J(t){return t.width<=t.height}e.NullL10n=L;var Q={EVENT:"event",TIMEOUT:"timeout"};function tt(t){var e=t.target,n=t.name,r=t.delay,i=void 0===r?0:r;return new Promise((function(t,r){if("object"!==l(e)||!n||"string"!==typeof n||!(Number.isInteger(i)&&i>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function o(r){e instanceof nt?e._off(n,a):e.removeEventListener(n,a),c&&clearTimeout(c),t(r)}var a=o.bind(null,Q.EVENT);e instanceof nt?e._on(n,a):e.addEventListener(n,a);var s=o.bind(null,Q.TIMEOUT),c=setTimeout(s,i)}))}e.WaitOnType=Q;var et=new Promise((function(t){window.requestAnimationFrame(t)}));e.animationStarted=et;var nt=function(){function t(e){o(this,t),this._listeners=Object.create(null)}return s(t,[{key:"on",value:function(t,e){this._on(t,e,{external:!0})}},{key:"off",value:function(t,e){this._off(t,e,{external:!0})}},{key:"dispatch",value:function(t){var e=this._listeners[t];if(e&&0!==e.length){var n,r=Array.prototype.slice.call(arguments,1);e.slice(0).forEach((function(t){var e=t.listener,i=t.external;if(i)return n||(n=[]),void n.push(e);e.apply(null,r)})),n&&(n.forEach((function(t){t.apply(null,r)})),n=null)}}},{key:"_on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this._listeners[t];r||(this._listeners[t]=r=[]),r.push({listener:e,external:!0===(n&&n.external)})}},{key:"_off",value:function(t,e){var n=this._listeners[t];if(n)for(var r=0,i=n.length;r<i;r++)if(n[r].listener===e)return void n.splice(r,1)}}]),t}();function rt(t,e,n){return Math.min(Math.max(t,e),n)}e.EventBus=nt;var it=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.height,i=n.width,a=n.units;o(this,t),this.visible=!0,this.div=document.querySelector(e+" .progress"),this.bar=this.div.parentNode,this.height=r||100,this.width=i||100,this.units=a||"%",this.div.style.height=this.height+this.units,this.percent=0}return s(t,[{key:"_updateBar",value:function(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");var t=this.width*this._percent/100;this.div.style.width=t+this.units}},{key:"setWidth",value:function(t){if(t){var e=t.parentNode,n=e.offsetWidth-t.offsetWidth;n>0&&(this.bar.style.width="calc(100% - ".concat(n,"px)"))}}},{key:"hide",value:function(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"),document.body.classList.remove("loadingInProgress"))}},{key:"show",value:function(){this.visible||(this.visible=!0,document.body.classList.add("loadingInProgress"),this.bar.classList.remove("hidden"))}},{key:"percent",get:function(){return this._percent},set:function(t){this._indeterminate=isNaN(t),this._percent=rt(t,0,100),this._updateBar()}}]),t}();function ot(t,e){for(var n=[],r=t.length,i=0,o=0;o<r;++o)e(t[o])?n.push(t[o]):(t[i]=t[o],++i);for(var a=0;i<r;++a,++i)t[i]=n[a]}e.ProgressBar=it},function(t,e,n){"use strict";t.exports=n(5)},function(t,e,n){"use strict";(function(t){function e(t){return e="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var n=function(t){var n,r=Object.prototype,i=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(L){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),a=new M(r||[]);return o._invoke=E(t,n,a),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(L){return{type:"throw",arg:L}}}t.wrap=u;var h="suspendedStart",p="suspendedYield",f="executing",g="completed",m={};function v(){}function b(){}function y(){}var w={};w[a]=function(){return this};var x=Object.getPrototypeOf,C=x&&x(x(N([])));C&&C!==r&&i.call(C,a)&&(w=C);var k=y.prototype=v.prototype=Object.create(w);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,n){function r(o,a,s,l){var c=d(t[o],t,a);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"===e(h)&&i.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,s,l)}),(function(t){r("throw",t,s,l)})):n.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,l)}))}l(c.arg)}var o;function a(t,e){function i(){return new n((function(n,i){r(t,e,n,i)}))}return o=o?o.then(i,i):i()}this._invoke=a}function E(t,e,n){var r=h;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw o;return P()}n.method=i,n.arg=o;while(1){var a=n.delegate;if(a){var s=O(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=d(t,e,n);if("normal"===l.type){if(r=n.done?g:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=g,n.method="throw",n.arg=l.arg)}}}function O(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator["return"]&&(e.method="return",e.arg=n,O(t,e),"throw"===e.method))return m;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=d(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,m):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function N(t){if(t){var e=t[a];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){while(++r<t.length)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:n,done:!0}}return b.prototype=k.constructor=y,y.constructor=b,b.displayName=c(y,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},A(S.prototype),S.prototype[s]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(k),c(k,l,"Generator"),k[a]=function(){return this},k.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){while(e.length){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=N,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,i){return s.type="throw",s.arg=t,e.next=r,i&&(e.method="next",e.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),m}},t}("object"===e(t)?t.exports:{});try{regeneratorRuntime=n}catch(r){Function("r","regeneratorRuntime = r")(n)}}).call(this,n(6)(t))},function(t,e,n){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleLinkService=e.PDFLinkService=void 0;var r=n(3);function i(t){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}var l=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.eventBus,r=e.externalLinkTarget,i=void 0===r?null:r,a=e.externalLinkRel,s=void 0===a?null:a,l=e.externalLinkEnabled,c=void 0===l||l,u=e.ignoreDestinationZoom,d=void 0!==u&&u;o(this,t),this.eventBus=n,this.externalLinkTarget=i,this.externalLinkRel=s,this.externalLinkEnabled=c,this._ignoreDestinationZoom=d,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null,this._pagesRefCache=null}return s(t,[{key:"setDocument",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.baseUrl=e,this.pdfDocument=t,this._pagesRefCache=Object.create(null)}},{key:"setViewer",value:function(t){this.pdfViewer=t}},{key:"setHistory",value:function(t){this.pdfHistory=t}},{key:"navigateTo",value:function(t){var e=this,n=function n(r){var i,o=r.namedDest,a=r.explicitDest,s=a[0];if(s instanceof Object){if(i=e._cachedPageNumber(s),null===i)return void e.pdfDocument.getPageIndex(s).then((function(t){e.cachePageRef(t+1,s),n({namedDest:o,explicitDest:a})}))["catch"]((function(){console.error('PDFLinkService.navigateTo: "'.concat(s,'" is not ')+'a valid page reference, for dest="'.concat(t,'".'))}))}else{if(!Number.isInteger(s))return void console.error('PDFLinkService.navigateTo: "'.concat(s,'" is not ')+'a valid destination reference, for dest="'.concat(t,'".'));i=s+1}!i||i<1||i>e.pagesCount?console.error('PDFLinkService.navigateTo: "'.concat(i,'" is not ')+'a valid page number, for dest="'.concat(t,'".')):(e.pdfHistory&&(e.pdfHistory.pushCurrentPosition(),e.pdfHistory.push({namedDest:o,explicitDest:a,pageNumber:i})),e.pdfViewer.scrollPageIntoView({pageNumber:i,destArray:a,ignoreDestinationZoom:e._ignoreDestinationZoom}))};new Promise((function(n,r){"string"!==typeof t?n({namedDest:"",explicitDest:t}):e.pdfDocument.getDestination(t).then((function(e){n({namedDest:t,explicitDest:e})}))})).then((function(e){Array.isArray(e.explicitDest)?n(e):console.error('PDFLinkService.navigateTo: "'.concat(e.explicitDest,'" is')+' not a valid destination array, for dest="'.concat(t,'".'))}))}},{key:"getDestinationHash",value:function(t){if("string"===typeof t)return this.getAnchorUrl("#"+escape(t));if(Array.isArray(t)){var e=JSON.stringify(t);return this.getAnchorUrl("#"+escape(e))}return this.getAnchorUrl("")}},{key:"getAnchorUrl",value:function(t){return(this.baseUrl||"")+t}},{key:"setHash",value:function(t){var e,n;if(t.includes("=")){var i=(0,r.parseQueryString)(t);if("search"in i&&this.eventBus.dispatch("findfromurlhash",{source:this,query:i.search.replace(/"/g,""),phraseSearch:"true"===i.phrase}),"page"in i&&(e=0|i.page||1),"zoom"in i){var o=i.zoom.split(","),a=o[0],s=parseFloat(a);a.includes("Fit")?"Fit"===a||"FitB"===a?n=[null,{name:a}]:"FitH"===a||"FitBH"===a||"FitV"===a||"FitBV"===a?n=[null,{name:a},o.length>1?0|o[1]:null]:"FitR"===a?5!==o.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):n=[null,{name:a},0|o[1],0|o[2],0|o[3],0|o[4]]:console.error('PDFLinkService.setHash: "'.concat(a,'" is not ')+"a valid zoom value."):n=[null,{name:"XYZ"},o.length>1?0|o[1]:null,o.length>2?0|o[2]:null,s?s/100:a]}n?this.pdfViewer.scrollPageIntoView({pageNumber:e||this.page,destArray:n,allowNegativeOffset:!0}):e&&(this.page=e),"pagemode"in i&&this.eventBus.dispatch("pagemode",{source:this,mode:i.pagemode}),"nameddest"in i&&this.navigateTo(i.nameddest)}else{n=unescape(t);try{n=JSON.parse(n),Array.isArray(n)||(n=n.toString())}catch(l){}if("string"===typeof n||c(n))return void this.navigateTo(n);console.error('PDFLinkService.setHash: "'.concat(unescape(t),'" is not ')+"a valid destination.")}}},{key:"executeNamedAction",value:function(t){switch(t){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.forward();break;case"NextPage":this.page<this.pagesCount&&this.page++;break;case"PrevPage":this.page>1&&this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break;default:break}this.eventBus.dispatch("namedaction",{source:this,action:t})}},{key:"cachePageRef",value:function(t,e){if(e){var n=0===e.gen?"".concat(e.num,"R"):"".concat(e.num,"R").concat(e.gen);this._pagesRefCache[n]=t}}},{key:"_cachedPageNumber",value:function(t){var e=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return this._pagesRefCache&&this._pagesRefCache[e]||null}},{key:"isPageVisible",value:function(t){return this.pdfViewer.isPageVisible(t)}},{key:"pagesCount",get:function(){return this.pdfDocument?this.pdfDocument.numPages:0}},{key:"page",get:function(){return this.pdfViewer.currentPageNumber},set:function(t){this.pdfViewer.currentPageNumber=t}},{key:"rotation",get:function(){return this.pdfViewer.pagesRotation},set:function(t){this.pdfViewer.pagesRotation=t}}]),t}();function c(t){if(!Array.isArray(t))return!1;var e=t.length;if(e<2)return!1;var n=t[0];if(("object"!==i(n)||!Number.isInteger(n.num)||!Number.isInteger(n.gen))&&!(Number.isInteger(n)&&n>=0))return!1;var r=t[1];if("object"!==i(r)||"string"!==typeof r.name)return!1;var o=!0;switch(r.name){case"XYZ":if(5!==e)return!1;break;case"Fit":case"FitB":return 2===e;case"FitH":case"FitBH":case"FitV":case"FitBV":if(3!==e)return!1;break;case"FitR":if(6!==e)return!1;o=!1;break;default:return!1}for(var a=2;a<e;a++){var s=t[a];if(!("number"===typeof s||o&&null===s))return!1}return!0}e.PDFLinkService=l;var u=function(){function t(){o(this,t),this.externalLinkTarget=null,this.externalLinkRel=null,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=!1}return s(t,[{key:"navigateTo",value:function(t){}},{key:"getDestinationHash",value:function(t){return"#"}},{key:"getAnchorUrl",value:function(t){return"#"}},{key:"setHash",value:function(t){}},{key:"executeNamedAction",value:function(t){}},{key:"cachePageRef",value:function(t,e){}},{key:"isPageVisible",value:function(t){return!0}},{key:"pagesCount",get:function(){return 0}},{key:"page",get:function(){return 0},set:function(t){}},{key:"rotation",get:function(){return 0},set:function(t){}}]),t}();e.SimpleLinkService=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultTextLayerFactory=e.TextLayerBuilder=void 0;var r=n(2);function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}var s=300,l=function(){function t(e){var n=e.textLayerDiv,r=e.eventBus,o=e.pageIndex,a=e.viewport,s=e.findController,l=void 0===s?null:s,c=e.enhanceTextSelection,u=void 0!==c&&c;i(this,t),this.textLayerDiv=n,this.eventBus=r,this.textContent=null,this.textContentItemsStr=[],this.textContentStream=null,this.renderingDone=!1,this.pageIdx=o,this.pageNumber=this.pageIdx+1,this.matches=[],this.viewport=a,this.textDivs=[],this.findController=l,this.textLayerRenderTask=null,this.enhanceTextSelection=u,this._onUpdateTextLayerMatches=null,this._bindMouse()}return a(t,[{key:"_finishRendering",value:function(){if(this.renderingDone=!0,!this.enhanceTextSelection){var t=document.createElement("div");t.className="endOfContent",this.textLayerDiv.appendChild(t)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}},{key:"render",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if((this.textContent||this.textContentStream)&&!this.renderingDone){this.cancel(),this.textDivs=[];var n=document.createDocumentFragment();this.textLayerRenderTask=(0,r.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:n,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:e,enhanceTextSelection:this.enhanceTextSelection}),this.textLayerRenderTask.promise.then((function(){t.textLayerDiv.appendChild(n),t._finishRendering(),t._updateMatches()}),(function(t){})),this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=function(e){e.pageIndex!==t.pageIdx&&-1!==e.pageIndex||t._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches))}}},{key:"cancel",value:function(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null)}},{key:"setTextContentStream",value:function(t){this.cancel(),this.textContentStream=t}},{key:"setTextContent",value:function(t){this.cancel(),this.textContent=t}},{key:"_convertMatches",value:function(t,e){if(!t)return[];for(var n=this.findController,r=this.textContentItemsStr,i=0,o=0,a=r.length-1,s=n.state.query.length,l=[],c=0,u=t.length;c<u;c++){var d=t[c];while(i!==a&&d>=o+r[i].length)o+=r[i].length,i++;i===r.length&&console.error("Could not find a matching mapping");var h={begin:{divIdx:i,offset:d-o}};d+=e?e[c]:s;while(i!==a&&d>o+r[i].length)o+=r[i].length,i++;h.end={divIdx:i,offset:d-o},l.push(h)}return l}},{key:"_renderMatches",value:function(t){if(0!==t.length){var e=this.findController,n=this.pageIdx,r=this.textContentItemsStr,i=this.textDivs,o=n===e.selected.pageIdx,a=e.selected.matchIdx,s=e.state.highlightAll,l=null,c={divIdx:-1,offset:void 0},u=a,d=u+1;if(s)u=0,d=t.length;else if(!o)return;for(var h=u;h<d;h++){var p=t[h],f=p.begin,g=p.end,m=o&&h===a,v=m?" selected":"";if(m&&e.scrollMatchIntoView({element:i[f.divIdx],pageIndex:n,matchIndex:a}),l&&f.divIdx===l.divIdx?x(l.divIdx,l.offset,f.offset):(null!==l&&x(l.divIdx,l.offset,c.offset),w(f)),f.divIdx===g.divIdx)x(f.divIdx,f.offset,g.offset,"highlight"+v);else{x(f.divIdx,f.offset,c.offset,"highlight begin"+v);for(var b=f.divIdx+1,y=g.divIdx;b<y;b++)i[b].className="highlight middle"+v;w(g,"highlight end"+v)}l=g}l&&x(l.divIdx,l.offset,c.offset)}function w(t,e){var n=t.divIdx;i[n].textContent="",x(n,0,t.offset,e)}function x(t,e,n,o){var a=i[t],s=r[t].substring(e,n),l=document.createTextNode(s);if(o){var c=document.createElement("span");return c.className=o,c.appendChild(l),void a.appendChild(c)}a.appendChild(l)}}},{key:"_updateMatches",value:function(){if(this.renderingDone){for(var t=this.findController,e=this.matches,n=this.pageIdx,r=this.textContentItemsStr,i=this.textDivs,o=-1,a=0,s=e.length;a<s;a++){for(var l=e[a],c=Math.max(o,l.begin.divIdx),u=c,d=l.end.divIdx;u<=d;u++){var h=i[u];h.textContent=r[u],h.className=""}o=l.end.divIdx+1}if(t&&t.highlightMatches){var p=t.pageMatches[n]||null,f=t.pageMatchesLength[n]||null;this.matches=this._convertMatches(p,f),this._renderMatches(this.matches)}}}},{key:"_bindMouse",value:function(){var t=this,e=this.textLayerDiv,n=null;e.addEventListener("mousedown",(function(r){if(t.enhanceTextSelection&&t.textLayerRenderTask)return t.textLayerRenderTask.expandTextDivs(!0),void(n&&(clearTimeout(n),n=null));var i=e.querySelector(".endOfContent");if(i){var o=r.target!==e;if(o=o&&"none"!==window.getComputedStyle(i).getPropertyValue("-moz-user-select"),o){var a=e.getBoundingClientRect(),s=Math.max(0,(r.pageY-a.top)/a.height);i.style.top=(100*s).toFixed(2)+"%"}i.classList.add("active")}})),e.addEventListener("mouseup",(function(){if(t.enhanceTextSelection&&t.textLayerRenderTask)n=setTimeout((function(){t.textLayerRenderTask&&t.textLayerRenderTask.expandTextDivs(!1),n=null}),s);else{var r=e.querySelector(".endOfContent");r&&(r.style.top="",r.classList.remove("active"))}}))}}]),t}();e.TextLayerBuilder=l;var c=function(){function t(){i(this,t)}return a(t,[{key:"createTextLayerBuilder",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;return new l({textLayerDiv:t,pageIndex:e,viewport:n,enhanceTextSelection:r,eventBus:i})}}]),t}();e.DefaultTextLayerFactory=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadManager=void 0;var r=n(2),i=n(10);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}function l(t,e){var n=document.createElement("a");if(!n.click)throw new Error('DownloadManager: "a.click()" is not supported.');n.href=t,n.target="_parent","download"in n&&(n.download=e),(document.body||document.documentElement).appendChild(n),n.click(),n.remove()}var c=function(){function t(){o(this,t)}return s(t,[{key:"downloadUrl",value:function(t,e){(0,r.createValidAbsoluteUrl)(t,"http://example.com")&&l(t+"#pdfjs.action=download",e)}},{key:"downloadData",value:function(t,e,n){if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:n}),e);else{var o=(0,r.createObjectURL)(t,n,i.viewerCompatibilityParams.disableCreateObjectURL);l(o,e)}}},{key:"download",value:function(t,e,n){if(navigator.msSaveBlob)navigator.msSaveBlob(t,n)||this.downloadUrl(e,n);else if(i.viewerCompatibilityParams.disableCreateObjectURL)this.downloadUrl(e,n);else{var r=URL.createObjectURL(t);l(r,n)}}}]),t}();e.DownloadManager=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.viewerCompatibilityParams=void 0;var r=Object.create(null),i="undefined"!==typeof navigator&&navigator.userAgent||"",o="undefined"!==typeof navigator&&navigator.platform||"",a="undefined"!==typeof navigator&&navigator.maxTouchPoints||1,s=/Android/.test(i),l=/Trident/.test(i),c=/\b(iPad|iPhone|iPod)(?=;)/.test(i)||"MacIntel"===o&&a>1,u=/CriOS/.test(i);(function(){(l||u)&&(r.disableCreateObjectURL=!0)})(),function(){(c||s)&&(r.maxCanvasPixels=5242880)}();var d=Object.freeze(r);e.viewerCompatibilityParams=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GenericL10n=void 0;var r=i(n(4));function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function s(t){o(a,r,i,s,l,"next",t)}function l(t){o(a,r,i,s,l,"throw",t)}s(void 0)}))}}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e,n){return e&&l(t.prototype,e),n&&l(t,n),t}n(12);var u=document.webL10n,d=function(){function t(e){s(this,t),this._lang=e,this._ready=new Promise((function(t,n){u.setLanguage(e,(function(){t(u)}))}))}return c(t,[{key:"getLanguage",value:function(){var t=a(r["default"].mark((function t(){var e;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this._ready;case 2:return e=t.sent,t.abrupt("return",e.getLanguage());case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"getDirection",value:function(){var t=a(r["default"].mark((function t(){var e;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this._ready;case 2:return e=t.sent,t.abrupt("return",e.getDirection());case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"get",value:function(){var t=a(r["default"].mark((function t(e,n,i){var o;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this._ready;case 2:return o=t.sent,t.abrupt("return",o.get(e,n,i));case 4:case"end":return t.stop()}}),t,this)})));function e(e,n,r){return t.apply(this,arguments)}return e}()},{key:"translate",value:function(){var t=a(r["default"].mark((function t(e){var n;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this._ready;case 2:return n=t.sent,t.abrupt("return",n.translate(e));case 4:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()}]),t}();e.GenericL10n=d},function(t,e,n){"use strict";document.webL10n=function(t,e,n){var r={},i="",o="textContent",a="",s={},l="loading",c=!0;function u(){return e.querySelectorAll('link[type="application/l10n"]')}function d(){var t=e.querySelector('script[type="application/l10n"]');return t?JSON.parse(t.innerHTML):null}function h(t){return t?t.querySelectorAll("*[data-l10n-id]"):[]}function p(t){if(!t)return{};var e=t.getAttribute("data-l10n-id"),n=t.getAttribute("data-l10n-args"),r={};if(n)try{r=JSON.parse(n)}catch(i){console.warn("could not parse arguments for #"+e)}return{id:e,args:r}}function f(t,e,n){e=e||function(t){},n=n||function(){};var r=new XMLHttpRequest;r.open("GET",t,c),r.overrideMimeType&&r.overrideMimeType("text/plain; charset=utf-8"),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0===r.status?e(r.responseText):n())},r.onerror=n,r.ontimeout=n;try{r.send(null)}catch(i){n()}}function g(t,e,n,a){var s=t.replace(/[^\/]*$/,"")||"./";function l(t){return t.lastIndexOf("\\")<0?t:t.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}function c(t,n){var r={},i=/^\s*|\s*$/,o=/^\s*#|^\s*$/,a=/^\s*\[(.*)\]\s*$/,c=/^\s*@import\s+url\((.*)\)\s*$/i,u=/^([^=\s]*)\s*=\s*(.+)$/;function d(t,n,d){var p=t.replace(i,"").split(/[\r\n]+/),f="*",g=e.split("-",1)[0],m=!1,v="";function b(){while(1){if(!p.length)return void d();var t=p.shift();if(!o.test(t)){if(n){if(v=a.exec(t),v){f=v[1].toLowerCase(),m="*"!==f&&f!==e&&f!==g;continue}if(m)continue;if(v=c.exec(t),v)return void h(s+v[1],b)}var i=t.match(u);i&&3==i.length&&(r[i[1]]=l(i[2]))}}}b()}function h(t,e){f(t,(function(t){d(t,!1,e)}),(function(){console.warn(t+" not found."),e()}))}d(t,!0,(function(){n(r)}))}f(t,(function(t){i+=t,c(t,(function(t){for(var e in t){var i,a,s=e.lastIndexOf(".");s>0?(i=e.substring(0,s),a=e.substring(s+1)):(i=e,a=o),r[i]||(r[i]={}),r[i][a]=t[e]}n&&n()}))}),a)}function m(t,e){t&&(t=t.toLowerCase()),e=e||function(){},v(),a=t;var n=u(),i=n.length;if(0!==i){var o=null,s=0;o=function(){s++,s>=i&&(e(),l="complete")};for(var c=0;c<i;c++){var h=new b(n[c]);h.load(t,o)}}else{var p=d();if(p&&p.locales&&p.default_locale){if(console.log("using the embedded JSON directory, early way out"),r=p.locales[t],!r){var f=p.default_locale.toLowerCase();for(var m in p.locales){if(m=m.toLowerCase(),m===t){r=p.locales[t];break}m===f&&(r=p.locales[f])}}e()}else console.log("no resource to load, early way out");l="complete"}function b(t){var e=t.href;this.load=function(t,n){g(e,t,n,(function(){console.warn(e+" not found."),console.warn('"'+t+'" resource not found'),a="",n()}))}}}function v(){r={},i="",a=""}function b(t){var e={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3};function n(t,e){return-1!==e.indexOf(t)}function r(t,e,n){return e<=t&&t<=n}var i={0:function(t){return"other"},1:function(t){return r(t%100,3,10)?"few":0===t?"zero":r(t%100,11,99)?"many":2==t?"two":1==t?"one":"other"},2:function(t){return 0!==t&&t%10===0?"many":2==t?"two":1==t?"one":"other"},3:function(t){return 1==t?"one":"other"},4:function(t){return r(t,0,1)?"one":"other"},5:function(t){return r(t,0,2)&&2!=t?"one":"other"},6:function(t){return 0===t?"zero":t%10==1&&t%100!=11?"one":"other"},7:function(t){return 2==t?"two":1==t?"one":"other"},8:function(t){return r(t,3,6)?"few":r(t,7,10)?"many":2==t?"two":1==t?"one":"other"},9:function(t){return 0===t||1!=t&&r(t%100,1,19)?"few":1==t?"one":"other"},10:function(t){return r(t%10,2,9)&&!r(t%100,11,19)?"few":t%10!=1||r(t%100,11,19)?"other":"one"},11:function(t){return r(t%10,2,4)&&!r(t%100,12,14)?"few":t%10===0||r(t%10,5,9)||r(t%100,11,14)?"many":t%10==1&&t%100!=11?"one":"other"},12:function(t){return r(t,2,4)?"few":1==t?"one":"other"},13:function(t){return r(t%10,2,4)&&!r(t%100,12,14)?"few":1!=t&&r(t%10,0,1)||r(t%10,5,9)||r(t%100,12,14)?"many":1==t?"one":"other"},14:function(t){return r(t%100,3,4)?"few":t%100==2?"two":t%100==1?"one":"other"},15:function(t){return 0===t||r(t%100,2,10)?"few":r(t%100,11,19)?"many":1==t?"one":"other"},16:function(t){return t%10==1&&11!=t?"one":"other"},17:function(t){return 3==t?"few":0===t?"zero":6==t?"many":2==t?"two":1==t?"one":"other"},18:function(t){return 0===t?"zero":r(t,0,2)&&0!==t&&2!=t?"one":"other"},19:function(t){return r(t,2,10)?"few":r(t,0,1)?"one":"other"},20:function(t){return!r(t%10,3,4)&&t%10!=9||r(t%100,10,19)||r(t%100,70,79)||r(t%100,90,99)?t%1e6===0&&0!==t?"many":t%10!=2||n(t%100,[12,72,92])?t%10!=1||n(t%100,[11,71,91])?"other":"one":"two":"few"},21:function(t){return 0===t?"zero":1==t?"one":"other"},22:function(t){return r(t,0,1)||r(t,11,99)?"one":"other"},23:function(t){return r(t%10,1,2)||t%20===0?"one":"other"},24:function(t){return r(t,3,10)||r(t,13,19)?"few":n(t,[2,12])?"two":n(t,[1,11])?"one":"other"}},o=e[t.replace(/-.*$/,"")];return o in i?i[o]:(console.warn("plural form unknown for ["+t+"]"),function(){return"other"})}function y(t,e,n){var i=r[t];if(!i){if(console.warn("#"+t+" is undefined."),!n)return null;i=n}var o={};for(var a in i){var s=i[a];s=w(s,e,t,a),s=x(s,e,t),o[a]=s}return o}function w(t,e,n,i){var o=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/,a=o.exec(t);if(!a||!a.length)return t;var l,c=a[1],u=a[2];if(e&&u in e?l=e[u]:u in r&&(l=r[u]),c in s){var d=s[c];t=d(t,l,n,i)}return t}function x(t,e,n){var i=/\{\{\s*(.+?)\s*\}\}/g;return t.replace(i,(function(t,i){return e&&i in e?e[i]:i in r?r[i]:(console.log("argument {{"+i+"}} for #"+n+" is undefined."),t)}))}function C(t){var n=p(t);if(n.id){var r=y(n.id,n.args);if(r){if(r[o]){if(0===k(t))t[o]=r[o];else{for(var i=t.childNodes,a=!1,s=0,l=i.length;s<l;s++)3===i[s].nodeType&&/\S/.test(i[s].nodeValue)&&(a?i[s].nodeValue="":(i[s].nodeValue=r[o],a=!0));if(!a){var c=e.createTextNode(r[o]);t.insertBefore(c,t.firstChild)}}delete r[o]}for(var u in r)t[u]=r[u]}else console.warn("#"+n.id+" is undefined.")}}function k(t){if(t.children)return t.children.length;if("undefined"!==typeof t.childElementCount)return t.childElementCount;for(var e=0,n=0;n<t.childNodes.length;n++)e+=1===t.nodeType?1:0;return e}function A(t){t=t||e.documentElement;for(var n=h(t),r=n.length,i=0;i<r;i++)C(n[i]);C(t)}return s.plural=function(t,e,n,i){var l=parseFloat(e);if(isNaN(l))return t;if(i!=o)return t;s._pluralRules||(s._pluralRules=b(a));var c="["+s._pluralRules(l)+"]";return 0===l&&n+"[zero]"in r?t=r[n+"[zero]"][i]:1==l&&n+"[one]"in r?t=r[n+"[one]"][i]:2==l&&n+"[two]"in r?t=r[n+"[two]"][i]:n+c in r?t=r[n+c][i]:n+"[other]"in r&&(t=r[n+"[other]"][i]),t},{get:function(t,e,n){var r,i=t.lastIndexOf("."),a=o;i>0&&(a=t.substring(i+1),t=t.substring(0,i)),n&&(r={},r[a]=n);var s=y(t,e,r);return s&&a in s?s[a]:"{{"+t+"}}"},getData:function(){return r},getText:function(){return i},getLanguage:function(){return a},setLanguage:function(t,e){m(t,(function(){e&&e()}))},getDirection:function(){var t=["ar","he","fa","ps","ur"],e=a.split("-",1)[0];return t.indexOf(e)>=0?"rtl":"ltr"},translate:A,getReadyState:function(){return l},ready:function(n){n&&("complete"==l||"interactive"==l?t.setTimeout((function(){n()})):e.addEventListener&&e.addEventListener("localized",(function t(){e.removeEventListener("localized",t),n()})))}}}(window,document)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFindController=e.FindState=void 0;var r=n(2),i=n(14),o=n(3);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}var c={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};e.FindState=c;var u=250,d=-50,h=-400,p={"":"'","":"'","":"'","":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},f=null;function g(t){if(!f){var e=Object.keys(p).join("");f=new RegExp("[".concat(e,"]"),"g")}return t.replace(f,(function(t){return p[t]}))}var m=function(){function t(e){var n=e.linkService,r=e.eventBus;a(this,t),this._linkService=n,this._eventBus=r,this._reset(),r._on("findbarclose",this._onFindBarClose.bind(this))}return l(t,[{key:"setDocument",value:function(t){this._pdfDocument&&this._reset(),t&&(this._pdfDocument=t,this._firstPageCapability.resolve())}},{key:"executeCommand",value:function(t,e){var n=this;if(e){var r=this._pdfDocument;(null===this._state||this._shouldDirtyMatch(t,e))&&(this._dirtyMatch=!0),this._state=e,"findhighlightallchange"!==t&&this._updateUIState(c.PENDING),this._firstPageCapability.promise.then((function(){if(n._pdfDocument&&(!r||n._pdfDocument===r)){n._extractText();var e=!n._highlightMatches,i=!!n._findTimeout;n._findTimeout&&(clearTimeout(n._findTimeout),n._findTimeout=null),"find"===t?n._findTimeout=setTimeout((function(){n._nextMatch(),n._findTimeout=null}),u):n._dirtyMatch?n._nextMatch():"findagain"===t?(n._nextMatch(),e&&n._state.highlightAll&&n._updateAllPages()):"findhighlightallchange"===t?(i?n._nextMatch():n._highlightMatches=!0,n._updateAllPages()):n._nextMatch()}}))}}},{key:"scrollMatchIntoView",value:function(t){var e=t.element,n=void 0===e?null:e,r=t.pageIndex,i=void 0===r?-1:r,a=t.matchIndex,s=void 0===a?-1:a;if(this._scrollMatches&&n&&-1!==s&&s===this._selected.matchIdx&&-1!==i&&i===this._selected.pageIdx){this._scrollMatches=!1;var l={top:d,left:h};(0,o.scrollIntoView)(n,l,!0)}}},{key:"_reset",value:function(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this._state=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=Object.create(null),this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=(0,r.createPromiseCapability)()}},{key:"_shouldDirtyMatch",value:function(t,e){if(e.query!==this._state.query)return!0;switch(t){case"findagain":var n=this._selected.pageIdx+1,r=this._linkService;return n>=1&&n<=r.pagesCount&&n!==r.page&&!r.isPageVisible(n);case"findhighlightallchange":return!1}return!0}},{key:"_prepareMatches",value:function(t,e,n){function r(e){var n=t[e],r=t[e+1];if(e<t.length-1&&n.match===r.match)return n.skipped=!0,!0;for(var i=e-1;i>=0;i--){var o=t[i];if(!o.skipped){if(o.match+o.matchLength<n.match)break;if(o.match+o.matchLength>=n.match+n.matchLength)return n.skipped=!0,!0}}return!1}t.sort((function(t,e){return t.match===e.match?t.matchLength-e.matchLength:t.match-e.match}));for(var i=0,o=t.length;i<o;i++)r(i)||(e.push(t[i].match),n.push(t[i].matchLength))}},{key:"_isEntireWord",value:function(t,e,n){if(e>0){var r=t.charCodeAt(e),o=t.charCodeAt(e-1);if((0,i.getCharacterType)(r)===(0,i.getCharacterType)(o))return!1}var a=e+n-1;if(a<t.length-1){var s=t.charCodeAt(a),l=t.charCodeAt(a+1);if((0,i.getCharacterType)(s)===(0,i.getCharacterType)(l))return!1}return!0}},{key:"_calculatePhraseMatch",value:function(t,e,n,r){var i=[],o=t.length,a=-o;while(1){if(a=n.indexOf(t,a+o),-1===a)break;r&&!this._isEntireWord(n,a,o)||i.push(a)}this._pageMatches[e]=i}},{key:"_calculateWordMatch",value:function(t,e,n,r){for(var i=[],o=t.match(/\S+/g),a=0,s=o.length;a<s;a++){var l=o[a],c=l.length,u=-c;while(1){if(u=n.indexOf(l,u+c),-1===u)break;r&&!this._isEntireWord(n,u,c)||i.push({match:u,matchLength:c,skipped:!1})}}this._pageMatchesLength[e]=[],this._pageMatches[e]=[],this._prepareMatches(i,this._pageMatches[e],this._pageMatchesLength[e])}},{key:"_calculateMatch",value:function(t){var e=this._pageContents[t],n=this._query,r=this._state,i=r.caseSensitive,o=r.entireWord,a=r.phraseSearch;if(0!==n.length){i||(e=e.toLowerCase(),n=n.toLowerCase()),a?this._calculatePhraseMatch(n,t,e,o):this._calculateWordMatch(n,t,e,o),this._state.highlightAll&&this._updatePage(t),this._resumePageIdx===t&&(this._resumePageIdx=null,this._nextPageMatch());var s=this._pageMatches[t].length;s>0&&(this._matchesCountTotal+=s,this._updateUIResultsCount())}}},{key:"_extractText",value:function(){var t=this;if(!(this._extractTextPromises.length>0))for(var e=Promise.resolve(),n=function(n,i){var o=(0,r.createPromiseCapability)();t._extractTextPromises[n]=o.promise,e=e.then((function(){return t._pdfDocument.getPage(n+1).then((function(t){return t.getTextContent({normalizeWhitespace:!0})})).then((function(e){for(var r=e.items,i=[],a=0,s=r.length;a<s;a++)i.push(r[a].str);t._pageContents[n]=g(i.join("")),o.resolve(n)}),(function(e){console.error("Unable to get text content for page ".concat(n+1),e),t._pageContents[n]="",o.resolve(n)}))}))},i=0,o=this._linkService.pagesCount;i<o;i++)n(i,o)}},{key:"_updatePage",value:function(t){this._scrollMatches&&this._selected.pageIdx===t&&(this._linkService.page=t+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:t})}},{key:"_updateAllPages",value:function(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}},{key:"_nextMatch",value:function(){var t=this,e=this._state.findPrevious,n=this._linkService.page-1,r=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=n,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this._matchesCountTotal=0,this._updateAllPages();for(var i=0;i<r;i++)!0!==this._pendingFindMatches[i]&&(this._pendingFindMatches[i]=!0,this._extractTextPromises[i].then((function(e){delete t._pendingFindMatches[e],t._calculateMatch(e)})))}if(""!==this._query){if(!this._resumePageIdx){var o=this._offset;if(this._pagesToSearch=r,null!==o.matchIdx){var a=this._pageMatches[o.pageIdx].length;if(!e&&o.matchIdx+1<a||e&&o.matchIdx>0)return o.matchIdx=e?o.matchIdx-1:o.matchIdx+1,void this._updateMatch(!0);this._advanceOffsetPage(e)}this._nextPageMatch()}}else this._updateUIState(c.FOUND)}},{key:"_matchesReady",value:function(t){var e=this._offset,n=t.length,r=this._state.findPrevious;return n?(e.matchIdx=r?n-1:0,this._updateMatch(!0),!0):(this._advanceOffsetPage(r),!!(e.wrapped&&(e.matchIdx=null,this._pagesToSearch<0))&&(this._updateMatch(!1),!0))}},{key:"_nextPageMatch",value:function(){null!==this._resumePageIdx&&console.error("There can only be one pending page.");var t=null;do{var e=this._offset.pageIdx;if(t=this._pageMatches[e],!t){this._resumePageIdx=e;break}}while(!this._matchesReady(t))}},{key:"_advanceOffsetPage",value:function(t){var e=this._offset,n=this._linkService.pagesCount;e.pageIdx=t?e.pageIdx-1:e.pageIdx+1,e.matchIdx=null,this._pagesToSearch--,(e.pageIdx>=n||e.pageIdx<0)&&(e.pageIdx=t?n-1:0,e.wrapped=!0)}},{key:"_updateMatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=c.NOT_FOUND,n=this._offset.wrapped;if(this._offset.wrapped=!1,t){var r=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,e=n?c.WRAPPED:c.FOUND,-1!==r&&r!==this._selected.pageIdx&&this._updatePage(r)}this._updateUIState(e,this._state.findPrevious),-1!==this._selected.pageIdx&&(this._scrollMatches=!0,this._updatePage(this._selected.pageIdx))}},{key:"_onFindBarClose",value:function(t){var e=this,n=this._pdfDocument;this._firstPageCapability.promise.then((function(){!e._pdfDocument||n&&e._pdfDocument!==n||(e._findTimeout&&(clearTimeout(e._findTimeout),e._findTimeout=null),e._resumePageIdx&&(e._resumePageIdx=null,e._dirtyMatch=!0),e._updateUIState(c.FOUND),e._highlightMatches=!1,e._updateAllPages())}))}},{key:"_requestMatchesCount",value:function(){var t=this._selected,e=t.pageIdx,n=t.matchIdx,r=0,i=this._matchesCountTotal;if(-1!==n){for(var o=0;o<e;o++)r+=this._pageMatches[o]&&this._pageMatches[o].length||0;r+=n+1}return(r<1||r>i)&&(r=i=0),{current:r,total:i}}},{key:"_updateUIResultsCount",value:function(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this._requestMatchesCount()})}},{key:"_updateUIState",value:function(t,e){this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:t,previous:e,matchesCount:this._requestMatchesCount(),rawQuery:this._state?this._state.query:null})}},{key:"highlightMatches",get:function(){return this._highlightMatches}},{key:"pageMatches",get:function(){return this._pageMatches}},{key:"pageMatchesLength",get:function(){return this._pageMatchesLength}},{key:"selected",get:function(){return this._selected}},{key:"state",get:function(){return this._state}},{key:"_query",get:function(){return this._state.query!==this._rawQuery&&(this._rawQuery=this._state.query,this._normalizedQuery=g(this._state.query)),this._normalizedQuery}}]),t}();e.PDFFindController=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCharacterType=f,e.CharacterType=void 0;var r={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};function i(t){return t<11904}function o(t){return 0===(65408&t)}function a(t){return t>=97&&t<=122||t>=65&&t<=90}function s(t){return t>=48&&t<=57}function l(t){return 32===t||9===t||13===t||10===t}function c(t){return t>=13312&&t<=40959||t>=63744&&t<=64255}function u(t){return t>=12448&&t<=12543}function d(t){return t>=12352&&t<=12447}function h(t){return t>=65376&&t<=65439}function p(t){return 3584===(65408&t)}function f(t){return i(t)?o(t)?l(t)?r.SPACE:a(t)||s(t)||95===t?r.ALPHA_LETTER:r.PUNCT:p(t)?r.THAI_LETTER:160===t?r.SPACE:r.ALPHA_LETTER:c(t)?r.HAN_LETTER:u(t)?r.KATAKANA_LETTER:d(t)?r.HIRAGANA_LETTER:h(t)?r.HALFWIDTH_KATAKANA_LETTER:r.ALPHA_LETTER}e.CharacterType=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isDestHashesEqual=y,e.isDestArraysEqual=w,e.PDFHistory=void 0;var r=n(3);function i(t){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){return u(t)||c(t,e)||s(t,e)||a()}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(t,e){if(t){if("string"===typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)if(n.push(a.value),e&&n.length===e)break}catch(l){i=!0,o=l}finally{try{r||null==s["return"]||s["return"]()}finally{if(i)throw o}}return n}}function u(t){if(Array.isArray(t))return t}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),t}var f=1e3,g=50,m=1e3;function v(){return document.location.hash}var b=function(){function t(e){var n=this,r=e.linkService,i=e.eventBus;d(this,t),this.linkService=r,this.eventBus=i,this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this._isViewerInPresentationMode=!1,this.eventBus._on("presentationmodechanged",(function(t){n._isViewerInPresentationMode=t.active||t.switchInProgress})),this.eventBus._on("pagesinit",(function(){n._isPagesLoaded=!1;var t=function t(e){n.eventBus._off("pagesloaded",t),n._isPagesLoaded=!!e.pagesCount};n.eventBus._on("pagesloaded",t)}))}return p(t,[{key:"initialize",value:function(t){var e=t.fingerprint,n=t.resetHistory,r=void 0!==n&&n,i=t.updateUrl,o=void 0!==i&&i;if(e&&"string"===typeof e){this._initialized&&this.reset();var a=""!==this._fingerprint&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=!0===o,this._initialized=!0,this._bindEvents();var s=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=v(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(s,!0)||r){var l=this._parseCurrentHash(!0),c=l.hash,u=l.page,d=l.rotation;return!c||a||r?void this._pushOrReplaceState(null,!0):void this._pushOrReplaceState({hash:c,page:u,rotation:d},!0)}var h=s.destination;this._updateInternalState(h,s.uid,!0),this._uid>this._maxUid&&(this._maxUid=this._uid),void 0!==h.rotation&&(this._initialRotation=h.rotation),h.dest?(this._initialBookmark=JSON.stringify(h.dest),this._destination.page=null):h.hash?this._initialBookmark=h.hash:h.page&&(this._initialBookmark="page=".concat(h.page))}else console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.')}},{key:"reset",value:function(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}},{key:"push",value:function(t){var e=this,n=t.namedDest,r=void 0===n?null:n,i=t.explicitDest,o=t.pageNumber;if(this._initialized)if(r&&"string"!==typeof r)console.error("PDFHistory.push: "+'"'.concat(r,'" is not a valid namedDest parameter.'));else if(Array.isArray(i))if(Number.isInteger(o)&&o>0&&o<=this.linkService.pagesCount||null===o&&!this._destination){var a=r||JSON.stringify(i);if(a){var s=!1;if(this._destination&&(y(this._destination.hash,a)||w(this._destination.dest,i))){if(this._destination.page)return;s=!0}this._popStateInProgress&&!s||(this._pushOrReplaceState({dest:i,hash:a,page:o,rotation:this.linkService.rotation},s),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((function(){e._popStateInProgress=!1}))))}}else console.error("PDFHistory.push: "+'"'.concat(o,'" is not a valid pageNumber parameter.'));else console.error("PDFHistory.push: "+'"'.concat(i,'" is not a valid explicitDest parameter.'))}},{key:"pushCurrentPosition",value:function(){this._initialized&&!this._popStateInProgress&&this._tryPushCurrentPosition()}},{key:"back",value:function(){if(this._initialized&&!this._popStateInProgress){var t=window.history.state;this._isValidState(t)&&t.uid>0&&window.history.back()}}},{key:"forward",value:function(){if(this._initialized&&!this._popStateInProgress){var t=window.history.state;this._isValidState(t)&&t.uid<this._maxUid&&window.history.forward()}}},{key:"_pushOrReplaceState",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=n||!this._destination,i={fingerprint:this._fingerprint,uid:r?this._uid:this._uid+1,destination:t};if(this._updateInternalState(t,i.uid),this._updateUrl&&t&&t.hash){var o=document.location.href.split("#")[0];o.startsWith("file://")||(e="".concat(o,"#").concat(t.hash))}r?window.history.replaceState(i,"",e):(this._maxUid=this._uid,window.history.pushState(i,"",e))}},{key:"_tryPushCurrentPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._position){var e=this._position;if(t&&(e=Object.assign(Object.create(null),this._position),e.temporary=!0),this._destination){if(this._destination.temporary)this._pushOrReplaceState(e,!0);else if(this._destination.hash!==e.hash&&(this._destination.page||!(g<=0||this._numPositionUpdates<=g))){var n=!1;if(this._destination.page>=e.first&&this._destination.page<=e.page){if(this._destination.dest||!this._destination.first)return;n=!0}this._pushOrReplaceState(e,n)}}else this._pushOrReplaceState(e)}}},{key:"_isValidState",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return!1;if(t.fingerprint!==this._fingerprint){if(!e)return!1;if("string"!==typeof t.fingerprint||t.fingerprint.length!==this._fingerprint.length)return!1;var n=performance.getEntriesByType("navigation"),r=o(n,1),a=r[0];if(!a||"reload"!==a.type)return!1}return!(!Number.isInteger(t.uid)||t.uid<0)&&(null!==t.destination&&"object"===i(t.destination))}},{key:"_updateInternalState",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),n&&t&&t.temporary&&delete t.temporary,this._destination=t,this._uid=e,this._numPositionUpdates=0}},{key:"_parseCurrentHash",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=unescape(v()).substring(1),n=(0,r.parseQueryString)(e),i=n.nameddest||"",o=0|n.page;return Number.isInteger(o)&&o>0&&o<=this.linkService.pagesCount&&!(t&&i.length>0)||(o=null),{hash:e,page:o,rotation:this.linkService.rotation}}},{key:"_updateViewarea",value:function(t){var e=this,n=t.location;this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:this._isViewerInPresentationMode?"page=".concat(n.pageNumber):n.pdfOpenParams.substring(1),page:this.linkService.page,first:n.pageNumber,rotation:n.rotation},this._popStateInProgress||(g>0&&this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,m>0&&(this._updateViewareaTimeout=setTimeout((function(){e._popStateInProgress||e._tryPushCurrentPosition(!0),e._updateViewareaTimeout=null}),m)))}},{key:"_popState",value:function(t){var e=this,n=t.state,i=v(),o=this._currentHash!==i;if(this._currentHash=i,n){if(this._isValidState(n)){this._popStateInProgress=!0,o&&(this._blockHashChange++,(0,r.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:f}).then((function(){e._blockHashChange--})));var a=n.destination;this._updateInternalState(a,n.uid,!0),this._uid>this._maxUid&&(this._maxUid=this._uid),(0,r.isValidRotation)(a.rotation)&&(this.linkService.rotation=a.rotation),a.dest?this.linkService.navigateTo(a.dest):a.hash?this.linkService.setHash(a.hash):a.page&&(this.linkService.page=a.page),Promise.resolve().then((function(){e._popStateInProgress=!1}))}}else{this._uid++;var s=this._parseCurrentHash(),l=s.hash,c=s.page,u=s.rotation;this._pushOrReplaceState({hash:l,page:c,rotation:u},!0)}}},{key:"_pageHide",value:function(){this._destination&&!this._destination.temporary||this._tryPushCurrentPosition()}},{key:"_bindEvents",value:function(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}},{key:"_unbindEvents",value:function(){this._boundEvents&&(this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}},{key:"popStateInProgress",get:function(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}},{key:"initialBookmark",get:function(){return this._initialized?this._initialBookmark:null}},{key:"initialRotation",get:function(){return this._initialized?this._initialRotation:null}}]),t}();function y(t,e){if("string"!==typeof t||"string"!==typeof e)return!1;if(t===e)return!0;var n=(0,r.parseQueryString)(t),i=n.nameddest;return i===e}function w(t,e){function n(t,e){if(i(t)!==i(e))return!1;if(Array.isArray(t)||Array.isArray(e))return!1;if(null!==t&&"object"===i(t)&&null!==e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var r in t)if(!n(t[r],e[r]))return!1;return!0}return t===e||Number.isNaN(t)&&Number.isNaN(e)}if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0,o=t.length;r<o;r++)if(!n(t[r],e[r]))return!1;return!0}e.PDFHistory=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFPageView=void 0;var r=l(n(4)),i=n(3),o=n(2),a=n(17),s=n(10);function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(c){return void n(c)}s.done?e(l):Promise.resolve(l).then(r,i)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){c(o,r,i,a,s,"next",t)}function s(t){c(o,r,i,a,s,"throw",t)}a(void 0)}))}}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),t}var f=s.viewerCompatibilityParams.maxCanvasPixels||16777216,g=function(){function t(e){d(this,t);var n=e.container,r=e.defaultViewport;this.id=e.id,this.renderingId="page"+this.id,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||i.DEFAULT_SCALE,this.viewport=r,this.pdfPageRotate=r.rotation,this._annotationStorage=e.annotationStorage||null,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,this.hasRestrictedScaling=!1,this.textLayerMode=Number.isInteger(e.textLayerMode)?e.textLayerMode:i.TextLayerMode.ENABLE,this.imageResourcesPath=e.imageResourcesPath||"",this.renderInteractiveForms="boolean"!==typeof e.renderInteractiveForms||e.renderInteractiveForms,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.maxCanvasPixels=e.maxCanvasPixels||f,this.eventBus=e.eventBus,this.renderingQueue=e.renderingQueue,this.textLayerFactory=e.textLayerFactory,this.annotationLayerFactory=e.annotationLayerFactory,this.renderer=e.renderer||i.RendererType.CANVAS,this.enableWebGL=e.enableWebGL||!1,this.l10n=e.l10n||i.NullL10n,this.paintTask=null,this.paintedViewportMap=new WeakMap,this.renderingState=a.RenderingStates.INITIAL,this.resume=null,this.error=null,this.annotationLayer=null,this.textLayer=null,this.zoomLayer=null;var o=document.createElement("div");o.className="page",o.style.width=Math.floor(this.viewport.width)+"px",o.style.height=Math.floor(this.viewport.height)+"px",o.setAttribute("data-page-number",this.id),this.div=o,n.appendChild(o)}return p(t,[{key:"setPdfPage",value:function(t){this.pdfPage=t,this.pdfPageRotate=t.rotate;var e=(this.rotation+this.pdfPageRotate)%360;this.viewport=t.getViewport({scale:this.scale*i.CSS_UNITS,rotation:e}),this.stats=t.stats,this.reset()}},{key:"destroy",value:function(){this.reset(),this.pdfPage&&this.pdfPage.cleanup()}},{key:"_renderAnnotationLayer",value:function(){var t=u(r["default"].mark((function t(){var e;return r["default"].wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=null,t.prev=1,t.next=4,this.annotationLayer.render(this.viewport,"display");case 4:t.next=9;break;case 6:t.prev=6,t.t0=t["catch"](1),e=t.t0;case 9:return t.prev=9,this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:e}),t.finish(9);case 12:case"end":return t.stop()}}),t,this,[[1,6,9,12]])})));function e(){return t.apply(this,arguments)}return e}()},{key:"_resetZoomLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.zoomLayer){var e=this.zoomLayer.firstChild;this.paintedViewportMap["delete"](e),e.width=0,e.height=0,t&&this.zoomLayer.remove(),this.zoomLayer=null}}},{key:"reset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.cancelRendering(e),this.renderingState=a.RenderingStates.INITIAL;var n=this.div;n.style.width=Math.floor(this.viewport.width)+"px",n.style.height=Math.floor(this.viewport.height)+"px";for(var r=n.childNodes,i=t&&this.zoomLayer||null,o=e&&this.annotationLayer&&this.annotationLayer.div||null,s=r.length-1;s>=0;s--){var l=r[s];i!==l&&o!==l&&n.removeChild(l)}n.removeAttribute("data-loaded"),o?this.annotationLayer.hide():this.annotationLayer&&(this.annotationLayer.cancel(),this.annotationLayer=null),i||(this.canvas&&(this.paintedViewportMap["delete"](this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer()),this.svg&&(this.paintedViewportMap["delete"](this.svg),delete this.svg),this.loadingIconDiv=document.createElement("div"),this.loadingIconDiv.className="loadingIcon",n.appendChild(this.loadingIconDiv)}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.scale=t||this.scale,"undefined"!==typeof e&&(this.rotation=e),n instanceof Promise&&(this._optionalContentConfigPromise=n);var r=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*i.CSS_UNITS,rotation:r}),this.svg)return this.cssTransform(this.svg,!0),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now()});var o=!1;if(this.canvas&&this.maxCanvasPixels>0){var a=this.outputScale;(Math.floor(this.viewport.width)*a.sx|0)*(Math.floor(this.viewport.height)*a.sy|0)>this.maxCanvasPixels&&(o=!0)}if(this.canvas){if(this.useOnlyCssZoom||this.hasRestrictedScaling&&o)return this.cssTransform(this.canvas,!0),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now()});this.zoomLayer||this.canvas.hasAttribute("hidden")||(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform(this.zoomLayer.firstChild),this.reset(!0,!0)}},{key:"cancelRendering",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.paintTask&&(this.paintTask.cancel(),this.paintTask=null),this.resume=null,this.textLayer&&(this.textLayer.cancel(),this.textLayer=null),!t&&this.annotationLayer&&(this.annotationLayer.cancel(),this.annotationLayer=null)}},{key:"cssTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.viewport.width,r=this.viewport.height,i=this.div;t.style.width=t.parentNode.style.width=i.style.width=Math.floor(n)+"px",t.style.height=t.parentNode.style.height=i.style.height=Math.floor(r)+"px";var o=this.viewport.rotation-this.paintedViewportMap.get(t).rotation,a=Math.abs(o),s=1,l=1;90!==a&&270!==a||(s=r/n,l=n/r);var c="rotate("+o+"deg) scale("+s+","+l+")";if(t.style.transform=c,this.textLayer){var u=this.textLayer.viewport,d=this.viewport.rotation-u.rotation,h=Math.abs(d),p=n/u.width;90!==h&&270!==h||(p=n/u.height);var f,g,m=this.textLayer.textLayerDiv;switch(h){case 0:f=g=0;break;case 90:f=0,g="-"+m.style.height;break;case 180:f="-"+m.style.width,g="-"+m.style.height;break;case 270:f="-"+m.style.width,g=0;break;default:console.error("Bad rotation value.");break}m.style.transform="rotate("+h+"deg) scale("+p+", "+p+") translate("+f+", "+g+")",m.style.transformOrigin="0% 0%"}e&&this.annotationLayer&&this._renderAnnotationLayer()}},{key:"getPagePoint",value:function(t,e){return this.viewport.convertToPdfPoint(t,e)}},{key:"draw",value:function(){var t=this;this.renderingState!==a.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());var e=this.div,n=this.pdfPage;if(!n)return this.renderingState=a.RenderingStates.FINISHED,this.loadingIconDiv&&(e.removeChild(this.loadingIconDiv),delete this.loadingIconDiv),Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=a.RenderingStates.RUNNING;var s=document.createElement("div");s.style.width=e.style.width,s.style.height=e.style.height,s.classList.add("canvasWrapper"),this.annotationLayer&&this.annotationLayer.div?e.insertBefore(s,this.annotationLayer.div):e.appendChild(s);var l=null;if(this.textLayerMode!==i.TextLayerMode.DISABLE&&this.textLayerFactory){var c=document.createElement("div");c.className="textLayer",c.style.width=s.style.width,c.style.height=s.style.height,this.annotationLayer&&this.annotationLayer.div?e.insertBefore(c,this.annotationLayer.div):e.appendChild(c),l=this.textLayerFactory.createTextLayerBuilder(c,this.id-1,this.viewport,this.textLayerMode===i.TextLayerMode.ENABLE_ENHANCE,this.eventBus)}this.textLayer=l;var d=null;this.renderingQueue&&(d=function(e){if(!t.renderingQueue.isHighestPriority(t))return t.renderingState=a.RenderingStates.PAUSED,void(t.resume=function(){t.renderingState=a.RenderingStates.RUNNING,e()});e()});var h=function(){var i=u(r["default"].mark((function i(s){return r["default"].wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(p===t.paintTask&&(t.paintTask=null),!(s instanceof o.RenderingCancelledException)){r.next=4;break}return t.error=null,r.abrupt("return");case 4:if(t.renderingState=a.RenderingStates.FINISHED,t.loadingIconDiv&&(e.removeChild(t.loadingIconDiv),delete t.loadingIconDiv),t._resetZoomLayer(!0),t.error=s,t.stats=n.stats,t.eventBus.dispatch("pagerendered",{source:t,pageNumber:t.id,cssTransform:!1,timestamp:performance.now()}),!s){r.next=12;break}throw s;case 12:case"end":return r.stop()}}),i)})));return function(t){return i.apply(this,arguments)}}(),p=this.renderer===i.RendererType.SVG?this.paintOnSvg(s):this.paintOnCanvas(s);p.onRenderContinue=d,this.paintTask=p;var f=p.promise.then((function(){return h(null).then((function(){if(l){var t=n.streamTextContent({normalizeWhitespace:!0});l.setTextContentStream(t),l.render()}}))}),(function(t){return h(t)}));return this.annotationLayerFactory&&(this.annotationLayer||(this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(e,n,this._annotationStorage,this.imageResourcesPath,this.renderInteractiveForms,this.l10n)),this._renderAnnotationLayer()),e.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),f}},{key:"paintOnCanvas",value:function(t){var e=(0,o.createPromiseCapability)(),n={promise:e.promise,onRenderContinue:function(t){t()},cancel:function(){b.cancel()}},r=this.viewport,a=document.createElement("canvas");this.l10n.get("page_canvas",{page:this.id},"Page {{page}}").then((function(t){a.setAttribute("aria-label",t)})),a.setAttribute("hidden","hidden");var s=!0,l=function(){s&&(a.removeAttribute("hidden"),s=!1)};t.appendChild(a),this.canvas=a,a.mozOpaque=!0;var c=a.getContext("2d",{alpha:!1}),u=(0,i.getOutputScale)(c);if(this.outputScale=u,this.useOnlyCssZoom){var d=r.clone({scale:i.CSS_UNITS});u.sx*=d.width/r.width,u.sy*=d.height/r.height,u.scaled=!0}if(this.maxCanvasPixels>0){var h=r.width*r.height,p=Math.sqrt(this.maxCanvasPixels/h);u.sx>p||u.sy>p?(u.sx=p,u.sy=p,u.scaled=!0,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}var f=(0,i.approximateFraction)(u.sx),g=(0,i.approximateFraction)(u.sy);a.width=(0,i.roundToDivide)(r.width*u.sx,f[0]),a.height=(0,i.roundToDivide)(r.height*u.sy,g[0]),a.style.width=(0,i.roundToDivide)(r.width,f[1])+"px",a.style.height=(0,i.roundToDivide)(r.height,g[1])+"px",this.paintedViewportMap.set(a,r);var m=u.scaled?[u.sx,0,0,u.sy,0,0]:null,v={canvasContext:c,transform:m,viewport:this.viewport,enableWebGL:this.enableWebGL,renderInteractiveForms:this.renderInteractiveForms,optionalContentConfigPromise:this._optionalContentConfigPromise},b=this.pdfPage.render(v);return b.onContinue=function(t){l(),n.onRenderContinue?n.onRenderContinue(t):t()},b.promise.then((function(){l(),e.resolve(void 0)}),(function(t){l(),e.reject(t)})),n}},{key:"paintOnSvg",value:function(t){var e=this,n=!1,r=function(){if(n)throw new o.RenderingCancelledException("Rendering cancelled, page ".concat(e.id),"svg")},s=this.pdfPage,l=this.viewport.clone({scale:i.CSS_UNITS}),c=s.getOperatorList().then((function(n){r();var i=new o.SVGGraphics(s.commonObjs,s.objs);return i.getSVG(n,l).then((function(n){r(),e.svg=n,e.paintedViewportMap.set(n,l),n.style.width=t.style.width,n.style.height=t.style.height,e.renderingState=a.RenderingStates.FINISHED,t.appendChild(n)}))}));return{promise:c,onRenderContinue:function(t){t()},cancel:function(){n=!0}}}},{key:"setPageLabel",value:function(t){this.pageLabel="string"===typeof t?t:null,null!==this.pageLabel?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}},{key:"width",get:function(){return this.viewport.width}},{key:"height",get:function(){return this.viewport.height}}]),t}();e.PDFPageView=g},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.PDFRenderingQueue=e.RenderingStates=void 0;var a=3e4,s={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};e.RenderingStates=s;var l=function(){function t(){r(this,t),this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}return o(t,[{key:"setViewer",value:function(t){this.pdfViewer=t}},{key:"setThumbnailViewer",value:function(t){this.pdfThumbnailViewer=t}},{key:"isHighestPriority",value:function(t){return this.highestPriorityPage===t.renderingId}},{key:"renderHighestPriority",value:function(t){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(t)||this.pdfThumbnailViewer&&this.isThumbnailViewEnabled&&this.pdfThumbnailViewer.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),a))}},{key:"getHighestPriority",value:function(t,e,n){var r=t.views,i=r.length;if(0===i)return null;for(var o=0;o<i;++o){var a=r[o].view;if(!this.isViewFinished(a))return a}if(n){var s=t.last.id;if(e[s]&&!this.isViewFinished(e[s]))return e[s]}else{var l=t.first.id-2;if(e[l]&&!this.isViewFinished(e[l]))return e[l]}return null}},{key:"isViewFinished",value:function(t){return t.renderingState===s.FINISHED}},{key:"renderView",value:function(t){var e=this;switch(t.renderingState){case s.FINISHED:return!1;case s.PAUSED:this.highestPriorityPage=t.renderingId,t.resume();break;case s.RUNNING:this.highestPriorityPage=t.renderingId;break;case s.INITIAL:this.highestPriorityPage=t.renderingId,t.draw()["finally"]((function(){e.renderHighestPriority()}))["catch"]((function(t){console.error('renderView: "'.concat(t,'"'))}));break}return!0}}]),t}();e.PDFRenderingQueue=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFSinglePageViewer=void 0;var r=n(19),i=n(2);function o(t){return o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function c(t,e,n){return c="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=u(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},c(t,e,n||t)}function u(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=v(t),null===t)break;return t}function d(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function p(t){var e=m();return function(){var n,r=v(t);if(e){var i=v(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f(this,n)}}function f(t,e){return!e||"object"!==o(e)&&"function"!==typeof e?g(t):e}function g(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}var b=function(t){d(n,t);var e=p(n);function n(t){var r;return a(this,n),r=e.call(this,t),r.eventBus._on("pagesinit",(function(t){r._ensurePageViewVisible()})),r}return l(n,[{key:"_resetView",value:function(){c(v(n.prototype),"_resetView",this).call(this),this._previousPageNumber=1,this._shadowViewer=document.createDocumentFragment(),this._updateScrollDown=null}},{key:"_ensurePageViewVisible",value:function(){var t=this._pages[this._currentPageNumber-1],e=this._pages[this._previousPageNumber-1],n=this.viewer.childNodes;switch(n.length){case 0:this.viewer.appendChild(t.div);break;case 1:if(n[0]!==e.div)throw new Error("_ensurePageViewVisible: Unexpected previously visible page.");if(t===e)break;this._shadowViewer.appendChild(e.div),this.viewer.appendChild(t.div),this.container.scrollTop=0;break;default:throw new Error("_ensurePageViewVisible: Only one page should be visible at a time.")}this._previousPageNumber=this._currentPageNumber}},{key:"_scrollUpdate",value:function(){this._updateScrollDown&&this._updateScrollDown(),c(v(n.prototype),"_scrollUpdate",this).call(this)}},{key:"_scrollIntoView",value:function(t){var e=this,r=t.pageDiv,i=t.pageSpot,o=void 0===i?null:i,a=t.pageNumber,s=void 0===a?null:a;s&&this._setCurrentPageNumber(s);var l=this._currentPageNumber>=this._previousPageNumber;this._ensurePageViewVisible(),this.update(),c(v(n.prototype),"_scrollIntoView",this).call(this,{pageDiv:r,pageSpot:o,pageNumber:s}),this._updateScrollDown=function(){e.scroll.down=l,e._updateScrollDown=null}}},{key:"_getVisiblePages",value:function(){return this._getCurrentVisiblePage()}},{key:"_updateHelper",value:function(t){}},{key:"_updateScrollMode",value:function(){}},{key:"_updateSpreadMode",value:function(){}},{key:"_viewerElement",get:function(){return(0,i.shadow)(this,"_viewerElement",this._shadowViewer)}},{key:"_isScrollModeHorizontal",get:function(){return(0,i.shadow)(this,"_isScrollModeHorizontal",!1)}}]),n}(r.BaseViewer);e.PDFSinglePageViewer=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseViewer=void 0;var r=n(3),i=n(17),o=n(1),a=n(2),s=n(16),l=n(7),c=n(8);function u(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=d(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}}}function d(t,e){if(t){if("string"===typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function g(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),t}var m=10;function v(t){var e=[];this.push=function(n){var r=e.indexOf(n);r>=0&&e.splice(r,1),e.push(n),e.length>t&&e.shift().destroy()},this.resize=function(n,i){if(t=n,i){for(var o=new Set,a=0,s=i.length;a<s;++a)o.add(i[a].id);(0,r.moveToEndOfArray)(e,(function(t){return o.has(t.id)}))}while(e.length>t)e.shift().destroy()}}function b(t,e){return e===t||Math.abs(e-t)<1e-15}var y=function(){function t(e){var n=this;if(p(this,t),this.constructor===t)throw new Error("Cannot initialize BaseViewer.");if(this._name=this.constructor.name,this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,!(this.container instanceof HTMLDivElement&&this.viewer instanceof HTMLDivElement))throw new Error("Invalid `container` and/or `viewer` option.");this.eventBus=e.eventBus,this.linkService=e.linkService||new l.SimpleLinkService,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,this.removePageBorders=e.removePageBorders||!1,this.textLayerMode=Number.isInteger(e.textLayerMode)?e.textLayerMode:r.TextLayerMode.ENABLE,this.imageResourcesPath=e.imageResourcesPath||"",this.renderInteractiveForms="boolean"!==typeof e.renderInteractiveForms||e.renderInteractiveForms,this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.renderer=e.renderer||r.RendererType.CANVAS,this.enableWebGL=e.enableWebGL||!1,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n||r.NullL10n,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new i.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue,this.scroll=(0,r.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=r.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),Promise.resolve().then((function(){n.eventBus.dispatch("baseviewerinit",{source:n})}))}return g(t,[{key:"getPageView",value:function(t){return this._pages[t]}},{key:"_setCurrentPageNumber",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._currentPageNumber===t?(e&&this._resetCurrentPageView(),!0):0<t&&t<=this.pagesCount&&(this._currentPageNumber=t,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:t,pageLabel:this._pageLabels&&this._pageLabels[t-1]}),e&&this._resetCurrentPageView(),!0)}},{key:"_onePageRenderedOrForceFetch",value:function(){return this.container.offsetParent&&0!==this._getVisiblePages().views.length?this._onePageRenderedCapability.promise:Promise.resolve()}},{key:"setDocument",value:function(t){var e=this;if(this.pdfDocument&&(this._cancelRendering(),this._resetView(),this.findController&&this.findController.setDocument(null)),this.pdfDocument=t,t){var n=t.numPages,i=t.getPage(1),o=t.annotationStorage,a=t.getOptionalContentConfig();this._pagesCapability.promise.then((function(){e.eventBus.dispatch("pagesloaded",{source:e,pagesCount:n})})),this._onBeforeDraw=function(t){var n=e._pages[t.pageNumber-1];n&&e._buffer.push(n)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=function(t){t.cssTransform||e._onePageRenderedCapability.settled||(e._onePageRenderedCapability.resolve(),e.eventBus._off("pagerendered",e._onAfterDraw),e._onAfterDraw=null)},this.eventBus._on("pagerendered",this._onAfterDraw),i.then((function(i){e._firstPageCapability.resolve(i),e._optionalContentConfigPromise=a;for(var l=e.currentScale,c=i.getViewport({scale:l*r.CSS_UNITS}),u=e.textLayerMode!==r.TextLayerMode.DISABLE?e:null,d=1;d<=n;++d){var h=new s.PDFPageView({container:e._viewerElement,eventBus:e.eventBus,id:d,scale:l,defaultViewport:c.clone(),annotationStorage:o,optionalContentConfigPromise:a,renderingQueue:e.renderingQueue,textLayerFactory:u,textLayerMode:e.textLayerMode,annotationLayerFactory:e,imageResourcesPath:e.imageResourcesPath,renderInteractiveForms:e.renderInteractiveForms,renderer:e.renderer,enableWebGL:e.enableWebGL,useOnlyCssZoom:e.useOnlyCssZoom,maxCanvasPixels:e.maxCanvasPixels,l10n:e.l10n});e._pages.push(h)}var p=e._pages[0];p&&(p.setPdfPage(i),e.linkService.cachePageRef(1,i.ref)),e._spreadMode!==r.SpreadMode.NONE&&e._updateSpreadMode(),e._onePageRenderedOrForceFetch().then((function(){if(e.findController&&e.findController.setDocument(t),t.loadingParams.disableAutoFetch||n>7500)e._pagesCapability.resolve();else{var r=n-1;if(r<=0)e._pagesCapability.resolve();else for(var i=function(n){t.getPage(n).then((function(t){var i=e._pages[n-1];i.pdfPage||i.setPdfPage(t),e.linkService.cachePageRef(n,t.ref),0===--r&&e._pagesCapability.resolve()}),(function(t){console.error("Unable to get page ".concat(n," to initialize viewer"),t),0===--r&&e._pagesCapability.resolve()}))},o=2;o<=n;++o)i(o)}})),e.eventBus.dispatch("pagesinit",{source:e}),e.defaultRenderingQueue&&e.update()}))["catch"]((function(t){console.error("Unable to initialize viewer",t)}))}}},{key:"setPageLabels",value:function(t){if(this.pdfDocument){t?Array.isArray(t)&&this.pdfDocument.numPages===t.length?this._pageLabels=t:(this._pageLabels=null,console.error("".concat(this._name,".setPageLabels: Invalid page labels."))):this._pageLabels=null;for(var e=0,n=this._pages.length;e<n;e++){var r=this._pages[e],i=this._pageLabels&&this._pageLabels[e];r.setPageLabel(i)}}}},{key:"_resetView",value:function(){this._pages=[],this._currentPageNumber=1,this._currentScale=r.UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,this._buffer=new v(m),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._pagesRequests=new WeakMap,this._firstPageCapability=(0,a.createPromiseCapability)(),this._onePageRenderedCapability=(0,a.createPromiseCapability)(),this._pagesCapability=(0,a.createPromiseCapability)(),this._scrollMode=r.ScrollMode.VERTICAL,this._spreadMode=r.SpreadMode.NONE,this._onBeforeDraw&&(this.eventBus._off("pagerender",this._onBeforeDraw),this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),this.viewer.textContent="",this._updateScrollMode()}},{key:"_scrollUpdate",value:function(){0!==this.pagesCount&&this.update()}},{key:"_scrollIntoView",value:function(t){var e=t.pageDiv,n=t.pageSpot,i=void 0===n?null:n;t.pageNumber;(0,r.scrollIntoView)(e,i)}},{key:"_setScaleUpdatePages",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this._currentScaleValue=e.toString(),b(this._currentScale,t))r&&this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:e});else{for(var i=0,o=this._pages.length;i<o;i++)this._pages[i].update(t);if(this._currentScale=t,!n){var a,s=this._currentPageNumber;!this._location||this.isInPresentationMode||this.isChangingPresentationMode||(s=this._location.pageNumber,a=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:s,destArray:a,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:t,presetValue:r?e:void 0}),this.defaultRenderingQueue&&this.update()}}},{key:"_setScale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=parseFloat(t);if(n>0)this._setScaleUpdatePages(n,t,e,!1);else{var i=this._pages[this._currentPageNumber-1];if(!i)return;var o=this.isInPresentationMode||this.removePageBorders,a=o?0:r.SCROLLBAR_PADDING,s=o?0:r.VERTICAL_PADDING;if(!o&&this._isScrollModeHorizontal){var l=[s,a];a=l[0],s=l[1]}var c=(this.container.clientWidth-a)/i.width*i.scale,u=(this.container.clientHeight-s)/i.height*i.scale;switch(t){case"page-actual":n=1;break;case"page-width":n=c;break;case"page-height":n=u;break;case"page-fit":n=Math.min(c,u);break;case"auto":var d=(0,r.isPortraitOrientation)(i)?c:Math.min(u,c);n=Math.min(r.MAX_AUTO_SCALE,d);break;default:return void console.error("".concat(this._name,'._setScale: "').concat(t,'" is an unknown zoom value.'))}this._setScaleUpdatePages(n,t,e,!0)}}},{key:"_resetCurrentPageView",value:function(){this.isInPresentationMode&&this._setScale(this._currentScaleValue,!0);var t=this._pages[this._currentPageNumber-1];this._scrollIntoView({pageDiv:t.div})}},{key:"scrollPageIntoView",value:function(t){var e=t.pageNumber,n=t.destArray,i=void 0===n?null:n,o=t.allowNegativeOffset,a=void 0!==o&&o,s=t.ignoreDestinationZoom,l=void 0!==s&&s;if(this.pdfDocument){var c=Number.isInteger(e)&&this._pages[e-1];if(c)if(!this.isInPresentationMode&&i){var u,d,h=0,p=0,f=0,g=0,m=c.rotation%180!==0,v=(m?c.height:c.width)/c.scale/r.CSS_UNITS,b=(m?c.width:c.height)/c.scale/r.CSS_UNITS,y=0;switch(i[1].name){case"XYZ":h=i[2],p=i[3],y=i[4],h=null!==h?h:0,p=null!==p?p:b;break;case"Fit":case"FitB":y="page-fit";break;case"FitH":case"FitBH":p=i[2],y="page-width",null===p&&this._location&&(h=this._location.left,p=this._location.top);break;case"FitV":case"FitBV":h=i[2],f=v,g=b,y="page-height";break;case"FitR":h=i[2],p=i[3],f=i[4]-h,g=i[5]-p;var w=this.removePageBorders?0:r.SCROLLBAR_PADDING,x=this.removePageBorders?0:r.VERTICAL_PADDING;u=(this.container.clientWidth-w)/f/r.CSS_UNITS,d=(this.container.clientHeight-x)/g/r.CSS_UNITS,y=Math.min(Math.abs(u),Math.abs(d));break;default:return void console.error("".concat(this._name,".scrollPageIntoView: ")+'"'.concat(i[1].name,'" is not a valid destination type.'))}if(l||(y&&y!==this._currentScale?this.currentScaleValue=y:this._currentScale===r.UNKNOWN_SCALE&&(this.currentScaleValue=r.DEFAULT_SCALE_VALUE)),"page-fit"!==y||i[4]){var C=[c.viewport.convertToViewportPoint(h,p),c.viewport.convertToViewportPoint(h+f,p+g)],k=Math.min(C[0][0],C[1][0]),A=Math.min(C[0][1],C[1][1]);a||(k=Math.max(k,0),A=Math.max(A,0)),this._scrollIntoView({pageDiv:c.div,pageSpot:{left:k,top:A},pageNumber:e})}else this._scrollIntoView({pageDiv:c.div,pageNumber:e})}else this._setCurrentPageNumber(e,!0);else console.error("".concat(this._name,".scrollPageIntoView: ")+'"'.concat(e,'" is not a valid pageNumber parameter.'))}}},{key:"_updateLocation",value:function(t){var e=this._currentScale,n=this._currentScaleValue,r=parseFloat(n)===e?Math.round(1e4*e)/100:n,i=t.id,o="#page="+i;o+="&zoom="+r;var a=this._pages[i-1],s=this.container,l=a.getPagePoint(s.scrollLeft-t.x,s.scrollTop-t.y),c=Math.round(l[0]),u=Math.round(l[1]);o+=","+c+","+u,this._location={pageNumber:i,scale:r,top:u,left:c,rotation:this._pagesRotation,pdfOpenParams:o}}},{key:"_updateHelper",value:function(t){throw new Error("Not implemented: _updateHelper")}},{key:"update",value:function(){var t=this._getVisiblePages(),e=t.views,n=e.length;if(0!==n){var r=Math.max(m,2*n+1);this._buffer.resize(r,e),this.renderingQueue.renderHighestPriority(t),this._updateHelper(e),this._updateLocation(t.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}}},{key:"containsElement",value:function(t){return this.container.contains(t)}},{key:"focus",value:function(){this.container.focus()}},{key:"_getCurrentVisiblePage",value:function(){if(!this.pagesCount)return{views:[]};var t=this._pages[this._currentPageNumber-1],e=t.div,n={id:t.id,x:e.offsetLeft+e.clientLeft,y:e.offsetTop+e.clientTop,view:t};return{first:n,last:n,views:[n]}}},{key:"_getVisiblePages",value:function(){return(0,r.getVisibleElements)(this.container,this._pages,!0,this._isScrollModeHorizontal)}},{key:"isPageVisible",value:function(t){return!!this.pdfDocument&&(t<1||t>this.pagesCount?(console.error("".concat(this._name,'.isPageVisible: "').concat(t,'" is out of bounds.')),!1):this._getVisiblePages().views.some((function(e){return e.id===t})))}},{key:"cleanup",value:function(){for(var t=0,e=this._pages.length;t<e;t++)this._pages[t]&&this._pages[t].renderingState!==i.RenderingStates.FINISHED&&this._pages[t].reset()}},{key:"_cancelRendering",value:function(){for(var t=0,e=this._pages.length;t<e;t++)this._pages[t]&&this._pages[t].cancelRendering()}},{key:"_ensurePdfPageLoaded",value:function(t){var e=this;if(t.pdfPage)return Promise.resolve(t.pdfPage);if(this._pagesRequests.has(t))return this._pagesRequests.get(t);var n=this.pdfDocument.getPage(t.id).then((function(n){return t.pdfPage||t.setPdfPage(n),e._pagesRequests["delete"](t),n}))["catch"]((function(n){console.error("Unable to get page for page view",n),e._pagesRequests["delete"](t)}));return this._pagesRequests.set(t,n),n}},{key:"forceRendering",value:function(t){var e=this,n=t||this._getVisiblePages(),r=this._isScrollModeHorizontal?this.scroll.right:this.scroll.down,i=this.renderingQueue.getHighestPriority(n,this._pages,r);return!!i&&(this._ensurePdfPageLoaded(i).then((function(){e.renderingQueue.renderView(i)})),!0)}},{key:"createTextLayerBuilder",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0;return new c.TextLayerBuilder({textLayerDiv:t,eventBus:i,pageIndex:e,viewport:n,findController:this.isInPresentationMode?null:this.findController,enhanceTextSelection:!this.isInPresentationMode&&r})}},{key:"createAnnotationLayerBuilder",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:r.NullL10n;return new o.AnnotationLayerBuilder({pageDiv:t,pdfPage:e,annotationStorage:n,imageResourcesPath:i,renderInteractiveForms:a,linkService:this.linkService,downloadManager:this.downloadManager,l10n:s})}},{key:"getPagesOverview",value:function(){var t=this._pages.map((function(t){var e=t.pdfPage.getViewport({scale:1});return{width:e.width,height:e.height,rotation:e.rotation}}));return this.enablePrintAutoRotate?t.map((function(t){return(0,r.isPortraitOrientation)(t)?t:{width:t.height,height:t.width,rotation:(t.rotation+90)%360}})):t}},{key:"_updateScrollMode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this._scrollMode,n=this.viewer;n.classList.toggle("scrollHorizontal",e===r.ScrollMode.HORIZONTAL),n.classList.toggle("scrollWrapped",e===r.ScrollMode.WRAPPED),this.pdfDocument&&t&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,!0),this._setCurrentPageNumber(t,!0),this.update())}},{key:"_updateSpreadMode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.pdfDocument){var e=this.viewer,n=this._pages;if(e.textContent="",this._spreadMode===r.SpreadMode.NONE)for(var i=0,o=n.length;i<o;++i)e.appendChild(n[i].div);else for(var a=this._spreadMode-1,s=null,l=0,c=n.length;l<c;++l)null===s?(s=document.createElement("div"),s.className="spread",e.appendChild(s)):l%2===a&&(s=s.cloneNode(!1),e.appendChild(s)),s.appendChild(n[l].div);t&&(this._setCurrentPageNumber(t,!0),this.update())}}},{key:"pagesCount",get:function(){return this._pages.length}},{key:"pageViewsReady",get:function(){return!!this._pagesCapability.settled&&this._pages.every((function(t){return t&&t.pdfPage}))}},{key:"currentPageNumber",get:function(){return this._currentPageNumber},set:function(t){if(!Number.isInteger(t))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(t,!0)||console.error("".concat(this._name,'.currentPageNumber: "').concat(t,'" is not a valid page.')))}},{key:"currentPageLabel",get:function(){return this._pageLabels&&this._pageLabels[this._currentPageNumber-1]},set:function(t){if(this.pdfDocument){var e=0|t;if(this._pageLabels){var n=this._pageLabels.indexOf(t);n>=0&&(e=n+1)}this._setCurrentPageNumber(e,!0)||console.error("".concat(this._name,'.currentPageLabel: "').concat(t,'" is not a valid page.'))}}},{key:"currentScale",get:function(){return this._currentScale!==r.UNKNOWN_SCALE?this._currentScale:r.DEFAULT_SCALE},set:function(t){if(isNaN(t))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(t,!1)}},{key:"currentScaleValue",get:function(){return this._currentScaleValue},set:function(t){this.pdfDocument&&this._setScale(t,!1)}},{key:"pagesRotation",get:function(){return this._pagesRotation},set:function(t){if(!(0,r.isValidRotation)(t))throw new Error("Invalid pages rotation angle.");if(this.pdfDocument&&this._pagesRotation!==t){this._pagesRotation=t;for(var e=this._currentPageNumber,n=0,i=this._pages.length;n<i;n++){var o=this._pages[n];o.update(o.scale,t)}this._currentScaleValue&&this._setScale(this._currentScaleValue,!0),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:t,pageNumber:e}),this.defaultRenderingQueue&&this.update()}}},{key:"firstPagePromise",get:function(){return this.pdfDocument?this._firstPageCapability.promise:null}},{key:"onePageRendered",get:function(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}},{key:"pagesPromise",get:function(){return this.pdfDocument?this._pagesCapability.promise:null}},{key:"_viewerElement",get:function(){throw new Error("Not implemented: _viewerElement")}},{key:"_isScrollModeHorizontal",get:function(){return!this.isInPresentationMode&&this._scrollMode===r.ScrollMode.HORIZONTAL}},{key:"isInPresentationMode",get:function(){return this.presentationModeState===r.PresentationModeState.FULLSCREEN}},{key:"isChangingPresentationMode",get:function(){return this.presentationModeState===r.PresentationModeState.CHANGING}},{key:"isHorizontalScrollbarEnabled",get:function(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}},{key:"isVerticalScrollbarEnabled",get:function(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}},{key:"hasEqualPageSizes",get:function(){for(var t=this._pages[0],e=1,n=this._pages.length;e<n;++e){var r=this._pages[e];if(r.width!==t.width||r.height!==t.height)return!1}return!0}},{key:"optionalContentConfigPromise",get:function(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:this.pdfDocument.getOptionalContentConfig():Promise.resolve(null)},set:function(t){if(!(t instanceof Promise))throw new Error("Invalid optionalContentConfigPromise: ".concat(t));if(this.pdfDocument&&this._optionalContentConfigPromise){this._optionalContentConfigPromise=t;var e,n=u(this._pages);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.update(r.scale,r.rotation,t)}}catch(i){n.e(i)}finally{n.f()}this.update(),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:t})}}},{key:"scrollMode",get:function(){return this._scrollMode},set:function(t){if(this._scrollMode!==t){if(!(0,r.isValidScrollMode)(t))throw new Error("Invalid scroll mode: ".concat(t));this._scrollMode=t,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:t}),this._updateScrollMode(this._currentPageNumber)}}},{key:"spreadMode",get:function(){return this._spreadMode},set:function(t){if(this._spreadMode!==t){if(!(0,r.isValidSpreadMode)(t))throw new Error("Invalid spread mode: ".concat(t));this._spreadMode=t,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:t}),this._updateSpreadMode(this._currentPageNumber)}}}]),t}();e.BaseViewer=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFViewer=void 0;var r=n(19),i=n(2);function o(t){return o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=s(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(l)throw o}}}}function s(t,e){if(t){if("string"===typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),t}function h(t,e,n){return h="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=p(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}},h(t,e,n||t)}function p(t,e){while(!Object.prototype.hasOwnProperty.call(t,e))if(t=w(t),null===t)break;return t}function f(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}function g(t,e){return g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},g(t,e)}function m(t){var e=y();return function(){var n,r=w(t);if(e){var i=w(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return v(this,n)}}function v(t,e){return!e||"object"!==o(e)&&"function"!==typeof e?b(t):e}function b(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}var x=function(t){f(n,t);var e=m(n);function n(){return c(this,n),e.apply(this,arguments)}return d(n,[{key:"_scrollIntoView",value:function(t){var e=t.pageDiv,r=t.pageSpot,i=void 0===r?null:r,o=t.pageNumber,a=void 0===o?null:o;if(!i&&!this.isInPresentationMode){var s=e.offsetLeft+e.clientLeft,l=s+e.clientWidth,c=this.container,u=c.scrollLeft,d=c.clientWidth;(this._isScrollModeHorizontal||s<u||l>u+d)&&(i={left:0,top:0})}h(w(n.prototype),"_scrollIntoView",this).call(this,{pageDiv:e,pageSpot:i,pageNumber:a})}},{key:"_getVisiblePages",value:function(){return this.isInPresentationMode?this._getCurrentVisiblePage():h(w(n.prototype),"_getVisiblePages",this).call(this)}},{key:"_updateHelper",value:function(t){if(!this.isInPresentationMode){var e,n=this._currentPageNumber,r=!1,i=a(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;if(o.percent<100)break;if(o.id===n){r=!0;break}}}catch(s){i.e(s)}finally{i.f()}r||(n=t[0].id),this._setCurrentPageNumber(n)}}},{key:"_viewerElement",get:function(){return(0,i.shadow)(this,"_viewerElement",this.viewer)}}]),n}(r.BaseViewer);e.PDFViewer=x}])}))},f8f8:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Segment=void 0;var i=n("722a"),o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isVisible=!0,e.isSegment=!0,e.isSubpathStart=!1,e}return r(e,t),Object.defineProperty(e.prototype,"end",{get:function(){return this.endPoint},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){if(null==this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end},enumerable:!1,configurable:!0}),e.prototype.closestPointT=function(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")},e.prototype.lengthAtT=function(t,e){if(t<=0)return 0;var n=this.length();return t>=1?n:n*t},e.prototype.divideAtT=function(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")},e.prototype.pointAtT=function(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")},e.prototype.tangentAtT=function(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")},e}(i.Geometry);e.Segment=o},f904:function(t,e,n){"use strict";var r=n("13d9"),i={"text/plain":"Text","text/html":"Url",default:"Text"},o="Copy to clipboard: #{key}, Enter";function a(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}function s(t,e){var n,s,l,c,u,d,h=!1;e||(e={}),n=e.debug||!1;try{l=r(),c=document.createRange(),u=document.getSelection(),d=document.createElement("span"),d.textContent=t,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",(function(r){if(r.stopPropagation(),e.format)if(r.preventDefault(),"undefined"===typeof r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[e.format]||i["default"];window.clipboardData.setData(o,t)}else r.clipboardData.clearData(),r.clipboardData.setData(e.format,t);e.onCopy&&(r.preventDefault(),e.onCopy(r.clipboardData))})),document.body.appendChild(d),c.selectNodeContents(d),u.addRange(c);var p=document.execCommand("copy");if(!p)throw new Error("copy command was unsuccessful");h=!0}catch(f){n&&console.error("unable to copy using execCommand: ",f),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),h=!0}catch(f){n&&console.error("unable to copy using clipboardData: ",f),n&&console.error("falling back to prompt"),s=a("message"in e?e.message:o),window.prompt(s,t)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(c):u.removeAllRanges()),d&&document.body.removeChild(d),l()}return h}t.exports=s},f9d4:function(t,e,n){(function(t){t(n("56b3"))})((function(t){"use strict";t.defineMode("javascript",(function(e,n){var r,i,o=e.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=!1!==n.trackScope,u=n.typescript,d=n.wordCharacters||/[\w$\xa1-\uffff]/,h=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),r=t("keyword c"),i=t("keyword d"),o=t("operator"),a={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:t("new"),delete:r,void:r,throw:r,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:t("this"),class:t("class"),super:t("atom"),yield:r,export:t("export"),import:t("import"),extends:r,await:r}}(),p=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t){var e,n=!1,r=!1;while(null!=(e=t.next())){if(!n){if("/"==e&&!r)return;"["==e?r=!0:r&&"]"==e&&(r=!1)}n=!n&&"\\"==e}}function m(t,e,n){return r=t,i=n,e}function v(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=b(n),e.tokenize(t,e);if("."==n&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==n&&t.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return m(n);if("="==n&&t.eat(">"))return m("=>","operator");if("0"==n&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(n))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==n)return t.eat("*")?(e.tokenize=y,y(t,e)):t.eat("/")?(t.skipToEnd(),m("comment","comment")):ie(t,e,1)?(g(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(t.eat("="),m("operator","operator",t.current()));if("`"==n)return e.tokenize=w,w(t,e);if("#"==n&&"!"==t.peek())return t.skipToEnd(),m("meta","meta");if("#"==n&&t.eatWhile(d))return m("variable","property");if("<"==n&&t.match("!--")||"-"==n&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),m("comment","comment");if(p.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-|&?]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),"?"==n&&t.eat(".")?m("."):m("operator","operator",t.current());if(d.test(n)){t.eatWhile(d);var r=t.current();if("."!=e.lastType){if(h.propertyIsEnumerable(r)){var i=h[r];return m(i.type,i.style,r)}if("async"==r&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",r)}return m("variable","variable",r)}}function b(t){return function(e,n){var r,i=!1;if(s&&"@"==e.peek()&&e.match(f))return n.tokenize=v,m("jsonld-keyword","meta");while(null!=(r=e.next())){if(r==t&&!i)break;i=!i&&"\\"==r}return i||(n.tokenize=v),m("string","string")}}function y(t,e){var n,r=!1;while(n=t.next()){if("/"==n&&r){e.tokenize=v;break}r="*"==n}return m("comment","comment")}function w(t,e){var n,r=!1;while(null!=(n=t.next())){if(!r&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=v;break}r=!r&&"\\"==n}return m("quasi","string-2",t.current())}var x="([{}])";function C(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),l=x.indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(d.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;var c=t.string.charAt(a-1);if(c==s&&"\\"!=t.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(e.fatArrowAt=a)}}var k={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function A(t,e,n,r,i,o){this.indented=t,this.column=e,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function S(t,e){if(!c)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var r=t.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==e)return!0}function E(t,e,n,r,i){var o=t.cc;O.state=t,O.stream=i,O.marked=null,O.cc=o,O.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);while(1){var a=o.length?o.pop():l?W:q;if(a(n,r)){while(o.length&&o[o.length-1].lex)o.pop()();return O.marked?O.marked:"variable"==n&&S(t,r)?"variable-2":e}}}var O={state:null,column:null,marked:null,cc:null};function T(){for(var t=arguments.length-1;t>=0;t--)O.cc.push(arguments[t])}function _(){return T.apply(null,arguments),!0}function M(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function N(t){var e=O.state;if(O.marked="def",c){if(e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var r=P(t,e.context);if(null!=r)return void(e.context=r)}else if(!M(t,e.localVars))return void(e.localVars=new j(t,e.localVars));n.globalVars&&!M(t,e.globalVars)&&(e.globalVars=new j(t,e.globalVars))}}function P(t,e){if(e){if(e.block){var n=P(t,e.prev);return n?n==e.prev?e:new D(n,e.vars,!0):null}return M(t,e.vars)?e:new D(e.prev,new j(t,e.vars),!1)}return null}function L(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function D(t,e,n){this.prev=t,this.vars=e,this.block=n}function j(t,e){this.name=t,this.next=e}var I=new j("this",new j("arguments",null));function R(){O.state.context=new D(O.state.context,O.state.localVars,!1),O.state.localVars=I}function F(){O.state.context=new D(O.state.context,O.state.localVars,!0),O.state.localVars=null}function B(){O.state.localVars=O.state.context.vars,O.state.context=O.state.context.prev}function z(t,e){var n=function(){var n=O.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new A(r,O.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function H(){var t=O.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function V(t){function e(n){return n==t?_():";"==t||"}"==n||")"==n||"]"==n?T():_(e)}return e}function q(t,e){return"var"==t?_(z("vardef",e),Tt,V(";"),H):"keyword a"==t?_(z("form"),G,q,H):"keyword b"==t?_(z("form"),q,H):"keyword d"==t?O.stream.match(/^\s*$/,!1)?_():_(z("stat"),X,V(";"),H):"debugger"==t?_(V(";")):"{"==t?_(z("}"),F,ht,H,B):";"==t?_():"if"==t?("else"==O.state.lexical.info&&O.state.cc[O.state.cc.length-1]==H&&O.state.cc.pop()(),_(z("form"),G,q,H,Dt)):"function"==t?_(Ft):"for"==t?_(z("form"),F,jt,q,B,H):"class"==t||u&&"interface"==e?(O.marked="keyword",_(z("form","class"==t?t:e),qt,H)):"variable"==t?u&&"declare"==e?(O.marked="keyword",_(q)):u&&("module"==e||"enum"==e||"type"==e)&&O.stream.match(/^\s*\w/,!1)?(O.marked="keyword","enum"==e?_(ee):"type"==e?_(zt,V("operator"),vt,V(";")):_(z("form"),_t,V("{"),z("}"),ht,H,H)):u&&"namespace"==e?(O.marked="keyword",_(z("form"),W,q,H)):u&&"abstract"==e?(O.marked="keyword",_(q)):_(z("stat"),ot):"switch"==t?_(z("form"),G,V("{"),z("}","switch"),F,ht,H,H,B):"case"==t?_(W,V(":")):"default"==t?_(V(":")):"catch"==t?_(z("form"),R,U,q,H,B):"export"==t?_(z("stat"),Gt,H):"import"==t?_(z("stat"),Xt,H):"async"==t?_(q):"@"==e?_(W,q):T(z("stat"),W,V(";"),H)}function U(t){if("("==t)return _(Ht,V(")"))}function W(t,e){return Y(t,e,!1)}function $(t,e){return Y(t,e,!0)}function G(t){return"("!=t?T():_(z(")"),X,V(")"),H)}function Y(t,e,n){if(O.state.fatArrowAt==O.stream.start){var r=n?et:tt;if("("==t)return _(R,z(")"),ut(Ht,")"),H,V("=>"),r,B);if("variable"==t)return T(R,_t,V("=>"),r,B)}var i=n?Z:K;return k.hasOwnProperty(t)?_(i):"function"==t?_(Ft,i):"class"==t||u&&"interface"==e?(O.marked="keyword",_(z("form"),Vt,H)):"keyword c"==t||"async"==t?_(n?$:W):"("==t?_(z(")"),X,V(")"),H,i):"operator"==t||"spread"==t?_(n?$:W):"["==t?_(z("]"),te,H,i):"{"==t?dt(st,"}",null,i):"quasi"==t?T(J,i):"new"==t?_(nt(n)):_()}function X(t){return t.match(/[;\}\)\],]/)?T():T(W)}function K(t,e){return","==t?_(X):Z(t,e,!1)}function Z(t,e,n){var r=0==n?K:Z,i=0==n?W:$;return"=>"==t?_(R,n?et:tt,B):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?_(r):u&&"<"==e&&O.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?_(z(">"),ut(vt,">"),H,r):"?"==e?_(W,V(":"),i):_(i):"quasi"==t?T(J,r):";"!=t?"("==t?dt($,")","call",r):"."==t?_(at,r):"["==t?_(z("]"),X,V("]"),H,r):u&&"as"==e?(O.marked="keyword",_(vt,r)):"regexp"==t?(O.state.lastType=O.marked="operator",O.stream.backUp(O.stream.pos-O.stream.start-1),_(i)):void 0:void 0}function J(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?_(J):_(X,Q)}function Q(t){if("}"==t)return O.marked="string-2",O.state.tokenize=w,_(J)}function tt(t){return C(O.stream,O.state),T("{"==t?q:W)}function et(t){return C(O.stream,O.state),T("{"==t?q:$)}function nt(t){return function(e){return"."==e?_(t?it:rt):"variable"==e&&u?_(St,t?Z:K):T(t?$:W)}}function rt(t,e){if("target"==e)return O.marked="keyword",_(K)}function it(t,e){if("target"==e)return O.marked="keyword",_(Z)}function ot(t){return":"==t?_(H,q):T(K,V(";"),H)}function at(t){if("variable"==t)return O.marked="property",_()}function st(t,e){return"async"==t?(O.marked="property",_(st)):"variable"==t||"keyword"==O.style?(O.marked="property","get"==e||"set"==e?_(lt):(u&&O.state.fatArrowAt==O.stream.start&&(n=O.stream.match(/^\s*:\s*/,!1))&&(O.state.fatArrowAt=O.stream.pos+n[0].length),_(ct))):"number"==t||"string"==t?(O.marked=s?"property":O.style+" property",_(ct)):"jsonld-keyword"==t?_(ct):u&&L(e)?(O.marked="keyword",_(st)):"["==t?_(W,pt,V("]"),ct):"spread"==t?_($,ct):"*"==e?(O.marked="keyword",_(st)):":"==t?T(ct):void 0;var n}function lt(t){return"variable"!=t?T(ct):(O.marked="property",_(Ft))}function ct(t){return":"==t?_($):"("==t?T(Ft):void 0}function ut(t,e,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=O.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),_((function(n,r){return n==e||r==e?T():T(t)}),r)}return i==e||o==e?_():n&&n.indexOf(";")>-1?T(t):_(V(e))}return function(n,i){return n==e||i==e?_():T(t,r)}}function dt(t,e,n){for(var r=3;r<arguments.length;r++)O.cc.push(arguments[r]);return _(z(e,n),ut(t,e),H)}function ht(t){return"}"==t?_():T(q,ht)}function pt(t,e){if(u){if(":"==t)return _(vt);if("?"==e)return _(pt)}}function ft(t,e){if(u&&(":"==t||"in"==e))return _(vt)}function gt(t){if(u&&":"==t)return O.stream.match(/^\s*\w+\s+is\b/,!1)?_(W,mt,vt):_(vt)}function mt(t,e){if("is"==e)return O.marked="keyword",_()}function vt(t,e){return"keyof"==e||"typeof"==e||"infer"==e||"readonly"==e?(O.marked="keyword",_("typeof"==e?$:vt)):"variable"==t||"void"==e?(O.marked="type",_(At)):"|"==e||"&"==e?_(vt):"string"==t||"number"==t||"atom"==t?_(At):"["==t?_(z("]"),ut(vt,"]",","),H,At):"{"==t?_(z("}"),yt,H,At):"("==t?_(ut(kt,")"),bt,At):"<"==t?_(ut(vt,">"),vt):"quasi"==t?T(xt,At):void 0}function bt(t){if("=>"==t)return _(vt)}function yt(t){return t.match(/[\}\)\]]/)?_():","==t||";"==t?_(yt):T(wt,yt)}function wt(t,e){return"variable"==t||"keyword"==O.style?(O.marked="property",_(wt)):"?"==e||"number"==t||"string"==t?_(wt):":"==t?_(vt):"["==t?_(V("variable"),ft,V("]"),wt):"("==t?T(Bt,wt):t.match(/[;\}\)\],]/)?void 0:_()}function xt(t,e){return"quasi"!=t?T():"${"!=e.slice(e.length-2)?_(xt):_(vt,Ct)}function Ct(t){if("}"==t)return O.marked="string-2",O.state.tokenize=w,_(xt)}function kt(t,e){return"variable"==t&&O.stream.match(/^\s*[?:]/,!1)||"?"==e?_(kt):":"==t?_(vt):"spread"==t?_(kt):T(vt)}function At(t,e){return"<"==e?_(z(">"),ut(vt,">"),H,At):"|"==e||"."==t||"&"==e?_(vt):"["==t?_(vt,V("]"),At):"extends"==e||"implements"==e?(O.marked="keyword",_(vt)):"?"==e?_(vt,V(":"),vt):void 0}function St(t,e){if("<"==e)return _(z(">"),ut(vt,">"),H,At)}function Et(){return T(vt,Ot)}function Ot(t,e){if("="==e)return _(vt)}function Tt(t,e){return"enum"==e?(O.marked="keyword",_(ee)):T(_t,pt,Pt,Lt)}function _t(t,e){return u&&L(e)?(O.marked="keyword",_(_t)):"variable"==t?(N(e),_()):"spread"==t?_(_t):"["==t?dt(Nt,"]"):"{"==t?dt(Mt,"}"):void 0}function Mt(t,e){return"variable"!=t||O.stream.match(/^\s*:/,!1)?("variable"==t&&(O.marked="property"),"spread"==t?_(_t):"}"==t?T():"["==t?_(W,V("]"),V(":"),Mt):_(V(":"),_t,Pt)):(N(e),_(Pt))}function Nt(){return T(_t,Pt)}function Pt(t,e){if("="==e)return _($)}function Lt(t){if(","==t)return _(Tt)}function Dt(t,e){if("keyword b"==t&&"else"==e)return _(z("form","else"),q,H)}function jt(t,e){return"await"==e?_(jt):"("==t?_(z(")"),It,H):void 0}function It(t){return"var"==t?_(Tt,Rt):"variable"==t?_(Rt):T(Rt)}function Rt(t,e){return")"==t?_():";"==t?_(Rt):"in"==e||"of"==e?(O.marked="keyword",_(W,Rt)):T(W,Rt)}function Ft(t,e){return"*"==e?(O.marked="keyword",_(Ft)):"variable"==t?(N(e),_(Ft)):"("==t?_(R,z(")"),ut(Ht,")"),H,gt,q,B):u&&"<"==e?_(z(">"),ut(Et,">"),H,Ft):void 0}function Bt(t,e){return"*"==e?(O.marked="keyword",_(Bt)):"variable"==t?(N(e),_(Bt)):"("==t?_(R,z(")"),ut(Ht,")"),H,gt,B):u&&"<"==e?_(z(">"),ut(Et,">"),H,Bt):void 0}function zt(t,e){return"keyword"==t||"variable"==t?(O.marked="type",_(zt)):"<"==e?_(z(">"),ut(Et,">"),H):void 0}function Ht(t,e){return"@"==e&&_(W,Ht),"spread"==t?_(Ht):u&&L(e)?(O.marked="keyword",_(Ht)):u&&"this"==t?_(pt,Pt):T(_t,pt,Pt)}function Vt(t,e){return"variable"==t?qt(t,e):Ut(t,e)}function qt(t,e){if("variable"==t)return N(e),_(Ut)}function Ut(t,e){return"<"==e?_(z(">"),ut(Et,">"),H,Ut):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(O.marked="keyword"),_(u?vt:W,Ut)):"{"==t?_(z("}"),Wt,H):void 0}function Wt(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&L(e))&&O.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(O.marked="keyword",_(Wt)):"variable"==t||"keyword"==O.style?(O.marked="property",_($t,Wt)):"number"==t||"string"==t?_($t,Wt):"["==t?_(W,pt,V("]"),$t,Wt):"*"==e?(O.marked="keyword",_(Wt)):u&&"("==t?T(Bt,Wt):";"==t||","==t?_(Wt):"}"==t?_():"@"==e?_(W,Wt):void 0}function $t(t,e){if("!"==e)return _($t);if("?"==e)return _($t);if(":"==t)return _(vt,Pt);if("="==e)return _($);var n=O.state.lexical.prev,r=n&&"interface"==n.info;return T(r?Bt:Ft)}function Gt(t,e){return"*"==e?(O.marked="keyword",_(Qt,V(";"))):"default"==e?(O.marked="keyword",_(W,V(";"))):"{"==t?_(ut(Yt,"}"),Qt,V(";")):T(q)}function Yt(t,e){return"as"==e?(O.marked="keyword",_(V("variable"))):"variable"==t?T($,Yt):void 0}function Xt(t){return"string"==t?_():"("==t?T(W):"."==t?T(K):T(Kt,Zt,Qt)}function Kt(t,e){return"{"==t?dt(Kt,"}"):("variable"==t&&N(e),"*"==e&&(O.marked="keyword"),_(Jt))}function Zt(t){if(","==t)return _(Kt,Zt)}function Jt(t,e){if("as"==e)return O.marked="keyword",_(Kt)}function Qt(t,e){if("from"==e)return O.marked="keyword",_(W)}function te(t){return"]"==t?_():T(ut($,"]"))}function ee(){return T(z("form"),_t,V("{"),z("}"),ut(ne,"}"),H,H)}function ne(){return T(_t,Pt)}function re(t,e){return"operator"==t.lastType||","==t.lastType||p.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function ie(t,e,n){return e.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return R.lex=F.lex=!0,B.lex=!0,H.lex=!0,{startState:function(t){var e={tokenize:v,lastType:"sof",cc:[],lexical:new A((t||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new D(null,null,!1),indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),C(t,e)),e.tokenize!=y&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==r?n:(e.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",E(e,n,r,i,t))},indent:function(e,r){if(e.tokenize==y||e.tokenize==w)return t.Pass;if(e.tokenize!=v)return 0;var i,s=r&&r.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(r))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==H)l=l.prev;else if(u!=Dt&&u!=B)break}while(("stat"==l.type||"form"==l.type)&&("}"==s||(i=e.cc[e.cc.length-1])&&(i==K||i==Z)&&!/^[,\.=+\-*:?[\(]/.test(r)))l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,h=s==d;return"vardef"==d?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+o:"stat"==d?l.indented+(re(e,r)?a||o:0):"switch"!=l.info||h||0==n.doubleIndentSwitch?l.align?l.column+(h?0:1):l.indented+(h?0:o):l.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:ie,skipExpression:function(e){E(e,"atom","atom","true",new t.StringStream("",2,null))}}})),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/manifest+json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}))},fa9e:function(t,e,n){n("986a")},fdad:function(t,e,n){},ff38:function(t,e,n){"use strict";var r=n("55be").isSpace;t.exports=function(t,e){var n,i,o,a=t.pos;if(10!==t.src.charCodeAt(a))return!1;if(n=t.pending.length-1,i=t.posMax,!e)if(n>=0&&32===t.pending.charCodeAt(n))if(n>=1&&32===t.pending.charCodeAt(n-1)){o=n-1;while(o>=1&&32===t.pending.charCodeAt(o-1))o--;t.pending=t.pending.slice(0,o),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);a++;while(a<i&&r(t.src.charCodeAt(a)))a++;return t.pos=a,!0}}}]);