1 line
142 KiB
Plaintext
1 line
142 KiB
Plaintext
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).AILabel=e()}(this,function(){"use strict";function F(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(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 n(t,e,n){e&&_(t.prototype,e),n&&_(t,n)}function u(t,e,n){e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e={exports:{}},z=function(a){var u,t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function o(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{o({},"")}catch(t){o=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,o,a,s,e=e&&e.prototype instanceof d?e:d,e=Object.create(e.prototype),r=new S(r||[]);return e._invoke=(i=t,o=n,a=r,s=h,function(t,e){if(s===y)throw new Error("Generator is already running");if(s===v){if("throw"===t)throw e;return j()}for(a.method=t,a.arg=e;;){var n=a.delegate;if(n){n=function t(e,n){var r=e.iterator[n.method];if(r===u){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=u,t(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}r=l(r,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,p;r=r.arg;if(!r)return n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p;{if(!r.done)return r;n[e.resultName]=r.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=u)}n.delegate=null;return p}(n,a);if(n){if(n===p)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===h)throw s=v,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=y;n=l(i,o,a);if("normal"===n.type){if(s=a.done?v:f,n.arg!==p)return{value:n.arg,done:a.done}}else"throw"===n.type&&(s=v,a.method="throw",a.arg=n.arg)}}),e}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=s;var h="suspendedStart",f="suspendedYield",y="executing",v="completed",p={};function d(){}function m(){}function g(){}var e={},b=(o(e,r,function(){return this}),Object.getPrototypeOf),b=b&&b(b(D([]))),w=(b&&b!==t&&c.call(b,r)&&(e=b),g.prototype=d.prototype=Object.create(e));function x(t){["next","throw","return"].forEach(function(e){o(t,e,function(t){return this._invoke(e,t)})})}function k(a,s){var e;this._invoke=function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var o,t=l(a[t],a,n);if("throw"!==t.type)return(n=(o=t.arg).value)&&"object"==typeof n&&c.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){o.value=t,r(o)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function O(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function D(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(c.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=u,t.done=!0,t}).next=t}return{next:j}}function j(){return{value:u,done:!0}}return o(w,"constructor",m.prototype=g),o(g,"constructor",m),m.displayName=o(g,i,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,o(t,i,"GeneratorFunction")),t.prototype=Object.create(w),t},a.awrap=function(t){return{__await:t}},x(k.prototype),o(k.prototype,n,function(){return this}),a.AsyncIterator=k,a.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var o=new k(s(t,e,n,r),i);return a.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},x(w),o(w,i,"Generator"),o(w,r,function(){return this}),o(w,"toString",function(){return"[object Generator]"}),a.keys=function(n){var t,r=[];for(t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=D,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return o.type="throw",o.arg=n,r.next=t,e&&(r.method="next",r.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=c.call(i,"catchLoc"),s=c.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&c.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var o=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(o)},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;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,P(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:D(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=u),p}},a}(e.exports);try{regeneratorRuntime=z}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=z:Function("r","regeneratorRuntime = r")(z)}var B=e.exports,z={exports:{}},e="object"==typeof Reflect?Reflect:null,W=e&&"function"==typeof e.apply?e.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};var U=e&&"function"==typeof e.ownKeys?e.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)},G=Number.isNaN||function(t){return t!=t};function r(){r.init.call(this)}z.exports=r,z.exports.once=function(s,u){return new Promise(function(t,e){function n(t){s.removeListener(u,r),e(t)}function r(){"function"==typeof s.removeListener&&s.removeListener("error",n),t([].slice.call(arguments))}var i,o,a;V(s,u,r,{once:!0}),"error"!==u&&(o=n,a={once:!0},"function"==typeof(i=s).on&&V(i,"error",o,a))})},(r.EventEmitter=r).prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var K=10;function N(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Y(t){return void 0===t._maxListeners?r.defaultMaxListeners:t._maxListeners}function X(t,e,n,r){var i,o;return N(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener||n),i=t._events),o=i[e]),void 0===o?(o=i[e]=n,++t._eventsCount):("function"==typeof o?o=i[e]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),0<(i=Y(t))&&o.length>i&&!o.warned&&(o.warned=!0,(r=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",r.emitter=t,r.type=e,r.count=o.length,n=r,console&&console.warn&&console.warn(n))),t}function H(t,e,n){t={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},e=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(t);return e.listener=n,t.wrapFn=e}function $(t,e,n){t=t._events;if(void 0===t)return[];t=t[e];{if(void 0===t)return[];if("function"==typeof t)return n?[t.listener||t]:[t];if(n){for(var r=t,i=new Array(r.length),o=0;o<i.length;++o)i[o]=r[o].listener||r[o];return i}return q(t,t.length)}}function Z(t){var e=this._events;if(void 0!==e){e=e[t];if("function"==typeof e)return 1;if(void 0!==e)return e.length}return 0}function q(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}function V(n,r,i,o){if("function"==typeof n.on)o.once?n.once(r,i):n.on(r,i);else{if("function"!=typeof n.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n);n.addEventListener(r,function t(e){o.once&&n.removeEventListener(r,t),i(e)})}}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return K},set:function(t){if("number"!=typeof t||t<0||G(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");K=t}}),r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||G(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},r.prototype.getMaxListeners=function(){return Y(this)},r.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){if((o=0<e.length?e[0]:o)instanceof Error)throw o;r=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw r.context=o,r}var o=i[t];if(void 0===o)return!1;if("function"==typeof o)W(o,this,e);else for(var a=o.length,s=q(o,a),n=0;n<a;++n)W(s[n],this,e);return!0},r.prototype.on=r.prototype.addListener=function(t,e){return X(this,t,e,!1)},r.prototype.prependListener=function(t,e){return X(this,t,e,!0)},r.prototype.once=function(t,e){return N(e),this.on(t,H(this,t,e)),this},r.prototype.prependOnceListener=function(t,e){return N(e),this.prependListener(t,H(this,t,e)),this},r.prototype.off=r.prototype.removeListener=function(t,e){var n,r,i,o,a;if(N(e),void 0!==(r=this._events)&&void 0!==(n=r[t]))if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,o=n.length-1;0<=o;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;if(0===i)n.shift();else{for(var s=n,u=i;u+1<s.length;u++)s[u]=s[u+1];s.pop()}1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},r.prototype.removeAllListeners=function(t){var e,n=this._events;if(void 0!==n){if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){for(var r,i=Object.keys(n),o=0;o<i.length;++o)"removeListener"!==(r=i[o])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(o=e.length-1;0<=o;o--)this.removeListener(t,e[o])}return this},r.prototype.listeners=function(t){return $(this,t,!0)},r.prototype.rawListeners=function(t){return $(this,t,!1)},r.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):Z.call(t,e)},r.prototype.listenerCount=Z,r.prototype.eventNames=function(){return 0<this._eventsCount?U(this._events):[]};var J=z.exports,e="undefined"!=typeof navigator&&0<navigator.userAgent.toLowerCase().indexOf("firefox");function Q(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on".concat(e),function(){n(window.event)})}function tt(t,e){for(var n=e.slice(0,e.length-1),r=0;r<n.length;r++)n[r]=t[n[r].toLowerCase()];return n}function et(t){for(var e=(t=(t="string"!=typeof t?"":t).replace(/\s/g,"")).split(","),n=e.lastIndexOf("");0<=n;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}for(var nt={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,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":e?173:189,"=":e?61:187,";":e?59:186,"'":222,"[":219,"]":221,"\\":220},rt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},it={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},y={16:!1,18:!1,17:!1,91:!1},v={},ot=1;ot<20;ot++)nt["f".concat(ot)]=111+ot;var p=[],at="all",st=[],ut=function(t){return nt[t.toLowerCase()]||rt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function ct(t){at=t||"all"}function lt(){return at||"all"}function ht(t){var e=t.key,i=t.scope,o=t.method,a=void 0===(t=t.splitKey)?"+":t;et(e).forEach(function(t){var e,t=t.split(a),n=t.length,r=t[n-1],r="*"===r?"*":ut(r);v[r]&&(i=i||lt(),e=1<n?tt(rt,t):[],v[r]=v[r].map(function(t){return o&&t.method!==o||t.scope!==i||!function(t,e){for(var n=t.length>=e.length?t:e,r=t.length>=e.length?e:t,i=!0,o=0;o<n.length;o++)-1===r.indexOf(n[o])&&(i=!1);return i}(t.mods,e)?t:{}}))})}function ft(t,e,n){var r;if(e.scope===n||"all"===e.scope){for(var i in r=0<e.mods.length,y)Object.prototype.hasOwnProperty.call(y,i)&&(!y[i]&&-1<e.mods.indexOf(+i)||y[i]&&-1===e.mods.indexOf(+i))&&(r=!1);(0!==e.mods.length||y[16]||y[18]||y[17]||y[91])&&!r&&"*"!==e.shortcut||!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function yt(n){var t=v["*"],e=n.keyCode||n.which||n.charCode;if(vt.filter.call(this,n)){if(-1===p.indexOf(e=93!==e&&224!==e?e:91)&&229!==e&&p.push(e),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(t){var e=it[t];n[t]&&-1===p.indexOf(e)?p.push(e):!n[t]&&-1<p.indexOf(e)?p.splice(p.indexOf(e),1):"metaKey"!==t||!n[t]||3!==p.length||n.ctrlKey||n.shiftKey||n.altKey||(p=p.slice(p.indexOf(e)))}),e in y){for(var r in y[e]=!0,rt)rt[r]===e&&(vt[r]=!0);if(!t)return}for(var i in y)Object.prototype.hasOwnProperty.call(y,i)&&(y[i]=n[it[i]]);n.getModifierState&&(!n.altKey||n.ctrlKey)&&n.getModifierState("AltGraph")&&(-1===p.indexOf(17)&&p.push(17),-1===p.indexOf(18)&&p.push(18),y[17]=!0,y[18]=!0);var o=lt();if(t)for(var a=0;a<t.length;a++)t[a].scope===o&&("keydown"===n.type&&t[a].keydown||"keyup"===n.type&&t[a].keyup)&&ft(n,t[a],o);if(e in v)for(var s=0;s<v[e].length;s++)if(("keydown"===n.type&&v[e][s].keydown||"keyup"===n.type&&v[e][s].keyup)&&v[e][s].key){for(var u=v[e][s],c=u.splitKey,l=u.key.split(c),h=[],f=0;f<l.length;f++)h.push(ut(l[f]));h.sort().join("")===p.sort().join("")&&ft(n,u,o)}}}function vt(t,e,n){p=[];var r=et(t),i=[],o="all",a=document,s=0,u=!1,c=!0,l="+";for(void 0===n&&"function"==typeof e&&(n=e),"[object Object]"===Object.prototype.toString.call(e)&&(e.scope&&(o=e.scope),e.element&&(a=e.element),e.keyup&&(u=e.keyup),void 0!==e.keydown&&(c=e.keydown),"string"==typeof e.splitKey&&(l=e.splitKey)),"string"==typeof e&&(o=e);s<r.length;s++)i=[],1<(t=r[s].split(l)).length&&(i=tt(rt,t)),(t="*"===(t=t[t.length-1])?"*":ut(t))in v||(v[t]=[]),v[t].push({keyup:u,keydown:c,scope:o,mods:i,shortcut:r[s],method:n,key:r[s],splitKey:l});void 0===a||(e=a,-1<st.indexOf(e))||!window||(st.push(a),Q(a,"keydown",function(t){yt(t)}),Q(window,"focus",function(){p=[]}),Q(a,"keyup",function(t){yt(t);var e=t.keyCode||t.which||t.charCode,n=p.indexOf(e);if(0<=n&&p.splice(n,1),t.key&&"meta"===t.key.toLowerCase()&&p.splice(0,p.length),(e=93!==e&&224!==e?e:91)in y)for(var r in y[e]=!1,rt)rt[r]===e&&(vt[r]=!1)}))}var pt,dt,mt={setScope:ct,getScope:lt,deleteScope:function(t,e){var n,r,i;for(i in t=t||lt(),v)if(Object.prototype.hasOwnProperty.call(v,i))for(n=v[i],r=0;r<n.length;)n[r].scope===t?n.splice(r,1):r++;lt()===t&&ct(e||"all")},getPressedKeyCodes:function(){return p.slice(0)},isPressed:function(t){return"string"==typeof t&&(t=ut(t)),-1!==p.indexOf(t)},filter:function(t){var e=(t=t.target||t.srcElement).tagName,n=!0;return n=!t.isContentEditable&&("INPUT"!==e&&"TEXTAREA"!==e&&"SELECT"!==e||t.readOnly)?n:!1},unbind:function(t){if(t){if(Array.isArray(t))t.forEach(function(t){t.key&&ht(t)});else if("object"==typeof t)t.key&&ht(t);else if("string"==typeof t){for(var e=arguments.length,n=new Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=n[0],o=n[1];"function"==typeof i&&(o=i,i=""),ht({key:t,scope:i,method:o,splitKey:"+"})}}else Object.keys(v).forEach(function(t){return delete v[t]})}};for(pt in mt)Object.prototype.hasOwnProperty.call(mt,pt)&&(vt[pt]=mt[pt]);"undefined"!=typeof window&&(dt=window.hotkeys,vt.noConflict=function(t){return t&&window.hotkeys===vt&&(window.hotkeys=dt),vt},window.hotkeys=vt);var z="object"==typeof t&&t&&t.Object===Object&&t,e="object"==typeof self&&self&&self.Object===Object&&self,t=z||e||Function("return this")(),e=t.Symbol,i=Object.prototype,gt=i.hasOwnProperty,bt=i.toString,wt=e?e.toStringTag:void 0;var xt=Object.prototype.toString;var kt=function(t){var e=gt.call(t,wt),n=t[wt];try{var r=!(t[wt]=void 0)}catch(t){}var i=bt.call(t);return r&&(e?t[wt]=n:delete t[wt]),i},Ot=function(t){return xt.call(t)},Pt=e?e.toStringTag:void 0;function St(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(Pt&&Pt in Object(t)?kt:Ot)(t)}function Dt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var jt=St,Ct=Dt;var b=function(t){return!!Ct(t)&&("[object Function]"==(t=jt(t))||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)},i=t["__core-js_shared__"],At=(i=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";var Mt=Function.prototype.toString;function Tt(t){if(null!=t){try{return Mt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Lt=b,Et=function(t){return!!At&&At in t},Rt=Dt,It=Tt,Ft=/^\[object .+?Constructor\]$/,i=Function.prototype,o=Object.prototype,i=i.toString,o=o.hasOwnProperty,_t=RegExp("^"+i.call(o).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var zt=function(t){return!(!Rt(t)||Et(t))&&(Lt(t)?_t:Ft).test(It(t))},Bt=function(t,e){return null==t?void 0:t[e]};function Wt(t,e){return t=Bt(t,e),zt(t)?t:void 0}var Ut=Wt,i=function(){try{var t=Ut(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Gt=i;function Kt(t,e,n){"__proto__"==e&&Gt?Gt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Nt(t,e){return t===e||t!=t&&e!=e}var Yt=Kt,Xt=Nt,Ht=Object.prototype.hasOwnProperty;function $t(t,e,n){var r=t[e];Ht.call(t,e)&&Xt(r,n)&&(void 0!==n||e in t)||Yt(t,e,n)}var Zt=$t,qt=Kt;function Vt(t,e,n,r){for(var i=!n,o=(n=n||{},-1),a=e.length;++o<a;){var s=e[o],u=r?r(n[s],t[s],s,n,t):void 0;void 0===u&&(u=t[s]),(i?qt:Zt)(n,s,u)}return n}function Jt(t){return t}var Qt=function(t,e,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])}return t.apply(e,n)},te=Math.max;var ee=function(t){return function(){return t}},ne=i,re=Date.now;var o=function(n){var r=0,i=0;return function(){var t=re(),e=16-(t-i);if(i=t,0<e){if(800<=++r)return arguments[0]}else r=0;return n.apply(void 0,arguments)}}(ne?function(t,e){return ne(t,"toString",{configurable:!0,enumerable:!1,value:ee(e),writable:!0})}:Jt),ie=Jt,oe=function(o,a,s){return a=te(void 0===a?o.length-1:a,0),function(){for(var t=arguments,e=-1,n=te(t.length-a,0),r=Array(n);++e<n;)r[e]=t[a+e];for(var e=-1,i=Array(a+1);++e<a;)i[e]=t[e];return i[a]=s(r),Qt(o,this,i)}},ae=o;function se(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991}var ue=b,ce=se;function le(t){return null!=t&&ce(t.length)&&!ue(t)}var he=/^(?:0|[1-9]\d*)$/;function fe(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&he.test(t))&&-1<t&&t%1==0&&t<e}var ye=Nt,ve=le,pe=fe,de=Dt;var me=function(t,e){return ae(oe(t,e,ie),t+"")},ge=function(t,e,n){if(!de(n))return!1;var r=typeof e;return!!("number"==r?ve(n)&&pe(e,n.length):"string"==r&&e in n)&&ye(n[e],t)};function be(s){return me(function(t,e){var n=-1,r=e.length,i=1<r?e[r-1]:void 0,o=2<r?e[2]:void 0,i=3<s.length&&"function"==typeof i?(r--,i):void 0;for(o&&ge(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var a=e[n];a&&s(t,a,n,i)}return t})}var we=Object.prototype;function xe(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||we)}function ke(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Oe(t){return null!=t&&"object"==typeof t}var Pe=St,Se=Oe;var i=function(t){return Se(t)&&"[object Arguments]"==Pe(t)},De=Oe,o=Object.prototype,je=o.hasOwnProperty,Ce=o.propertyIsEnumerable,o=i(function(){return arguments}())?i:function(t){return De(t)&&je.call(t,"callee")&&!Ce.call(t,"callee")},i=Array.isArray,Ae={exports:{}};h=(h=(l=Ae).exports)&&!h.nodeType&&h,c=(c=h&&l&&!l.nodeType&&l)&&c.exports===h?t.Buffer:void 0,h=c?c.isBuffer:void 0,l.exports=h||function(){return!1};var Me=St,Te=se,Le=Oe,a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;function Ee(t){return Le(t)&&Te(t.length)&&!!a[Me(t)]}function Re(e){return function(t){return e(t)}}var Ie,Fe,c={exports:{}},z=(h=(h=(l=c).exports)&&!h.nodeType&&h,Ie=h&&l&&!l.nodeType&&l,Fe=Ie&&Ie.exports===h&&z.process,h=function(){try{var t=Ie&&Ie.require&&Ie.require("util").types;return t?t:Fe&&Fe.binding&&Fe.binding("util")}catch(t){}}(),l.exports=h,Ee),l=Re,h=c.exports,h=h&&h.isTypedArray,l=h?l(h):z,_e=ke,ze=o,Be=i,We=Ae.exports,Ue=fe,Ge=l,Ke=Object.prototype.hasOwnProperty;function Ne(t,e){var n,r=Be(t),i=!r&&ze(t),o=!r&&!i&&We(t),a=!r&&!i&&!o&&Ge(t),s=r||i||o||a,u=s?_e(t.length,String):[],c=u.length;for(n in t)!e&&!Ke.call(t,n)||s&&("length"==n||o&&("offset"==n||"parent"==n)||a&&("buffer"==n||"byteLength"==n||"byteOffset"==n)||Ue(n,c))||u.push(n);return u}function Ye(e,n){return function(t){return e(n(t))}}var h=Ye(Object.keys,Object),Xe=xe,He=h,$e=Object.prototype.hasOwnProperty;var Ze=Ne,qe=function(t){if(!Xe(t))return He(t);var e,n=[];for(e in Object(t))$e.call(t,e)&&"constructor"!=e&&n.push(e);return n},Ve=le;function Je(t){return(Ve(t)?Ze:qe)(t)}var Qe=$t,tn=Vt,z=be,en=le,nn=xe,rn=Je,on=Object.prototype.hasOwnProperty,an=z(function(t,e){if(nn(e)||en(e))tn(e,rn(e),t);else for(var n in e)on.call(e,n)&&Qe(t,n,e[n])});function sn(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var un=St,cn=Oe;function ln(t){return"symbol"==typeof t||cn(t)&&"[object Symbol]"==un(t)}var hn=sn,fn=i,yn=ln,h=e?e.prototype:void 0,vn=h?h.toString:void 0;var pn=function t(e){if("string"==typeof e)return e;if(fn(e))return hn(e,t)+"";if(yn(e))return vn?vn.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n};function dn(t){return null==t?"":pn(t)}var mn=dn,gn=0;var bn=function(t){var e=++gn;return mn(t)+e};function wn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}var xn=function(u){return function(t,e,n){for(var r=-1,i=Object(t),o=n(t),a=o.length;a--;){var s=o[u?a:++r];if(!1===e(i[s],s,i))break}return t}}(),kn=Je;var On=le;var z=function(o,a){return function(t,e){if(null!=t){if(!On(t))return o(t,e);for(var n=t.length,r=a?n:-1,i=Object(t);(a?r--:++r<n)&&!1!==e(i[r],r,i););}return t}}(function(t,e){return t&&xn(t,e,kn)}),Pn=Jt;var Sn=wn,Dn=z,jn=function(t){return"function"==typeof t?t:Pn},Cn=i;var P=function(t,e){return(Cn(t)?Sn:Dn)(t,jn(e))},An=i,Mn=ln,Tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ln=/^\w*$/;function En(t,e){if(An(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Mn(t))||(Ln.test(t)||!Tn.test(t)||null!=e&&t in Object(e))}var h=Wt(Object,"create"),Rn=h;var In=h,Fn=Object.prototype.hasOwnProperty;var _n=h,zn=Object.prototype.hasOwnProperty;var Bn=h;function Wn(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t}function Un(t){var e,n=this.__data__;return In?"__lodash_hash_undefined__"===(e=n[t])?void 0:e:Fn.call(n,t)?n[t]:void 0}function Gn(t){var e=this.__data__;return _n?void 0!==e[t]:zn.call(e,t)}function Kn(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Bn&&void 0===e?"__lodash_hash_undefined__":e,this}function Nn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Nn.prototype.clear=function(){this.__data__=Rn?Rn(null):{},this.size=0},Nn.prototype.delete=Wn,Nn.prototype.get=Un,Nn.prototype.has=Gn,Nn.prototype.set=Kn;h=Nn;var Yn=Nt;function Xn(t,e){for(var n=t.length;n--;)if(Yn(t[n][0],e))return n;return-1}var Hn=Xn,$n=Array.prototype.splice;var Zn=Xn;var qn=Xn;var Vn=Xn;function Jn(t){var e=this.__data__;return!((t=Hn(e,t))<0)&&(t==e.length-1?e.pop():$n.call(e,t,1),--this.size,!0)}function Qn(t){var e=this.__data__;return(t=Zn(e,t))<0?void 0:e[t][1]}function tr(t){return-1<qn(this.__data__,t)}function er(t,e){var n=this.__data__,r=Vn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function nr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nr.prototype.clear=function(){this.__data__=[],this.size=0},nr.prototype.delete=Jn,nr.prototype.get=Qn,nr.prototype.has=tr,nr.prototype.set=er;var rr=nr,ir=Wt(t,"Map"),or=h,ar=rr,sr=ir;var ur=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};function cr(t,e){return t=t.__data__,ur(e)?t["string"==typeof e?"string":"hash"]:t.map}var lr=cr;var hr=cr;var fr=cr;var yr=cr;function vr(t){return t=lr(this,t).delete(t),this.size-=t?1:0,t}function pr(t){return hr(this,t).get(t)}function dr(t){return fr(this,t).has(t)}function mr(t,e){var n=yr(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function gr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}gr.prototype.clear=function(){this.size=0,this.__data__={hash:new or,map:new(sr||ar),string:new or}},gr.prototype.delete=vr,gr.prototype.get=pr,gr.prototype.has=dr,gr.prototype.set=mr;var h=gr,br=h;function wr(r,i){if("function"!=typeof r||null!=i&&"function"!=typeof i)throw new TypeError("Expected a function");function o(){var t=arguments,e=i?i.apply(this,t):t[0],n=o.cache;return n.has(e)?n.get(e):(t=r.apply(this,t),o.cache=n.set(e,t)||n,t)}return o.cache=new(wr.Cache||br),o}wr.Cache=br;var xr=wr;var kr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Or=/\\(\\)?/g,Pr=function(t){var e=(t=xr(t,function(t){return 500===e.size&&e.clear(),t})).cache;return t}(function(t){var i=[];return 46===t.charCodeAt(0)&&i.push(""),t.replace(kr,function(t,e,n,r){i.push(n?r.replace(Or,"$1"):e||t)}),i}),Sr=i,Dr=En,jr=Pr,Cr=dn;function Ar(t,e){return Sr(t)?t:Dr(t,e)?[t]:jr(Cr(t))}var Mr=ln;function Tr(t){if("string"==typeof t||Mr(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}var Lr=Ar,Er=Tr;function Rr(t,e){for(var n=0,r=(e=Lr(e,t)).length;null!=t&&n<r;)t=t[Er(e[n++])];return n&&n==r?t:void 0}var Ir=Rr;var d=function(t,e,n){return void 0===(t=null==t?void 0:Ir(t,e))?n:t},Fr=St,_r=Oe;var S=function(t){return"number"==typeof t||_r(t)&&"[object Number]"==Fr(t)},zr=rr;var Br=rr,Wr=ir,Ur=h;function Gr(t){var e=this.__data__,t=e.delete(t);return this.size=e.size,t}function Kr(t){return this.__data__.get(t)}function Nr(t){return this.__data__.has(t)}function Yr(t,e){var n=this.__data__;if(n instanceof Br){var r=n.__data__;if(!Wr||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ur(r)}return n.set(t,e),this.size=n.size,this}var Xr=rr;function Hr(t){t=this.__data__=new Xr(t);this.size=t.size}Hr.prototype.clear=function(){this.__data__=new zr,this.size=0},Hr.prototype.delete=Gr,Hr.prototype.get=Kr,Hr.prototype.has=Nr,Hr.prototype.set=Yr;var Pr=Hr,$r=Vt,Zr=Je;function qr(t,e){return t&&$r(e,Zr(e),t)}var Vr=Dt,Jr=xe,Qr=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},ti=Object.prototype.hasOwnProperty;var ei=Ne,ni=function(t){if(!Vr(t))return Qr(t);var e,n=Jr(t),r=[];for(e in t)("constructor"!=e||!n&&ti.call(t,e))&&r.push(e);return r},ri=le;function ii(t){return ri(t)?ei(t,!0):ni(t)}var oi=Vt,ai=ii;function si(t,e){return t&&oi(e,ai(e),t)}var ui,rr={exports:{}};f=(f=(m=rr).exports)&&!f.nodeType&&f,bi=(bi=f&&m&&!m.nodeType&&m)&&bi.exports===f?t.Buffer:void 0,ui=bi?bi.allocUnsafe:void 0,m.exports=function(t,e){return e?t.slice():(e=t.length,e=ui?ui(e):new t.constructor(e),t.copy(e),e)};function ci(t,e){var n=-1,r=t.length;for(e=e||Array(r);++n<r;)e[n]=t[n];return e}function li(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function hi(){return[]}var fi=li,yi=Object.prototype.propertyIsEnumerable,vi=Object.getOwnPropertySymbols,f=vi?function(e){return null==e?[]:(e=Object(e),fi(vi(e),function(t){return yi.call(e,t)}))}:hi,pi=Vt,di=f;function mi(t,e){return pi(t,di(t),e)}function gi(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var bi=Ye(Object.getPrototypeOf,Object),wi=gi,xi=bi,ki=f,m=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)wi(e,ki(t)),t=xi(t);return e}:hi,Oi=Vt,Pi=m;function Si(t,e){return Oi(t,Pi(t),e)}var Di=gi,ji=i;function Ci(t,e,n){return e=e(t),ji(t)?e:Di(e,n(t))}var Ai=Ci,Mi=f,Ti=Je;function Li(t){return Ai(t,Ti,Mi)}var Ei=Ci,Ri=m,Ii=ii;function Fi(t){return Ei(t,Ii,Ri)}var f=Wt(t,"DataView"),m=Wt(t,"Promise"),_i=Wt(t,"Set"),g=_i,zi=Wt(t,"WeakMap"),Bi=St,Wi=Tt,Ui="[object Map]",Gi="[object Promise]",Ki="[object Set]",Ni="[object WeakMap]",Yi="[object DataView]",Xi=Wi(f),Hi=Wi(ir),$i=Wi(m),Zi=Wi(g),qi=Wi(zi),Vi=Bi,f=Vi=f&&Vi(new f(new ArrayBuffer(1)))!=Yi||ir&&Vi(new ir)!=Ui||m&&Vi(m.resolve())!=Gi||g&&Vi(new g)!=Ki||zi&&Vi(new zi)!=Ni?function(t){var e=Bi(t),t="[object Object]"==e?t.constructor:void 0,t=t?Wi(t):"";if(t)switch(t){case Xi:return Yi;case Hi:return Ui;case $i:return Gi;case Zi:return Ki;case qi:return Ni}return e}:Vi,Ji=Object.prototype.hasOwnProperty;function Qi(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ji.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var ir=t.Uint8Array,to=ir;function eo(t){var e=new t.constructor(t.byteLength);return new to(e).set(new to(t)),e}var no=eo;var ro=/\w*$/;var m=e?e.prototype:void 0,io=m?m.valueOf:void 0;var oo=eo;var ao=eo,so=function(t,e){return e=e?no(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.byteLength)},uo=function(t){var e=new t.constructor(t.source,ro.exec(t));return e.lastIndex=t.lastIndex,e},co=function(t){return io?Object(io.call(t)):{}},lo=function(t,e){return e=e?oo(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.length)};function ho(t,e,n){var r=t.constructor;switch(e){case"[object ArrayBuffer]":return ao(t);case"[object Boolean]":case"[object Date]":return new r(+t);case"[object DataView]":return so(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return lo(t,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(t);case"[object RegExp]":return uo(t);case"[object Set]":return new r;case"[object Symbol]":return co(t)}}var fo=Dt,yo=Object.create;function vo(){}var po=function(t){if(!fo(t))return{};if(yo)return yo(t);vo.prototype=t;t=new vo;return vo.prototype=void 0,t},mo=bi,go=xe;function bo(t){return"function"!=typeof t.constructor||go(t)?{}:po(mo(t))}var wo=f,xo=Oe;function ko(t){return xo(t)&&"[object Map]"==wo(t)}var g=Re,zi=c.exports,Vi=zi&&zi.isMap,t=Vi?g(Vi):ko,Oo=f,Po=Oe;function So(t){return Po(t)&&"[object Set]"==Oo(t)}var m=Re,bi=c.exports,zi=bi&&bi.isSet,g=zi?m(zi):So,Do=Pr,jo=wn,Co=$t,Ao=qr,Mo=si,To=rr.exports,Lo=ci,Eo=mi,Ro=Si,Io=Li,Fo=Fi,_o=f,zo=Qi,Bo=ho,Wo=bo,Uo=i,Go=Ae.exports,Ko=t,No=Dt,Yo=g,Xo=Je,Ho=ii,$o="[object Arguments]",Zo="[object Function]",qo="[object Object]",w={};w[$o]=w["[object Array]"]=w["[object ArrayBuffer]"]=w["[object DataView]"]=w["[object Boolean]"]=w["[object Date]"]=w["[object Float32Array]"]=w["[object Float64Array]"]=w["[object Int8Array]"]=w["[object Int16Array]"]=w["[object Int32Array]"]=w["[object Map]"]=w["[object Number]"]=w[qo]=w["[object RegExp]"]=w["[object Set]"]=w["[object String]"]=w["[object Symbol]"]=w["[object Uint8Array]"]=w["[object Uint8ClampedArray]"]=w["[object Uint16Array]"]=w["[object Uint32Array]"]=!0,w["[object Error]"]=w[Zo]=w["[object WeakMap]"]=!1;var Vo=function n(r,i,o,t,e,a){var s,u=1&i,c=2&i,l=4&i;if(void 0===(s=o?e?o(r,t,e,a):o(r):s)){if(!No(r))return r;if(t=Uo(r)){if(s=zo(r),!u)return Lo(r,s)}else{var h=_o(r),f=h==Zo||"[object GeneratorFunction]"==h;if(Go(r))return To(r,u);if(h==qo||h==$o||f&&!e){if(s=c||f?{}:Wo(r),!u)return c?Ro(r,Mo(s,r)):Eo(r,Ao(s,r))}else{if(!w[h])return e?r:{};s=Bo(r,h,u)}}if(f=(a=a||new Do).get(r))return f;a.set(r,s),Yo(r)?r.forEach(function(t){s.add(n(t,i,o,t,r,a))}):Ko(r)&&r.forEach(function(t,e){s.set(e,n(t,i,o,e,r,a))});var y=t?void 0:(l?c?Fo:Io:c?Ho:Xo)(r);jo(y||r,function(t,e){y&&(t=r[e=t]),Co(s,e,n(t,i,o,e,r,a))})}return s};var Jo=function(t){return Vo(t,5)},Qo=z;function ta(t,r){var i=[];return Qo(t,function(t,e,n){r(t,e,n)&&i.push(t)}),i}function ea(t){return this.__data__.has(t)}var na=h;function ra(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new na;++e<n;)this.add(t[e])}ra.prototype.add=ra.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ra.prototype.has=ea;Vi=ra;function ia(t,e){return t.has(e)}var oa=Vi,aa=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},sa=ia;function ua(t,e,n,r,i,o){var a=1&n,s=t.length,u=e.length;if(s!=u&&!(a&&s<u))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var l=-1,h=!0,f=2&n?new oa:void 0;for(o.set(t,e),o.set(e,t);++l<s;){var y,v=t[l],p=e[l];if(void 0!==(y=r?a?r(p,v,l,e,t,o):r(v,p,l,t,e,o):y)){if(y)continue;h=!1;break}if(f){if(!aa(e,function(t,e){if(!sa(f,e)&&(v===t||i(v,t,n,r,o)))return f.push(e)})){h=!1;break}}else if(v!==p&&!i(v,p,n,r,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function ca(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function la(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}var ha=ir,fa=Nt,ya=ua,va=ca,c=e?e.prototype:void 0,pa=c?c.valueOf:void 0;var da=Li,ma=Object.prototype.hasOwnProperty;var ga=Pr,ba=ua,wa=function(t,e,n,r,i,o,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return t.byteLength==e.byteLength&&o(new ha(t),new ha(e))?!0:!1;case"[object Boolean]":case"[object Date]":case"[object Number]":return fa(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=la;case"[object Set]":s=s||va;if(t.size!=e.size&&!(1&r))return!1;var u=a.get(t);if(u)return u==e;r|=2,a.set(t,e);u=ya(s(t),s(e),r,i,o,a);return a.delete(t),u;case"[object Symbol]":if(pa)return pa.call(t)==pa.call(e)}return!1},xa=function(t,e,n,r,i,o){var a=1&n,s=da(t),u=s.length;if(u!=da(e).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in e:ma.call(e,l)))return!1}var h=o.get(t),f=o.get(e);if(h&&f)return h==e&&f==t;for(var y=!0,v=(o.set(t,e),o.set(e,t),a);++c<u;){var p,d=t[l=s[c]],m=e[l];if(!(void 0===(p=r?a?r(m,d,l,e,t,o):r(d,m,l,t,e,o):p)?d===m||i(d,m,n,r,o):p)){y=!1;break}v=v||"constructor"==l}return y&&!v&&(h=t.constructor)!=(f=e.constructor)&&"constructor"in t&&"constructor"in e&&!("function"==typeof h&&h instanceof h&&"function"==typeof f&&f instanceof f)&&(y=!1),o.delete(t),o.delete(e),y},ka=f,Oa=i,Pa=Ae.exports,Sa=l,Da="[object Arguments]",ja="[object Array]",Ca="[object Object]",Aa=Object.prototype.hasOwnProperty;var Ma=function(t,e,n,r,i,o){var a=Oa(t),s=Oa(e),u=a?ja:ka(t),s=s?ja:ka(e),c=(u=u==Da?Ca:u)==Ca,l=(s=s==Da?Ca:s)==Ca;if((s=u==s)&&Pa(t)){if(!Pa(e))return!1;c=!(a=!0)}if(s&&!c)return o=o||new ga,a||Sa(t)?ba(t,e,n,r,i,o):wa(t,e,u,n,r,i,o);if(!(1&n)){a=c&&Aa.call(t,"__wrapped__"),u=l&&Aa.call(e,"__wrapped__");if(a||u)return i(a?t.value():t,u?e.value():e,n,r,o=o||new ga)}return!!s&&(o=o||new ga,xa(t,e,n,r,i,o))},Ta=Oe;function La(t,e,n,r,i){return t===e||(null==t||null==e||!Ta(t)&&!Ta(e)?t!=t&&e!=e:Ma(t,e,n,r,La,i))}var Ea=Pr,Ra=La;var Ia=Dt;function Fa(t){return t==t&&!Ia(t)}var _a=Fa,za=Je;function Ba(e,n){return function(t){return null!=t&&(t[e]===n&&(void 0!==n||e in Object(t)))}}var Wa=function(t,e,n,r){var i=n.length,o=i,a=!r;if(null==t)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){var u=(s=n[i])[0],c=t[u],l=s[1];if(a&&s[2]){if(void 0===c&&!(u in t))return!1}else{var h,f=new Ea;if(!(void 0===(h=r?r(c,l,u,t,e,f):h)?Ra(l,c,3,r,f):h))return!1}}return!0},Ua=function(t){for(var e=za(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,_a(i)]}return e},Ga=Ba;var Ka=Ar,Na=o,Ya=i,Xa=fe,Ha=se,$a=Tr;function Za(t,e){return null!=t&&e in Object(t)}var qa=function(t,e,n){for(var r=-1,i=(e=Ka(e,t)).length,o=!1;++r<i;){var a=$a(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Ha(i)&&Xa(a,i)&&(Ya(t)||Na(t))};var Va=La,Ja=d,Qa=function(t,e){return null!=t&&qa(t,e,Za)},ts=En,es=Fa,ns=Ba,rs=Tr;var is=Rr;var os=function(e){return function(t){return null==t?void 0:t[e]}},as=function(e){return function(t){return is(t,e)}},ss=En,us=Tr;var cs=function(e){var n=Ua(e);return 1==n.length&&n[0][2]?Ga(n[0][0],n[0][1]):function(t){return t===e||Wa(t,e,n)}},ls=function(n,r){return ts(n)&&es(r)?ns(rs(n),r):function(t){var e=Ja(t,n);return void 0===e&&e===r?Qa(t,n):Va(r,e,3)}},hs=Jt,fs=i,ys=function(t){return ss(t)?os(us(t)):as(t)};function vs(t){return"function"==typeof t?t:null==t?hs:"object"==typeof t?fs(t)?ls(t[0],t[1]):cs(t):ys(t)}var ps=li,ds=ta,ms=vs,gs=i;var bs,ws,xs,ks,x,k,Os,O,Ps,Ss=function(t,e){return(gs(t)?ps:ds)(t,ms(e))};function Ds(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 js(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ds(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ds(t,e):void 0}}(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 D(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Cs(t,e,n){return(Cs="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var t=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=j(t)););return t}(t,e);if(t)return t=Object.getOwnPropertyDescriptor(t,e),t.get?t.get.call(n):t.value})(t,e,n||t)}function As(t,e){return(As=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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&&As(t,e)}function Ms(t){return(Ms="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})(t)}function A(t,e){if(e&&("object"===Ms(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return D(t)}(bi=bs=bs||{}).DOWN="down",bi.UP="up",bi.LEFT="left",bi.RIGHT="right",(m=ws=ws||{}).Left="left",m.Right="right",(zi=xs=xs||{}).Top="top",zi.Bottom="bottom",(rr=ks=ks||{}).Bottom="bottom",rr.Top="top",rr.Middle="middle",(t=x=x||{}).Pan="PAN",t.Ban="BAN",t.MARKER="MARKER",t.Point="POINT",t.Circle="CIRCLE",t.Line="LINE",t.Polyline="POLYLINE",t.Rect="RECT",t.Polygon="POLYGON",t.DrawMask="DRAWMASK",t.ClearMask="CLEARMASK",t.ImageMask="IMAGEMASK",(g=k=k||{}).BoundsChanged="boundsChanged",g.FeatureSelected="featureSelected",g.FeatureUnselected="featureUnselected",g.DrawDone="drawDone",g.FeatureUpdated="featureUpdated",g.FeatureDeleted="featureDeleted",g.Click="click",g.DblClick="dblClick",g.MouseDown="mouseDown",g.MouseMove="mouseMove",g.MouseUp="mouseUp",g.MouseOver="mouseOver",g.MouseOut="mouseOut",(h=Os=Os||{}).DrawActivePoint="drawActivePoint",h.DrawActiveMiddlePoint="drawActiveMiddlePoint",(ir=O=O||{}).Grab="-webkit-grab",ir.Grabbing="-webkit-grabbing",ir.Crosshair="crosshair",ir.Pointer="pointer",ir.Move="move",ir.NESW_Resize="nesw-resize",ir.NWSE_Resize="nwse-resize",(e=Ps=Ps||{}).DrawMask="crosshair",e.ClearMask="crosshair";var Ts=z,Ls=le;function Es(t,r){var i=-1,o=Ls(t)?Array(t.length):[];return Ts(t,function(t,e,n){o[++i]=r(t,e,n)}),o}var Rs=sn,Is=vs,Fs=i;var _s=function(t,e){return(Fs(t)?Rs:Es)(t,Is(e))};var zs=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};function Bs(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Ws(t){return t!=t}var Us=Bs,Gs=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1};function Ks(t,e,n){return e==e?Gs(t,e,n):Us(t,Ws,n)}var Ns=St,Ys=i,Xs=Oe;var Hs=function(t){return"string"==typeof t||!Ys(t)&&Xs(t)&&"[object String]"==Ns(t)},$s=/\s/;var Zs=function(t){for(var e=t.length;e--&&$s.test(t.charAt(e)););return e},qs=/^\s+/;var Vs=function(t){return t&&t.slice(0,Zs(t)+1).replace(qs,"")},Js=Dt,Qs=ln,tu=/^[-+]0x[0-9a-f]+$/i,eu=/^0b[01]+$/i,nu=/^0o[0-7]+$/i,ru=parseInt;var iu=function(t){if("number"==typeof t)return t;if(Qs(t))return NaN;if(Js(t)&&(e="function"==typeof t.valueOf?t.valueOf():t,t=Js(e)?e+"":e),"string"!=typeof t)return 0===t?t:+t;t=Vs(t);var e=eu.test(t);return e||nu.test(t)?ru(t.slice(2),e?2:8):tu.test(t)?NaN:+t};var ou=function(t){return t?(t=iu(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0};function au(t){var e=(t=ou(t))%1;return t==t?e?t-e:t:0}var su=sn;var uu=function(e,t){return su(t,function(t){return e[t]})},cu=Je;var lu=Ks,hu=le,fu=Hs,yu=au,vu=function(t){return null==t?[]:uu(t,cu(t))},pu=Math.max;var du,mu=function(t,e,n,r){return t=hu(t)?t:vu(t),n=n&&!r?yu(n):0,r=t.length,n<0&&(n=pu(r+n,0)),fu(t)?n<=r&&-1<t.indexOf(e,n):!!r&&-1<lu(t,e,n)},gu=((c=du=du||{}).Draw="DRAW",c.Clear="CLEAR",c.Image="IMAGE",function(){function i(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};s(this,i),this.id=t,this.type=e,this.props=n,this.style=an({},i.defaultStyle,r)}return n(i,[{key:"onAdd",value:function(t){this.layer=t,this.refresh()}},{key:"onRemove",value:function(){}},{key:"setStyle",value:function(t,e){e=e.refresh,e=void 0===e||e;this.style=t,e&&null!=(t=this.layer)&&t.refresh()}},{key:"refresh",value:function(){}},{key:"printInfo",value:function(){}}]),i}()),bu=(u(gu,"defaultStyle",{opacity:1,fillStyle:"rgba(255, 0, 0, 0)",lineWidth:1,strokeStyle:"#000"}),St),wu=Oe;var xu=function(t){return!0===t||!1===t||wu(t)&&"[object Boolean]"==bu(t)},ku=function(){function i(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};s(this,i),this.id=t,this.type=e,this.props=n,this.style=an({},i.defaultStyle,r),this.domId="layer-".concat(t,"-wrapper"),this.setDom()}return n(i,[{key:"setDom",value:function(){this.dom||(this.dom=document.createElement("div"),this.dom.setAttribute("id",this.domId),this.dom.style.position="absolute",this.dom.style.left="0",this.dom.style.top="0");var t=this.style,e=t.zIndex,t=t.opacity;this.dom.style.zIndex="".concat(e),this.dom.style.opacity="".concat(t)}},{key:"onAdd",value:function(t){this.map=t,this.resize()}},{key:"onRemove",value:function(){var t=document.getElementById(this.domId);t&&t.remove(),this.map=null}},{key:"resize",value:function(){var t=this.map.getSize(),e=t.width,t=t.height;this.dom.style.width="".concat(e,"px"),this.dom.style.height="".concat(t,"px")}},{key:"refresh",value:function(){}},{key:"resizeAndRefresh",value:function(){this.resize(),this.refresh()}},{key:"printInfo",value:function(){}}]),i}();function Ou(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}u(ku,"defaultStyle",{zIndex:1,opacity:1});var M=function(){C(o,ku);var i=Ou(o);function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};return s(this,o),(t=i.call(this,t,e,n,r)).createRenderCanvas(),t}return n(o,[{key:"onAdd",value:function(t){Cs(j(o.prototype),"onAdd",this).call(this,t),this.resize()}},{key:"createRenderCanvas",value:function(){this.canvas=document.createElement("canvas"),this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.dom.appendChild(this.canvas),this.canvasContext=this.canvas.getContext("2d")}},{key:"resize",value:function(){Cs(j(o.prototype),"resize",this).call(this);var t=this.map.getSize(),e=t.width,t=t.height;this.canvas.width=e*o.dpr,this.canvas.height=t*o.dpr,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px"}},{key:"refresh",value:function(){this.clear(),Cs(j(o.prototype),"refresh",this).call(this)}},{key:"clear",value:function(){var t;null!=(t=this.canvasContext)&&t.clearRect(0,0,this.canvas.width,this.canvas.height)}}]),o}();function Pu(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function Su(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pu(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}u(M,"dpr",window.devicePixelRatio);var T=function(){function g(){s(this,g)}return n(g,null,[{key:"setStyle",value:function(r){var t=an({},g.defaultStyle,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});P(t,function(t,e){var n;b(g.formatStyle[e])?(n=g.formatStyle[e](t),b(r[e])||(r[e]=n)):b(r[e])||(r[e]=t)})}},{key:"drawPolyline",value:function(t,e,n,r){var i=r.format,r=r.limitCount,r=void 0===r?2:r,i=b(i)?i(e):e,o=i.points,e=i.width,a=o.length;if(!(a<r)){g.setStyle(t,n),S(e)&&(t.lineWidth=e),t.beginPath();i=o[0],r=i.x,n=i.y;t.moveTo(r,n);for(var s=1;s<a;s++){var u=o[s],c=u.x,u=u.y;t.lineTo(c,u)}t.stroke()}}},{key:"drawLine",value:function(t,e,n,r){g.setStyle(t,n);n=(r||{}).format,r=b(n)?n(e):e,n=r.start,e=r.end,r=r.width;S(r)&&(t.lineWidth=r),t.beginPath(),t.moveTo(n.x,n.y),t.lineTo(e.x,e.y),t.stroke()}},{key:"drawRect",value:function(t,e,n,r){var r=(r||{}).format,i=!xu(n.stroke)||n.stroke,o=!!xu(n.fill)&&n.fill,r=b(r)?r(e):e,e=r.x,a=r.y,s=e+r.width,r=a+r.height;g.drawPolygon(t,[{x:e,y:a},{x:s,y:a},{x:s,y:r},{x:e,y:r}],n,{fill:o,stroke:i})}},{key:"drawPolygon",value:function(t,e,n,r){var i=r.format,o=r.limitCount,o=void 0===o?2:o,r=r.closePath,r=void 0===r||r,a=!xu(n.stroke)||n.stroke,s=!!xu(n.fill)&&n.fill,u=e.length;if(!(u<o)){g.setStyle(t,n),t.beginPath();o=b(i)?i(e[0]):e[0],n=o.x,o=o.y;t.moveTo(n,o);for(var c=1;c<u;c++){var l=b(i)?i(e[c]):e[c],h=l.x,l=l.y;t.lineTo(h,l)}r&&t.closePath(),s&&t.fill(),a&&(t.globalAlpha=1,t.stroke())}}},{key:"drawCircle",value:function(t,e,n,r){var r=r.format,i=!xu(n.stroke)||n.stroke,o=!!xu(n.fill)&&n.fill,r=b(r)?r(e):e,e=r.cx,a=r.cy,r=r.r;g.setStyle(t,n),t.beginPath(),t.arc(e,a,r,0,2*Math.PI),o&&t.fill(),i&&(t.globalAlpha=1,t.stroke())}},{key:"drawPoint",value:function(t,e,n,r){var r=r.format,r=b(r)?r(e):e,e=r.x,i=r.y,r=r.r,r=void 0===r?2:r;g.setStyle(t,n),t.beginPath(),t.arc(e,i,r,0,2*Math.PI),t.fill()}},{key:"drawImage",value:function(t,e,n){var r=e.image,i=e.x,o=e.y,a=e.width,e=e.height;t.drawImage(r,i,o,a,e)}},{key:"drawText",value:function(t,e,n,r){var i,o,a,s,u,c,l,h,f,y,v,p=n.background,r=r.format,d=!xu(n.fill)||n.fill,r=b(r)?r(e):e,e=r.text,m=r.position,r=r.offset;e&&(g.setStyle(t,n),i=m.x+r.x,o=m.y-r.y,a=t.lineWidth,s=3*M.dpr,u=4*M.dpr,c=t.textBaseline===ks.Bottom,l=t.textBaseline===ks.Top,h=t.textBaseline===ks.Middle,p&&(f=t.measureText(e).width,y=parseInt(t.font.replace(/[^0-9.]/gi,""),10)+2*s,v=m.y,c&&(v-=y),h&&(v-=y/2),m={x:m.x+r.x,y:v-r.y,width:f+2*u,height:y},g.drawRect(t,m,Su(Su({},n||{}),{},{fill:!0}))),t.globalAlpha=1,d?(t.fillStyle=n.fontColor,c&&p&&t.fillText(e,i+u,o-s+a),h&&p&&t.fillText(e,i+u,o),l&&p&&t.fillText(e,i+u,o+s+a),p||t.fillText(e,i,o)):(t.strokeStyle=n.fontColor,c&&p&&t.strokeText(e,i+u,o-s+a),h&&p&&t.strokeText(e,i+u,o),l&&p&&t.strokeText(e,i+u,o+s+a),p||t.strokeText(e,i,o)))}},{key:"drawArrow",value:function(n,t,e,r,i){i=(i||{}).format,i=b(i)?i(t):t,t=i.position,i=i.points,i=void 0===i?[]:i;g.setStyle(n,r),n.save(),n.beginPath(),n.translate(t.x,t.y),n.rotate(e),P(i,function(t,e){0===e?n.moveTo(t.x,t.y):n.lineTo(t.x,t.y)}),n.closePath(),n.restore(),n.fill(),n.stroke()}}]),g}();function Du(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function ju(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Du(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Du(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Cu(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}u(T,"defaultStyle",{fillStyle:"#FF0000",strokeStyle:"#FF0000",lineWidth:1,font:"normal 12px Arial",globalAlpha:1,lineCap:"round",lineJoin:"round",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0}),u(T,"formatStyle",{lineWidth:function(t){return t*M.dpr},font:function(t){var e=t.replace(/[^0-9.]/gi,""),n=parseInt(e,10)*M.dpr,e=new RegExp("".concat(e),"g");return t.replace(e,"".concat(n))}});function L(){s(this,L)}var E,Au,R,Mu,Tu,Lu,Eu=function(){C(o,gu);var i=Cu(o);function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};return s(this,o),(t=i.call(this,t,du.Clear,n,r)).shape=e,t}return n(o,[{key:"refresh",value:function(){var n=this,r=M.dpr,i=this.layer.map.getScale(),t=ju(ju({},this.style||{}),{},{lineCap:"round",lineJoin:"round"});this.layer.canvasContext.globalCompositeOperation="destination-out",T.drawPolyline(this.layer.canvasContext,this.shape,t,{format:function(t){var e=t.points,t=t.width;return ju({points:_s(e,function(t){var t=n.layer.map.transformGlobalToScreen(t),e=t.x,t=t.y;return{x:e*r,y:t*r}})},S(t)?{width:t*i*r}:{})}}),this.layer.canvasContext.globalCompositeOperation="source-over"}}]),o}();(f=E=E||{}).Image="IMAGE",f.Feature="FEATURE",f.Event="EVENT",f.Mask="MASK",f.Text="TEXT",f.Marker="MARKER",f.Overlay="OVERLAY",f.Support="SUPPORT",(Ae=Au=Au||{}).LoadStart="loadStart",Ae.LoadEnd="loadEnd",Ae.LoadError="loadError",(l=R=R||{}).Point="POINT",l.Line="LINE",l.Polyline="POLYLINE",l.Polygon="POLYGON",l.Rect="RECT",l.Circle="CIRCLE",l.Arrow="ARROW",(Pr=Mu=Mu||{}).Global="GLOBAL",Pr.Screen="SCREEN";function Ru(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ru(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ru(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Iu(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}u(L,"MathUtil",{getMiddlePoint:function(t,e){var n=t.x,t=t.y;return{x:(n+e.x)/2,y:(t+e.y)/2}},distance:function(t,e){var n=t.x,t=t.y,n=n-e.x,t=t-e.y;return Math.sqrt(n*n+t*t)},pointInPolygon:function(t,e){for(var n=t.x,r=t.y,i=!1,o=-1,a=e.length,s=a-1;++o<a;s=o){var u=e[o],c=u.x,u=u.y,l=e[s],h=l.x,l=l.y;(u<=r&&r<l||l<=r&&r<u)&&n<(h-c)*(r-u)/(l-u)+c&&(i=!i)}return i},pointInPoint:function(t,e){var n=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).tolerance;return L.MathUtil.distance(t,e)<=n},pointInPolyline:function(n,r){var i=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).tolerance,o=r.length-1,a=!1;return P(r,function(t,e){if(e!==o)return e=r[e+1],L.MathUtil.distancePoint2Line(n,t,e)<=i?!(a=!0):void 0}),a},distancePoint2Line:function(t,e,n){var r,i=t.x,t=t.y,o=e.x,e=e.y,a=n.x,n=n.y,s=a-o,u=n-e,c=s*s+u*u,c=0!=c?((i-o)*s+(t-e)*u)/c:-1,a=c<0?(r=o,e):1<c?(r=a,n):(r=o+c*s,e+c*u),n=i-r,o=t-a;return Math.sqrt(n*n+o*o)}}),u(L,"EventUtil",{getButtonIndex:function(t){if(!+[1])switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}return t.button},getMouseDirection:function(t,e){var n=t.offsetLeft,r=-t.offsetTop,i=n+t.offsetWidth,t=r-t.offsetHeight,o=(n+i)/2,a=(r+t)/2,t=(t-r)/(i-n),r=e||window.event,i=r.clientX,n=-r.clientY,e=(n-a)/(i-o);return t<e&&e<-t?o<i?1:3:a<n?0:2}}),(Tu=Tu||{}).Marker="MARKER",(o=Lu=Lu||{}).Click="click",o.MouseDown="mouseDown",o.MouseUp="mouseUp",o.MouseOver="mouseOver",o.MouseOut="mouseOut",o.DragStart="dragStart",o.Dragging="dragging",o.DragEnd="dragEnd",o.RightClick="rightClick";var Fu=function(){C(i,ku);var r=Iu(i);function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return s(this,i),u(D(t=r.call(this,t,E.Event,e,n)),"dragging",!1),u(D(t),"breakFeatureCapture",!1),u(D(t),"tmpPointsStore",[]),u(D(t),"hoverFeature",null),u(D(t),"hoverFeatureIndex",void 0),t.onMouseDown=t.onMouseDown.bind(D(t)),t.onMouseMove=t.onMouseMove.bind(D(t)),t.onMouseUp=t.onMouseUp.bind(D(t)),t.onMouseOut=t.onMouseOut.bind(D(t)),t.onMouseOver=t.onMouseOver.bind(D(t)),t.onMouseClick=t.onMouseClick.bind(D(t)),t.onMouseDblClick=t.onMouseDblClick.bind(D(t)),t.onMouseWheel=t.onMouseWheel.bind(D(t)),t}return n(i,[{key:"onAdd",value:function(t){Cs(j(i.prototype),"onAdd",this).call(this,t),this.createEventDom(),this.dom.appendChild(this.eventDom),this.addEventListener()}},{key:"createEventDom",value:function(){this.eventDom=document.createElement("div"),this.eventDom.style.position="absolute",this.eventDom.style.left="0",this.eventDom.style.right="0",this.eventDom.style.top="0",this.eventDom.style.bottom="0",this.eventDom.style.zIndex="1",this.eventDom.ondragstart=function(t){t.preventDefault(),t.stopPropagation()}}},{key:"addEventListener",value:function(){this.eventDom.addEventListener("mousedown",this.onMouseDown),this.eventDom.addEventListener("mousemove",this.onMouseMove),this.eventDom.addEventListener("mouseup",this.onMouseUp),this.eventDom.addEventListener("click",this.onMouseClick),this.eventDom.addEventListener("dblclick",this.onMouseDblClick),this.eventDom.addEventListener("mousewheel",this.onMouseWheel),this.eventDom.addEventListener("mouseout",this.onMouseOut),this.eventDom.addEventListener("mouseover",this.onMouseOver)}},{key:"removeEventListener",value:function(){this.eventDom.removeEventListener("mousedown",this.onMouseDown),this.eventDom.removeEventListener("mousemove",this.onMouseMove),this.eventDom.removeEventListener("mouseup",this.onMouseUp),this.eventDom.removeEventListener("click",this.onMouseClick),this.eventDom.removeEventListener("dblclick",this.onMouseDblClick),this.eventDom.removeEventListener("mousewheel",this.onMouseWheel),this.eventDom.removeEventListener("mouseout",this.onMouseOut),this.eventDom.removeEventListener("mouseover",this.onMouseOver)}},{key:"handleMapPanStart",value:function(t){var e=this;this.dragging=!0,this.setEventCursor(O.Grabbing),document.onmousemove=function(t){return e.handleMapPanMove(t)},document.onmouseup=function(t){return e.handleMapPanEnd(t)}}},{key:"handleMapPanMove",value:function(t){var t=this.getDltXY(t),e=t.x,t=t.y;this.map.onDrag(e,t)}},{key:"handleMapPanEnd",value:function(t){this.dragging=!1,this.setEventCursor(O.Grab),document.onmousemove=null,document.onmouseup=null;var t=this.getDltXY(t),e=t.x,t=t.y,n=this.map.getScreenCenter(),r=n.x,n=n.y,r=this.map.transformScreenToGlobal({x:r-e,y:n-t});this.map.reset().setCenter(r)}},{key:"getDltXY",value:function(t,e){var e=(e||{}).transform,e=void 0!==e&&e,n=this.map.getScale(),r=t.screenX,t=t.screenY,i=this.startPageScreenPoint,r=r-i.x,t=t-i.y;return{x:e?r/n:r,y:e?t/n:t}}},{key:"clearDownTimer",value:function(){this.downTimer&&(window.clearTimeout(this.downTimer),this.downTimer=null)}},{key:"handleMarkerStart",value:function(t){var e=this;this.clearDownTimer(),this.downTimer=window.setTimeout(function(){e.map.eventsObServer.emit(k.DrawDone,e.map.mode,{x:e.startPoint.global.x,y:e.startPoint.global.y})},300)}},{key:"handlePointStart",value:function(t){var e=this;this.clearDownTimer(),this.downTimer=window.setTimeout(function(){e.map.eventsObServer.emit(k.DrawDone,e.map.mode,{x:e.startPoint.global.x,y:e.startPoint.global.y}),e.reset()},300)}},{key:"handleCircleStart",value:function(t){var e=this,n=(this.dragging=!0,document.onmousemove=function(t){return e.handleCircleMove(t)},document.onmouseup=function(t){return e.handleCircleEnd(t)},this.startPoint.global);this.setTip({text:"移动开始绘制",position:n})}},{key:"handleCircleMove",value:function(t){var e=this.startPoint.global,n=this.getDltXY(t,{transform:!0}),r=n.x,n=n.y,t=this.getDltXY(t,{transform:!1}),i=t.x,t=t.y,i=Math.sqrt(i*i+t*t),t=this.map.xAxis.direction===ws.Right,o=this.map.yAxis.direction===xs.Top,t={x:e.x+(t?r:-r),y:e.y-(o?n:-n)},r={cx:e.x,cy:e.y,sr:i};this.map.overlayLayer.addCircleFeature(r),this.setTip({text:"抬起完成绘制",position:t})}},{key:"handleCircleEnd",value:function(t){this.dragging=!1,document.onmousemove=null,document.onmouseup=null;var e=this.startPoint.global,n=e.x,e=e.y,r=this.getDltXY(t,{transform:!0}),i=r.x,r=r.y,t=this.getDltXY(t,{transform:!1}),o=t.x,t=t.y,i=Math.sqrt(i*i+r*r),r=Math.sqrt(o*o+t*t);this.reset(),Math.abs(r)<=2?console.warn("the circle is too small..."):this.map.eventsObServer.emit(k.DrawDone,this.map.mode,{cx:n,cy:e,r:i},{cx:n,cy:e,sr:r})}},{key:"handleLineStart",value:function(t){var e,n,r=this;0===this.tmpPointsStore.length?(this.clearDownTimer(),this.downTimer=window.setTimeout(function(){r.tmpPointsStore.push(r.startPoint),r.setTip({text:"移动开始绘制",position:r.startPoint.global})},300)):1===this.tmpPointsStore.length&&(e=this.tmpPointsStore[0].global,n=this.startPoint.global,this.map.eventsObServer.emit(k.DrawDone,this.map.mode,{start:e,end:n}),this.reset())}},{key:"handleLineMove",value:function(t){var e=t.offsetX,t=t.offsetY,n=this.map.transformScreenToGlobal({x:e,y:t}),r=this.tmpPointsStore.length;0===r?this.setTip({text:"单击确定起点",position:n}):1===r&&(r=this.tmpPointsStore[0].global,e=this.map.transformScreenToGlobal({x:e,y:t}),this.map.overlayLayer.addLineFeature({start:r,end:e}),this.setTip({text:"单击确定终点",position:n}))}},{key:"handlePolylineStart",value:function(t){var e=this;0===this.tmpPointsStore.length?(this.clearDownTimer(),this.downTimer=window.setTimeout(function(){e.tmpPointsStore.push(e.startPoint),e.setTip({text:"移动开始绘制",position:e.startPoint.global})},300)):(this.tmpPointsStore.push(this.startPoint),this.map.withHotKeys&&this.setTip({text:"ctrl+z撤销",position:this.startPoint.global}))}},{key:"handlePolylineMove",value:function(t){var e=t.offsetX,t=t.offsetY,e=this.map.transformScreenToGlobal({x:e,y:t}),t=_s(this.tmpPointsStore,function(t){return t.global});t.push(e),1===t.length?this.setTip({text:"单击确定起点",position:e}):1<t.length&&(this.map.overlayLayer.addPolylineFeature({points:t}),this.setTip({text:"单击绘制/双击结束",position:e}))}},{key:"handlePolylineEnd",value:function(t){this.tmpPointsStore.pop(),2<=this.tmpPointsStore.length&&this.map.eventsObServer.emit(k.DrawDone,this.map.mode,_s(this.tmpPointsStore,function(t){return t.global})),this.reset()}},{key:"handleRectStart",value:function(t){var e=this,n=(this.dragging=!0,document.onmousemove=function(t){return e.handleRectMove(t)},document.onmouseup=function(t){return e.handleRectEnd(t)},this.startPoint.global);this.setTip({text:"移动开始绘制",position:n})}},{key:"handleRectMove",value:function(t){var e=this.startPoint.global,n=e.x,e=e.y,t=this.getDltXY(t,{transform:!0}),r=t.x,t=t.y,i=this.map.xAxis.direction===ws.Right,o=this.map.yAxis.direction===xs.Top,a={x:i?n+r:n-r,y:o?e-t:e+t},i={x:i?Math.min(n,n+r):Math.max(n,n-r),y:o?Math.max(e,e-t):Math.min(e,e+t),width:Math.abs(r),height:Math.abs(t)};this.map.overlayLayer.addRectFeature(i),this.setTip({text:"抬起完成绘制",position:a})}},{key:"handleRectEnd",value:function(t){this.dragging=!1,document.onmousemove=null,document.onmouseup=null;var e=this.map.getScale(),n=this.startPoint.screen,r=n.x,n=n.y,t=this.getDltXY(t),i=t.x,t=t.y,o=Math.abs(i)/e,e=Math.abs(t)/e,a=n+t,r=Math.min(r+i,r),a=Math.min(a,n),n=this.map.transformScreenToGlobal({x:r,y:a});this.reset(),Math.abs(i)<=3||Math.abs(t)<=3?console.warn("the rect is too small..."):(r={x:n.x,y:n.y,width:o,height:e},this.map.eventsObServer.emit(k.DrawDone,this.map.mode,r))}},{key:"handlePolygonStart",value:function(t){var e=this;0===this.tmpPointsStore.length?(this.clearDownTimer(),this.downTimer=window.setTimeout(function(){e.tmpPointsStore.push(e.startPoint),e.setTip({text:"移动开始绘制",position:e.startPoint.global})},300)):(this.tmpPointsStore.push(this.startPoint),this.map.withHotKeys&&this.setTip({text:"ctrl+z撤销",position:this.startPoint.global}))}},{key:"handlePolygonMove",value:function(t){var e=t.offsetX,t=t.offsetY,e=this.map.transformScreenToGlobal({x:e,y:t}),t=_s(this.tmpPointsStore,function(t){return t.global}),n=(t.push(e),t.length);1===n?this.setTip({text:"单击确定起点",position:e}):1<n&&(this.map.overlayLayer.addPolygonFeature({points:t},{node:!0}),this.setTip({text:2===n?"单击绘制":"单击绘制/双击结束",position:e}))}},{key:"handlePolygonEnd",value:function(t){var e;this.tmpPointsStore.pop(),3<=this.tmpPointsStore.length&&(e=_s(this.tmpPointsStore,function(t){return t.global}),this.map.eventsObServer.emit(k.DrawDone,this.map.mode,e)),this.reset()}},{key:"handleMaskStart",value:function(t){var e=this,n=(this.dragging=!0,document.onmousemove=function(t){return e.handleMaskMove(t)},document.onmouseup=function(t){return e.handleMaskEnd(t)},this.tmpPointsStore.push(this.startPoint),_s(this.tmpPointsStore,function(t){return t.global}));switch(this.map.mode){case x.DrawMask:this.map.overlayLayer.addDrawAction({points:n});break;case x.ClearMask:this.handleMaskClearMoving({points:n})}}},{key:"handleMaskMove",value:function(t){var e=this.startPoint.screen,n=e.x,e=e.y,t=this.getDltXY(t),n={x:n+t.x,y:e+t.y},e=this.map.transformScreenToGlobal(n),t=zs(this.tmpPointsStore);if(t){t=t.screen;if(L.MathUtil.distance(t,n)<=3)return}this.tmpPointsStore.push({screen:n,global:e});var r=_s(this.tmpPointsStore,function(t){return t.global});switch(this.map.mode){case x.DrawMask:this.map.overlayLayer.addDrawAction({points:r});break;case x.ClearMask:this.handleMaskClearMoving({points:r})}}},{key:"handleMaskEnd",value:function(t){this.dragging=!1,document.onmousemove=null,document.onmouseup=null;var e=_s(this.tmpPointsStore,function(t){return t.global});this.map.eventsObServer.emit(k.DrawDone,this.map.mode,e),this.reset(),this.handleMaskClearMoving({reset:!0})}},{key:"handleMaskClearMoving",value:function(t){var e=t.points,n=void 0===e?[]:e,e=t.reset,r=void 0!==e&&e,t=this.map.getLayers(),i=this.map.drawingStyle,e=i.lineWidth,o=(void 0===e?10:e)/this.map.getScale();P(t,function(t){var e;t.type!==E.Mask||r?t.type===E.Mask&&r&&t.setMovingClearAction(null):(e=new Eu("".concat(+new Date),{points:n,width:o},{},i),t.setMovingClearAction(e))})}},{key:"handleMapZoom",value:function(t){var e=90+this.map.zoomWheelRatio,n={x:t.offsetX,y:t.offsetY},n={screen:n,global:this.map.transformScreenToGlobal(n)},t=t.deltaY<0?this.map.zoom*e/100:100*this.map.zoom/e,e=this.map.getScreenCenter(),e=this.map.transformScreenToGlobal(e,{basePoint:n,zoom:t});this.map.centerAndZoom({center:e,zoom:t},{refreshDelay:!0})}},{key:"handleFeatureSelect",value:function(t){var e=this.map.getTargetFeatureWithPoint(this.startPoint.global);e&&this.map.eventsObServer.emit(k.FeatureSelected,e)}},{key:"handleActiveFeatureCapture",value:function(t){var r=this,i={x:t.offsetX,y:t.offsetY},o=this.map.transformScreenToGlobal(i),e=this.map.activeFeature,t=e||{},n=t.type,a=t.shape;switch(this.hoverFeature=null,this.hoverFeatureIndex=void 0,n){case R.Point:e.captureWithPoint(o)&&(this.hoverFeature=e,this.setEventCursor(O.Pointer),this.map.eventLayer.breakFeatureCapture=!0,this.setTip({text:"按下移动图形/右键删除",position:o}));break;case R.Rect:case R.Circle:var s=n===R.Rect?e.getPoints():e.getEdgePoints();P(s,function(t,e){var t=r.map.transformGlobalToScreen(t);if(L.MathUtil.distance(t,i)<=5)return t=1===(r.hoverFeatureIndex=e)||3===e?O.NESW_Resize:O.NWSE_Resize,r.setEventCursor(t),r.map.eventLayer.breakFeatureCapture=!0,r.setTip({text:"按下拖动",position:o}),!1}),!S(this.hoverFeatureIndex)&&e.captureWithPoint(o)&&(this.hoverFeature=e,this.setEventCursor(O.Move),this.map.eventLayer.breakFeatureCapture=!0,this.setTip({text:"按下移动图形",position:o}));break;case R.Line:case R.Polyline:case R.Polygon:var u=n===R.Line,c=n===R.Polyline,s=(R.Polygon,a),l=s.start,s=s.end,h=a.points,f=u?[l,s]:void 0===h?[]:h,y=f.length;P(f,function(t,e){var n=r.map.transformGlobalToScreen(t);if(L.MathUtil.distance(n,i)<=5)return r.hoverFeatureIndex=e,r.setEventCursor(O.Pointer),n=(u||c?2:3)<y?"/右键删除":"",r.map.eventLayer.breakFeatureCapture=!0,r.setTip({text:"按下拖动".concat(n),position:o}),!1;if(!u){if(c&&!f[e+1])return!1;n=f[e+1]||f[0],t=L.MathUtil.getMiddlePoint(t,n),n=r.map.transformGlobalToScreen(t);return L.MathUtil.distance(n,i)<=5?(r.hoverFeatureIndex=e+.5,r.setEventCursor(O.Pointer),r.map.eventLayer.breakFeatureCapture=!0,r.setTip({text:"按下拖动添加新节点",position:o}),!1):void 0}}),!S(this.hoverFeatureIndex)&&e.captureWithPoint(o)&&(this.hoverFeature=e,this.setEventCursor(O.Move),this.map.eventLayer.breakFeatureCapture=!0,this.setTip({text:"按下移动图形",position:o}))}}},{key:"handleActiveFeatureStart",value:function(t){var e=this,n=(this.map.tipLayer.removeAllFeatureActionText(),L.EventUtil.getButtonIndex(t));0===n?(this.dragging=!0,document.onmousemove=function(t){return e.handleActiveFeatureMove(t)},document.onmouseup=function(t){return e.handleActiveFeatureEnd(t)}):2===n&&this.handleActiveFeatureElse(t)}},{key:"handleActiveFeatureMove",value:function(t){var r=this,e=this.getDltXY(t,{transform:!0}),n=e.x,i=e.y,e=this.getDltXY(t,{transform:!1}),t=e.x,o=(e.y,this.map.activeFeature),a=o.type,s=o.shape,u=o.style,c=this.map.xAxis.direction===ws.Right,l=this.map.yAxis.direction===xs.Top,h=c?n:-n,f=l?i:-i,y=c?t:-t;switch(a){case R.Point:var v=s.x,p=s.y;this.toUpdateShape=I(I({},s),{},{x:v+h,y:p-f}),this.map.overlayLayer.addActiveFeature(o),this.map.overlayLayer.addPointFeature(this.toUpdateShape,{clear:!1,style:I(I({},u),{},{fillStyle:null==(v=this.map)?void 0:v.editingColor})});break;case R.Circle:var p=s.cx,v=s.cy,d=s.r,m=s.sr;if(this.hoverFeature)this.toUpdateShape=I(I({},s),{},{cx:p+h,cy:v-f});else if(S(this.hoverFeatureIndex)){0!==this.hoverFeatureIndex&&this.hoverFeatureIndex;p=1===this.hoverFeatureIndex||2===this.hoverFeatureIndex,v=o.getSubType()===Mu.Global,d=v?p?d+h:d-h:p?m+y:m-y;if(d<=0)return void console.warn("circle update error: invalid radius, radius <= 0");this.toUpdateShape=I(I({},s),v?{r:d}:{sr:d})}this.map.overlayLayer.addActiveFeature(o),this.map.overlayLayer.addCircleFeature(this.toUpdateShape,{clear:!1,style:I(I({},u),{},{lineWidth:1,strokeStyle:null==(p=this.map)?void 0:p.editingColor})});break;case R.Rect:var m=s.x,v=s.y,d=s.width,p=s.height,g=null;this.hoverFeature?g={x:m+h,y:v-f,width:d,height:p}:S(this.hoverFeatureIndex)&&(x=0===this.hoverFeatureIndex||3===this.hoverFeatureIndex,w=0===this.hoverFeatureIndex||1===this.hoverFeatureIndex,m=x?m+h:m,v=w?v-f:v,x=x?d-n:d+n,d=w?p-i:p+i,w=c?m+x:m-x,p=l?v-d:v+d,g={x:c?Math.min(m,w):Math.max(m,w),y:l?Math.max(v,p):Math.min(v,p),width:Math.abs(x),height:Math.abs(d)}),this.toUpdateShape=I(I({},s),g),this.map.overlayLayer.addActiveFeature(o),this.map.overlayLayer.addRectFeature(this.toUpdateShape,{clear:!1,style:I(I({},u),{},{lineWidth:1,strokeStyle:null==(m=this.map)?void 0:m.editingColor})});break;case R.Line:case R.Polyline:case R.Polygon:var b,w=a===R.Line,v=a===R.Polyline,p=a===R.Polygon,x=s.start,d=s.end,g=s.points,k=w?[x,d]:void 0===g?[]:g,O=[];this.hoverFeature?O=_s(k,function(t){var e=t.x,t=t.y;return{x:e+h,y:t-f}}):S(this.hoverFeatureIndex)&&(b=parseInt("".concat(this.hoverFeatureIndex),10),P(k,function(t,e){var n=t.x,t=t.y;e===b&&b===r.hoverFeatureIndex?O.push({x:n+h,y:t-f}):e===b&&b!==r.hoverFeatureIndex?(e=k[e+1]||k[0],e=L.MathUtil.getMiddlePoint({x:n,y:t},e),O.push({x:n,y:t}),O.push({x:e.x+h,y:e.y-f})):O.push({x:n,y:t})})),w?(x=(m=js(O,2))[0],d=m[1],this.toUpdateShape=I(I({},s),{},{start:x,end:d})):this.toUpdateShape=I(I({},s),{},{points:O}),this.map.overlayLayer.addActiveFeature(o),w&&this.map.overlayLayer.addLineFeature(this.toUpdateShape,{clear:!1,style:I(I({},u),{},{strokeStyle:null==(g=this.map)?void 0:g.editingColor})}),v&&this.map.overlayLayer.addPolylineFeature(this.toUpdateShape,{clear:!1,style:I(I({},u),{},{strokeStyle:null==(m=this.map)?void 0:m.editingColor})}),p&&this.map.overlayLayer.addPolygonFeature(this.toUpdateShape,{clear:!1,style:I(I({},u),{},{lineWidth:1,strokeStyle:null==(x=this.map)?void 0:x.editingColor})})}}},{key:"handleActiveFeatureEnd",value:function(t){this.dragging=!1,document.onmousemove=null,document.onmouseup=null,this.map.overlayLayer.removeAllFeatureActionText();var e=this.map.activeFeature;if(e&&this.map.overlayLayer.addActiveFeature(e),this.toUpdateShape&&e){switch(e.type){case R.Point:case R.Circle:case R.Line:case R.Polyline:case R.Rect:case R.Polygon:this.map.eventsObServer.emit(k.FeatureUpdated,e,this.toUpdateShape)}this.toUpdateShape=null}}},{key:"handleActiveFeatureElse",value:function(t){var e=this.map.activeFeature;if(e){var n=e.type,r=e.shape;switch(n){case R.Point:this.map.eventsObServer.emit(k.FeatureDeleted,e);break;case R.Polyline:case R.Polygon:var i,o=n===R.Polyline,o=(R.Polygon,o?2:3),a=r.points,a=void 0===a?[]:a;S(this.hoverFeatureIndex)&&a.length>o&&((i=parseInt("".concat(this.hoverFeatureIndex),10))===this.hoverFeatureIndex&&(o=Ss(a,function(t,e){return e!==i}),a=I(I({},r),{},{points:o}),this.map.eventsObServer.emit(k.FeatureUpdated,e,a)))}}}},{key:"handleFeatureCapture",value:function(t){var e=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).extraTip,e=void 0===e?"":e,n=this.dragging||this.tmpPointsStore.length;this.map.featureCaptureWhenMove&&!n&&this.map.getTargetFeatureWithPoint(t)&&this.setTip({text:(e?e+"/":"")+"双击选中",position:t})}},{key:"clearMousemoveTimer",value:function(){this.mousemoveTimer&&(window.clearTimeout(this.mousemoveTimer),this.mousemoveTimer=null)}},{key:"getMouseEventPoint",value:function(t){t={x:t.offsetX,y:t.offsetY};return{screen:t,global:this.map.transformScreenToGlobal(t)}}},{key:"onMouseDown",value:function(t){var e=t.screenX,n=t.screenY,e=(this.startPoint=this.getMouseEventPoint(t),this.startPageScreenPoint={x:e,y:n},this.map.mode),n=this.dragging,r=this.hoverFeature||S(this.hoverFeatureIndex),i=!n&&!r;this.map.eventsObServer.emit(k.MouseDown,this.startPoint),this.map.activeFeature&&!r?this.map.eventsObServer.emit(k.FeatureUnselected,this.map.activeFeature,"cancel by click"):e!==x.Ban&&(e===x.Pan&&i?this.handleMapPanStart(t):e===x.MARKER&&i?this.handleMarkerStart(t):e===x.Point&&i?this.handlePointStart(t):e===x.Circle&&i?this.handleCircleStart(t):e===x.Line&&i?this.handleLineStart(t):e===x.Polyline&&i?this.handlePolylineStart(t):e===x.Rect&&i?this.handleRectStart(t):e===x.Polygon&&i?this.handlePolygonStart(t):e!==x.DrawMask&&e!==x.ClearMask||!i||this.handleMaskStart(t),r&&!n&&this.handleActiveFeatureStart(t))}},{key:"onMouseMove",value:function(t){this.mouseMoveEvent=t;var e=this.getMouseEventPoint(t),n=e.screen,e=e.global,r=this.map.mode,i=this.dragging;this.map.eventsObServer.emit(k.MouseMove,{screen:n,global:e}),this.map.activeFeature||i||this.map.overlayLayer.removeAllFeatureActionText(),r!==x.Ban&&(r!==x.Pan||i?r!==x.MARKER||i?r!==x.Point||i?r===x.Circle?(this.setEventCursor(O.Crosshair,{},e),i||(this.setTip({text:"按下确定圆心",position:e}),this.handleFeatureCapture(e))):r!==x.Line||i?r!==x.Polyline||i?r===x.Rect?(this.setEventCursor(O.Crosshair,{},e),i||(this.setTip({text:"按下确定起点",position:e}),this.handleFeatureCapture(e))):r!==x.Polygon||i?r===x.DrawMask?(n=d(this.map.drawingStyle,"lineWidth",1),this.setEventCursor(Ps.DrawMask,{type:R.Circle,shape:{sr:n/2,cx:e.x,cy:e.y}})):r===x.ClearMask&&(n=d(this.map.drawingStyle,"lineWidth",1),this.setEventCursor(Ps.ClearMask,{type:R.Circle,shape:{sr:n/2,cx:e.x,cy:e.y}})):(this.setEventCursor(O.Crosshair,{},e),this.handlePolygonMove(t),this.handleFeatureCapture(e)):(this.setEventCursor(O.Crosshair,{},e),this.handlePolylineMove(t),this.handleFeatureCapture(e)):(this.setEventCursor(O.Crosshair,{},e),this.handleLineMove(t),this.handleFeatureCapture(e)):(this.setEventCursor(O.Crosshair,{},e),this.setTip({text:"点击绘制点",position:e}),this.handleFeatureCapture(e)):this.setEventCursor(O.Crosshair,{},e):this.setEventCursor(O.Grab),this.map.activeFeature&&!i&&this.setTip({text:"单击取消选中",position:e}),mu([x.Point,x.Circle,x.Line,x.Polyline,x.Rect,x.Polygon],r)&&!i&&this.handleActiveFeatureCapture(t))}},{key:"onMouseUp",value:function(t){this.map.eventsObServer.emit(k.MouseUp,this.getMouseEventPoint(t))}},{key:"onMouseClick",value:function(t){this.map.eventsObServer.emit(k.Click,this.getMouseEventPoint(t))}},{key:"onMouseDblClick",value:function(t){var e=this.map.mode,n=(this.clearDownTimer(),this.dragging||this.tmpPointsStore.length);this.map.eventsObServer.emit(k.DblClick,this.getMouseEventPoint(t)),e!==x.Ban&&(e===x.Polyline&&n?this.handlePolylineEnd(t):e===x.Polygon&&n&&this.handlePolygonEnd(t),mu([x.Point,x.Circle,x.Line,x.Polyline,x.Rect,x.Polygon],e)&&!n&&this.handleFeatureSelect(t))}},{key:"onMouseWheel",value:function(t){var e=this.map.mode;switch(e!==x.Ban&&t.preventDefault(),e){case x.Ban:break;case x.Pan:this.handleMapZoom(t);break;default:this.map.zoomWhenDrawing&&this.handleMapZoom(t)}}},{key:"clearPanWhenDrawingTimer",value:function(){this.panWhenDrawingTimer&&(window.clearInterval(this.panWhenDrawingTimer),this.panWhenDrawingTimer=null)}},{key:"handlePanWhenDrawing",value:function(t){var o=this,a=L.EventUtil.getMouseDirection(this.map.dom,t);this.clearPanWhenDrawingTimer();this.map.panWhenDrawing&&this.tmpPointsStore.length&&(this.panWhenDrawingTimer=window.setInterval(function(){var t=10/o.map.getScale(),e=o.map.getCenter(),n=o.map.xAxis.direction===ws.Right,r=o.map.yAxis.direction===xs.Top,i=e;switch(a){case 0:i={x:e.x,y:r?e.y+t:e.y-t};break;case 1:i={x:n?e.x+t:e.x-t,y:e.y};break;case 2:i={x:e.x,y:r?e.y-t:e.y+t};break;case 3:i={x:n?e.x-t:e.x+t,y:e.y}}o.map.setCenter(i)},100))}},{key:"onMouseOut",value:function(t){if((t.preventDefault(),this.map.tipLayer.removeAllFeatureActionText(),this.map.supportLayer.removeAllSupports(),this.map.cursorLayer.removeAllFeatureActionText(),t.toElement)&&t.toElement.getAttribute("data-type")===Tu.Marker)return;this.handlePanWhenDrawing(t),this.map.eventsObServer.emit(k.MouseOut,this.getMouseEventPoint(t))}},{key:"onMouseOver",value:function(t){t.preventDefault(),this.map.tipLayer.removeAllFeatureActionText(),this.clearPanWhenDrawingTimer(),this.map.eventsObServer.emit(k.MouseOver,this.getMouseEventPoint(t))}},{key:"revokeTmpPointsStore",value:function(){var t;this.tmpPointsStore.length&&(this.tmpPointsStore.pop(),(t=this.mouseMoveEvent)&&this.onMouseMove(t))}},{key:"setTip",value:function(t){this.map.drawingTip?this.map.tipLayer.addText(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}):this.map.tipLayer.removeAllFeatureActionText()}},{key:"setCrosshair",value:function(t){this.map.drawingTip?this.map.supportLayer.addCrosshair(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}):this.map.supportLayer.removeAllSupports()}},{key:"setEventCursor",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;this.map.setCursor(t,e),n&&this.map.drawingCrosshair?this.setCrosshair(n):this.map.supportLayer.removeAllSupports()}},{key:"reset",value:function(){this.tmpPointsStore=[],this.map.overlayLayer.removeAllFeatureActionText(),this.map.tipLayer.removeAllFeatureActionText()}},{key:"refresh",value:function(){Cs(j(i.prototype),"refresh",this).call(this)}}]),i}(),_u="base64",zu="blob",Bu=function(){function e(t){s(this,e),u(this,"objects",[]),u(this,"map",{activeFeature:null,setActiveFeature:function(){},getScale:function(){return 1},transformGlobalToScreen:function(t){var e=t.x,t=t.y,n=this.bounds;return{x:e-n.x,y:t-n.y}}}),this.bounds=t,this.createRenderCanvas(),this.map.getScale=this.map.getScale.bind(this),this.map.transformGlobalToScreen=this.map.transformGlobalToScreen.bind(this)}return n(e,[{key:"createRenderCanvas",value:function(){var t=this.bounds,e=t.width,t=t.height;this.canvas=document.createElement("canvas"),this.canvas.width=e*M.dpr,this.canvas.height=t*M.dpr,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px",this.canvasContext=this.canvas.getContext("2d"),T.drawRect(this.canvasContext,{x:0,y:0,width:this.canvas.width,height:this.canvas.height},{fill:!0,fillStyle:"#fff",stroke:!1})}},{key:"addObject",value:function(t){t.onAdd(this),this.objects.push(t)}},{key:"addObjects",value:function(t){var e=this;P(t,function(t){return e.addObject(t)})}},{key:"putImage",value:function(t){this.canvasContext.drawImage(t,0,0)}},{key:"addImageLayer",value:function(t){var e=this.map.transformGlobalToScreen(t.position),n=e.x,e=e.y,r=M.dpr,i=this.map.getScale(),o=t.imageInfo,a=o.width,o=o.height;t.image&&t.imageSuccess&&T.drawImage(this.canvasContext,{image:t.image,x:n*r,y:e*r,width:a*i*r,height:o*i*r},{})}},{key:"convertCanvasToImage",value:function(n,t,e){return n===_u?this.convertCanvasToBase64(t,e):n===zu?this.convertCanvasToBlob(t,e):new Promise(function(t,e){e(new Error("export params error:"+n))})}},{key:"convertCanvasToBlob",value:function(o,t){var a=this;return new Promise(function(r,i){a.canvas.toBlob(function(t){a.canvas=null;var e=a.bounds,n=e.width,e=e.height;a.resizeBlobImage(t,{width:n,height:e},o,r,i)},o,t)})}},{key:"resizeBlobImage",value:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"image/png",r=3<arguments.length?arguments[3]:void 0,i=4<arguments.length?arguments[4]:void 0,o=new Image,a=URL.createObjectURL(t),s=(o.src=a,e.width),u=e.height,c=document.createElement("canvas"),l=c.getContext("2d");c.width=s,c.height=u,c.style.width=s+"px",c.style.height=u+"px",o.onload=function(){URL.revokeObjectURL(a),l.drawImage(o,0,0,s,u),c.toBlob(function(t){c=null,r(t)},n,1)},o.onerror=function(){i(new Error("resize image error"))}}},{key:"convertCanvasToBase64",value:function(t,e){var n=this.canvas.toDataURL(t),r=(this.canvas=null,this.bounds),i=r.width,r=r.height;return this.resizeBase64Image(n,{width:i,height:r},t)}},{key:"resizeBase64Image",value:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"image/png",r=new Image,i=(r.src=t,e.width),o=e.height,a=document.createElement("canvas"),s=a.getContext("2d");return a.width=i,a.height=o,a.style.width=i+"px",a.style.height=o+"px",new Promise(function(t,e){r.onload=function(){s.drawImage(r,0,0,i,o),t(a.toDataURL(n))},r.onerror=function(){e(new Error("resize image error"))}})}},{key:"refresh",value:function(){P(this.objects,function(t){return t.refresh()})}},{key:"clear",value:function(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}}]),e}(),Wu=function(){function i(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};s(this,i),this.id=t,this.type=e,this.props=n,this.style=an({},i.defaultStyle,r)}return n(i,[{key:"onAdd",value:function(t){this.layer=t,this.refresh()}},{key:"onRemove",value:function(){var t=null==(t=this.layer)||null==(t=t.map)?void 0:t.activeFeature;t&&t.id===this.id&&this.layer.map.setActiveFeature(null)}},{key:"getBounds",value:function(){return{x:0,y:0,width:0,height:0}}},{key:"captureWithPoint",value:function(t){return!1}},{key:"updateShape",value:function(t){this.shape=t,null!=(t=this.layer)&&t.refresh();t=null==(t=this.layer)||null==(t=t.map)?void 0:t.activeFeature;t&&t.id===this.id&&this.layer.map.setActiveFeature(this)}},{key:"onMove",value:function(t){}},{key:"setStyle",value:function(t,e){e=e.refresh,e=void 0===e||e;this.style=t,e&&null!=(t=this.layer)&&t.refresh()}},{key:"refresh",value:function(){}},{key:"printInfo",value:function(){}}]),i}();function Uu(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}u(Wu,"moveStep",1),u(Wu,"defaultStyle",{opacity:1,fillStyle:"rgba(255, 0, 0, 0)",lineWidth:1,strokeStyle:"#000"});var Gu=function(){C(a,Wu);var o=Uu(a);function a(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},i=4<arguments.length?arguments[4]:void 0;return s(this,a),u(D(t=o.call(this,t,R.Point,n,r)),"option",{}),t.shape=e,t.option=an({},a.defaultOption,i||{}),t}return n(a,[{key:"captureWithPoint",value:function(t){var e=this.shape,n=e.x,r=e.y,i=e.r,e=e.sr,o=null==(o=this.layer)||null==(o=o.map)?void 0:o.getScale(),a=o?3/o:0,i=S(i)?i+a:S(e)?e/o+a:a;return L.MathUtil.pointInPoint(t,{x:n,y:r},{tolerance:i})}},{key:"refresh",value:function(){var t,e,n,r,i=this.shape,o=i.x,a=i.y,s=i.r,i=i.sr;null!=(e=this.layer)&&e.map&&(o=(e=this.layer.map.transformGlobalToScreen({x:o,y:a})).x,a=e.y,e=M.dpr,t=this.layer.map.getScale(),o=o*e,a=a*e,s=(S(s)?s*t:S(i)?i:2)*e,T.drawPoint(this.layer.canvasContext,{x:o,y:a,r:s},this.style,{}),this.option.active&&(T.drawLine(this.layer.canvasContext,{start:{x:i=t=o-s-2,y:o=e=a-s-2},end:{x:n=t+(a=2*s+4),y:r=o+(s=2*s+4)}},{strokeStyle:"#fff"}),T.drawLine(this.layer.canvasContext,{start:{x:n,y:o},end:{x:i,y:r}},{strokeStyle:"#fff"}),T.drawRect(this.layer.canvasContext,{x:t,y:e,width:a,height:s},{strokeStyle:"#666"})))}}]),a}();function Ku(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function Nu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ku(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ku(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yu(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}u(Gu,"defaultOption",{active:!1});var Xu=function(){C(o,Wu);var i=Yu(o);function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};return s(this,o),(t=i.call(this,t,R.Line,n,r)).shape=e,t}return n(o,[{key:"captureWithPoint",value:function(t){var e=this.shape,n=e.start,r=e.end,e=e.width,i=null==(i=this.layer)||null==(i=i.map)?void 0:i.getScale(),i=i?3/i:0,e=S(e)?e/2+i:i;return L.MathUtil.pointInPolyline(t,[n,r],{tolerance:e})}},{key:"getLineWidth",value:function(){var t=this.shape.width,e=this.style.lineWidth||1,n=null==(n=this.layer)||null==(n=n.map)?void 0:n.getScale();return t?t*n:e}},{key:"refresh",value:function(){var t,e,n,r,i,o,a,s,u,c;null!=(t=this.layer)&&t.map&&(n=(t=this.shape).start,i=t.end,t=t.width,e=(n=this.layer.map.transformGlobalToScreen(n)).x,n=n.y,r=(i=this.layer.map.transformGlobalToScreen(i)).x,i=i.y,o=M.dpr,a=(t||0)*this.layer.map.getScale(),c=this.getLineWidth(),s=Math.atan((i-n)/(r-e)),s+=(e<r?90:-90)*Math.PI/180,u=1.2*c*o,c=1.4*c*o,this.style.arrow&&T.drawArrow(this.layer.canvasContext,{position:{x:r*o,y:i*o},points:[{x:0*o,y:0-c},{x:u,y:2*u-c},{x:-u,y:2*u-c}]},s,Nu(Nu({},this.style),{},{lineWidth:2},this.style.strokeStyle?{fillStyle:this.style.strokeStyle}:{})),T.drawLine(this.layer.canvasContext,Nu({start:{x:e*o,y:n*o},end:{x:r*o,y:i*o}},S(t)?{width:a*o}:{}),this.style,{}))}}]),o}();function Hu(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function $u(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}var Zu=function(){C(o,Wu);var i=$u(o);function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};return s(this,o),(t=i.call(this,t,R.Polyline,n,r)).shape=e,t}return n(o,[{key:"captureWithPoint",value:function(t){var e=this.shape,n=e.points,n=void 0===n?[]:n,e=e.width,r=null==(r=this.layer)||null==(r=r.map)?void 0:r.getScale(),r=r?3/r:0,e=S(e)?e/2+r:r;return L.MathUtil.pointInPolyline(t,n,{tolerance:e})}},{key:"refresh",value:function(){var t,n,r,i=this;null!=(t=this.layer)&&t.map&&(n=M.dpr,r=this.layer.map.getScale(),T.drawPolyline(this.layer.canvasContext,this.shape,this.style,{format:function(t){var e=t.points,t=t.width;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hu(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({points:_s(e,function(t){var t=i.layer.map.transformGlobalToScreen(t),e=t.x,t=t.y;return{x:e*n,y:t*n}})},S(t)?{width:t*r*n}:{})}}))}}]),o}();function qu(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function Vu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qu(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ju(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}var Qu=function(){C(o,Wu);var i=Ju(o);function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};return s(this,o),(t=i.call(this,t,R.Rect,n,r)).shape=e,t}return n(o,[{key:"captureWithPoint",value:function(t){var e=this.getPoints();return L.MathUtil.pointInPolygon(t,e)}},{key:"getPoints",value:function(){var t=(null==(t=this.layer)||null==(t=t.map)?void 0:t.xAxis.direction)===ws.Left,e=(null==(e=this.layer)||null==(e=e.map)?void 0:e.yAxis.direction)===xs.Bottom,n=this.shape,r=n.x,i=n.y,o=n.width,n=n.height,t=t?r-o:r+o,o=e?i+n:i-n;return[{x:r,y:i},{x:t,y:i},{x:t,y:o},{x:r,y:o}]}},{key:"onMove",value:function(t){var e=Wu.moveStep,n=this.shape,r=n.x,i=n.y,n=null==(n=this.layer)||null==(n=n.map)?void 0:n.getScale(),o=(null==(c=this.layer)||null==(c=c.map)||null==(c=c.xAxis)?void 0:c.direction)===ws.Left,a=(null==(c=this.layer)||null==(c=c.map)||null==(c=c.yAxis)?void 0:c.direction)===xs.Bottom,s=e/n,u={};switch(t){case bs.UP:u={y:a?i-s:i+s};break;case bs.DOWN:u={y:a?i+s:i-s};break;case bs.LEFT:u={x:o?r+s:r-s};break;case bs.RIGHT:u={x:o?r-s:r+s}}var c=Vu(Vu({},this.shape),u);null!=(e=this.layer)&&null!=(n=e.map)&&null!=(t=n.eventsObServer)&&t.emit(k.FeatureUpdated,this,c)}},{key:"refresh",value:function(){var t,i,o,a=this;null!=(t=this.layer)&&t.map&&(i=M.dpr,o=this.layer.map.getScale(),T.drawRect(this.layer.canvasContext,this.shape,this.style,{format:function(t){var e=t.x,n=t.y,r=t.width,t=t.height,e=a.layer.map.transformGlobalToScreen({x:e,y:n}),n=e.x,e=e.y;return{x:n*i,y:e*i,width:r*o*i,height:t*o*i}}}))}}]),o}();function tc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}var ec=function(){C(o,Wu);var i=tc(o);function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};return s(this,o),(t=i.call(this,t,R.Polygon,n,r)).shape=e,t}return n(o,[{key:"captureWithPoint",value:function(t){var e=this.shape.points;return L.MathUtil.pointInPolygon(t,void 0===e?[]:e)}},{key:"refresh",value:function(){var t,e,n,r=this;null!=(t=this.layer)&&t.map&&(e=(t=this.shape).points,t.inner,n=M.dpr,T.drawPolygon(this.layer.canvasContext,e,this.style,{format:function(t){var t=r.layer.map.transformGlobalToScreen(t),e=t.x,t=t.y;return{x:e*n,y:t*n}}}))}}]),o}();function nc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}var rc=function(){C(a,Wu);var o=nc(a);function a(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},i=4<arguments.length?arguments[4]:void 0;return s(this,a),u(D(t=o.call(this,t,R.Circle,n,r)),"option",{}),t.shape=e,t.option=an({},a.defaultOption,i||{}),t}return n(a,[{key:"getSubType",value:function(){var t=this.shape,e=t.r,t=t.sr;return S(e)?Mu.Global:S(t)?Mu.Screen:void 0}},{key:"captureWithPoint",value:function(t){var e=this.getSubType()===Mu.Global,n=this.getSubType()===Mu.Screen,r=this.shape,i=r.cx,o=r.cy,a=r.r,r=r.sr,s=null==(s=this.layer)||null==(s=s.map)?void 0:s.getScale(),u=s?3/s:0;return L.MathUtil.pointInPoint(t,{x:i,y:o},{tolerance:e?a+u:n?r/s+u:u})}},{key:"getEdgePoints",value:function(){var t=this.getSubType()===Mu.Global,e=this.getSubType()===Mu.Screen,n=(null==(n=this.layer)||null==(n=n.map)?void 0:n.xAxis.direction)===ws.Left,r=(null==(r=this.layer)||null==(r=r.map)?void 0:r.yAxis.direction)===xs.Bottom,i=this.shape,o=i.cx,a=i.cy,s=i.r,i=i.sr,s=t?s:e?i:0,i=Math.sqrt(s*s/2),s=n?-i:i,u=r?-i:i;if(t)return[{x:o-s,y:a+u},{x:o+s,y:a+u},{x:o+s,y:a-u},{x:o-s,y:a-u}];if(e){u=null==(t=this.layer)||null==(s=t.map)?void 0:s.getScale();if(!u)return console.error("circle getEdgePoints error: no added to layer or map"),[];e=i/u,t=n?-e:e,s=r?-e:e;return[{x:o-t,y:a+s},{x:o+t,y:a+s},{x:o+t,y:a-s},{x:o-t,y:a-s}]}return console.error("circle getEdgePoints error: no valid radius"),[]}},{key:"refresh",value:function(){var i,o,a,t,s=this;null!=(t=this.layer)&&t.map&&(i=this.getSubType()===Mu.Global,o=M.dpr,a=this.layer.map.getScale(),T.drawCircle(this.layer.canvasContext,this.shape,this.style,{format:function(t){var e=t.cx,n=t.cy,r=t.r,t=t.sr,r=i?r*a:S(t)?t:2,t=s.layer.map.transformGlobalToScreen({x:e,y:n}),e=t.x,n=t.y;return{cx:e*o,cy:n*o,r:r*o}}}),this.option.active&&(t=this.getEdgePoints(),P(t,function(t){var e=t.x,t=t.y;T.drawCircle(s.layer.canvasContext,{sr:3.5,cx:e,cy:t},{strokeStyle:"#666",fillStyle:"#fff",stroke:!0,fill:!0,lineWidth:1},{format:function(t){var e=t.cx,n=t.cy,t=t.sr,e=s.layer.map.transformGlobalToScreen({x:e,y:n}),n=e.x,e=e.y;return{cx:n*o,cy:e*o,r:t*o}}})})))}}]),a}();function ic(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ic(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ic(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ac(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}u(rc,"defaultOption",{active:!1});var sc,uc=function(){C(a,gu);var o=ac(a);function a(t,e,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{};return s(this,a),u(D(t=o.call(this,t,du.Draw,r,i)),"category",""),t.shape=n,t.category=e,t}return n(a,[{key:"refresh",value:function(){var n=this,r=M.dpr,i=this.layer.map.getScale(),t=oc(oc({},this.style||{}),{},{lineCap:"round",lineJoin:"round"});T.drawPolyline(this.layer.canvasContext,this.shape,t,{format:function(t){var e=t.points,t=t.width;return oc({points:_s(e,function(t){var t=n.layer.map.transformGlobalToScreen(t),e=t.x,t=t.y;return{x:e*r,y:t*r}})},S(t)?{width:t*i*r}:{})}})}}]),a}();function cc(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function lc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cc(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}(sc=sc||{}).Text="TEXT";var hc=function(){function i(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};s(this,i),this.id=t,this.type=sc.Text,this.props=n,this.textInfo=an({},i.defaultTextInfo,e),this.style=an({},i.defaultStyle,r)}return n(i,[{key:"onAdd",value:function(t){this.layer=t,this.refresh()}},{key:"onRemove",value:function(){}},{key:"updateText",value:function(t){var e;Hs(t)&&t&&(e=this.textInfo,this.textInfo=lc(lc({},e),{},{text:t}),null!=(e=this.layer)&&e.refresh())}},{key:"updatePosition",value:function(t){var e=this.textInfo;this.textInfo=lc(lc({},e),{},{position:t}),null!=(e=this.layer)&&e.refresh()}},{key:"refresh",value:function(){var t,o,a=this;null!=(t=this.layer)&&t.map&&(t=this.textInfo,o=M.dpr,T.drawText(this.layer.canvasContext,t,this.style,{format:function(t){var e=t.position,n=t.offset,e=a.layer.map.transformGlobalToScreen(e),r=e.x,e=e.y,i=n.x,n=n.y;return lc(lc({},t),{},{position:{x:r*o,y:e*o},offset:{x:i*o,y:n*o}})}}))}},{key:"printInfo",value:function(){}}]),i}();function fc(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function yc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fc(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}u(hc,"defaultStyle",{opacity:1,strokeStyle:"#FF0000",background:!0,fontColor:"#FFFFFF",fillStyle:"#FF0000",font:"normal 12px Arial",textAlign:"left",textBaseline:"bottom"}),u(hc,"defaultTextInfo",{text:"",position:{x:0,y:0},offset:{x:0,y:0}});var pc=function(){C(i,M);var r=vc(i);function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return s(this,i),u(D(t=r.call(this,t,E.Overlay,e,n)),"featureActionTexts",[]),u(D(t),"defaultActiveFeatureStyle",{strokeStyle:"#FF0000",fillStyle:"#FF0000",lineWidth:1}),u(D(t),"defaultTextStyle",{fillStyle:"#FFFFFF",strokeStyle:"#D2691E",background:!0,globalAlpha:1,fontColor:"#333",font:"normal 10px Arial",textBaseline:"top"}),t}return n(i,[{key:"addFeatureActionText",value:function(t,e){e=(e||{}).clear;void 0!==e&&e&&this.removeAllFeatureActionText(),t.onAdd(this),this.featureActionTexts.push(t)}},{key:"addPointFeature",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.style,r=e.clear,r=void 0===r||r,e=e.active,e=void 0!==e&&e,t=new Gu("".concat(+new Date),t,{},n||this.map.drawingStyle,{active:e});this.addFeatureActionText(t,{clear:r})}},{key:"addLineFeature",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.style,e=e.clear,e=void 0===e||e,n=new Xu("".concat(+new Date),t,{},n||this.map.drawingStyle);this.addFeatureActionText(n,{clear:e});n=t.start,e=t.end;this.addDrawingPoints([n,e])}},{key:"addPolylineFeature",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.style,e=e.clear,e=void 0===e||e,n=new Zu("".concat(+new Date),t,{},n||this.map.drawingStyle);this.addFeatureActionText(n,{clear:e}),this.addDrawingPoints(t.points)}},{key:"addRectFeature",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.style,e=e.clear,e=void 0===e||e,t=new Qu("".concat(+new Date),t,{},n||this.map.drawingStyle),n=(this.addFeatureActionText(t,{clear:e}),t.getPoints());this.addDrawingPoints(n)}},{key:"addPolygonFeature",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.style,e=e.clear,e=void 0===e||e,n=new ec("".concat(+new Date),t,{},n||this.map.drawingStyle);this.addFeatureActionText(n,{clear:e}),this.addDrawingPoints(t.points)}},{key:"addCircleFeature",value:function(t,e){var e=e||{},n=e.clear,n=void 0===n||n,r=e.style,e=e.active,e=void 0!==e&&e,t=new rc("".concat(+new Date),t,{},r||this.map.drawingStyle,{active:e});this.addFeatureActionText(t,{clear:n})}},{key:"addDrawAction",value:function(t){t=new uc("".concat(+new Date),"drawAction",t,{},this.map.drawingStyle);this.addFeatureActionText(t,{clear:!0})}},{key:"addText",value:function(t,e){e=(e||{}).clear,e=void 0===e||e,t=new hc("".concat(+new Date),yc(yc({},t),{},{offset:{x:5,y:-5}}),{},this.defaultTextStyle);this.addFeatureActionText(t,{clear:e})}},{key:"addActiveFeature",value:function(t){if(t){var e=this.defaultActiveFeatureStyle,n=t.type,r=t.shape;switch(n){case R.Point:this.addPointFeature(r,{style:e,active:!0});break;case R.Line:this.addLineFeature(r,{style:e});break;case R.Polyline:this.addPolylineFeature(r,{style:e}),this.addActiveMiddlePoints(r.points,{withClose:!1});break;case R.Rect:this.addRectFeature(r,{style:e});break;case R.Polygon:this.addPolygonFeature(r,{style:e}),this.addActiveMiddlePoints(r.points,{withClose:!0});break;case R.Circle:this.addCircleFeature(r,{style:e,active:!0})}}else this.removeAllFeatureActionText()}},{key:"addActiveMiddlePoints",value:function(n){var r=this,t=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).withClose,i=void 0===t||t;P(n,function(t,e){e=i?n[e+1]||n[0]:n[e+1];e&&(t=L.MathUtil.getMiddlePoint(t,e),r.addDrawingPoint(t,{strokeStyle:"#228B22",withAddIcon:!0,isMiddlePoint:!0}))})}},{key:"addDrawingPoints",value:function(t){var e=this;P(t,function(t){e.addDrawingPoint(t)})}},{key:"addDrawingPoint",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.strokeStyle,n=void 0===n?"#666":n,r=e.fillStyle,r=void 0===r?"#fff":r,i=e.withAddIcon,i=void 0!==i&&i,o=e.iconColor,o=void 0===o?"#228B22":o,e=e.isMiddlePoint,e=void 0!==e&&e,a=t.x,s=t.y,u=null==(u=this.map)?void 0:u.slotsObServer[Os.DrawActivePoint];if(!e&&b(u)&&!1===u(t,this))return;u=null==(u=this.map)?void 0:u.slotsObServer[Os.DrawActiveMiddlePoint];if(e&&b(u)&&!1===u(t,this))return;this.addCircleFeature({sr:3.5,cx:a,cy:s},{clear:!1,style:{strokeStyle:n,fillStyle:r,stroke:!0,fill:!0,lineWidth:1}}),i&&this.addCircleFeature({sr:1.25,cx:a,cy:s},{clear:!1,style:{fillStyle:o,stroke:!1,fill:!0}})}},{key:"removeAllFeatureActionText",value:function(){this.featureActionTexts=[],this.clear()}},{key:"refresh",value:function(){Cs(j(i.prototype),"refresh",this).call(this),P(this.featureActionTexts,function(t){return t.refresh()})}}]),i}();function dc(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dc(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}var bc=function(){C(i,M);var r=gc(i);function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return s(this,i),u(D(t=r.call(this,t,E.Support,e,n)),"supports",[]),t}return n(i,[{key:"addSupports",value:function(t,e){e=(e||{}).clear;void 0!==e&&e&&this.removeAllSupports(),t.onAdd(this),this.supports.push(t)}},{key:"addText",value:function(t,e){var e=e||{},n=e.style,e=e.clear,e=void 0===e||e,t=new hc("".concat(+new Date),mc(mc({},t),{},{offset:{x:5,y:-5}}),{},n||i.defaultTextStyle);this.addSupports(t,{clear:e})}},{key:"addLineFeature",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.style,e=e.clear,e=void 0===e||e,t=new Xu("".concat(+new Date),t,{},n||i.defaultFeatureStyle);this.addSupports(t,{clear:e})}},{key:"addCrosshair",value:function(t){var e=t.x,t=t.y,n=this.map.getBounds(),r=n.x,i=n.y,o=n.width,a={x:e,y:i},e={x:e,y:i-n.height};this.addLineFeature({start:{x:r,y:t},end:{x:r+o,y:t}},{clear:!0}),this.addLineFeature({start:a,end:e},{clear:!1})}},{key:"removeAllSupports",value:function(){this.supports=[],this.clear()}},{key:"refresh",value:function(){Cs(j(i.prototype),"refresh",this).call(this),P(this.supports,function(t){return t.refresh()})}}]),i}(),wc=(u(bc,"defaultTextStyle",{fillStyle:"#FFFFFF",strokeStyle:"#D2691E",background:!0,globalAlpha:1,fontColor:"#333",font:"normal 10px Arial",textBaseline:"top"}),u(bc,"defaultFeatureStyle",{fillStyle:"#FFFFFF",strokeStyle:"#D2691E",background:!0,globalAlpha:.3,fontColor:"#333",font:"normal 10px Arial",textBaseline:"top"}),vs),xc=le,kc=Je;var Oc=Bs,Pc=vs,Sc=au,Dc=Math.max;var jc=function(o){return function(t,e,n){var r,i=Object(t),e=(xc(t)||(r=wc(e),t=kc(t),e=function(t){return r(i[t],t,i)}),o(t,e,n));return-1<e?i[r?t[e]:e]:void 0}}(function(t,e,n){var r=null==t?0:t.length;return r?((n=null==n?0:Sc(n))<0&&(n=Dc(r+n,0)),Oc(t,Pc(e),n)):-1});function Cc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}var Ac=function(){C(i,ku);var r=Cc(i);function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return s(this,i),u(D(t=r.call(this,t,E.Marker,e,n)),"markers",[]),t}return n(i,[{key:"addMarker",value:function(t,e){t.onAdd(this),this.markers.push(t)}},{key:"removeMarkerById",value:function(e){var t=Ss(this.markers,function(t){return t.id!==e||(t.onRemove(),!1)});this.markers=t,this.refresh()}},{key:"getMarkerById",value:function(e){return jc(this.markers,function(t){return t.id===e})}},{key:"getAllMarkers",value:function(){return this.markers}},{key:"removeAllMarkers",value:function(){var t=Ss(this.markers,function(t){return t.onRemove(),!1});this.markers=t,this.refresh()}},{key:"resize",value:function(){this.dom.style.width="0px",this.dom.style.height="0px"}},{key:"refresh",value:function(){Cs(j(i.prototype),"refresh",this).call(this),P(this.markers,function(t){return t.refresh()})}}]),i}(),bi=function(){function r(t,e){var n=this;s(this,r),u(this,"controls",[]),u(this,"layers",[]),u(this,"drawingStyle",{}),u(this,"drawingTip",!0),u(this,"drawingCrosshair",!0),u(this,"editingColor","#FF0000"),u(this,"slotsObServer",{}),u(this,"activeFeature",null),u(this,"events",{on:function(t,e){n.eventsObServer.on(t,e)}}),u(this,"slots",{on:function(t,e){n.slotsObServer[t]=e}}),this.wrapperDomId=t,this.wrapperDom=document.getElementById(t),this.createMainDom(),this.mapOptions=an({},r.defaultMapOptions,e),this.zoom=this.mapOptions.zoom,this.center=this.mapOptions.center,this.mode=this.mapOptions.mode,this.refreshDelayWhenZooming=this.mapOptions.refreshDelayWhenZooming,this.zoomWhenDrawing=this.mapOptions.zoomWhenDrawing,this.panWhenDrawing=this.mapOptions.panWhenDrawing,this.featureCaptureWhenMove=this.mapOptions.featureCaptureWhenMove,this.withHotKeys=this.mapOptions.withHotKeys,this.zoomWheelRatio=this.mapOptions.zoomWheelRatio,this.xAxis=this.mapOptions.xAxis,this.yAxis=this.mapOptions.yAxis,this.size=this.mapOptions.size||{width:d(this.dom,"clientWidth",0),height:d(this.dom,"clientHeight",0)},this.setDomStyle(),this.createSubDoms(),this.addOverlayLayer(),this.addTipLayer(),this.addSupportLayer(),this.addCursorLayer(),this.addEventLayer(),this.addMarkerLayer(),this.eventsObServer=new J.EventEmitter,this.withHotKeys&&this.registerHotkey()}return n(r,[{key:"setDomStyle",value:function(){this.dom.ondragstart=function(t){t.preventDefault(),t.stopPropagation()},this.dom.oncontextmenu=function(t){t.preventDefault(),t.stopPropagation()}}},{key:"setMode",value:function(t){this.mode=t,this.eventLayer.reset(),this.activeFeature&&this.eventsObServer.emit(k.FeatureUnselected,this.activeFeature,"cancel by switch mode")}},{key:"setDrawingStyle",value:function(t){this.drawingStyle=t}},{key:"setEditingColor",value:function(t){this.editingColor=t}},{key:"enableDrawingTip",value:function(){this.drawingTip=!0}},{key:"disableDrawingTip",value:function(){this.drawingTip=!1}},{key:"enableDrawingCrosshair",value:function(){this.drawingCrosshair=!0}},{key:"disableDrawingCrosshair",value:function(){this.drawingCrosshair=!1}},{key:"getSize",value:function(){return this.size}},{key:"getScale",value:function(t){var t=S(t)?t:this.zoom,e=this.getSize().width;return parseInt(1e6*e/t+"",10)/1e6}},{key:"setCenter",value:function(t){return this.center=t,this.refresh(),this.triggerBoundsChanged(),this}},{key:"getCenter",value:function(){return this.center}},{key:"getScreenCenter",value:function(){var t=this.getSize();return{x:t.width/2,y:t.height/2}}},{key:"getBounds",value:function(t){var e=this.getSize(),n=e.width,e=e.height,r=this.transformScreenToGlobal({x:0,y:0}),i=r.x,r=r.y,n=this.transformScreenToGlobal({x:n,y:e});return{x:i,y:r,width:n.x-i,height:r-n.y}}},{key:"enableZoomWhenDrawing",value:function(){this.zoomWhenDrawing=!0}},{key:"disableZoomWhenDrawing",value:function(){this.zoomWhenDrawing=!1}},{key:"enablePanWhenDrawing",value:function(){this.panWhenDrawing=!0}},{key:"disablePanWhenDrawing",value:function(){this.panWhenDrawing=!1}},{key:"enableFeatureCaptureWhenMove",value:function(){this.featureCaptureWhenMove=!0}},{key:"disableFeatureCaptureWhenMove",value:function(){this.featureCaptureWhenMove=!1}},{key:"enableHotKeys",value:function(){this.withHotKeys||(this.withHotKeys=!0,this.registerHotkey())}},{key:"disableHotKeys",value:function(){this.withHotKeys&&(this.withHotKeys=!1,this.unbindHotkey())}},{key:"centerAndZoom",value:function(t){var e=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).refreshDelay,e=void 0!==e&&e,n=t.center,t=t.zoom;return n&&(this.center=n),S(t)&&(this.zoom=t),this.refresh(e&&this.refreshDelayWhenZooming),this.triggerBoundsChanged(),this}},{key:"zoomTo",value:function(t){this.zoom=t,this.refresh(),this.triggerBoundsChanged()}},{key:"zoomIn",value:function(){this.zoom=this.zoom/2,this.refresh(),this.triggerBoundsChanged()}},{key:"zoomOut",value:function(){this.zoom=2*this.zoom,this.refresh(),this.triggerBoundsChanged()}},{key:"setZoomWheelRatio",value:function(t){this.zoomWheelRatio=t}},{key:"addControl",value:function(t){t.onAdd(this),this.controls.push(t)}},{key:"removeControlById",value:function(e){var t=Ss(this.controls,function(t){return t.id!==e||(t.onRemove(),!1)});this.controls=t}},{key:"addLayer",value:function(t){var e=t.dom;this.layerDom.appendChild(e),t.onAdd(this),this.layers.push(t)}},{key:"removeLayerById",value:function(e){var t=Ss(this.layers,function(t){return t.id!==e||(t.onRemove(),!1)});this.layers=t,this.refresh()}},{key:"removeAllLayers",value:function(){var t=Ss(this.layers,function(t){return t.onRemove(),!1});this.layers=t,this.refresh()}},{key:"getLayers",value:function(){return this.layers}},{key:"triggerBoundsChanged",value:function(){var t=this;this.boundsChangedTimer&&(window.clearTimeout(this.boundsChangedTimer),this.boundsChangedTimer=null),this.boundsChangedTimer=window.setTimeout(function(){t.eventsObServer.emit(k.BoundsChanged)},666),this.overlayLayer.refresh()}},{key:"refresh",value:function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];P(this.layers,function(t){return t.refresh(e)}),this.markerLayer.refresh()}},{key:"resize",value:function(t){this.size=t||{width:d(this.dom,"clientWidth",0),height:d(this.dom,"clientHeight",0)},this.setLayerDomSize(),this.setPlatformDomSize(),P(this.layers,function(t){return t.resizeAndRefresh()}),this.markerLayer.resizeAndRefresh(),this.overlayLayer.resizeAndRefresh(),this.tipLayer.resizeAndRefresh(),this.supportLayer.resizeAndRefresh(),this.eventLayer.resizeAndRefresh()}},{key:"setActiveFeature",value:function(t){this.activeFeature=t,this.overlayLayer.addActiveFeature(t);t=this.eventLayer.mouseMoveEvent;t&&this.eventLayer.onMouseMove(t)}},{key:"getActiveFeature",value:function(){return this.activeFeature}},{key:"removeDrawingPoints",value:function(){this.eventLayer.revokeTmpPointsStore()}},{key:"getTargetFeatureWithPoint",value:function(e){var t=this.getLayers(),n=[];return P(t,function(t){if(t.type===E.Feature){t=t.getTargetFeatureWithPoint(e);if(t)return n.push(t),!1}}),d(n,"[0]",null)}},{key:"exportLayersToImage",value:function(o){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.layers,e=void 0===e?this.getLayers():e,n=t.type,r=void 0===n?"base64":n,n=t.format,i=void 0===n?"image/png":n,n=t.quality,a=void 0===n?1:n,t=e,u=new Bu(o),c=[];return P(t,function(){s=B.mark(function t(e){var n,r,i;return B.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e.type===E.Feature?(n=e.getAllFeatures(),n=Jo(n),u.addObjects(n),c.push(new Promise(function(t){t(!0)}))):e.type===E.Text?(n=e.getAllTexts(),i=Jo(n),u.addObjects(i),c.push(new Promise(function(t){t(!0)}))):e.type===E.Mask?(r=e.getImageWithBounds(o),c.push(new Promise(function(t,e){var n=new Image;n.onload=function(){u.putImage(n),t(!0)},n.onerror=function(){e()},n.src=r}))):e.type===E.Image&&(i=Jo(e),u.addImageLayer(i),c.push(new Promise(function(t){t(!0)})));case 1:case"end":return t.stop()}},t)});var s,e=function(){var t=this,a=arguments;return new Promise(function(e,n){var r=s.apply(t,a);function i(t){F(r,e,n,i,o,"next",t)}function o(t){F(r,e,n,i,o,"throw",t)}i(void 0)})};return function(t){return e.apply(this,arguments)}}()),new Promise(function(e,t){Promise.all(c).then(function(){u.convertCanvasToImage(r,i,a).then(function(t){u=null,e(t)}).catch(function(t){console.log(t)})}).catch(function(t){console.log(t)})})}},{key:"transformScreenToGlobal",value:function(t,e){var e=e||{},n=e.basePoint,e=e.zoom,e=this.getScale(e),r=this.getScreenCenter(),i=r.x,r=r.y,o=t.x,t=t.y,i=d(n,"screen.x",i),r=d(n,"screen.y",r),n=d(n,"global",this.center),a=n.x,n=n.y,o=o-i,i=t-r;return{x:this.xAxis.direction===ws.Right?a+o/e:a-o/e,y:this.yAxis.direction===xs.Top?n-i/e:n+i/e}}},{key:"transformGlobalToScreen",value:function(t,e){var e=e||{},n=e.basePoint,e=e.zoom,e=this.getScale(e),r=this.getScreenCenter(),i=r.x,r=r.y,o=t.x,t=t.y,i=d(n,"screen.x",i),r=d(n,"screen.y",r),n=d(n,"global",this.center),o=o-n.x,t=t-n.y;return{x:this.xAxis.direction===ws.Right?i+o*e:i-o*e,y:this.yAxis.direction===xs.Top?r-t*e:r+t*e}}},{key:"createMainDom",value:function(){this.domId="main-wrapper-".concat(bn()),this.dom=document.createElement("div"),this.dom.setAttribute("id",this.domId),this.dom.style.position="absolute",this.dom.style.left="0",this.dom.style.top="0",this.dom.style.right="0",this.dom.style.bottom="0",this.wrapperDom.appendChild(this.dom)}},{key:"createSubDoms",value:function(){this.setLayerDom(),this.setPlatformDom(),this.setLayerDom2(),this.setControlDom()}},{key:"setLayerDom",value:function(){this.layerDomId="layer-wrapper-".concat(bn()),this.layerDom=document.createElement("div"),this.layerDom.setAttribute("id",this.layerDomId),this.layerDom.style.position="absolute",this.layerDom.style.left="0",this.layerDom.style.top="0",this.layerDom.style.zIndex="1",this.setLayerDomSize(),this.dom.appendChild(this.layerDom)}},{key:"setLayerDomSize",value:function(){var t=this.getSize(),e=t.width,t=t.height;this.layerDom.style.width="".concat(e,"px"),this.layerDom.style.height="".concat(t,"px")}},{key:"setPlatformDom",value:function(){this.platformDomId="platform-wrapper-".concat(bn()),this.platformDom=document.createElement("div"),this.platformDom.setAttribute("id",this.platformDomId),this.platformDom.style.position="absolute",this.platformDom.style.left="0",this.platformDom.style.top="0",this.platformDom.style.zIndex="5",this.setPlatformDomSize(),this.dom.appendChild(this.platformDom)}},{key:"setPlatformDomSize",value:function(){var t=this.getSize(),e=t.width,t=t.height;this.platformDom.style.width="".concat(e,"px"),this.platformDom.style.height="".concat(t,"px")}},{key:"setLayerDom2",value:function(){this.layerDom2Id="layer2-wrapper-".concat(bn()),this.layerDom2=document.createElement("div"),this.layerDom2.setAttribute("id",this.layerDom2Id),this.layerDom2.style.position="absolute",this.layerDom2.style.left="0",this.layerDom2.style.right="0",this.layerDom2.style.width="0",this.layerDom2.style.height="0",this.layerDom2.style.zIndex="10",this.dom.appendChild(this.layerDom2)}},{key:"setControlDom",value:function(){this.controlDomId="control-wrapper-".concat(bn()),this.controlDom=document.createElement("div"),this.controlDom.setAttribute("id",this.controlDomId),this.controlDom.style.position="absolute",this.controlDom.style.left="0",this.controlDom.style.right="0",this.controlDom.style.width="0",this.controlDom.style.height="0",this.controlDom.style.zIndex="15",this.dom.appendChild(this.controlDom)}},{key:"addEventLayer",value:function(){this.eventLayer=new Fu("event-".concat(bn()),{},{zIndex:5}),this.platformDom.appendChild(this.eventLayer.dom),this.eventLayer.onAdd(this)}},{key:"addOverlayLayer",value:function(){this.overlayLayer=new pc("overlay-".concat(bn()),{},{zIndex:1}),this.platformDom.appendChild(this.overlayLayer.dom),this.overlayLayer.onAdd(this)}},{key:"addTipLayer",value:function(){this.tipLayer=new pc("tip-".concat(bn()),{},{zIndex:2}),this.platformDom.appendChild(this.tipLayer.dom),this.tipLayer.onAdd(this)}},{key:"addSupportLayer",value:function(){this.supportLayer=new bc("support-".concat(bn()),{},{zIndex:1}),this.platformDom.appendChild(this.supportLayer.dom),this.supportLayer.onAdd(this)}},{key:"addCursorLayer",value:function(){this.cursorLayer=new pc("cursor-".concat(bn()),{},{zIndex:3}),this.platformDom.appendChild(this.cursorLayer.dom),this.cursorLayer.onAdd(this)}},{key:"addMarkerLayer",value:function(){this.markerLayer=new Ac("marker-".concat(bn()),{},{zIndex:10}),this.layerDom2.appendChild(this.markerLayer.dom),this.markerLayer.onAdd(this)}},{key:"registerHotkey",value:function(){var n=this;vt("ctrl+z",function(t,e){n.removeDrawingPoints()}),vt("up,down,left,right",function(t,e){t.preventDefault(),t.stopPropagation();t=n.getActiveFeature();t&&t.onMove(e.key)})}},{key:"unbindHotkey",value:function(){vt.unbind("ctrl+z"),vt.unbind("up,down,left,right")}},{key:"setCursor",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.cursorLayer.removeAllFeatureActionText(),this.platformDom.style.cursor=t,this.setCursorFeature(e),this}},{key:"setUrlCursor",value:function(t){return this}},{key:"setCursorFeature",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.type,t=t.shape;e===R.Circle&&this.cursorLayer.addCircleFeature(t,{style:{lineWidth:1,strokeStyle:"#aaa",fillStyle:"#ffffffb3",stroke:!0,fill:!0}})}},{key:"onDrag",value:function(t,e){this.layerDom.style.left="".concat(t,"px"),this.layerDom.style.top="".concat(e,"px"),this.layerDom2.style.left="".concat(t,"px"),this.layerDom2.style.top="".concat(e,"px")}},{key:"onZoom",value:function(t){this.dom.style.transform="scale(".concat(t,")")}},{key:"reset",value:function(){return this.layerDom.style.left="0",this.layerDom.style.top="0",this.layerDom2.style.left="0",this.layerDom2.style.top="0",this}},{key:"destroy",value:function(){this.dom.remove()}},{key:"printInfo",value:function(){}}]),r}();function Mc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}u(bi,"defaultMapOptions",{center:{x:0,y:0},zoom:1e3,zoomWheelRatio:5,mode:x.Pan,size:null,refreshDelayWhenZooming:!0,zoomWhenDrawing:!1,featureCaptureWhenMove:!1,withHotKeys:!0,panWhenDrawing:!1,xAxis:{direction:ws.Right},yAxis:{direction:xs.Bottom}});m=function(){C(a,M);var o=Mc(a);function a(t,e){var n,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};return s(this,a),u(D(n=o.call(this,t,E.Image,r,i)),"imageSuccess",!1),u(D(n),"events",{on:function(t,e){n.eventsObServer.on(t,e)}}),n.eventsObServer=new J.EventEmitter,n.imageInfo=an({},a.defaultImageInfo,e),n.position=n.imageInfo.position,n.grid=n.imageInfo.grid,n}return n(a,[{key:"updateImageInfo",value:function(t){this.imageInfo=an({},this.imageInfo,t),t.position&&(this.position=this.imageInfo.position),t.src&&this.updateImage(),this.refresh()}},{key:"updateImage",value:function(){var t=this;this.imageInfo.src&&(this.imageSuccess=!1,this.eventsObServer.emit(Au.LoadStart,this.imageInfo.src,this),this.image=new Image,this.imageInfo.crossOrigin?this.image.setAttribute("crossOrigin","anonymous"):this.image.removeAttribute("crossOrigin"),this.image.src=this.imageInfo.src,this.image.onload=function(){t.imageSuccess=!0,t.map&&t.refresh(),t.eventsObServer.emit(Au.LoadEnd,t.imageInfo.src,t)},this.image.onerror=function(){t.imageSuccess=!1,console.error("image src: "+t.imageInfo.src+" load error"),t.eventsObServer.emit(Au.LoadError,t.imageInfo.src,t)})}},{key:"updateGrid",value:function(t){this.grid=t,this.refresh()}},{key:"onAdd",value:function(t){Cs(j(a.prototype),"onAdd",this).call(this,t),this.updateImage(),this.refresh()}},{key:"drawImage",value:function(){var t=this.map.transformGlobalToScreen(this.position),e=t.x,t=t.y,n=M.dpr,r=this.map.getScale(),i=this.imageInfo,o=i.width,i=i.height;this.image&&this.imageSuccess&&T.drawImage(this.canvasContext,{image:this.image,x:e*n,y:t*n,width:o*r*n,height:i*r*n},{})}},{key:"drawGrid",value:function(){var o=this,t=this.imageInfo,a=t.width,s=t.height,t=this.position,u=t.x,c=t.y,l=M.dpr,h=this.map.xAxis.direction===ws.Right,f=this.map.yAxis.direction===xs.Top,t=d(this.grid,"columns",[]),e=d(this.grid,"rows",[]),n=t.length,y=a/(n+1),n=(P(t,function(t,e){var t=t||{},n=t.color,n=void 0===n?"#333":n,t=t.width,t=void 0===t?1:t,e=(e+1)*y,e=h?u+e:u-e,r=f?c-s:c+s,i=o.map.transformGlobalToScreen({x:e,y:c}),e=o.map.transformGlobalToScreen({x:e,y:r});T.drawLine(o.canvasContext,{start:{x:i.x*l,y:i.y*l},end:{x:e.x*l,y:e.y*l}},{strokeStyle:n,lineWidth:t})}),e.length),v=s/(n+1);P(e,function(t,e){var t=t||{},n=t.color,n=void 0===n?"#333":n,t=t.width,t=void 0===t?1:t,e=(e+1)*v,e=f?c-e:c+e,r=h?u+a:u-a,i=o.map.transformGlobalToScreen({x:u,y:e}),r=o.map.transformGlobalToScreen({x:r,y:e});T.drawLine(o.canvasContext,{start:{x:i.x*l,y:i.y*l},end:{x:r.x*l,y:r.y*l}},{strokeStyle:n,lineWidth:t})})}},{key:"refresh",value:function(){Cs(j(a.prototype),"refresh",this).call(this),this.drawImage(),this.drawGrid()}}]),a}();function Tc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}u(m,"defaultImageInfo",{src:"",width:0,height:0,position:{x:0,y:0},crossOrigin:!1,grid:{columns:[],rows:[]}});var zi=function(){C(i,M);var r=Tc(i);function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return s(this,i),u(D(t=r.call(this,t,E.Feature,e,n)),"features",[]),t}return n(i,[{key:"addFeature",value:function(t,e){e=(e||{}).clear;void 0!==e&&e&&(this.features=[],this.clear()),t.onAdd(this),this.features.push(t)}},{key:"removeFeatureById",value:function(e){var t=Ss(this.features,function(t){return t.id!==e||(t.onRemove(),!1)});this.features=t,this.refresh()}},{key:"getFeatureById",value:function(e){return jc(this.features,function(t){return t.id===e})}},{key:"getAllFeatures",value:function(){return this.features}},{key:"removeAllFeatures",value:function(){var t=Ss(this.features,function(t){return t.onRemove(),!1});this.features=t,this.refresh()}},{key:"getTargetFeatureWithPoint",value:function(e){var n=[];return P(this.features,function(t){if(t.captureWithPoint(e))return n.push(t),!1}),d(n,"[0]",null)}},{key:"refresh",value:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.refreshDelayTimer&&(window.clearTimeout(this.refreshDelayTimer),this.refreshDelayTimer=null),Cs(j(i.prototype),"refresh",this).call(this),e?this.refreshDelayTimer=window.setTimeout(function(){P(t.features,function(t){return t.refresh()})},100):P(this.features,function(t){return t.refresh()})}}]),i}(),Lc=Ks;function Ec(t,e){return!!(null==t?0:t.length)&&-1<Lc(t,e,0)}function Rc(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Ic(){}var Fc=_i,rr=Fc&&1/ca(new Fc([,-0]))[1]==1/0?function(t){return new Fc(t)}:Ic,_c=Vi,zc=Ec,Bc=Rc,Wc=ia,Uc=rr,Gc=ca;var Kc=function(t,e,n){var r=-1,i=zc,o=t.length,a=!0,s=[],u=s;if(n)a=!1,i=Bc;else if(200<=o){var c=e?null:Uc(t);if(c)return Gc(c);a=!1,i=Wc,u=new _c}else u=e?[]:s;t:for(;++r<o;){var l=t[r],h=e?e(l):l,l=n||0!==l?l:0;if(a&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue t;e&&u.push(h),s.push(l)}else i(u,h,n)||(u!==s&&u.push(h),s.push(l))}return s};var Nc=function(t){return t&&t.length?Kc(t):[]},Yc=function(){function e(t){s(this,e),u(this,"actions",[]),u(this,"map",{getScale:function(){return 1},transformGlobalToScreen:function(t){var e=t.x,t=t.y,n=this.bounds;return{x:e-n.x,y:t-n.y}}}),this.bounds=t,this.createRenderCanvas(),this.map.getScale=this.map.getScale.bind(this),this.map.transformGlobalToScreen=this.map.transformGlobalToScreen.bind(this)}return n(e,[{key:"createRenderCanvas",value:function(){var t=this.bounds,e=t.width,t=t.height;this.canvas=new OffscreenCanvas(e,t),this.canvas.width=e*M.dpr,this.canvas.height=t*M.dpr,this.canvasContext=this.canvas.getContext("2d")}},{key:"addAction",value:function(t){t.setStyle({strokeStyle:"#ff0000",fillStyle:"#ff0000"},{refresh:!1}),t.onAdd(this),this.actions.push(t)}},{key:"addActions",value:function(t){var e=this;P(t,function(t){return e.addAction(t)})}},{key:"getRle",value:function(){for(var t=[],e=M.dpr,n=this.bounds,r=n.width,i=n.height,n=this.canvas,o=n.width,n=n.height,a=this.canvasContext.getImageData(0,0,o,n).data,s=0,u=1,c=0;c<i;c++)for(var l=0;l<r;l++){var h=4*(c*e*r+l)*e,f=a[h],y=a[1+h],v=a[2+h],h=a[3+h],f=+!!(f||y||v||h);f===u?s++:(t.push(s),s=1),c+1===i&&l+1===r&&t.push(s),u=f}return t}},{key:"refresh",value:function(){P(this.actions,function(t){return t.refresh()})}},{key:"clear",value:function(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}}]),e}();function Xc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}t=function(){C(i,M);var r=Xc(i);function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return s(this,i),u(D(t=r.call(this,t,E.Mask,e,n)),"actions",[]),t}return n(i,[{key:"addAction",value:function(t,e){t.onAdd(this),this.actions.push(t)}},{key:"removeActionById",value:function(e){var t=Ss(this.actions,function(t){return t.id!==e||(t.onRemove(),!1)});this.actions=t,this.refresh()}},{key:"getAllActions",value:function(){return this.actions}},{key:"removeAllActions",value:function(){var t=Ss(this.actions,function(t){return t.onRemove(),!1});this.actions=t,this.refresh()}},{key:"setMovingClearAction",value:function(t){t&&t.onAdd(this),t||this.refresh()}},{key:"getActionCategories",value:function(){var t=this.actions,t=_s(t,function(t){return t.category});return Ss(Nc(t),function(t){return!!t})}},{key:"groupByCategory",value:function(){var e=this.actions,t=this.getActionCategories(),r=[];return P(t,function(n){var t=Ss(e,function(t){var e=t.type;return t.category===n||e===du.Clear});r.push({category:n,actions:t})}),r}},{key:"getGroupRleData",value:function(t,e){var n=t.category,t=t.actions,t=void 0===t?[]:t,e=new Yc(e),t=Jo(t);return e.addActions(t),{category:n,rle:e.getRle()}}},{key:"getImageData",value:function(t){var e=t.x,n=t.y,r=t.width,t=t.height,e=this.map.transformGlobalToScreen({x:e,y:n}),n=this.map.getScale(),i=e.x*M.dpr,e=e.y*M.dpr,r=r/n*M.dpr,t=t/n*M.dpr;return this.canvasContext.getImageData(i,e,r,t)}},{key:"getImageWithBounds",value:function(t){var e=t.width,n=t.height,t=this.getImageData(t),r=document.createElement("canvas");return r.width=e*M.dpr,r.height=n*M.dpr,r.style.width=e+"px",r.style.height=n+"px",r.getContext("2d").putImageData(t,0,0),r.toDataURL("image/png",1)}},{key:"getRleData",value:function(e){var n=this,t=this.groupByCategory(),r=[];return P(t,function(t){t=n.getGroupRleData(t,e);r.push(t)}),r}},{key:"refresh",value:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.refreshDelayTimer&&(window.clearTimeout(this.refreshDelayTimer),this.refreshDelayTimer=null),Cs(j(i.prototype),"refresh",this).call(this),e?this.refreshDelayTimer=window.setTimeout(function(){P(t.actions,function(t){return t.refresh()})},100):P(this.actions,function(t){return t.refresh()})}}]),i}();function Hc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}g={Text:function(){C(i,M);var r=Hc(i);function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return s(this,i),u(D(t=r.call(this,t,E.Text,e,n)),"texts",[]),t}return n(i,[{key:"addText",value:function(t,e){e=(e||{}).clear;void 0!==e&&e&&this.clear(),t.onAdd(this),this.texts.push(t)}},{key:"removeTextById",value:function(e){var t=Ss(this.texts,function(t){return t.id!==e||(t.onRemove(),!1)});this.texts=t,this.refresh()}},{key:"getTextById",value:function(e){return jc(this.texts,function(t){return t.id===e})}},{key:"getAllTexts",value:function(){return this.texts}},{key:"removeAllTexts",value:function(){var t=Ss(this.texts,function(t){return t.onRemove(),!1});this.texts=t,this.refresh()}},{key:"refresh",value:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.refreshDelayTimer&&(window.clearTimeout(this.refreshDelayTimer),this.refreshDelayTimer=null),Cs(j(i.prototype),"refresh",this).call(this),e?this.refreshDelayTimer=window.setTimeout(function(){P(t.texts,function(t){return t.refresh()})},100):P(this.texts,function(t){return t.refresh()})}}]),i}(),Mask:t,Image:m,Feature:zi,OverlayLayer:pc,SupportLayer:bc,EventLayer:Fu};function $c(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}var h={Base:Wu,Point:Gu,Circle:rc,Line:Xu,Polyline:Zu,Rect:Qu,Polygon:ec,Arrow:function(){C(o,Wu);var i=$c(o);function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};return s(this,o),(t=i.call(this,t,R.Arrow,n,r)).shape=e,t}return n(o,[{key:"captureWithPoint",value:function(t){return!1}},{key:"refresh",value:function(){var t;null!=(t=this.layer)&&t.map}}]),o}()};function Zc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}var ir=function(){C(a,gu);var o=Zc(a);function a(t,e,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{};return s(this,a),u(D(t=o.call(this,t,du.Image,r,i)),"category",""),t.imageInfo=an({},a.defaultImageInfo,n),t.position=t.imageInfo.position,t.updateImage(),t.category=e,t}return n(a,[{key:"updateImage",value:function(){var t=this;this.imageInfo.src&&(this.image=new Image,this.imageInfo.crossOrigin?this.image.setAttribute("crossOrigin","anonymous"):this.image.removeAttribute("crossOrigin"),this.image.src=this.imageInfo.src,this.image.onload=function(){return t.layer&&t.refresh()})}},{key:"drawImage",value:function(){var t,e,n,r,i,o;null!=(e=this.layer)&&e.map&&(t=(e=this.layer.map.transformGlobalToScreen(this.position)).x,e=e.y,n=M.dpr,r=this.layer.map.getScale(),i=(o=this.imageInfo).width,o=o.height,T.drawImage(this.layer.canvasContext,{image:this.image,x:t*n,y:e*n,width:i*r*n,height:o*r*n},{}))}},{key:"refresh",value:function(){Cs(j(a.prototype),"refresh",this).call(this),this.drawImage()}}]),a}(),e=(u(ir,"defaultImageInfo",{src:"",width:0,height:0,crossOrigin:!1,position:{x:0,y:0}}),{Draw:uc,Clear:Eu,Image:ir}),qc=function(){function i(t,e,n,r){s(this,i),this.id=t,this.type=e,this.props=n||{},this.option=r||{},this.domId="control-grid-".concat(t,"-wrapper"),this.createContainer()}return n(i,[{key:"createContainer",value:function(){this.dom||(this.dom=document.createElement("div"),this.dom.setAttribute("id",this.domId),this.dom.style.position="absolute",this.dom.style.left="0",this.dom.style.top="0",this.dom.style.zIndex="20")}},{key:"onAdd",value:function(t){this.map=t,this.map.dom.appendChild(this.dom)}},{key:"onRemove",value:function(){var t=document.getElementById(this.domId);t&&t.remove()}},{key:"updatePosition",value:function(t){this.position=t,this.refresh()}},{key:"refresh",value:function(){}},{key:"printInfo",value:function(){}}]),i}();function Vc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}var Jc,z=function(){C(e,qc);var t=Vc(e);function e(){return s(this,e),t.call(this)}return n(e,[{key:"refresh",value:function(){}}]),e}();function Qc(n){var r=function(){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}}();return function(){var t,e=j(n);return A(this,r?(t=j(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}(i=Jc=Jc||{}).Scale="SCALE",i.Grid="GRID";var c=function(){C(o,qc);var i=Qc(o);function o(t,e,n,r){return s(this,o),console.log(111,t),(t=i.call(this,t,Jc.Grid,n,r)).gridInfo=an({},o.defaultGridInfo,e),t.creatCanvasElement(),t.refreshElement(),t}return n(o,[{key:"refreshElement",value:function(){this.setContainerSize(),this.setContainerPosition(),this.setContainerStyle(),this.setRenderCanvasSize()}},{key:"setContainerSize",value:function(){var t=this.gridInfo.size,e=t.width,t=t.height;this.dom.style.width=e+"px",this.dom.style.height=t+"px"}},{key:"setContainerPosition",value:function(){var t=this.gridInfo.position,e=t.left,n=t.top,r=t.right,t=t.bottom;this.dom.style.left=S(e)?"".concat(e,"px"):"initial",this.dom.style.right=S(r)?"".concat(r,"px"):"initial",this.dom.style.top=S(n)?"".concat(n,"px"):"initial",this.dom.style.bottom=S(t)?"".concat(t,"px"):"initial"}},{key:"setContainerStyle",value:function(){this.dom.style.border="1px solid red"}},{key:"creatCanvasElement",value:function(){this.canvas=document.createElement("canvas"),this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.dom.appendChild(this.canvas),this.canvasContext=this.canvas.getContext("2d")}},{key:"setRenderCanvasSize",value:function(){var t=this.gridInfo.size,e=t.width,t=t.height;this.canvas.width=e*M.dpr,this.canvas.height=t*M.dpr,this.canvas.style.width=e+"px",this.canvas.style.height=t+"px"}},{key:"refresh",value:function(){}}]),o}(),f=(u(c,"defaultGridInfo",{position:{right:10,bottom:10},size:{width:200,height:200},grid:{columns:[],rows:[]}}),{Scale:z,Grid:c});function tl(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}function el(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tl(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Ae=function(){function i(t,e){var n=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};s(this,i),u(this,"dragging",!1),u(this,"draggingEnabled",!1),u(this,"events",{on:function(t,e){n.eventsObServer.on(t,e)}}),this.id=t,this.type=Tu.Marker,this.props=r,this.markerInfo=an({},i.defaultMarkerInfo,e),this.updateImage(),this.eventsObServer=new J.EventEmitter}return n(i,[{key:"onAdd",value:function(t){this.layer=t,this.refresh()}},{key:"onRemove",value:function(){var t=document.getElementById(this.id);t&&t.remove()}},{key:"enableDragging",value:function(){this.draggingEnabled=!0,this.dragging=!1}},{key:"disableDragging",value:function(){this.draggingEnabled=!1,this.dragging=!1}},{key:"updateImage",value:function(){var e=this;this.markerInfo.src&&(this.image=new Image,this.image.id=this.id,this.image.setAttribute("data-type",this.type),this.image.style.position="absolute",this.image.style.cursor="pointer",this.image.style.userSelect="none",this.image.src=this.markerInfo.src,this.image.onload=function(){var t;null!=(t=e.layer)&&null!=(t=t.dom)&&t.appendChild(e.image),e.attachEvents()},this.image.onerror=function(){console.error("marker‘s src onerror")})}},{key:"updatePosition",value:function(t){var e=this.markerInfo;this.markerInfo=el(el({},e),{},{position:t}),this.refresh()}},{key:"handleMouseDown",value:function(t){var e=this,n=t.screenX,r=t.screenY,n=(this.startPageScreenPoint={x:n,y:r},this.toUpdatePosition=null,L.EventUtil.getButtonIndex(t));this.eventsObServer.emit(Lu.MouseDown,this),2===n&&this.eventsObServer.emit(Lu.RightClick,this),this.draggingEnabled&&(this.dragging=!0,document.onmousemove=function(t){return e.handleMarkerMove(t)},document.onmouseup=function(t){return e.handleMarkerUp(t)},this.eventsObServer.emit(Lu.DragStart,this))}},{key:"handleMarkerMove",value:function(t){var e=this.layer.map.getScale(),n=t.screenX,t=t.screenY,r=this.startPageScreenPoint,n=(n-r.x)/e,t=(t-r.y)/e,r=this.layer.map.xAxis.direction===ws.Right,e=this.layer.map.yAxis.direction===xs.Top,i=this.markerInfo.position;this.toUpdatePosition={x:i.x+(r?n:-n),y:i.y-(e?t:-t)},this.refresh(this.toUpdatePosition),this.eventsObServer.emit(Lu.Dragging,this,this.toUpdatePosition)}},{key:"handleMarkerUp",value:function(t){this.dragging=!1,document.onmousemove=null,document.onmouseup=null,this.toUpdatePosition&&(this.refresh(),this.eventsObServer.emit(Lu.DragEnd,this,this.toUpdatePosition)),this.toUpdatePosition=null}},{key:"handleMouseUp",value:function(t){this.eventsObServer.emit(Lu.MouseUp,this)}},{key:"handleMouseOver",value:function(t){var e;this.layer.map.eventLayer.breakFeatureCapture=!0,null!=(e=this.layer)&&null!=(e=e.map)&&e.tipLayer.removeAllFeatureActionText(),this.eventsObServer.emit(Lu.MouseOver,this)}},{key:"handleMouseOut",value:function(t){this.eventsObServer.emit(Lu.MouseOut,this)}},{key:"handleClick",value:function(t){this.eventsObServer.emit(Lu.Click,this)}},{key:"attachEvents",value:function(){var e=this;this.image.onmousedown=function(t){return e.handleMouseDown(t)},this.image.onmouseup=function(t){return e.handleMouseUp(t)},this.image.onmouseover=function(t){return e.handleMouseOver(t)},this.image.onmouseout=function(t){return e.handleMouseOut(t)},this.image.onclick=function(t){return e.handleClick(t)}}},{key:"refresh",value:function(t){var e=this.markerInfo,n=e.position,e=e.offset,t=this.layer.map.transformGlobalToScreen(t||n),n=t.x,t=t.y,r=e.x,t=t-e.y;this.image.style.left="".concat(n+r,"px"),this.image.style.top="".concat(t,"px")}},{key:"printInfo",value:function(){}}]),i}();return u(Ae,"defaultMarkerInfo",{src:"",position:{x:0,y:0},offset:{x:0,y:0}}),{Map:bi,Layer:g,Feature:h,Mask:e,Control:f,Text:hc,Marker:Ae,Util:L,version:"5.1.8"}}); |