iobroker.kisshome-defender
Version:
Collection of information for KISSHome defender
1 lines • 753 kB
JavaScript
import{j as D}from"./jsx-runtime-CnA0dVj1.js";import{k as zi,R as yi}from"./kisshome_mf_2_defender__loadShare__react__loadShare__-m8N8GhhJ.js";import{k as O,a as bt}from"./kisshome_mf_2_defender__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-26WprJVP.js";import{k as w2,a as D2}from"./kisshome_mf_2_defender__mf_v__runtimeInit__mf_v__-BiDQ8yU9.js";import{g as C2}from"./_commonjsHelpers-DsqdWQfm.js";const T2=""+new URL("kisshome-defender-Thki-JWA.svg",import.meta.url).href,{loadShare:k2}=D2,{initPromise:A2}=w2,M2=A2.then(t=>k2("@iobroker/adapter-react-v5",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),E2=await M2.then(t=>t());var L=E2;const un=600,ln=1024*1024*1024,cn=1024*1024,Eo=1024;function gt(t,e,r){return t==null||isNaN(t)?"--":e!==void 0&&e>ln?`${(t/ln).toFixed(1).replace(".",",")}Gb`:e!==void 0&&e>cn?`${(t/cn).toFixed(e>12*cn&&r?0:1).replace(".",",")}Mb`:t<Eo?`${t}b`:e!==void 0?t<1024*1024?`${(t/Eo).toFixed(e>12*Eo&&r?0:1).replace(".",",")}kb`:t<ln?`${(t/cn).toFixed(e>12*cn&&r?0:1).replace(".",",")}Mb`:`${(t/ln).toFixed(e>12*ln&&r?0:1).replace(".",",")}Gb`:t<cn?`${(t/Eo).toFixed(r?0:1).replace(".",",")}kb`:t<ln?`${(t/cn).toFixed(r?0:1).replace(".",",")}Mb`:`${(t/ln).toFixed(r?0:1).replace(".",",")}Gb`}function ee(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent||t&&typeof t=="object"&&("touches"in t||"changedTouches"in t)}async function w1(t,e){const r=await t.getObject(`system.adapter.kisshome-defender.${e}`);if(r!=null&&r.native){const n=r.common.host,i=await t.getAdapterInstances("admin");let a=i.find(o=>o.common.enabled&&o.common.host===n);if(a||=i.find(o=>o.common.enabled),a||=i[0],a)return`http${a.native.secure?"s":""}://${a.common.host===n?window.location.hostname:a.common.host}:${a.native.port}/#tab-instances/config/system.adapter.kisshome-defender.${e}/_instances`}else console.error("Failed to load adapter configuration");return""}const st={title:{paddingLeft:10,alignItems:"center"},row:{height:38},result:{display:"flex",gap:10,alignItems:"center",height:38}};function zt(t){return D.jsx("span",{style:{borderRadius:!t.ok&&t.warning?void 0:30,backgroundColor:t.ok?"green":t.warning?void 0:"red",width:t.size||30,height:t.size||30,display:"flex",justifyContent:"center",alignItems:"center",...t.style},children:t.ok?D.jsx(bt.Check,{style:{color:"white",width:t.size||30,height:t.size||30,fill:"currentColor"}}):t.warning?D.jsx(bt.Warning,{style:{color:"red",width:t.size||30,height:t.size||30,fill:"currentColor"}}):D.jsx(bt.Close,{style:{color:"white",width:t.size||30,height:t.size||30,fill:"currentColor"}})})}class I2 extends zi.Component{constructor(e){super(e),this.state={recordingEnabled:!1,idsStatus:"Unknown",recordingCaptured:0,recordingRunning:!1,adminLink:""}}async componentDidMount(){const e=`kisshome-defender.${this.props.instance}.info.ids.status`,r=`kisshome-defender.${this.props.instance}.info.recording.enabled`,n=`kisshome-defender.${this.props.instance}.info.recording.running`,i=`kisshome-defender.${this.props.instance}.info.recording.capturedFull`,a=await this.props.socket.getState(e),o=await this.props.socket.getState(r),s=await this.props.socket.getState(n),u=await this.props.socket.getState(i);this.onIdsStatusChanged(e,a),this.onRecordingEnabledChanged(r,o),this.onRecordingRunningChanged(n,s),this.onRecordingCapturedChanged(i,u),await this.props.socket.subscribeState(e,this.onIdsStatusChanged),await this.props.socket.subscribeState(r,this.onRecordingEnabledChanged),await this.props.socket.subscribeState(n,this.onRecordingRunningChanged),await this.props.socket.subscribeState(i,this.onRecordingCapturedChanged),this.setState({adminLink:await w1(this.props.socket,this.props.instance)})}componentWillUnmount(){this.props.socket.unsubscribeState(`kisshome-defender.${this.props.instance}.info.ids.status`,this.onIdsStatusChanged),this.props.socket.unsubscribeState(`kisshome-defender.${this.props.instance}.info.recording.enabled`,this.onRecordingEnabledChanged),this.props.socket.unsubscribeState(`kisshome-defender.${this.props.instance}.info.recording.running`,this.onRecordingRunningChanged),this.props.socket.unsubscribeState(`kisshome-defender.${this.props.instance}.info.recording.capturedFull`,this.onRecordingCapturedChanged)}onIdsStatusChanged=(e,r)=>{((r==null?void 0:r.val)||"")!==this.state.idsStatus&&this.setState({idsStatus:(r==null?void 0:r.val)||"Unknown"})};onRecordingEnabledChanged=(e,r)=>{!!(r!=null&&r.val)!==this.state.recordingEnabled&&this.setState({recordingEnabled:!!(r!=null&&r.val)})};onRecordingRunningChanged=(e,r)=>{!!(r!=null&&r.val)!==this.state.recordingRunning&&this.setState({recordingRunning:!!(r!=null&&r.val)})};onRecordingCapturedChanged=(e,r)=>{((r==null?void 0:r.val)||0)!==this.state.recordingCaptured&&this.setState({recordingCaptured:(r==null?void 0:r.val)||0})};getStatusColor(){return this.state.idsStatus==="Error"||this.state.idsStatus==="Exited"?"red":this.state.idsStatus==="No connection"||this.state.idsStatus==="Unknown"?"orange":"green"}render(){var a,o;const r=(((a=this.props.results)==null?void 0:a.results)||[]).filter(s=>s.isAlert);let n=0;if(this.props.lastSeenID){let s=!1;for(let u=0;u<r.length;u++)s&&n++,r[u].uuid===this.props.lastSeenID&&(s=!0);s||(n=r.length)}else n=r.length;let i="";return this.props.alive?this.state.idsStatus==="Error"?i=L.I18n.t("kisshome-defender_Detection engine exited"):this.state.recordingRunning||(i=L.I18n.t("kisshome-defender_Recording is not running. Please check the log for more details")):i=L.I18n.t("kisshome-defender_Instance is not running"),D.jsxs("div",{className:"status-tab",style:{width:`calc(100% - ${this.props.isMobile?10:20}px)`,height:`calc(100% - ${this.props.isMobile?10:20}px)`,display:"flex",flexDirection:"column",padding:this.props.isMobile?5:10,gap:this.props.isMobile?10:20},children:[D.jsxs(O.Paper,{style:{flexGrow:1,padding:this.props.isMobile?5:10,border:`2px solid ${this.props.themeType==="dark"?"white":"black"}`,borderRadius:0,backgroundColor:this.props.themeType==="dark"?void 0:"#E6E6E6",boxShadow:"none",display:"flex",justifyContent:this.props.isMobile?"space-evenly":"center",alignItems:"center",fontSize:this.props.isMobile?"0.9rem":"1.3rem",width:`calc(100% - ${this.props.isMobile?10:20}`,flexDirection:"column"},children:[this.props.alive?D.jsx(O.Button,{variant:"contained",color:"primary",style:this.props.isMobile?{}:{position:"absolute",top:80,right:30},onClick:async s=>{this.props.reportUxEvent({id:"kisshome-defender-status-recording-enabled",event:"change",ts:Date.now(),isTouchEvent:ee(s)}),await this.props.socket.setState(`kisshome-defender.${this.props.instance}.info.recording.enabled`,!this.state.recordingEnabled)},children:this.state.recordingEnabled?L.I18n.t("kisshome-defender_Deactivate protection"):L.I18n.t("kisshome-defender_Activate protection")}):null,D.jsx("table",{children:D.jsxs("tbody",{children:[this.props.alive?null:D.jsxs("tr",{style:{...st.row,display:"flex",alignItems:"center",width:void 0},children:[D.jsx("td",{style:st.result,children:D.jsx(zt,{ok:this.props.alive})}),D.jsx("td",{style:st.title,children:L.I18n.t("kisshome-defender_Instance is not running")})]}),this.props.alive&&this.state.adminLink?null:D.jsx("tr",{style:{...st.row,display:"flex",alignItems:"center",gap:10,width:void 0},children:D.jsx("td",{colSpan:2,children:D.jsx(O.Link,{href:this.state.adminLink,target:"settings",onClick:s=>{this.props.reportUxEvent({id:"kisshome-defender-settings-admin-link",event:"click",data:this.state.adminLink,ts:Date.now(),isTouchEvent:ee(s)})},children:L.I18n.t("kisshome-defender_Enable the instance in the admin")})})}),this.props.alive?D.jsxs("tr",{style:st.row,children:[D.jsx("td",{style:st.result,title:i,children:D.jsx(zt,{ok:this.state.recordingRunning})}),D.jsx("td",{style:st.title,children:this.state.recordingRunning?L.I18n.t("kisshome-defender_Software activated"):L.I18n.t("kisshome-defender_Software not activated")})]}):null,this.props.alive?D.jsxs("tr",{style:st.row,children:[D.jsxs("td",{style:{...st.result,color:this.getStatusColor()},children:[D.jsx(zt,{ok:this.getStatusColor()==="green"}),D.jsx("span",{style:{fontSize:"smaller",fontStyle:"italic"},children:L.I18n.t(`kisshome-defender_${this.state.idsStatus}`)})]}),D.jsx("td",{style:st.title,children:L.I18n.t("kisshome-defender_Detection engine status")})]}):null,this.props.alive&&this.state.recordingRunning?D.jsxs("tr",{style:st.row,children:[D.jsxs("td",{style:{...st.result,fontSize:"0.9rem"},children:[D.jsx(zt,{ok:!0}),D.jsx(O.CircularProgress,{}),D.jsx("span",{children:L.I18n.t("kisshome-defender_%s collected",gt(this.state.recordingCaptured))})]}),D.jsx("td",{style:st.title,children:L.I18n.t("kisshome-defender_Recording is running")})]}):null]})})]}),this.props.alive?D.jsxs(O.Paper,{style:{height:this.props.isMobile?60:80,padding:"10px 40px 10px 10px",border:`2px solid ${this.props.themeType==="dark"?"white":"black"}`,borderRadius:0,backgroundColor:this.props.themeType==="dark"?void 0:"#E6E6E6",boxShadow:"none",cursor:(o=this.props.results)!=null&&o.results.length?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,fontSize:"1.3rem"},onClick:()=>{var s;(s=this.props.results)!=null&&s.results.length&&(this.props.reportUxEvent({id:"kisshome-defender-status-detections",event:"click",ts:Date.now()}),this.props.onNavigateToDetections())},children:[D.jsx("div",{}),n?`${L.I18n.t("kisshome-defender_New problem detected")}: ${n}`:L.I18n.t("kisshome-defender_Everything OK"),D.jsx(zt,{style:{marginLeft:10},ok:!n,warning:!0,size:this.props.isMobile?36:52})]}):null]})}}var D1={};var zc=function(t,e){return zc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},zc(t,e)};function z(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Vc=function(){return Vc=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Vc.apply(this,arguments)};function P2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function L2(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function R2(t,e){return function(r,n){e(r,n,t)}}function O2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function F2(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{l(n.next(c))}catch(f){o(f)}}function u(c){try{l(n.throw(c))}catch(f){o(f)}}function l(c){c.done?a(c.value):i(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})}function B2(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(c){l=[6,c],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var rh=Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]});function N2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rh(e,t,r)}function jc(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function C1(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function z2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(C1(arguments[e]));return t}function V2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}function j2(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||e)}function ja(t){return this instanceof ja?(this.v=t,this):new ja(t)}function G2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){n[h]&&(i[h]=function(d){return new Promise(function(v,p){a.push([h,d,v,p])>1||s(h,d)})})}function s(h,d){try{u(n[h](d))}catch(v){f(a[0][3],v)}}function u(h){h.value instanceof ja?Promise.resolve(h.value.v).then(l,c):f(a[0][2],h)}function l(h){s("next",h)}function c(h){s("throw",h)}function f(h,d){h(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}function W2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=t[i]?function(o){return(r=!r)?{value:ja(t[i](o)),done:i==="return"}:a?a(o):o}:a}}function U2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof jc=="function"?jc(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(o){return new Promise(function(s,u){o=t[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(l){a({value:l,done:s})},o)}}function H2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var $2=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e};function q2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&rh(e,t,r);return $2(e,t),e}function Y2(t){return t&&t.__esModule?t:{default:t}}function X2(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Z2(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}const K2=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Vc},__asyncDelegator:W2,__asyncGenerator:G2,__asyncValues:U2,__await:ja,__awaiter:F2,__classPrivateFieldGet:X2,__classPrivateFieldSet:Z2,__createBinding:rh,__decorate:L2,__exportStar:N2,__extends:z,__generator:B2,__importDefault:Y2,__importStar:q2,__makeTemplateObject:H2,__metadata:O2,__param:R2,__read:C1,__rest:P2,__spread:z2,__spreadArray:j2,__spreadArrays:V2,__values:jc},Symbol.toStringTag,{value:"Module"})),T1=C2(K2);var dr={},vr={},ol={},zd;function Q2(){return zd||(zd=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=1,r=function(){return"".concat(e++)};t.default=r})(ol)),ol}var $i={},qi={},sl={},Vd;function k1(){return Vd||(Vd=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,a=null;return function(){for(var o=this,s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];clearTimeout(a),a=setTimeout(function(){n.apply(o,u)},i)}};t.default=e})(sl)),sl}var pr={},jd;function nh(){if(jd)return pr;jd=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.SizeSensorId=pr.SensorTabIndex=pr.SensorClassName=void 0;var t="size-sensor-id";pr.SizeSensorId=t;var e="size-sensor-object";pr.SensorClassName=e;var r="-1";return pr.SensorTabIndex=r,pr}var Gd;function J2(){if(Gd)return qi;Gd=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.createSensor=void 0;var t=r(k1()),e=nh();function r(i){return i&&i.__esModule?i:{default:i}}var n=function(a,o){var s=void 0,u=[],l=function(){getComputedStyle(a).position==="static"&&(a.style.position="relative");var p=document.createElement("object");return p.onload=function(){p.contentDocument.defaultView.addEventListener("resize",c),c()},p.style.display="block",p.style.position="absolute",p.style.top="0",p.style.left="0",p.style.height="100%",p.style.width="100%",p.style.overflow="hidden",p.style.pointerEvents="none",p.style.zIndex="-1",p.style.opacity="0",p.setAttribute("class",e.SensorClassName),p.setAttribute("tabindex",e.SensorTabIndex),p.type="text/html",a.appendChild(p),p.data="about:blank",p},c=(0,t.default)(function(){u.forEach(function(v){v(a)})}),f=function(p){s||(s=l()),u.indexOf(p)===-1&&u.push(p)},h=function(){s&&s.parentNode&&(s.contentDocument&&s.contentDocument.defaultView.removeEventListener("resize",c),s.parentNode.removeChild(s),a.removeAttribute(e.SizeSensorId),s=void 0,u=[],o&&o())},d=function(p){var g=u.indexOf(p);g!==-1&&u.splice(g,1),u.length===0&&s&&h()};return{element:a,bind:f,destroy:h,unbind:d}};return qi.createSensor=n,qi}var Yi={},Wd;function ex(){if(Wd)return Yi;Wd=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.createSensor=void 0;var t=nh(),e=r(k1());function r(i){return i&&i.__esModule?i:{default:i}}var n=function(a,o){var s=void 0,u=[],l=(0,e.default)(function(){u.forEach(function(v){v(a)})}),c=function(){var p=new ResizeObserver(l);return p.observe(a),l(),p},f=function(p){s||(s=c()),u.indexOf(p)===-1&&u.push(p)},h=function(){s.disconnect(),u=[],s=void 0,a.removeAttribute(t.SizeSensorId),o&&o()},d=function(p){var g=u.indexOf(p);g!==-1&&u.splice(g,1),u.length===0&&s&&h()};return{element:a,bind:f,destroy:h,unbind:d}};return Yi.createSensor=n,Yi}var Ud;function tx(){if(Ud)return $i;Ud=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.createSensor=void 0;var t=J2(),e=ex(),r=typeof ResizeObserver<"u"?e.createSensor:t.createSensor;return $i.createSensor=r,$i}var Hd;function rx(){if(Hd)return vr;Hd=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.removeSensor=vr.getSensor=vr.Sensors=void 0;var t=n(Q2()),e=tx(),r=nh();function n(u){return u&&u.__esModule?u:{default:u}}var i={};vr.Sensors=i;function a(u){u&&i[u]&&delete i[u]}var o=function(l){var c=l.getAttribute(r.SizeSensorId);if(c&&i[c])return i[c];var f=(0,t.default)();l.setAttribute(r.SizeSensorId,f);var h=(0,e.createSensor)(l,function(){return a(f)});return i[f]=h,h};vr.getSensor=o;var s=function(l){var c=l.element.getAttribute(r.SizeSensorId);l.destroy(),a(c)};return vr.removeSensor=s,vr}var $d;function nx(){if($d)return dr;$d=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.ver=dr.clear=dr.bind=void 0;var t=rx(),e=function(a,o){var s=(0,t.getSensor)(a);return s.bind(o),function(){s.unbind(o)}};dr.bind=e;var r=function(a){var o=(0,t.getSensor)(a);(0,t.removeSensor)(o)};dr.clear=r;var n="1.0.2";return dr.ver=n,dr}var Xi={},qd;function ix(){if(qd)return Xi;qd=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.pick=void 0;function t(e,r){var n={};return r.forEach(function(i){n[i]=e[i]}),n}return Xi.pick=t,Xi}var Zi={},Yd;function ax(){if(Yd)return Zi;Yd=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.isFunction=void 0;function t(e){return typeof e=="function"}return Zi.isFunction=t,Zi}var Ki={},Xd;function ox(){if(Xd)return Ki;Xd=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.isString=void 0;function t(e){return typeof e=="string"}return Ki.isString=t,Ki}var Qi={},ul,Zd;function sx(){return Zd||(Zd=1,ul=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,a;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(a=Object.keys(e),n=a.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;i--!==0;){var o=a[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}),ul}var Kd;function ux(){if(Kd)return Qi;Kd=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.isEqual=void 0;var t=T1,e=t.__importDefault(sx());return Qi.isEqual=e.default,Qi}Object.defineProperty(D1,"__esModule",{value:!0});var Kt=T1,Qd=Kt.__importStar(zi),Jd=nx(),e0=ix(),ll=ax(),t0=ox(),ei=ux(),lx=(function(t){Kt.__extends(e,t);function e(r){var n=t.call(this,r)||this;return n.echarts=r.echarts,n.ele=null,n.isInitialResize=!0,n}return e.prototype.componentDidMount=function(){this.renderNewEcharts()},e.prototype.componentDidUpdate=function(r){var n=this.props.shouldSetOption;if(!((0,ll.isFunction)(n)&&!n(r,this.props))){if(!(0,ei.isEqual)(r.theme,this.props.theme)||!(0,ei.isEqual)(r.opts,this.props.opts)){this.dispose(),this.renderNewEcharts();return}var i=this.getEchartsInstance();(0,ei.isEqual)(r.onEvents,this.props.onEvents)||(this.offEvents(i,r.onEvents),this.bindEvents(i,this.props.onEvents));var a=["option","notMerge","replaceMerge","lazyUpdate","showLoading","loadingOption"];(0,ei.isEqual)((0,e0.pick)(this.props,a),(0,e0.pick)(r,a))||this.updateEChartsOption(),(!(0,ei.isEqual)(r.style,this.props.style)||!(0,ei.isEqual)(r.className,this.props.className))&&this.resize()}},e.prototype.componentWillUnmount=function(){this.dispose()},e.prototype.initEchartsInstance=function(){return Kt.__awaiter(this,void 0,void 0,function(){var r=this;return Kt.__generator(this,function(n){return[2,new Promise(function(i){r.echarts.init(r.ele,r.props.theme,r.props.opts);var a=r.getEchartsInstance();a.on("finished",function(){var o=r.ele.clientWidth,s=r.ele.clientHeight;r.echarts.dispose(r.ele);var u=Kt.__assign({width:o,height:s},r.props.opts);i(r.echarts.init(r.ele,r.props.theme,u))})})]})})},e.prototype.getEchartsInstance=function(){return this.echarts.getInstanceByDom(this.ele)},e.prototype.dispose=function(){if(this.ele){try{(0,Jd.clear)(this.ele)}catch(r){console.warn(r)}this.echarts.dispose(this.ele)}},e.prototype.renderNewEcharts=function(){return Kt.__awaiter(this,void 0,void 0,function(){var r,n,i,a,o,s,u=this;return Kt.__generator(this,function(l){switch(l.label){case 0:return r=this.props,n=r.onEvents,i=r.onChartReady,a=r.autoResize,o=a===void 0?!0:a,[4,this.initEchartsInstance()];case 1:return l.sent(),s=this.updateEChartsOption(),this.bindEvents(s,n||{}),(0,ll.isFunction)(i)&&i(s),this.ele&&o&&(0,Jd.bind)(this.ele,function(){u.resize()}),[2]}})})},e.prototype.bindEvents=function(r,n){function i(o,s){(0,t0.isString)(o)&&(0,ll.isFunction)(s)&&r.on(o,function(u){s(u,r)})}for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&i(a,n[a])},e.prototype.offEvents=function(r,n){if(n)for(var i in n)(0,t0.isString)(i)&&r.off(i,n[i])},e.prototype.updateEChartsOption=function(){var r=this.props,n=r.option,i=r.notMerge,a=i===void 0?!1:i,o=r.replaceMerge,s=o===void 0?null:o,u=r.lazyUpdate,l=u===void 0?!1:u,c=r.showLoading,f=r.loadingOption,h=f===void 0?null:f,d=this.getEchartsInstance();return d.setOption(n,{notMerge:a,replaceMerge:s,lazyUpdate:l}),c?d.showLoading(h):d.hideLoading(),d},e.prototype.resize=function(){var r=this.getEchartsInstance();if(!this.isInitialResize)try{r.resize({width:"auto",height:"auto"})}catch(n){console.warn(n)}this.isInitialResize=!1},e.prototype.render=function(){var r=this,n=this.props,i=n.style,a=n.className,o=a===void 0?"":a;n.echarts,n.option,n.theme,n.notMerge,n.replaceMerge,n.lazyUpdate,n.showLoading,n.loadingOption,n.opts,n.onChartReady,n.onEvents,n.shouldSetOption,n.autoResize;var s=Kt.__rest(n,["style","className","echarts","option","theme","notMerge","replaceMerge","lazyUpdate","showLoading","loadingOption","opts","onChartReady","onEvents","shouldSetOption","autoResize"]),u=Kt.__assign({height:300},i);return Qd.default.createElement("div",Kt.__assign({ref:function(l){r.ele=l},style:u,className:"echarts-for-react ".concat(o)},s))},e})(Qd.PureComponent),Io=D1.default=lx,cx=(function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t})(),fx=(function(){function t(){this.browser=new cx,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return t})(),X=new fx;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(X.wxa=!0,X.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?X.worker=!0:!X.hasGlobalWindow||"Deno"in window?(X.node=!0,X.svgSupported=!0):hx(navigator.userAgent,X);function hx(t,e){var r=e.browser,n=t.match(/Firefox\/([\d.]+)/),i=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(t);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}var ih=12,A1="sans-serif",Qr=ih+"px "+A1,dx=20,vx=100,px="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function gx(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r<t.length;r++){var n=String.fromCharCode(r+32),i=(t.charCodeAt(r)-dx)/vx;e[n]=i}return e}var mx=gx(px),Jr={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var t,e;return function(r,n){if(!t){var i=Jr.createCanvas();t=i&&i.getContext("2d")}if(t)return e!==n&&(e=t.font=n||Qr),t.measureText(r);r=r||"",n=n||Qr;var a=/((?:\d+)?\.?\d*)px/.exec(n),o=a&&+a[1]||ih,s=0;if(n.indexOf("mono")>=0)s=o*r.length;else for(var u=0;u<r.length;u++){var l=mx[r[u]];s+=l==null?o:l*o}return{width:s}}})(),loadImage:function(t,e,r){var n=new Image;return n.onload=e,n.onerror=r,n.src=t,n}};function M1(t){for(var e in Jr)t[e]&&(Jr[e]=t[e])}var E1=ar(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),I1=ar(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),Vi=Object.prototype.toString,fu=Array.prototype,yx=fu.forEach,_x=fu.filter,ah=fu.slice,bx=fu.map,r0=function(){}.constructor,Po=r0?r0.prototype:null,oh="__proto__",xx=2311;function sh(){return xx++}function uh(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];typeof console<"u"&&console.error.apply(console,t)}function te(t){if(t==null||typeof t!="object")return t;var e=t,r=Vi.call(t);if(r==="[object Array]"){if(!Ci(t)){e=[];for(var n=0,i=t.length;n<i;n++)e[n]=te(t[n])}}else if(I1[r]){if(!Ci(t)){var a=t.constructor;if(a.from)e=a.from(t);else{e=new a(t.length);for(var n=0,i=t.length;n<i;n++)e[n]=t[n]}}}else if(!E1[r]&&!Ci(t)&&!Ii(t)){e={};for(var o in t)t.hasOwnProperty(o)&&o!==oh&&(e[o]=te(t[o]))}return e}function fe(t,e,r){if(!H(e)||!H(t))return r?te(e):t;for(var n in e)if(e.hasOwnProperty(n)&&n!==oh){var i=t[n],a=e[n];H(a)&&H(i)&&!V(a)&&!V(i)&&!Ii(a)&&!Ii(i)&&!Gc(a)&&!Gc(i)&&!Ci(a)&&!Ci(i)?fe(i,a,r):(r||!(n in t))&&(t[n]=te(e[n]))}return t}function Sx(t,e){for(var r=t[0],n=1,i=t.length;n<i;n++)r=fe(r,t[n],e);return r}function B(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==oh&&(t[r]=e[r]);return t}function ue(t,e,r){for(var n=ae(e),i=0,a=n.length;i<a;i++){var o=n[i];(r?e[o]!=null:t[o]==null)&&(t[o]=e[o])}return t}var Dx=Jr.createCanvas;function ve(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r}return-1}function lh(t,e){var r=t.prototype;function n(){}n.prototype=e.prototype,t.prototype=new n;for(var i in r)r.hasOwnProperty(i)&&(t.prototype[i]=r[i]);t.prototype.constructor=t,t.superClass=e}function ht(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(e),i=0;i<n.length;i++){var a=n[i];a!=="constructor"&&(r?e[a]!=null:t[a]==null)&&(t[a]=e[a])}else ue(t,e,r)}function qe(t){return!t||typeof t=="string"?!1:typeof t.length=="number"}function k(t,e,r){if(t&&e)if(t.forEach&&t.forEach===yx)t.forEach(e,r);else if(t.length===+t.length)for(var n=0,i=t.length;n<i;n++)e.call(r,t[n],n,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(r,t[a],a,t)}function W(t,e,r){if(!t)return[];if(!e)return du(t);if(t.map&&t.map===bx)return t.map(e,r);for(var n=[],i=0,a=t.length;i<a;i++)n.push(e.call(r,t[i],i,t));return n}function ar(t,e,r,n){if(t&&e){for(var i=0,a=t.length;i<a;i++)r=e.call(n,r,t[i],i,t);return r}}function Se(t,e,r){if(!t)return[];if(!e)return du(t);if(t.filter&&t.filter===_x)return t.filter(e,r);for(var n=[],i=0,a=t.length;i<a;i++)e.call(r,t[i],i,t)&&n.push(t[i]);return n}function Cx(t,e,r){if(t&&e){for(var n=0,i=t.length;n<i;n++)if(e.call(r,t[n],n,t))return t[n]}}function ae(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}function Tx(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return function(){return t.apply(e,r.concat(ah.call(arguments)))}}var se=Po&&Z(Po.bind)?Po.call.bind(Po.bind):Tx;function we(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(ah.call(arguments)))}}function V(t){return Array.isArray?Array.isArray(t):Vi.call(t)==="[object Array]"}function Z(t){return typeof t=="function"}function G(t){return typeof t=="string"}function Rs(t){return Vi.call(t)==="[object String]"}function me(t){return typeof t=="number"}function H(t){var e=typeof t;return e==="function"||!!t&&e==="object"}function Gc(t){return!!E1[Vi.call(t)]}function Ye(t){return!!I1[Vi.call(t)]}function Ii(t){return typeof t=="object"&&typeof t.nodeType=="number"&&typeof t.ownerDocument=="object"}function hu(t){return t.colorStops!=null}function kx(t){return t.image!=null}function Ax(t){return Vi.call(t)==="[object RegExp]"}function Ga(t){return t!==t}function Pi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,n=t.length;r<n;r++)if(t[r]!=null)return t[r]}function Y(t,e){return t??e}function Aa(t,e,r){return t??e??r}function du(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return ah.apply(t,e)}function ch(t){if(typeof t=="number")return[t,t,t,t];var e=t.length;return e===2?[t[0],t[1],t[0],t[1]]:e===3?[t[0],t[1],t[2],t[1]]:t}function Tt(t,e){if(!t)throw new Error(e)}function Vt(t){return t==null?null:typeof t.trim=="function"?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var P1="__ec_primitive__";function Os(t){t[P1]=!0}function Ci(t){return t[P1]}var Mx=(function(){function t(){this.data={}}return t.prototype.delete=function(e){var r=this.has(e);return r&&delete this.data[e],r},t.prototype.has=function(e){return this.data.hasOwnProperty(e)},t.prototype.get=function(e){return this.data[e]},t.prototype.set=function(e,r){return this.data[e]=r,this},t.prototype.keys=function(){return ae(this.data)},t.prototype.forEach=function(e){var r=this.data;for(var n in r)r.hasOwnProperty(n)&&e(r[n],n)},t})(),L1=typeof Map=="function";function Ex(){return L1?new Map:new Mx}var R1=(function(){function t(e){var r=V(e);this.data=Ex();var n=this;e instanceof t?e.each(i):e&&k(e,i);function i(a,o){r?n.set(a,o):n.set(o,a)}}return t.prototype.hasKey=function(e){return this.data.has(e)},t.prototype.get=function(e){return this.data.get(e)},t.prototype.set=function(e,r){return this.data.set(e,r),r},t.prototype.each=function(e,r){this.data.forEach(function(n,i){e.call(r,n,i)})},t.prototype.keys=function(){var e=this.data.keys();return L1?Array.from(e):e},t.prototype.removeKey=function(e){this.data.delete(e)},t})();function Q(t){return new R1(t)}function O1(t,e){for(var r=new t.constructor(t.length+e.length),n=0;n<t.length;n++)r[n]=t[n];for(var i=t.length,n=0;n<e.length;n++)r[n+i]=e[n];return r}function ho(t,e){var r;if(Object.create)r=Object.create(t);else{var n=function(){};n.prototype=t,r=new n}return e&&B(r,e),r}function Ix(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function en(t,e){return t.hasOwnProperty(e)}function je(){}var Ma=180/Math.PI;const Px=Object.freeze(Object.defineProperty({__proto__:null,HashMap:R1,RADIAN_TO_DEGREE:Ma,assert:Tt,bind:se,clone:te,concatArray:O1,createCanvas:Dx,createHashMap:Q,createObject:ho,curry:we,defaults:ue,disableUserSelect:Ix,each:k,eqNaN:Ga,extend:B,filter:Se,find:Cx,guid:sh,hasOwn:en,indexOf:ve,inherits:lh,isArray:V,isArrayLike:qe,isBuiltInObject:Gc,isDom:Ii,isFunction:Z,isGradientObject:hu,isImagePatternObject:kx,isNumber:me,isObject:H,isPrimitive:Ci,isRegExp:Ax,isString:G,isStringSafe:Rs,isTypedArray:Ye,keys:ae,logError:uh,map:W,merge:fe,mergeAll:Sx,mixin:ht,noop:je,normalizeCssArray:ch,reduce:ar,retrieve:Pi,retrieve2:Y,retrieve3:Aa,setAsPrimitive:Os,slice:du,trim:Vt},Symbol.toStringTag,{value:"Module"}));function Zn(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function Lx(t,e){return t[0]=e[0],t[1]=e[1],t}function F1(t){return[t[0],t[1]]}function Rx(t,e,r){return t[0]=e,t[1]=r,t}function Wc(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function Ox(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function B1(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function fh(t){return Math.sqrt(hh(t))}var Fx=fh;function hh(t){return t[0]*t[0]+t[1]*t[1]}var Bx=hh;function Nx(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function zx(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function Vx(t,e){return t[0]*e[0]+t[1]*e[1]}function bs(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function N1(t,e){var r=fh(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function Fs(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var z1=Fs;function V1(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var zn=V1;function jx(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Gx(t,e,r,n){return t[0]=e[0]+n*(r[0]-e[0]),t[1]=e[1]+n*(r[1]-e[1]),t}function He(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function jr(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Gr(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}const Wx=Object.freeze(Object.defineProperty({__proto__:null,add:Wc,applyTransform:He,clone:F1,copy:Lx,create:Zn,dist:z1,distSquare:zn,distance:Fs,distanceSquare:V1,div:zx,dot:Vx,len:fh,lenSquare:hh,length:Fx,lengthSquare:Bx,lerp:Gx,max:Gr,min:jr,mul:Nx,negate:jx,normalize:N1,scale:bs,scaleAndAdd:Ox,set:Rx,sub:B1},Symbol.toStringTag,{value:"Module"}));var ti=(function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t})(),Ux=(function(){function t(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(e){for(var r=e.target;r&&!r.draggable;)r=r.parent||r.__hostTarget;r&&(this._draggingTarget=r,r.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new ti(r,e),"dragstart",e.event))},t.prototype._drag=function(e){var r=this._draggingTarget;if(r){var n=e.offsetX,i=e.offsetY,a=n-this._x,o=i-this._y;this._x=n,this._y=i,r.drift(a,o,e),this.handler.dispatchToElement(new ti(r,e),"drag",e.event);var s=this.handler.findHover(n,i,r).target,u=this._dropTarget;this._dropTarget=s,r!==s&&(u&&s!==u&&this.handler.dispatchToElement(new ti(u,e),"dragleave",e.event),s&&s!==u&&this.handler.dispatchToElement(new ti(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new ti(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new ti(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t})(),Tr=(function(){function t(e){e&&(this._$eventProcessor=e)}return t.prototype.on=function(e,r,n,i){this._$handlers||(this._$handlers={});var a=this._$handlers;if(typeof r=="function"&&(i=n,n=r,r=null),!n||!e)return this;var o=this._$eventProcessor;r!=null&&o&&o.normalizeQuery&&(r=o.normalizeQuery(r)),a[e]||(a[e]=[]);for(var s=0;s<a[e].length;s++)if(a[e][s].h===n)return this;var u={h:n,query:r,ctx:i||this,callAtLast:n.zrEventfulCallAtLast},l=a[e].length-1,c=a[e][l];return c&&c.callAtLast?a[e].splice(l,0,u):a[e].push(u),this},t.prototype.isSilent=function(e){var r=this._$handlers;return!r||!r[e]||!r[e].length},t.prototype.off=function(e,r){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(r){if(n[e]){for(var i=[],a=0,o=n[e].length;a<o;a++)n[e][a].h!==r&&i.push(n[e][a]);n[e]=i}n[e]&&n[e].length===0&&delete n[e]}else delete n[e];return this},t.prototype.trigger=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var i=this._$handlers[e],a=this._$eventProcessor;if(i)for(var o=r.length,s=i.length,u=0;u<s;u++){var l=i[u];if(!(a&&a.filter&&l.query!=null&&!a.filter(e,l.query)))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,r[0]);break;case 2:l.h.call(l.ctx,r[0],r[1]);break;default:l.h.apply(l.ctx,r);break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},t.prototype.triggerWithContext=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var i=this._$handlers[e],a=this._$eventProcessor;if(i)for(var o=r.length,s=r[o-1],u=i.length,l=0;l<u;l++){var c=i[l];if(!(a&&a.filter&&c.query!=null&&!a.filter(e,c.query)))switch(o){case 0:c.h.call(s);break;case 1:c.h.call(s,r[0]);break;case 2:c.h.call(s,r[0],r[1]);break;default:c.h.apply(s,r.slice(1,o-1));break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},t})(),Hx=Math.log(2);function Uc(t,e,r,n,i,a){var o=n+"-"+i,s=t.length;if(a.hasOwnProperty(o))return a[o];if(e===1){var u=Math.round(Math.log((1<<s)-1&~i)/Hx);return t[r][u]}for(var l=n|1<<r,c=r+1;n&1<<c;)c++;for(var f=0,h=0,d=0;h<s;h++){var v=1<<h;v&i||(f+=(d%2?-1:1)*t[r][h]*Uc(t,e-1,c,l,i|v,a),d++)}return a[o]=f,f}function n0(t,e){var r=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],n={},i=Uc(r,8,0,0,0,n);if(i!==0){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)a[s]==null&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*Uc(r,7,o===0?1:0,1<<o,1<<s,n)/i*e[o];return function(u,l,c){var f=l*a[6]+c*a[7]+1;u[0]=(l*a[0]+c*a[1]+a[2])/f,u[1]=(l*a[3]+c*a[4]+a[5])/f}}}var i0="___zrEVENTSAVED",cl=[];function $x(t,e,r,n,i){return Hc(cl,e,n,i,!0)&&Hc(t,r,cl[0],cl[1])}function Hc(t,e,r,n,i){if(e.getBoundingClientRect&&X.domSupported&&!j1(e)){var a=e[i0]||(e[i0]={}),o=qx(e,a),s=Yx(o,a,i);if(s)return s(t,r,n),!0}return!1}function qx(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var n=["left","right"],i=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=o.style,u=a%2,l=(a>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[u]+":0",i[l]+":0",n[1-u]+":auto",i[1-l]+":auto",""].join("!important;"),t.appendChild(o),r.push(o)}return r}function Yx(t,e,r){for(var n=r?"invTrans":"trans",i=e[n],a=e.srcCoords,o=[],s=[],u=!0,l=0;l<4;l++){var c=t[l].getBoundingClientRect(),f=2*l,h=c.left,d=c.top;o.push(h,d),u=u&&a&&h===a[f]&&d===a[f+1],s.push(t[l].offsetLeft,t[l].offsetTop)}return u&&i?i:(e.srcCoords=o,e[n]=r?n0(s,o):n0(o,s))}function j1(t){return t.nodeName.toUpperCase()==="CANVAS"}var Xx=/([&<>"'])/g,Zx={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ve(t){return t==null?"":(t+"").replace(Xx,function(e,r){return Zx[r]})}var Kx=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fl=[],Qx=X.browser.firefox&&+X.browser.version.split(".")[0]<39;function $c(t,e,r,n){return r=r||{},n?a0(t,e,r):Qx&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):a0(t,e,r),r}function a0(t,e,r){if(X.domSupported&&t.getBoundingClientRect){var n=e.clientX,i=e.clientY;if(j1(t)){var a=t.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(Hc(fl,t,n,i)){r.zrX=fl[0],r.zrY=fl[1];return}}r.zrX=r.zrY=0}function dh(t){return t||window.event}function mt(t,e,r){if(e=dh(e),e.zrX!=null)return e;var n=e.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&$c(t,o,e,r)}else{$c(t,e,e,r);var a=Jx(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&Kx.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function Jx(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,n=t.deltaY;if(r==null||n==null)return e;var i=Math.abs(n!==0?n:r),a=n>0?-1:n<0?1:r>0?-1:1;return 3*i*a}function eS(t,e,r,n){t.addEventListener(e,r,n)}function tS(t,e,r,n){t.removeEventListener(e,r,n)}var G1=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0},rS=(function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,n){return this._doTrack(e,r,n),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,n){var i=e.touches;if(i){for(var a={points:[],touches:[],target:r,event:e},o=0,s=i.length;o<s;o++){var u=i[o],l=$c(n,u,{});a.points.push([l.zrX,l.zrY]),a.touches.push(u)}this._track.push(a)}},t.prototype._recognize=function(e){for(var r in hl)if(hl.hasOwnProperty(r)){var n=hl[r](this._track,e);if(n)return n}},t})();function o0(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}function nS(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var hl={pinch:function(t,e){var r=t.length;if(r){var n=(t[r-1]||{}).points,i=(t[r-2]||{}).points||n;if(i&&i.length>1&&n&&n.length>1){var a=o0(n)/o0(i);!isFinite(a)&&(a=1),e.pinchScale=a;var o=nS(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}};function Sr(){return[1,0,0,1,0,0]}function vo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function vh(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Yr(t,e,r){var n=e[0]*r[0]+e[2]*r[1],i=e[1]*r[0]+e[3]*r[1],a=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],u=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t}function Li(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function po(t,e,r,n){n===void 0&&(n=[0,0]);var i=e[0],a=e[2],o=e[4],s=e[1],u=e[3],l=e[5],c=Math.sin(r),f=Math.cos(r);return t[0]=i*f+s*c,t[1]=-i*c+s*f,t[2]=a*f+u*c,t[3]=-a*c+f*u,t[4]=f*(o-n[0])+c*(l-n[1])+n[0],t[5]=f*(l-n[1])-c*(o-n[0])+n[1],t}function W1(t,e,r){var n=r[0],i=r[1];return t[0]=e[0]*n,t[1]=e[1]*i,t[2]=e[2]*n,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*i,t}function go(t,e){var r=e[0],n=e[2],i=e[4],a=e[1],o=e[3],s=e[5],u=r*o-a*n;return u?(u=1/u,t[0]=o*u,t[1]=-a*u,t[2]=-n*u,t[3]=r*u,t[4]=(n*s-o*i)*u,t[5]=(a*i-r*s)*u,t):null}function iS(t){var e=Sr();return vh(e,t),e}const aS=Object.freeze(Object.defineProperty({__proto__:null,clone:iS,copy:vh,create:Sr,identity:vo,invert:go,mul:Yr,rotate:po,scale:W1,translate:Li},Symbol.toStringTag,{value:"Module"}));var ge=(function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,n=this.y-e.y;return Math.sqrt(r*r+n*n)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,n=this.y-e.y;return r*r+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,n=this.y;return this.x=e[0]*r+e[2]*n+e[4],this.y=e[1]*r+e[3]*n+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,n){e.x=r,e.y=n},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,n){e.x=r.x+n.x,e.y=r.y+n.y},t.sub=function(e,r,n){e.x=r.x-n.x,e.y=r.y-n.y},t.scale=function(e,r,n){e.x=r.x*n,e.y=r.y*n},t.scaleAndAdd=function(e,r,n,i){e.x=r.x+n.x*i,e.y=r.y+n.y*i},t.lerp=function(e,r,n,i){var a=1-i;e.x=a*r.x+i*n.x,e.y=a*r.y+i*n.y},t})(),Lo=Math.min,Ro=Math.max,fn=new ge,hn=new ge,dn=new ge,vn=new ge,Ji=new ge,ea=new ge,he=(function(){function t(e,r,n,i){n<0&&(e=e+n,n=-n),i<0&&(r=r+i,i=-i),this.x=e,this.y=r,this.width=n,this.height=i}return t.prototype.union=function(e){var r=Lo(e.x,this.x),n=Lo(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ro(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ro(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=r,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){var r=this,n=e.width/r.width,i=e.height/r.height,a=Sr();return Li(a,a,[-r.x,-r.y]),W1(a,a,[n,i]),Li(a,a,[e.x,e.y]),a},t.prototype.intersect=function(e,r){if(!e)return!1;e instanceof t||(e=t.create(e));var n=this,i=n.x,a=n.x+n.width,o=n.y,s=n.y+n.height,u=e.x,l=e.x+e.width,c=e.y,f=e.y+e.height,h=!(a<u||l<i||s<c||f<o);if(r){var d=1/0,v=0,p=Math.abs(a-u),g=Math.abs(l-i),m=Math.abs(s-c),y=Math.abs(f-o),_=Math.min(p,g),b=Math.min(m,y);a<u||l<i?_>v&&(v=_,p<g?ge.set(ea,-p,0):ge.set(ea,g,0)):_<d&&(d=_,p<g?ge.set(Ji,p,0):ge.set(Ji,-g,0)),s<c||f<o?b>v&&(v=b,m<y?ge.set(ea,0,-m):ge.set(ea,0,y)):_<d&&(d=_,m<y?ge.set(Ji,0,m):ge.set(Ji,0,-y))}return r&&ge.copy(r,h?Ji:ea),h},t.prototype.contain=function(e,r){var n=this;return e>=n.x&&e<=n.x+n.width&&r>=n.y&&r<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(e,r){e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height},t.applyTransform=function(e,r,n){if(!n){e!==r&&t.copy(e,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];e.x=r.x*i+o,e.y=r.y*a+s,e.width=r.width*i,e.height=r.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}fn.x=dn.x=r.x,fn.y=vn.y=r.y,hn.x=vn.x=r.x+r.width,hn.y=dn.y=r.y+r.height,fn.transform(n),vn.transform(n),hn.transform(n),dn.transform(n),e.x=Lo(fn.x,hn.x,dn.x,vn.x),e.y