@visactor/lark-vchart
Version:
VChart 飞书小程序组件
18 lines (16 loc) • 2.19 MB
JavaScript
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(t,e,i){return e=u(e),f(t,h()?Reflect.construct(e,i||[],u(t).constructor):e.apply(t,i))}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function a(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=S(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}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,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function s(t,e,i){return(e=b(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}},l.apply(null,arguments)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(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&&y(t,e)}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}function d(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function v(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?d(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function f(t,i){if(i&&("object"==typeof i||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");return e(t)}function p(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var t,e,i="function"==typeof Symbol?Symbol:{},n=i.iterator||"@@iterator",r=i.toStringTag||"@@toStringTag";function a(i,n,r,a){var l=n&&n.prototype instanceof s?n:s,u=Object.create(l.prototype);return g(u,"_invoke",function(i,n,r){var a,s,l,u=0,c=r||[],h=!1,d={p:0,n:0,v:t,a:v,f:v.bind(t,4),d:function(e,i){return a=e,s=0,l=t,d.n=i,o}};function v(i,n){for(s=i,l=n,e=0;!h&&u&&!r&&e<c.length;e++){var r,a=c[e],v=d.p,f=a[2];i>3?(r=f===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=t):a[0]<=v&&((r=i<2&&v<a[1])?(s=0,d.v=n,d.n=a[1]):v<f&&(r=i<3||a[0]>n||n>f)&&(a[4]=i,a[5]=n,d.n=f,s=0))}if(r||i>1)return o;throw h=!0,n}return function(r,c,f){if(u>1)throw TypeError("Generator is already running");for(h&&1===c&&v(c,f),s=c,l=f;(e=s<2?t:l)||!h;){a||(s?s<3?(s>1&&(d.n=-1),v(s,l)):d.n=l:d.v=l);try{if(u=2,a){if(s||(r="next"),e=a[r]){if(!(e=e.call(a,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=a.return)&&e.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);a=t}else if((e=(h=d.n<0)?l:i.call(n,d))!==o)break}catch(e){a=t,s=1,l=e}finally{u=1}}return{value:e,done:h}}}(i,r,a),!0),u}var o={};function s(){}function l(){}function u(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(g(e={},n,(function(){return this})),e),h=u.prototype=s.prototype=Object.create(c);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,g(t,r,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=u,g(h,"constructor",u),g(u,"constructor",l),l.displayName="GeneratorFunction",g(u,r,"GeneratorFunction"),g(h),g(h,r,"Generator"),g(h,n,(function(){return this})),g(h,"toString",(function(){return"[object Generator]"})),(p=function(){return{w:a,m:d}})()}function g(t,e,i,n){var r=Object.defineProperty;try{r({},"",{})}catch(t){r=0}g=function(t,e,i,n){if(e)r?r(t,e,{value:i,enumerable:!n,configurable:!n,writable:!n}):t[e]=i;else{function a(e,i){g(t,e,(function(t){return this._invoke(e,i,t)}))}a("next",0),a("throw",1),a("return",2)}},g(t,e,i,n)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,a,o,s=[],l=!0,u=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(u)throw r}}return s}}(t,e)||S(t,e)||function(){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 _(t,e,i,n){var r=l(u(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof r?function(t){return r.apply(i,t)}:r}function k(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||S(e)||function(){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 b(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function x(t){return x="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},x(t)}function S(e,i){if(e){if("string"==typeof e)return t(e,i);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,i):void 0}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function A(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var M={exports:{}};(function(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 r(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}function l(t,e,i,n){return new(i||(i=Promise))((function(r,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}l((n=n.apply(t,e||[])).next())}))}var u,d,v=function(t){return t};function g(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}t.RenderModeEnum=void 0,(u=t.RenderModeEnum||(t.RenderModeEnum={}))["desktop-browser"]="desktop-browser",u["mobile-browser"]="mobile-browser",u.node="node",u.worker="worker",u.miniApp="miniApp",u.wx="wx",u.tt="tt",u.harmony="harmony",u["desktop-miniApp"]="desktop-miniApp",u.lynx="lynx",function(t){t.cartesianAxis="cartesianAxis",t.cartesianBandAxis="cartesianAxis-band",t.cartesianLinearAxis="cartesianAxis-linear",t.cartesianTimeAxis="cartesianAxis-time",t.cartesianLogAxis="cartesianAxis-log",t.cartesianSymlogAxis="cartesianAxis-symlog",t.polarAxis="polarAxis",t.polarBandAxis="polarAxis-band",t.polarLinearAxis="polarAxis-linear",t.crosshair="crosshair",t.cartesianCrosshair="cartesianCrosshair",t.polarCrosshair="polarCrosshair",t.dataZoom="dataZoom",t.geoCoordinate="geoCoordinate",t.indicator="indicator",t.discreteLegend="discreteLegend",t.continuousLegend="continuousLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend",t.markLine="markLine",t.markArea="markArea",t.markPoint="markPoint",t.polarMarkLine="polarMarkLine",t.polarMarkArea="polarMarkArea",t.polarMarkPoint="polarMarkPoint",t.geoMarkPoint="geoMarkPoint",t.tooltip="tooltip",t.title="title",t.player="player",t.scrollBar="scrollBar",t.label="label",t.totalLabel="totalLabel",t.brush="brush",t.poptip="poptip",t.customMark="customMark"}(d||(d={}));var b={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,n,a,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,a||t,o),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],s]:t._events[l].push(s):(t._events[l]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,a=n.length,o=new Array(a);r<a;r++)o[r]=n[r].fn;return o},s.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},s.prototype.emit=function(t,e,n,r,a,o){var s=i?i+t:t;if(!this._events[s])return!1;var l,u,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,a),!0;case 6:return c.fn.call(c.context,e,n,r,a,o),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,v=c.length;for(u=0;u<v;u++)switch(c[u].once&&this.removeListener(t,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,e);break;case 3:c[u].fn.call(c[u].context,e,n);break;case 4:c[u].fn.call(c[u].context,e,n,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},s.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},s.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},s.prototype.removeListener=function(t,e,n,r){var a=i?i+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||r&&!s.once||n&&s.context!==n||o(this,a);else{for(var l=0,u=[],c=s.length;l<c;l++)(s[l].fn!==e||r&&!s[l].once||n&&s[l].context!==n)&&u.push(s[l]);u.length?this._events[a]=1===u.length?u[0]:u:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,t.exports=s}(b);var S=g(b.exports),A=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},M=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||A(t,"Boolean")},T=function(t){return"function"==typeof t},w=function(t){return null==t},C=function(t){return null!=t},E=function(t){var e=x(t);return null!==t&&"object"===e||"function"===e},B=function(t){return"object"==x(t)&&null!==t},P=function(t){if(!B(t)||!A(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},R=function(t){return void 0===t},L=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=x(t);return e?"string"===i:"string"===i||A(t,"String")},O=function(t){return Array.isArray?Array.isArray(t):A(t,"Array")},I=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},D=function(t){return A(t,"Date")},F=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=x(t);return e?"number"===i:"number"===i||A(t,"Number")},j=function(t){return"string"==typeof t&&!isNaN(Number(t))&&!isNaN(parseFloat(t))},z=function(t){return F(t)&&Number.isFinite(t)},H=function(t){return new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t)},V=function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)},N=function(t){return{}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")},U=Object.prototype,W=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||U)},G=Object.prototype.hasOwnProperty;function Y(t){if(w(t))return!0;if(I(t))return!t.length;var e=N(t);if("Map"===e||"Set"===e)return!t.size;if(W(t))return!Object.keys(t).length;for(var i in t)if(G.call(t,i))return!1;return!0}var X=function(t,e,i){for(var n=L(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},K=Object.prototype.hasOwnProperty,q=function(t,e){return null!=t&&K.call(t,e)};function Z(t,e,i){var n;if(!C(t)||"object"!=x(t)||e&&e(t))return t;var r=O(t),a=t.length;n=r?new Array(a):"object"==x(t)?{}:M(t)||F(t)||L(t)?t:D(t)?new Date(+t):void 0;var o=r?void 0:Object.keys(Object(t)),s=-1;if(n)for(;++s<(o||t).length;){var l=o?o[s]:s,u=t[l];i&&i.includes(l.toString())?n[l]=u:n[l]=Z(u,e,i)}return n}function J(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(C(e)&&"object"==x(e)){var r=Object(e),a=[];for(var o in r)a.push(o);for(var s=a.length,l=-1;s--;){var u=a[++l];!C(r[u])||"object"!=x(r[u])||n&&O(t[u])?$(t,u,r[u]):Q(t,e,u,i,n)}}}}function Q(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=t[i],o=e[i],s=e[i],l=!0;if(O(o)){if(n)s=[];else if(O(a))s=a;else if(I(a)){s=new Array(a.length);for(var u=-1,c=a.length;++u<c;)s[u]=a[u]}}else P(o)?(s=null!=a?a:{},"function"!=typeof a&&"object"==x(a)||(s={})):l=!1;l&&J(s,o,n,r),$(t,i,s)}function $(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function et(t){for(var e=-1,i=arguments.length<=1?0:arguments.length-1;++e<i;)J(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function it(t,e){if(!t||!P(t))return t;var i={};return Object.keys(t).forEach((function(n){var r=t[n],a=!1;e.forEach((function(t){(L(t)&&t===n||t instanceof RegExp&&n.match(t))&&(a=!0)})),a||(i[n]=r)})),i}function nt(t){return Object.prototype.toString.call(t)}function rt(t){return Object.keys(t)}function at(t,e,i){if(t===e)return!0;if(x(t)!=x(e))return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(nt(t)!==nt(e))return!1;if(T(t))return!!(null==i?void 0:i.skipFunction);if("object"!=x(t))return!1;if(O(t)){if(t.length!==e.length)return!1;for(var n=t.length-1;n>=0;n--)if(!at(t[n],e[n],i))return!1;return!0}if(!P(t))return!1;var r=rt(t),a=rt(e);if(r.length!==a.length)return!1;r.sort(),a.sort();for(var o=r.length-1;o>=0;o--)if(r[o]!=a[o])return!1;for(var s=r.length-1;s>=0;s--){var l=r[s];if(!at(t[l],e[l],i))return!1}return!0}function ot(t,e,i){for(var n=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e}(e),r=0;r<n.length;r++){var a=n[r];(i?null!=e[a]:null==t[a])&&(t[a]=e[a])}return t}function st(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var a=n[r];"constructor"!==a&&(i?null!=e[a]:null==t[a])&&(t[a]=e[a])}else ot(t,e,i)}function lt(t){return C(t)?O(t)?t:[t]:[]}function ut(t){if(I(t))return t[t.length-1]}var ct=function(t,e){var i;if(0!==t.length){for(var n=t[0],r=1;r<t.length;r++){var a=t[r];(null!==(i=null==e?void 0:e(a,n))&&void 0!==i?i:a-n)>0&&(n=a)}return n}},ht=function(t,e){var i;if(0!==t.length){for(var n=t[0],r=1;r<t.length;r++){var a=t[r];(null!==(i=null==e?void 0:e(a,n))&&void 0!==i?i:a-n)<0&&(n=a)}return n}};function dt(t,e){if(!O(t)||!O(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function vt(t){for(var e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.random,r=t.length;r;)e=Math.floor(n()*r),i=t[--r],t[r]=t[e],t[e]=i;return t}function ft(t){if(!O(t))return[t];var e,i=[],n=o(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;i.push.apply(i,k(ft(r)))}}catch(t){n.e(t)}finally{n.f()}return i}function pt(t,e,i){C(e)||(e=t,t=0),C(i)||(i=1);for(var n=-1,r=0|Math.max(0,Math.ceil((e-t)/i)),a=new Array(r);++n<r;)a[n]=t+n*i;return a}function gt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function yt(t){return Number(t)}var mt,_t="undefined"!=typeof console;function kt(t,e,i){var n=[e].concat([].slice.call(i));_t&&console[t].apply(console,n)}!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(mt||(mt={}));var bt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mt.None,i=arguments.length>1?arguments[1]:void 0;n(this,t),this._onErrorHandler=[],this._level=e,this._method=i}return a(t,[{key:"addErrorHandler",value:function(t){this._onErrorHandler.find((function(e){return e===t}))||this._onErrorHandler.push(t)}},{key:"removeErrorHandler",value:function(t){var e=this._onErrorHandler.findIndex((function(e){return e===t}));e<0||this._onErrorHandler.splice(e,1)}},{key:"callErrorHandler",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((function(t){return t.apply(void 0,e)}))}},{key:"canLogInfo",value:function(){return this._level>=mt.Info}},{key:"canLogDebug",value:function(){return this._level>=mt.Debug}},{key:"canLogError",value:function(){return this._level>=mt.Error}},{key:"canLogWarn",value:function(){return this._level>=mt.Warn}},{key:"level",value:function(t){return arguments.length?(this._level=+t,this):this._level}},{key:"error",value:function(){for(var t,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=mt.Error&&(this._onErrorHandler.length?this.callErrorHandler.apply(this,i):kt(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Warn&&kt(this._method||"warn","WARN",e),this}},{key:"info",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Info&&kt(this._method||"log","INFO",e),this}},{key:"debug",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Debug&&kt(this._method||"log","DEBUG",e),this}}],[{key:"getInstance",value:function(e,i){return t._instance&&F(e)?t._instance.level(e):t._instance||(t._instance=new t(e,i)),t._instance}},{key:"setInstance",value:function(e){return t._instance=e}},{key:"setInstanceLevel",value:function(e){t._instance?t._instance.level(e):t._instance=new t(e)}},{key:"clearInstance",value:function(){t._instance=null}}])}();function xt(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;for(w(n)&&(n=t.length);i<n;){var r=i+n>>>1;gt(t[r],e)>0?n=r:i=r+1}return i}bt._instance=null;var St=function(t,e){return At(0,t.length,(function(i){return e(t[i])}))},At=function(t,e,i){for(var n=t,r=e;n<r;){var a=Math.floor((n+r)/2);i(a)>=0?r=a:n=a+1}return n},Mt=function(t,e){var i=t;return!0!==e&&(i=t.sort(gt)),function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yt,n=t.length;if(n){if(e<=0||n<2)return i(t[0],0,t);if(e>=1)return i(t[n-1],n-1,t);var r=(n-1)*e,a=Math.floor(r),o=i(t[a],a,t);return o+(i(t[a+1],a+1,t)-o)*(r-a)}}(i,.5)},Tt=1e-10,wt=1e-10;function Ct(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Tt,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:wt)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}function Et(t,e,i,n){return t>e&&!Ct(t,e,i,n)}function Bt(t,e,i,n){return t<e&&!Ct(t,e,i,n)}var Pt=function(t){var e=null,i=null;return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e&&r.every((function(t,i){return t===e[i]}))||(e=r,i=t.apply(void 0,r)),i}},Rt=function(t,e,i){return t<e?e:t>i?i:t},Lt=function(t,e,i){var n=m(t,2),r=n[0],a=n[1];a<r&&(r=t[1],a=t[0]);var o=a-r;return o>=i-e?[e,i]:[r=Math.min(Math.max(r,e),i-o),r+o]};function Ot(t,e){var i;return t>e&&(i=t,t=e,e=i),function(i){return Math.max(t,Math.min(e,i))}}var It=!1;try{It="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){It=!1}function Dt(t,e,i){var n,r,a,o,s,l,u=0,c=!1,h=!1,d=!0,v=!e&&0!==e&&It;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var i=n,a=r;return n=r=void 0,u=e,o=t.apply(a,i)}function p(t,e){return v?(cancelAnimationFrame(s),requestAnimationFrame(t)):setTimeout(t,e)}function g(t){var i=t-l;return void 0===l||i>=e||i<0||h&&t-u>=a}function y(){var t=Date.now();if(g(t))return m(t);s=p(y,function(t){var i=t-u,n=e-(t-l);return h?Math.min(n,a-i):n}(t))}function m(t){return s=void 0,d&&n?f(t):(n=r=void 0,o)}function _(){for(var t=Date.now(),i=g(t),a=arguments.length,d=new Array(a),v=0;v<a;v++)d[v]=arguments[v];if(n=d,r=this,l=t,i){if(void 0===s)return function(t){return u=t,s=p(y,e),c?f(t):o}(l);if(h)return s=p(y,e),f(l)}return void 0===s&&(s=p(y,e)),o}return e=+e||0,E(i)&&(c=!!i.leading,(h="maxWait"in i)&&(a=Math.max(z(i.maxWait)?i.maxWait:0,e)),d="trailing"in i?!!i.trailing:d),_.cancel=function(){void 0!==s&&function(t){if(v)return cancelAnimationFrame(t);clearTimeout(t)}(s),u=0,n=l=r=s=void 0},_.flush=function(){return void 0===s?o:m(Date.now())},_.pending=function(){return void 0!==s},_}function Ft(t,e,i){var n=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return E(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),Dt(t,e,{leading:n,trailing:r,maxWait:e})}function jt(t,e){return function(i){return t*(1-i)+e*i}}function zt(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}function Ht(t){if(z(t))return t;var e=+t;return z(e)?e:0}function Vt(t){return parseFloat("0."+Math.sin(t).toString().substring(6))}It=!1;var Nt=4294967296,Ut=function(t){return function(e){return X(e,t)}},Wt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(T(t))return t;var i=[t];return(e&&e.get||Ut)(i)},Gt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(O(t)){var i=t.map((function(t){return Wt(t,e)}));return function(t){return i.map((function(e){return e(t)}))}}return Wt(t,e)},Yt=function(t,e){return w(t)?e:L(t)?e*parseFloat(t)/100:t},Xt=function(t){return 0},Kt=function(t,e){var i,n,r=T(e)?e:function(t){return t};if(t&&t.length){for(var a=t.length,o=0;o<a;o+=1){var s=r(t[o]);w(s)||!F(s=+s)||Number.isNaN(s)||(w(i)?(i=s,n=s):(i=Math.min(i,s),n=Math.max(n,s)))}return[i,n]}return[i,n]};function qt(t,e,i,n){var r,a,o=-1;t.forEach((function(t){r=e(t),a=i(t),!w(r)&&(r=+r)>=r&&!w(a)&&(a=+a)>=a&&n(r,a,++o)}))}function Zt(t,e,i,n,r){var a=0,o=0;return qt(t,e,i,(function(t,e){var i=e-r(t),s=e-n;a+=i*i,o+=s*s})),1-a/o}function Jt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return t.x},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t){return t.y},n=0,r=0,a=0,o=0,s=0;qt(t,e,i,(function(t,e){++s,n+=(t-n)/s,r+=(e-r)/s,a+=(t*e-a)/s,o+=(t*t-o)/s}));var l=function(t,e,i,n){var r=n-t*t,a=Math.abs(r)<1e-24?0:(i-t*e)/r;return[e-a*t,a]}(n,r,a,o),u=function(t){return l[0]+l[1]*t};return{coef:l,predict:u,rSquared:Zt(t,e,i,r,u)}}var Qt=1e-12,$t=Math.PI,te=$t/2,ee=2*$t,ie=2*Math.PI,ne=Math.abs,re=Math.atan2,ae=Math.cos,oe=Math.max,se=Math.min,le=Math.sin,ue=Math.sqrt,ce=Math.pow;function he(t){return t>=1?te:t<=-1?-te:Math.asin(t)}function de(t,e,i,n,r){var a=i,o=n;return"number"==typeof t&&"number"==typeof i&&(a=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:a,y:o}}function ve(t,e){return t[0]*e[1]-t[1]*e[0]}function fe(t,e){for(var i=0,n=0;n<t.length;++n)i+=t[n]*e[n];return i}function pe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return Math.round(t*e)/e}function ge(t){var e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}function ye(t,e){return pe(t+e,Math.pow(10,Math.max(ge(t),ge(e))))}function me(t,e){return pe(t-e,Math.pow(10,Math.max(ge(t),ge(e))))}var _e=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;n(this,t),this.x=0,this.y=0,this.x=e,this.y=i,this.x1=r,this.y1=a}return a(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return F(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return F(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}])}(),ke=function(){function t(){n(this,t)}return a(t,null,[{key:"distancePP",value:function(t,e){return ue(ce(t.x-e.x,2)+ce(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return ue(ce(t-i,2)+ce(e-n,2))}},{key:"distancePN",value:function(t,e,i){return ue(ce(e-t.x,2)+ce(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new _e((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}])}();function be(t){return t*(Math.PI/180)}function xe(t){return 180*t/Math.PI}var Se,Ae=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-ee;)t+=ee;else if(t>0)for(;t>ee;)t-=ee;return t};function Me(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function Te(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:0,y:0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI,r=t.x,a=t.y,o=r-e.x,s=a-e.y,l=Math.sqrt(o*o+s*s);if(0===l)return{radius:0,angle:0};o/=l,s/=l;var u=Math.atan2(s,o);if(u<i)for(;u<=i;)u+=2*Math.PI;if(u>n)for(;u>=n;)u-=2*Math.PI;return{radius:l,angle:u}}function we(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function Ce(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Ee(t,e,i,n){var r=e.x,a=e.y,o=function(t,e){var i=Math.abs(e-t);if(i>=2*Math.PI||2*Math.PI-i<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];for(var n=Ce(Math.min(t,e)),r=n+i,a=[n,r],o=Math.floor(n/Math.PI)*Math.PI/2;o<r;)o>n&&a.push(o),o+=Math.PI/2;return a}(i,n),s=t.width,l=t.height,u=[];return o.forEach((function(t){var e=Math.sin(t),i=Math.cos(t);1===e?u.push(l-a):-1===e?u.push(a):1===i?u.push(s-r):-1===i?u.push(r):(e>0?u.push(Math.abs((l-a)/e)):u.push(Math.abs(a/e)),i>0?u.push(Math.abs((s-r)/i)):u.push(Math.abs(r/i)))})),Math.min.apply(null,u)}function Be(t){return(t=Ce(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}function Pe(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Re(t,e,i,n){var r,a,o,s,l=t[0],u=e[0],c=i[0],h=n[0];return u<l&&(l=(r=[u,l])[0],u=r[1]),h<c&&(h=(a=[c,h])[0],c=a[1]),!(u<c||h<l||(l=t[1],u=e[1],c=i[1],h=n[1],u<l&&(o=[u,l],l=o[0],u=o[1]),h<c&&(s=[c,h],h=s[0],c=s[1]),u<c||h<l))}function Le(t,e,i,n){if(!Re(t,e,i,n))return!1;var r=[0,0],a=[0,0],o=[0,0];if(Pe(r,e,t),Pe(a,n,i),function(t,e){return ne(t[0]-e[0])+ne(t[1]-e[1])<1e-12}(r,a))return!0;Pe(o,i,t);var s=ve(o,a)/ve(r,a);return s>=0&&s<=1&&[t[0]+r[0]*s,t[1]+r[1]*s]}function Oe(t,e,i){if(null===t)return e;if(null===e)return t;var n=Ie(t,e,i),r=n.x11,a=n.x12,o=n.y11,s=n.y12,l=n.x21,u=n.x22,c=n.y21,h=n.y22;return r>=u||a<=l||o>=h||s<=c?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(r,l),y1:Math.max(o,c),x2:Math.min(a,u),y2:Math.min(s,h)}}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Se||(Se={}));var Ie=function(t,e,i){var n,r,a,o,s=t.x1,l=t.x2,u=t.y1,c=t.y2,h=e.x1,d=e.x2,v=e.y1,f=e.y2;return i&&(s>l&&(s=(n=[l,s])[0],l=n[1]),u>c&&(u=(r=[c,u])[0],c=r[1]),h>d&&(h=(a=[d,h])[0],d=a[1]),v>f&&(v=(o=[f,v])[0],f=o[1])),{x11:s,x12:l,y11:u,y12:c,x21:h,x22:d,y21:v,y22:f}};function De(t,e,i){if(!t||!e)return Se.NONE;var n=Ie(t,e,i),r=n.x11,a=n.x12,o=n.y11,s=n.y12,l=n.x21,u=n.x22,c=n.y21,h=n.y22;return r>l&&a<u&&o>c&&s<h?Se.BBOX1:l>r&&u<a&&c>o&&h<s?Se.BBOX2:Se.NONE}function Fe(t,e,i){if(t&&e){if(!i)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);var n=Ie(t,e,!0),r=n.x11,a=n.x12,o=n.y11,s=n.y12,l=n.x21,u=n.x22,c=n.y21,h=n.y22;return!(r>u||a<l||o>h||s<c)}return!0}function je(t,e,i){var n,r;if(!e)return!0;if(!i)return t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;var a=e.x1,o=e.x2,s=e.y1,l=e.y2;return a>o&&(a=(n=[o,a])[0],o=n[1]),s>l&&(s=(r=[l,s])[0],l=r[1]),t.x>=a&&t.x<=o&&t.y>=s&&t.y<=l}function ze(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function He(t,e){var i=t.x,n=t.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-r.x)*Math.cos(e)-(n-r.y)*Math.sin(e)+r.x,y:(i-r.x)*Math.sin(e)+(n-r.y)*Math.cos(e)+r.y}}function Ve(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Ne(t,e){var i=e?be(t.angle):t.angle,n=Ve(t);return[He({x:t.x1,y:t.y1},i,n),He({x:t.x2,y:t.y1},i,n),He({x:t.x2,y:t.y2},i,n),He({x:t.x1,y:t.y2},i,n)]}function Ue(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=Ne(t,i),r=Ne(e,i),a=function(t,e){return[e.x-t.x,e.y-t.y]},o=a(Ve(t),Ve(e)),s=a(n[0],n[1]),l=a(n[1],n[2]),u=a(r[0],r[1]),c=a(r[1],r[2]),h=i?be(t.angle):t.angle,d=i?be(90-t.angle):t.angle+te,v=i?be(e.angle):e.angle,f=i?be(90-e.angle):e.angle+te;d>ie&&(d-=ie),f>ie&&(f-=ie);var p=function(t,e,i,n){var r=[Math.cos(e),Math.sin(e)];return t+(ze(r,i)+ze(r,n))/2>ze(r,o)};return p((t.x2-t.x1)/2,h,u,c)&&p((t.y2-t.y1)/2,d,u,c)&&p((e.x2-e.x1)/2,v,s,l)&&p((e.y2-e.y1)/2,f,s,l)}var We=1e-8;function Ge(t,e,i,n,r){for(var a=0,o=r[r.length-1];a<r.length;a++){var s=r[a];if(Re([t,e],[i,n],[s.x,s.y],[o.x,o.y]))return!0;o=s}return!1}function Ye(t,e,i){var n=0,r=t[0];if(!r)return!1;for(var a=1;a<t.length;a++){var o=t[a];n+=Xe(r.x,r.y,o.x,o.y,e,i),r=o}var s=t[0];return Ke(r.x,s.x)&&Ke(r.y,s.y)||(n+=Xe(r.x,r.y,s.x,s.y,e,i)),0!==n}function Xe(t,e,i,n,r,a){if(a>e&&a>n||a<e&&a<n)return 0;if(n===e)return 0;var o=(a-e)/(n-e),s=n<e?1:-1;1!==o&&0!==o||(s=n<e?.5:-.5);var l=o*(i-t)+t;return l===r?1/0:l>r?s:0}function Ke(t,e){return Math.abs(t-e)<We}var qe=function(t){var e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(n=(e&=1023)<<10|(i&=1023),n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function Ze(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);var n=t.fontStyle,r=void 0===n?e.fontStyle:n,a=t.fontVariant,o=void 0===a?e.fontVariant:a,s=t.fontWeight,l=void 0===s?e.fontWeight:s,u=t.fontSize,c=void 0===u?e.fontSize:u,h=t.fontFamily;return(r?r+" ":"")+(o?o+" ":"")+(l?l+" ":"")+c*i+"px "+((void 0===h?e.fontFamily:h)||"sans-serif")}var Je=function(){function t(e,i){n(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=i?i:{},this.textSpec=this._initSpec(),C(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=C(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return a(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(w(this._canvas)&&(C(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),w(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&C(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),w(this._context)&&C(this._canvas)){var t=this._canvas.getContext("2d");C(t)&&(t.save(),t.font=Ze(this.textSpec),this._contextSaved=!0,this._context=t)}return!w(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,i,n=this._option.defaultFontParams,r=void 0===n?{}:n,a=this._userSpec,o=a.fontStyle,s=void 0===o?r.fontStyle:o,l=a.fontVariant,u=void 0===l?r.fontVariant:l,c=a.fontWeight,h=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,d=a.fontSize,v=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,f=a.fontFamily,p=void 0===f?null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif":f,g=a.align,y=a.textAlign,m=void 0===y?null!=g?g:"center":y,_=a.baseline,k=a.textBaseline,b=void 0===k?null!=_?_:"middle":k,x=a.ellipsis,S=a.limit,A=this._userSpec.lineHeight,M=void 0===A?v:A;if(L(M)&&"%"===M[M.length-1]){var T=Number.parseFloat(M.substring(0,M.length-1))/100;M=v*T}return{fontStyle:s,fontVariant:u,fontFamily:p,fontSize:v,fontWeight:h,textAlign:m,textBaseline:b,ellipsis:x,limit:S,lineHeight:M}}},{key:"measure",value:function(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}},{key:"fullMeasure",value:function(t){if(w(t))return{width:0,height:0};if(w(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,a=i.fontWeight,o=i.textAlign,s=i.textBaseline,l=i.ellipsis,u=i.limit,c=i.lineHeight;try{var h=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:a,textAlign:o,textBaseline:s,ellipsis:!!l,maxLineWidth:u||1/0,lineHeight:c});e={width:h.width(),height:h.height()}}catch(n){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var i=this._context.measureText(t),n=this.textSpec,r=n.fontSize,a=n.lineHeight;return{width:i.width,height:null!==(e=a)&&void 0!==e?e:r,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var i={width:0,height:0},n=0;n<e.length;n++){var r=e[n],a=this._measureSpecialChar(r);w(a)&&t.NUMBERS_CHAR_SET.includes(r)&&(a=this._measureNumberChar()),w(a)&&["F","W"].includes(qe(r))&&(a=this._measureFullSizeChar()),w(a)&&(a=this._measureLetterChar()),i.width+=a.width,i.height=Math.max(i.height,a.height),!w(a.fontBoundingBoxAscent)&&(i.fontBoundingBoxAscent=a.fontBoundingBoxAscent),!w(a.fontBoundingBoxDescent)&&(i.fontBoundingBoxDescent=a.fontBoundingBoxDescent)}return i}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e,i={width:0,height:0},n=this.textSpec,r=n.fontSize,a=n.lineHeight,o=0;o<t.length;o++){var s=t[o],l=["F","W"].includes(qe(s))?1:.53;i.width+=l*r}return i.height=null!==(e=a)&&void 0!==e?e:r,i}},{key:"_measureReduce",value:function(t,e){var i,n=this.textSpec,r=n.fontSize,a=n.lineHeight,o={width:0,height:0};if(w(t))return o;if(O(t)){var s=t.filter(C).map((function(t){return t.toString()}));return 0===s.length?o:1===s.length?e(s[0]):{width:s.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:s.length*((null!==(i=a)&&void 0!==i?i:r)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(w(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return w(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(w(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return C(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){C(this._canvas)&&(this._canvas=null),C(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}])}();Je.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Je.NUMBERS_CHAR_SET="0123456789",Je.FULL_SIZE_CHAR="字";var Qe=function(t,e){return Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)},$e=function(t,e){function i(t,e,i){var n=t.getRotatedCorners().map((function(t){return t.x*e+t.y*i}));return{min:Math.min.apply(Math,k(n)),max:Math.max.apply(Math,k(n))}}for(var n=0,r=0,a=[{x:Math.cos(t.angle),y:Math.sin(t.angle)},{x:-Math.sin(t.angle),y:Math.cos(t.angle)},{x:Math.cos(e.angle),y:Math.sin(t.angle)},{x:-Math.sin(e.angle),y:Math.cos(t.angle)}];r<a.length;r++){var o=a[r],s=i(t,o.x,o.y),l=i(e,o.x,o.y),u=void 0;u=s.max<l.min?l.min-s.max:l.max<s.min?s.min-l.max:0,n=Math.max(n,u)}return n};function ti(t,e,i){var n=e.x1,r=e.y1,a=e.x2,o=e.y2;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*a+i.c*r+i.e,i.b*a+i.d*r+i.f),t.add(i.a*a+i.c*o+i.e,i.b*a+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}var ei=function(){function t(e){n(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return a(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return O(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return ti(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,i){var n=this.x1,r=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),l=Math.sin(t),u=e-e*s+i*l,c=i-e*l-i*s;return[s*n-l*r+u,l*n+s*r+c,s*n-l*o+u,l*n+s*o+c,s*a-l*r+u,l*a+s*r+c,s*a-l*o+u,l*a+s*o+c]}},{key:"scalePoints",value:function(t,e,i,n){return[t*this.x1+(1-t)*i,e*this.y1+(1-e)*n,t*this.x2+(1-t)*i,e*this.y2+(1-e)*n]}}])}(),ii=function(t){function e(){return n(this,e),i(this,e,arguments)}return c(e,t),a(e)}(ei),ni=function(t){function e(t){var r,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return n(this,e),r=i(this,e,[t]),t&&(r.angle=null!==(a=t.angle)&&void 0!==a?a:o),r}return c(e,t),a(e,[{key:"intersects",value:function(t){return Ue(this,t)}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return _(e,"setValue",this,3)([t,i,n,r]),this.angle=a,this}},{key:"clone",value:function(){return new e(this)}},{key:"getRotatedCorners",value:function(){var t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[He({x:this.x1,y:this.y1},this.angle,t),He({x:this.x2,y:this.y1},this.angle,t),He({x:this.x1,y:this.y2},this.angle