|
|
`).join("");if("string"==typeof e)return e;return""}(a)),l=t.state.wordAt(s);return{pos:(null==l?void 0:l.from)??s,end:(null==l?void 0:l.to)??s,create(){let t=document.createElement("div");return t.classList.add("cm-code-hover"),t.innerHTML=o,t.style.cssText="padding: 5px 10px;max-width: 360px;",{dom:t}}}}),a.tk.theme({".cm-code-hover a":{color:"#3b98ff"},".cm-code-hover pre":{margin:"0"}})),null==n?void 0:n.doSignatureHelp){;l.push((i=async(t,e)=>{let{textDocument:i,generatedRangeFor:r}=t.field(p.B5),s=r({from:e,to:e}),a=null==s?void 0:s.from;return"number"!=typeof a?null:await n.doSignatureHelp({textDocument:i,offset:a})},[ed.of(i),a.lg.fromClass(eh),ea,ec,a.$f.of(el),a.tk.domEventHandlers({blur(t,e){(!(t.relatedTarget instanceof Element)||!t.relatedTarget.closest(".cm-signature-tooltip"))&&queueMicrotask(()=>{e.dispatch({effects:er.of(-1)})})}})]))}if((null==n?void 0:n.doComplete)&&l.push(a.tk.theme({".cm-completionInfo p":{margin:0},".cm-completionMatchedText":{textDecoration:"none",color:"#4daafc"}}),(0,tK.ys)({override:[async function({state:t,pos:e,view:i}){var r;let s;let{textDocument:a,originalRangeFor:o,generatedRangeFor:l}=t.field(p.B5),h=l({from:e,to:e}),d=null==h?void 0:h.from;if("number"!=typeof d)return null;let u=await n.doComplete({textDocument:a,offset:d});if(!u||!Array.isArray(u.items)||0===u.items.length)return null;let{items:c}=u,g=t.doc.toString(),f=g.slice(e-1,e);if(!(n.triggerCharacters??[]).includes(f)){let t=e-1,i="";for(;t>=0;){let i=g.slice(t,t+1);if("\n"===i||!ef.test(i)&&t+1<=e)break;t--}(i=g.slice(t+1,e))?c=(0,tf.default)(c,{key:"label"})(i).map(i=>({...i.item,textEdit:{range:{start:a.positionAt(t+1),end:a.positionAt(e)},newText:i.item.label},data:{matches:i.matches.reduce((t,e)=>e?[...t,...e.reduce((t,e)=>[...t,e[0],e[1]+1],[])]:t,[])}})):Array.isArray(n.triggerCharacters)&&(c=[])}let m=[],v=new WeakMap;"function"==typeof n.resolveCompletionItem&&(s=function(t,e,i){let r=document.createElement("div"),n=new AbortController;function s(t){!t.signal.aborted&&(r.style.display="none")}return a=>{n.abort();let o=n=new AbortController;return(async()=>{let n=i.get(a);if(!t||!n||"function"!=typeof e.resolveCompletionItem){s(o);return}let{textDocument:l,originalRangeFor:h}=t.state.field(p.B5),d=h({from:t.state.selection.main.from,to:t.state.selection.main.from});if(!d){s(o);return}let u=await e.resolveCompletionItem({textDocument:l,offset:d.from},n);if(!u.detail&&!u.documentation){s(o);return}let c=tp.A_.is(u.documentation)?await ei(u.documentation.value):u.documentation??"",g=[`<div style="opacity: 0.8;white-space: pre-wrap;">${u.detail??""}</div>`,u.documentation?"<br />":"",`<div>${c}</div>`].join("");if(!o.signal.aborted){var f;f=g,o.signal.aborted||(r.innerHTML=f,r.style.display="block")}})(),r}}(i,n,v));let y=new WeakMap;for(let t of c){let{kind:e,label:i,textEdit:n,textEditText:l}=t,h={label:i,type:function(t){switch(t){case 1:return"text";case 15:return"snippet";case 2:return"method";case 3:return"function";case 4:return"constructor";case 7:return"class";case 5:return"field";case 10:return"property";case 6:return"variable";case 18:return"reference";case 23:return"event";case 8:return"interface";case 22:return"struct";case 25:return"typeParameter";case 9:return"module";case 12:default:return"value";case 13:case 20:return"enum";case 11:return"unit";case 14:return"keyword";case 24:return"operator";case 16:return"color";case 21:return"constant"}}(e),detail:t.detail??""};if(v.set(h,t),y.set(h,null==(r=t.data)?void 0:r.matches),n){let e="range"in n?n.range:n.replace,i=a.offsetAt(e.start),r=o({from:i,to:a.offsetAt(e.end)});if(!r)continue;let s=n.newText,{insertTextFormat:l}=t;h.apply=t=>{2===l?(0,tK.DB)(function(t){return t.includes("${")?t:`${t}\${0}`}(s.replace(/\$(\d+)/g,"$${$1}").replace(/\\\$/g,"$")))(t,h,r.from,r.to):t.dispatch((0,tK.$L)(t.state,s,r.from,r.to))}}else l&&(h.apply=l);h.info=s,m.push(h)}return{from:e,options:m,filter:!1,getMatch:t=>y.get(t)??[]}}]})),null==n?void 0:n.findDefinition){;l.push((r=async({pos:t,view:e})=>{let{textDocument:i,originalRangeFor:r,generatedRangeFor:s}=e.state.field(p.B5),o=s({from:t,to:t}),l=null==o?void 0:o.from;if("number"!=typeof l)return null;let h=await n.findDefinition({textDocument:i,offset:l});if(!Array.isArray(h)||0===h.length)return;let d=h[0],u=r({from:d.from,to:d.to});if(!!u)e.dispatch({effects:a.tk.scrollIntoView(u.from,{y:"center"}),selection:g.jT.range(u.from,u.to)})},[ep.of(r),eg]))}return(null==n?void 0:n.findLinks)&&l.push(function(t,e=500){return[tX(t,e)]}(async t=>{let{textDocument:e,originalRangeFor:i}=t.state.field(p.B5);return(await n.findLinks({textDocument:e})).map(t=>{let e=i(t.range);if(!!e)return{range:e,target:t.target}}).filter(t=>(function(t){return!!t})(t))})),o&&l.push(o),l}},ev=new em,ey=[(0,a.HQ)(),(0,a.AE)(),(0,t1.m8)(),(0,a.Uw)(),(0,a.qr)(),g.yy.allowMultipleSelections.of(!0),(0,f.nY)(),(0,f.nF)(f.R_,{fallback:!0}),(0,tK.vQ)(),(0,tK.ys)(),(0,a.Zs)(),(0,a.S2)(),(0,a.ZO)(),a.$f.of([...t1.wQ,...tK.GA,...t1.f$,...f.e7,...tK.B1,t1.oc,{key:"Tab",run:tK.dk}])],eb=({variant:t,settings:e,styles:i})=>{let r=(e.bracketColors??[]).reduce((t,e,i)=>({...t,[`.colorization-bracket-${i}`]:{color:e},[`.colorization-bracket-${i} > span`]:{color:e}}),{}),n={".cm-tooltip":e.tooltip??{},".cm-tooltip-autocomplete":e.tooltipCompletion??{},".cm-tooltip a":e.link??{color:"#4daafc"}},s={".cm-tooltip-autocomplete ul li[aria-selected]":e.completionItemSelected??{},".cm-tooltip-autocomplete ul li:not([aria-selected]):hover":e.completionItemHover??{},".cm-completionIcon":e.completionItemIcon??{},".cm-completionLabel":e.completionItemLabel??{},".cm-completionDetail":e.completionItemDetail??{},".cm-completionInfo":e.completionItemInfo??{}},o=a.tk.theme({"&":{backgroundColor:e.background,color:e.foreground},".cm-content":{caretColor:e.caret},".cm-cursor, .cm-dropCursor":{borderLeftColor:e.caret},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:e.selection},".cm-activeLine":{backgroundColor:e.lineHighlight},".cm-gutters":{backgroundColor:e.gutterBackground,color:e.gutterForeground,borderRightColor:e.gutterBorderColor,borderRightWidth:`${e.gutterBorderWidth}px`},".cm-activeLineGutter":{backgroundColor:e.lineHighlight},...r,...n,...s},{dark:"dark"===t}),l=f.Qf.define(i);return[o,(0,f.nF)(l)]},ex=t=>e=>{let i=t(new t2.x(e));return{code:i.toString(),mapping:{originalRangeFor:i.originalRangeFor.bind(i),generatedRangeFor:i.generatedRangeFor.bind(i),originalOffsetFor:i.originalOffsetFor.bind(i),generatedOffsetFor:i.generatedOffsetFor.bind(i)}}},e_=[...r.Z,(0,c.AO)([ey,n.T9,d,p.B5,g.Wl.low(a.tk.theme({".cm-foldGutter .cm-gutterElement":{display:"flex",alignItems:"center",cursor:"pointer"}})),g.Wl.low(a.tk.theme({".cm-link":{textDecoration:"underline"}})),g.Wl.low(a.tk.theme({".cm-tooltip":{borderRadius:"5px",fontSize:"12px"},".cm-diagnostic-error":{borderLeft:"none"},".cm-diagnostic":{padding:"5px 10px"},".cm-lineNumbers":{userSelect:"none"},".cm-tooltip.cm-tooltip-autocomplete > ul":{width:"264px",padding:"4px"},".cm-completionInfo":{minWidth:"200px",margin:"0 2px"},".cm-tooltip.cm-completionInfo":{padding:"6px 9px"},".cm-completionInfo p:last-child":{display:"inline-block"},".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]":{color:"inherit"},".cm-tooltip.cm-tooltip-autocomplete > ul > li":{padding:"1px 9px",height:"24px",display:"flex",alignItems:"center",borderRadius:"5px"},".cm-tooltip.cm-tooltip-autocomplete > ul > li:not(:first-child)":{marginTop:"2px"},".cm-completionIcon":{fontSize:"11px",opacity:"1",display:"flex"},".cm-completionLabel":{flex:1,overflow:"hidden",textOverflow:"ellipsis"},".cm-completionDetail":{maxWidth:"86px",overflow:"hidden",textOverflow:"ellipsis",textAlign:"right",fontStyle:"initial"},".cm-tooltip-autocomplete":{borderRadius:"8px"},".cm-tooltip-hover":{overflowY:"auto",maxHeight:"360px",wordBreak:"break-word"},".cm-tooltip-hover p":{margin:0},".cm-tooltip-section:not(:first-child)":{"border-top":"solid 0.5px #666666ab"}}))]),(0,c.Kw)("tabSize",(t=2)=>[g.yy.tabSize.of(t),f.c.of(" ".repeat(t))]),(0,c.Kw)("height",u.Cb),(0,c.Kw)("minHeight",u.jw),(0,c.Kw)("maxHeight",u.kC),(0,c.Kw)("scrollBeyondLastLine",t=>t?(0,n.j9)():[]),(0,c.Kw)("uri",t=>p.fS.of(t)),(0,c.Kw)("theme",t=>t4.get(t)??[]),(0,c.Kw)("languageId",t=>[p._Z.of(t),ev.getExtension(t)]),(0,c.Kw)("transformer",t=>p.D2.of(t)),(0,c.Kw)("overlayScrollbar",(t=!0)=>t?[h()]:[]),(0,c.Kw)("lineNumbersGutter",(t=!0)=>t?(0,a.Eu)({domEventHandlers:{mousedown:(t,e,i)=>(i.preventDefault(),!1)}}):[]),(0,c.Kw)("foldGutter",(t=!0)=>t?(0,f.mi)({markerDOM(t){let e=document.createElement("div");return e.innerHTML=t?'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="m7.976 10.072l4.357-4.357l.62.618L8.284 11h-.618L3 6.333l.619-.618z" clip-rule="evenodd"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M10.072 8.024L5.715 3.667l.618-.62L11 7.716v.618L6.333 13l-.618-.619z" clip-rule="evenodd"/></svg>',e},domEventHandlers:{mousedown:(t,e,i)=>(i.preventDefault(),!1)}}):[]),(0,c.Kw)("colorizeBrackets",(t=!0)=>t?n.Tz:[]),(0,c.hi)("validate",({view:t})=>()=>{t.dispatch({userEvent:t9})})];t4.register("_light",t6),t4.register("_dark",t8);var eA=e_},116005:function(t,e,i){i.d(e,{Z:function(){return a}});var r=i(642199),n=i(121107),s=i(554011),a=[(0,s.AO)([n.AI,n.Gm]),(0,s.Kw)("fontSize",n.JB),(0,s.Kw)("placeholder",n.W$),(0,s.Kw)("readOnly",n.qt),(0,s.Kw)("editable",n.Ah),(0,s.Kw)("lineWrapping",n.FF),(0,s.Kw)("height",n.Cb),(0,s.Kw)("minHeight",n.jw),(0,s.Kw)("maxHeight",n.kC),(0,s.hi)("getValue",n.NA),(0,s.hi)("setValue",n.sO),(0,s.hi)("replaceText",n.lp),(0,s.hi)("getCursorPosition",n.Ny),(0,s.hi)("setCursorPosition",n.Cw),(0,s.hi)("focus",n.T_),(0,s.hi)("blur",n.yv),(0,s.hi)("disableKeybindings",n.FW),(0,s.hi)("updateASTDecorations",({view:t})=>()=>{(0,r.U_)(t)}),(0,s.hi)("undo",n.Yw),(0,s.hi)("redo",n.KX),(0,s.hi)("transformTextInSelection",n.sR),(0,s.hi)("getSelection",n.Mf),(0,s.hi)("getLineInfoAtPosition",n.y2),(0,s.B)("selectionChange",n.Ee),(0,s.B)("change",n.Yf),(0,s.B)("focus",n.Rl),(0,s.B)("blur",n.ej),(0,s.Gj)("mousedown"),(0,s.Gj)("mouseup")]},876274:function(t,e,i){var r=i(455069),n=i(805366);let s=(0,n.A)(function(t){return r.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm5.04-6.14a1.5 1.5 0 0 1-2.13.04l-2.87-2.78L9.26 17A1.5 1.5 0 0 1 7.1 14.9l2.78-2.87L7 9.26A1.5 1.5 0 1 1 9.1 7.1l2.87 2.78L14.74 7A1.5 1.5 0 0 1 16.9 9.1l-2.78 2.87L17 14.74c.6.58.61 1.53.04 2.12Z",fill:"currentColor"}))},"clear");e.Z=s},251486:function(t,e,i){var r=i(455069),n=i(805366);let s=(0,n.A)(function(t){return r.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.62 19.12a1.25 1.25 0 0 0 1.76 1.76l7.12-7.11 7.12 7.11a1.25 1.25 0 0 0 1.76-1.76L14.27 12l7.11-7.12a1.25 1.25 0 0 0-1.76-1.76l-7.12 7.11-7.12-7.11a1.25 1.25 0 1 0-1.76 1.76L10.73 12l-7.11 7.12Z",fill:"currentColor"}))},"cross_stroked");e.Z=s},666524:function(t,e,i){var r=i(455069),n=i(805366);let s=(0,n.A)(function(t){return r.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 4a1 1 0 1 0-2 0v9.59l-2.8-2.8a1 1 0 0 0-1.4 1.42l4.5 4.5a1 1 0 0 0 .7.29 1 1 0 0 0 .7-.29l4.5-4.5a1 1 0 0 0-1.4-1.42L13 13.6V4Zm8 9a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-7a1 1 0 1 1 2 0v6h16v-6a1 1 0 0 1 1-1Z",fill:"currentColor"}))},"download_stroked");e.Z=s},132201:function(t,e,i){var r=i(455069),n=i(805366);let s=(0,n.A)(function(t){return r.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4C5 4 1 10 1 12s4 8 11 8 11-6 11-8-4-8-11-8Zm5 8a5 5 0 1 1-10 0 5 5 0 0 1 10 0Zm-5 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",fill:"currentColor"}))},"eye_opened");e.Z=s},306416:function(t,e,i){var r=i(455069),n=i(805366);let s=(0,n.A)(function(t){return r.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),r.createElement("path",{d:"M9 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),r.createElement("path",{d:"M9 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),r.createElement("path",{d:"M11 19a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",fill:"currentColor"}),r.createElement("path",{d:"M15 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),r.createElement("path",{d:"M17 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",fill:"currentColor"}),r.createElement("path",{d:"M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}))},"handle");e.Z=s},886601:function(t,e,i){var r=i(455069),n=i(805366);let s=(0,n.A)(function(t){return r.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),r.createElement("path",{d:"M5 2.9a1 1 0 0 1 1.57-.82l13.23 9.1a1 1 0 0 1 0 1.64l-13.23 9.1A1 1 0 0 1 5 21.1V2.9Z",fill:"currentColor"}))},"play");e.Z=s},188272:function(t,e,i){var r=i(455069),n=i(805366);let s=(0,n.A)(function(t){return r.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 2a8.5 8.5 0 1 0 4.86 15.48l4.08 4.08a1.5 1.5 0 1 0 2.12-2.12l-4.08-4.08A8.5 8.5 0 0 0 10.5 2ZM5 10.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",fill:"currentColor"}))},"search");e.Z=s},50835:function(t,e,i){var r=i(455069),n=i(805366);let s=(0,n.A)(function(t){return r.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.35 4.27c.68.47.86 1.4.38 2.08l-10 14.5a1.5 1.5 0 0 1-2.33.17l-6.5-7a1.5 1.5 0 0 1 2.2-2.04l5.23 5.63 8.94-12.96a1.5 1.5 0 0 1 2.08-.38Z",fill:"currentColor"}))},"tick");e.Z=s},483866:function(t,e,i){var r=i(455069),n=i(805366);let s=(0,n.A)(function(t){return r.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23 12a11 11 0 1 1-22 0 11 11 0 0 1 22 0Zm-9.5 5.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0ZM12 5a1.9 1.9 0 0 0-1.89 2l.3 5.5a1.59 1.59 0 0 0 3.17 0l.3-5.5c.07-1.09-.8-2-1.88-2Z",fill:"currentColor"}))},"upload_error");e.Z=s},860256:function(t,e,i){i.d(e,{Z:()=>m});var r=function(){function t(t){var e=this;this._insertTag=function(t){var i;i=0===e.tags.length?e.insertionPoint?e.insertionPoint.nextSibling:e.prepend?e.container.firstChild:e.before:e.tags[e.tags.length-1].nextSibling,e.container.insertBefore(t,i),e.tags.push(t)},this.isSpeedy=void 0===t.speedy||t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){if(this.ctr%(this.isSpeedy?65e3:1)==0){var e,i;this._insertTag((e=this,(i=document.createElement("style")).setAttribute("data-emotion",e.key),void 0!==e.nonce&&i.setAttribute("nonce",e.nonce),i.appendChild(document.createTextNode("")),i.setAttribute("data-s",""),i))}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}(r);try{n.insertRule(t,n.cssRules.length)}catch(t){}}else r.appendChild(document.createTextNode(t));this.ctr++},e.flush=function(){this.tags.forEach(function(t){var e;return null==(e=t.parentNode)?void 0:e.removeChild(t)}),this.tags=[],this.ctr=0},t}(),n=i("83464"),s=i("323022"),a=i("547907"),o=i("294709"),l=i("845459"),h=i("587030"),d=function(t,e,i){for(var r=0,s=0;r=s,s=(0,n.fj)(),38===r&&12===s&&(e[i]=1),!(0,n.r)(s);){;(0,n.lp)()}return(0,n.tP)(t,n.FK)},u=function(t,e){var i=-1,r=44;do switch((0,n.r)(r)){case 0:38===r&&12===(0,n.fj)()&&(e[i]=1),t[i]+=d(n.FK-1,e,i);break;case 2:t[i]+=(0,n.iF)(r);break;case 4:if(44===r){t[++i]=58===(0,n.fj)()?"&\f":"",e[i]=t[i].length;break}default:t[i]+=(0,s.Dp)(r)}while(r=(0,n.lp)());return t},c=new WeakMap,p=function(t){if("rule"!==t.type||!t.parent||t.length<1)return;for(var e,i,r=t.value,s=t.parent,a=t.column===s.column&&t.line===s.line;"rule"!==s.type;)if(!(s=s.parent))return;if((1!==t.props.length||58===r.charCodeAt(0)||!!c.get(s))&&!a){c.set(t,!0);var o=[];for(var l=(e=r,i=o,(0,n.cE)(u((0,n.un)(e),i))),h=s.props,d=0,p=0;d<l.length;d++)for(var g=0;g<h.length;g++,p++)t.props[p]=o[d]?l[d].replace(/&\f/g,h[g]):h[g]+" "+l[d]}},g=function(t){if("decl"===t.type){var e=t.value;108===e.charCodeAt(0)&&98===e.charCodeAt(2)&&(t.return="",t.value="")}},f=[function(t,e,i,r){if(t.length>-1&&!t.return)switch(t.type){case a.h5:t.return=function t(e,i){switch((0,s.vp)(e,i)){case 5103:return a.G$+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a.G$+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return a.G$+e+a.uj+e+a.MS+e+e;case 6828:case 4268:return a.G$+e+a.MS+e+e;case 6165:return a.G$+e+a.MS+"flex-"+e+e;case 5187:return a.G$+e+(0,s.gx)(e,/(\w+).+(:[^]+)/,a.G$+"box-$1$2"+a.MS+"flex-$1$2")+e;case 5443:return a.G$+e+a.MS+"flex-item-"+(0,s.gx)(e,/flex-|-self/,"")+e;case 4675:return a.G$+e+a.MS+"flex-line-pack"+(0,s.gx)(e,/align-content|flex-|-self/,"")+e;case 5548:return a.G$+e+a.MS+(0,s.gx)(e,"shrink","negative")+e;case 5292:return a.G$+e+a.MS+(0,s.gx)(e,"basis","preferred-size")+e;case 6060:return a.G$+"box-"+(0,s.gx)(e,"-grow","")+a.G$+e+a.MS+(0,s.gx)(e,"grow","positive")+e;case 4554:return a.G$+(0,s.gx)(e,/([^-])(transform)/g,"$1"+a.G$+"$2")+e;case 6187:return(0,s.gx)((0,s.gx)((0,s.gx)(e,/(zoom-|grab)/,a.G$+"$1"),/(image-set)/,a.G$+"$1"),e,"")+e;case 5495:case 3959:return(0,s.gx)(e,/(image-set\([^]*)/,a.G$+"$1$`$1");case 4968:return(0,s.gx)((0,s.gx)(e,/(.+:)(flex-)?(.*)/,a.G$+"box-pack:$3"+a.MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a.G$+e+e;case 4095:case 3583:case 4068:case 2532:return(0,s.gx)(e,/(.+)-inline(.+)/,a.G$+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if((0,s.to)(e)-1-i>6)switch((0,s.uO)(e,i+1)){case 109:if(45!==(0,s.uO)(e,i+4))break;case 102:return(0,s.gx)(e,/(.+:)(.+)-([^]+)/,"$1"+a.G$+"$2-$3$1"+a.uj+(108==(0,s.uO)(e,i+3)?"$3":"$2-$3"))+e;case 115:return~(0,s.Cw)(e,"stretch")?t((0,s.gx)(e,"stretch","fill-available"),i)+e:e}break;case 4949:if(115!==(0,s.uO)(e,i+1))break;case 6444:switch((0,s.uO)(e,(0,s.to)(e)-3-(~(0,s.Cw)(e,"!important")&&10))){case 107:return(0,s.gx)(e,":",":"+a.G$)+e;case 101:return(0,s.gx)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+a.G$+(45===(0,s.uO)(e,14)?"inline-":"")+"box$3$1"+a.G$+"$2$3$1"+a.MS+"$2box$3")+e}break;case 5936:switch((0,s.uO)(e,i+11)){case 114:return a.G$+e+a.MS+(0,s.gx)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return a.G$+e+a.MS+(0,s.gx)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return a.G$+e+a.MS+(0,s.gx)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return a.G$+e+a.MS+e+e}return e}(t.value,t.length);break;case a.lK:return(0,o.q)([(0,n.JG)(t,{value:(0,s.gx)(t.value,"@","@"+a.G$)})],r);case a.Fr:if(t.length)return(0,s.$e)(t.props,function(e){switch((0,s.EQ)(e,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return(0,o.q)([(0,n.JG)(t,{props:[(0,s.gx)(e,/:(read-\w+)/,":"+a.uj+"$1")]})],r);case"::placeholder":return(0,o.q)([(0,n.JG)(t,{props:[(0,s.gx)(e,/:(plac\w+)/,":"+a.G$+"input-$1")]}),(0,n.JG)(t,{props:[(0,s.gx)(e,/:(plac\w+)/,":"+a.uj+"$1")]}),(0,n.JG)(t,{props:[(0,s.gx)(e,/:(plac\w+)/,a.MS+"input-$1")]})],r)}return""})}}],m=function(t){var e=t.key;if("css"===e){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(t){if(-1!==t.getAttribute("data-emotion").indexOf(" "))document.head.appendChild(t),t.setAttribute("data-s","")})}var n=t.stylisPlugins||f,s={},a=[];d=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),function(t){for(var e=t.getAttribute("data-emotion").split(" "),i=1;i<e.length;i++)s[e[i]]=!0;a.push(t)});var d,u,c,m=[o.P,(0,l.cD)(function(t){c.insert(t)})],v=(0,l.qR)([p,g].concat(n,m));u=function(t,e,i,r){var n;c=i,n=t?t+"{"+e.styles+"}":e.styles,(0,o.q)((0,h.MY)(n),v),r&&(y.inserted[e.name]=!0)};var y={key:e,sheet:new r({key:e,container:d,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:s,registered:{},insert:u};return y.sheet.hydrate(a),y}},16921:function(t,e,i){i.d(e,{Z:function(){return r}});function r(t){var e=Object.create(null);return function(i){return void 0===e[i]&&(e[i]=t(i)),e[i]}}},222759:function(t,e,i){i.d(e,{C:function(){return o},T:function(){return h},i:function(){return s},w:function(){return l}});var r=i(455069),n=i(860256);i(950240);var s=!0,a=r.createContext("undefined"!=typeof HTMLElement?(0,n.Z)({key:"css"}):null),o=a.Provider,l=function(t){return(0,r.forwardRef)(function(e,i){return t(e,(0,r.useContext)(a),i)})};!s&&(l=function(t){return function(e){var i=(0,r.useContext)(a);return null===i?(i=(0,n.Z)({key:"css"}),r.createElement(a.Provider,{value:i},t(e,i))):t(e,i)}});var h=r.createContext({})},261117:function(t,e,i){i.d(e,{F4:function(){return d},iv:function(){return h},xB:function(){return l}});var r=i(222759),n=i(455069),s=i(740897),a=i(950240),o=i(942406);i(860256),i(224333);var l=(0,r.w)(function(t,e){var i=t.styles,l=(0,o.O)([i],void 0,n.useContext(r.T));if(!r.i){for(var h,d=l.name,u=l.styles,c=l.next;void 0!==c;)d+=" "+c.name,u+=c.styles,c=c.next;var p=!0===e.compat,g=e.insert("",{name:d,styles:u},e.sheet,p);return p?null:n.createElement("style",((h={})["data-emotion"]=e.key+"-global "+d,h.dangerouslySetInnerHTML={__html:g},h.nonce=e.sheet.nonce,h))}var f=n.useRef();return(0,a.j)(function(){var t=e.key+"-global",i=new e.sheet.constructor({key:t,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),r=!1,n=document.querySelector('style[data-emotion="'+t+" "+l.name+'"]');return e.sheet.tags.length&&(i.before=e.sheet.tags[0]),null!==n&&(r=!0,n.setAttribute("data-emotion",t),i.hydrate([n])),f.current=[i,r],function(){i.flush()}},[e]),(0,a.j)(function(){var t=f.current,i=t[0];if(t[1]){t[1]=!1;return}if(void 0!==l.next&&(0,s.My)(e,l.next,!0),i.tags.length){var r=i.tags[i.tags.length-1].nextElementSibling;i.before=r,i.flush()}e.insert("",l,i,!1)},[e,l.name]),null});function h(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];return(0,o.O)(e)}var d=function(){var t=h.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}},942406:function(t,e,i){i.d(e,{O:()=>g});var r,n={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},s=i("16921"),a=/[A-Z]|^ms/g,o=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(t){return 45===t.charCodeAt(1)},h=function(t){return null!=t&&"boolean"!=typeof t},d=(0,s.Z)(function(t){return l(t)?t:t.replace(a,"-$&").toLowerCase()}),u=function(t,e){switch(t){case"animation":case"animationName":if("string"==typeof e)return e.replace(o,function(t,e,i){return r={name:e,styles:i,next:r},e})}return 1===n[t]||l(t)||"number"!=typeof e||0===e?e:e+"px"};function c(t,e,i){if(null==i)return"";if(void 0!==i.__emotion_styles)return i;switch(typeof i){case"boolean":return"";case"object":if(1===i.anim)return r={name:i.name,styles:i.styles,next:r},i.name;if(void 0!==i.styles){var n=i.next;if(void 0!==n)for(;void 0!==n;)r={name:n.name,styles:n.styles,next:r},n=n.next;return i.styles+";"}return function(t,e,i){var r="";if(Array.isArray(i))for(var n=0;n<i.length;n++)r+=c(t,e,i[n])+";";else for(var s in i){var a=i[s];if("object"!=typeof a)null!=e&&void 0!==e[a]?r+=s+"{"+e[a]+"}":h(a)&&(r+=d(s)+":"+u(s,a)+";");else{if(Array.isArray(a)&&"string"==typeof a[0]&&(null==e||void 0===e[a[0]]))for(var o=0;o<a.length;o++)h(a[o])&&(r+=d(s)+":"+u(s,a[o])+";");else{var l=c(t,e,a);switch(s){case"animation":case"animationName":r+=d(s)+":"+l+";";break;default:r+=s+"{"+l+"}"}}}}return r}(t,e,i);case"function":if(void 0!==t){var s=r,a=i(t);return r=s,c(t,e,a)}}if(null==e)return i;var o=e[i];return void 0!==o?o:i}var p=/label:\s*([^\s;{]+)\s*(;|$)/g;function g(t,e,i){if(1===t.length&&"object"==typeof t[0]&&null!==t[0]&&void 0!==t[0].styles)return t[0];var n,s=!0,a="";r=void 0;var o=t[0];null==o||void 0===o.raw?(s=!1,a+=c(i,e,o)):a+=o[0];for(var l=1;l<t.length;l++)a+=c(i,e,t[l]),s&&(a+=o[l]);p.lastIndex=0;for(var h="";null!==(n=p.exec(a));)h+="-"+n[1];return{name:function(t){for(var e=0,i,r=0,n=t.length;n>=4;++r,n-=4)i=(65535&(i=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))*0x5bd1e995+((i>>>16)*59797<<16),i^=i>>>24,e=(65535&i)*0x5bd1e995+((i>>>16)*59797<<16)^(65535&e)*0x5bd1e995+((e>>>16)*59797<<16);switch(n){case 3:e^=(255&t.charCodeAt(r+2))<<16;case 2:e^=(255&t.charCodeAt(r+1))<<8;case 1:e^=255&t.charCodeAt(r),e=(65535&e)*0x5bd1e995+((e>>>16)*59797<<16)}return e^=e>>>13,(((e=(65535&e)*0x5bd1e995+((e>>>16)*59797<<16))^e>>>15)>>>0).toString(36)}(a)+h,styles:a,next:r}}},950240:function(t,e,i){i.d(e,{L:function(){return a},j:function(){return o}});var r,n=i(455069),s=!!(r||(r=i.t(n,2))).useInsertionEffect&&(r||(r=i.t(n,2))).useInsertionEffect,a=s||function(t){return t()},o=s||n.useLayoutEffect},740897:function(t,e,i){i.d(e,{My:function(){return s},fp:function(){return r},hC:function(){return n}});function r(t,e,i){var r="";return i.split(" ").forEach(function(i){void 0!==t[i]?e.push(t[i]+";"):i&&(r+=i+" ")}),r}var n=function(t,e,i){var r=t.key+"-"+e.name;!1===i&&void 0===t.registered[r]&&(t.registered[r]=e.styles)},s=function(t,e,i){n(t,e,i);var r=t.key+"-"+e.name;if(void 0===t.inserted[e.name]){var s=e;do t.insert(e===s?"."+r:"",s,t.sheet,!0),s=s.next;while(void 0!==s)}}},602706:function(t,e,i){i.d(e,{Xr5:()=>n.Xr5,Lwd:()=>n.Lwd,V7e:()=>n.V7e,SyX:()=>n.SyX,f_u:()=>tS,v2K:()=>n.v2K,wYF:()=>n.wYF,OKI:()=>n.OKI,lVg:()=>n.lVg,yyW:()=>n.yyW,LzJ:()=>n.LzJ,Fu1:()=>n.Fu1,d3V:()=>n.d3V,esp:()=>n.esp,FwO:()=>n.FwO,M1y:()=>n.M1y,mh4:()=>n.mh4,cvZ:()=>n.cvZ,rQR:()=>n.rQR,JAk:()=>n.JAk,kDE:()=>n.kDE,eGM:()=>n.eGM,xFV:()=>n.xFV,R6T:()=>n.R6T,t9U:()=>j,O06:()=>n.O06,bPQ:()=>n.bPQ,Dcz:()=>n.Dcz,Q5$:()=>n.Q5$,h3M:()=>n.h3M,Vlw:()=>n.Vlw,cc3:()=>n.cc3,AeJ:()=>n.AeJ,qq0:()=>n.qq0,E9j:()=>n.E9j,W6u:()=>n.W6u,c$u:()=>n.c$u,CMu:()=>n.CMu,G2Z:()=>n.G2Z,Emw:()=>n.Emw,KVE:()=>n.KVE,XDS:()=>n.XDS,erw:()=>tB,XsM:()=>n.XsM,pQ4:()=>n.pQ4,nYJ:()=>n.nYJ}),i("915911");var r,n=i("226643"),s=i("702570"),a=i("755000"),o=i("2553"),l=i("952522"),h=i("168316"),d=i("435946"),u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,p={type:o.Sy.END,meta:{draggable:!1,isNodeEnd:!0,selectable:!1,copyDisable:!0},getLines:()=>[],getLabels:()=>[]},g={type:o.OT.DYNAMIC_SPLIT,meta:{hidden:!0,inlineSpacingAfter:t=>t.collapsed&&t.entity.collapsedChildren.length>1?21:0,spacing:t=>{let e=(0,o.yI)(t.entity,o.cc.NODE_SPACING);return 1===t.children.length?e:e/2}},getLabels:t=>t.isNodeEnd?[]:[{type:o.nx.ADDER_LABEL,offset:t.transform.outputPoint}],onCreate:(t,e)=>t.document.addInlineBlocks(t,e.blocks||[]),getInputPoint:t=>t.firstChild?.inputPoint||t.defaultInputPoint,getOutputPoint(t,e){let i=o.XP.isVertical(e),r=1===t.children.length,n=t.lastChild?.outputPoint,s=(0,o.yI)(t.entity,o.cc.NODE_SPACING);return i?{x:n?n.x:t.bounds.center.x,y:t.bounds.bottom+(r?s/2:0)}:{x:t.bounds.right+(r?s/2:0),y:n?n.y:t.bounds.center.y}},addChild(t,e,i={}){let{index:r}=i,n=t.document,s=`$inlineBlocks$${t.id}`,a=n.getNode(s);return!a&&(a=n.addNode({id:s,type:"inlineBlocks",originParent:t,parent:t})),n.addBlock(t,e,void 0,void 0,r)}},f={extend:o.OT.DYNAMIC_SPLIT,type:o.OT.STATIC_SPLIT,extendChildRegistries:[{type:o.Sy.INLINE_BLOCKS,getLabels:()=>[]}]},m={type:o.Sy.BLOCK,meta:{spacing:o.Lu.NULL,inlineSpacingAfter:o.Lu.INLINE_BLOCK_PADDING_BOTTOM,hidden:!0},getLines(t){let e=t.transform,{isVertical:i}=t.entity,r=[{type:o.IG.DIVERGE_LINE,from:e.parent.inputPoint,to:e.inputPoint,side:o.VH.NORMAL_BRANCH}];if(e&&e.entity.isInlineBlock&&t.renderData.draggable){if(i){let t=e.firstChild?.bounds?.right||0,i=e.next?.firstChild?.bounds?.left||0,n=e.inputPoint.y;e?.next&&r.push({type:o.IG.DRAGGING_LINE,from:e.parent.inputPoint,to:{x:(t+i)/2,y:n},side:o.VH.NORMAL_BRANCH})}else{let t=e.firstChild?.bounds?.bottom||0,i=e.next?.firstChild?.bounds?.top||0,n=e.inputPoint.x;e?.next&&r.push({type:o.IG.DRAGGING_LINE,from:e.parent.inputPoint,to:{x:n,y:(t+i)/2},side:o.VH.NORMAL_BRANCH})}}return!t.isNodeEnd&&r.push({type:o.IG.MERGE_LINE,from:e.outputPoint,to:e.parent.outputPoint,side:o.VH.NORMAL_BRANCH}),r},getInputPoint(t){let e=t.firstChild;return e?e.inputPoint:t.defaultInputPoint},getOutputPoint(t,e){let i=o.XP.isVertical(e),r=t.lastChild;return i?{x:r?r.outputPoint.x:t.bounds.bottomCenter.x,y:t.bounds.bottom}:{x:t.bounds.right,y:r?r.outputPoint.y:t.bounds.rightCenter.y}},getLabels(t){let e=t.transform,{isVertical:i}=t.entity,r=[];if(e&&e.entity.isInlineBlock&&t.renderData.draggable){if(i){let t=e.firstChild?.bounds?.right||0,i=e.next?.firstChild?.bounds?.left||0,n=e.inputPoint.y;e?.next&&r.push({offset:{x:(t+i)/2,y:n},type:o.nx.BRANCH_DRAGGING_LABEL,width:i-t,props:{side:o.VH.NORMAL_BRANCH}})}else{let t=e.firstChild?.bounds?.bottom||0,i=e.next?.firstChild?.bounds?.top||0,n=e.inputPoint.x;e?.next&&r.push({offset:{x:n,y:(t+i)/2},type:o.nx.BRANCH_DRAGGING_LABEL,width:i-t,props:{side:o.VH.NORMAL_BRANCH}})}}return[...r]},addChild(t,e,i={}){let{index:r}=i;return t.document.addNode({...e,...i,parent:t,index:"number"==typeof r?r+1:void 0})}},v={type:o.Sy.INLINE_BLOCKS,meta:{hidden:!0,spacing:t=>(0,o.yI)(t.entity,o.cc.NODE_SPACING),isInlineBlocks:!0,inlineSpacingPre:t=>(0,o.yI)(t.entity,o.cc.INLINE_BLOCKS_PADDING_TOP)||o.Lu.INLINE_BLOCKS_PADDING_TOP,inlineSpacingAfter:t=>(0,o.yI)(t.entity,o.cc.INLINE_BLOCKS_PADDING_BOTTOM)},getChildDelta(t,e){let i=o.XP.isVertical(e),r=t.entity.pre?.getData(o.eG);if(r){let{localBounds:e}=r;if(i){let i=r.size.width+r.originDeltaX,n=Math.max(t.parent.minInlineBlockSpacing-i,o.Lu.MARGIN_RIGHT-t.originDeltaX);return{x:e.right+n,y:0}}{let i=r.size.height+r.originDeltaY,n=Math.max(t.parent.minInlineBlockSpacing-i,o.Lu.MARGIN_RIGHT-t.originDeltaY);return{x:0,y:e.bottom+n}}}return{x:0,y:0}},getDelta(t,e){let i=o.XP.isVertical(e),{pre:r,collapsed:n}=t;if(n)return{x:0,y:0};if(i){let e=r.localBounds.center.x,i=t.firstChild?.transform.position.x||0,n=t.lastChild?.transform.position.x||0;return{x:e-(n-i)/2,y:0}}let s=r.localBounds.center.y,a=t.firstChild?.transform.position.y||0,l=t.lastChild?.transform.position.y||0;return{x:0,y:s-(l-a)/2}},getLabels:t=>(function(t){let{isVertical:e}=t.entity,i=t.transform;return i.collapsed?[{type:o.nx.COLLAPSE_LABEL,offset:h.E9.move(i.inputPoint,e?{y:10}:{x:10}),props:{activateNode:t.entity.pre}}]:[{type:o.nx.CUSTOM_LABEL,renderKey:a.kD.BRANCH_ADDER,offset:h.E9.move(i.inputPoint,e?{y:10}:{x:10}),props:{activated:t.entity.getData(o.Lz).activated,transform:i,node:i.originParent?.entity}}]})(t),getLines:()=>[],getInputPoint:(t,e)=>o.XP.isVertical(e)?{x:t.pre?.outputPoint.x||0,y:t.bounds.top}:{x:t.bounds.left,y:t.pre?.outputPoint.y||0},getOutputPoint(t,e){let i=o.XP.isVertical(e);return t.collapsed?t.inputPoint:i?{x:t.pre?.outputPoint.x||0,y:t.bounds.bottom}:{x:t.bounds.right,y:t.pre?.outputPoint.y||0}}},y={type:o.Sy.BLOCK_ICON,meta:{spacing:20,size:{width:250,height:84}},getLabels(t){let e=t.transform,{isVertical:i}=t.entity;if(t.entity.parent.collapsedChildren.length<=1)return[];let r=(0,o.yI)(t.entity,o.T4.COLLAPSED_SPACING);return[{type:o.nx.COLLAPSE_LABEL,offset:h.E9.move(e.outputPoint,i?{y:r}:{x:r}),props:{collapseNode:t.entity.parent,activateNode:t.entity}}]}},b={type:o.Sy.BLOCK_ORDER_ICON,meta:{spacing:40},getLabels(t){let e=t.transform,{isVertical:i}=t.entity,r=e.outputPoint,n=e.next,s=e.parent;if(t.entity.parent.collapsedChildren.length<=1)return[{offset:s?.outputPoint,type:o.nx.ADDER_LABEL}];let a=(0,o.yI)(t.entity,o.T4.COLLAPSED_SPACING);return[{offset:n?h.E9.getMiddlePoint(r,n.inputPoint):h.E9.move(r,i?{y:a}:{x:a}),type:o.nx.COLLAPSE_ADDER_LABEL,props:{activateNode:t.entity,collapseNode:t.entity.parent}}]}},x={type:o.Sy.START,meta:{isStart:!0,draggable:!1,selectable:!1,deleteDisable:!0,copyDisable:!0,addDisable:!0}},_={extend:o.Sy.BLOCK,type:"catchBlock",meta:{hidden:!0,spacing:o.Lu.NULL},getLines(t){let e;let{transform:i}=t,{isVertical:r}=t.entity,n=i.parent,{inputPoint:s,outputPoint:a}=i;e=r?{x:n.inputPoint.x,y:n.inputPoint.y-20}:{x:n.inputPoint.x-20,y:n.inputPoint.y};let l=[{type:o.IG.DIVERGE_LINE,from:e,to:s}];if(!t.isNodeEnd){let t;t=r?{x:n.outputPoint.x,y:n.bounds.bottom}:{x:n.bounds.right,y:n.outputPoint.y},l.push({type:o.IG.MERGE_LINE,from:a,to:t})}return l},getLabels:()=>[]},A={extend:o.Sy.INLINE_BLOCKS,type:"catchInlineBlocks",meta:{spacing:o.Lu.NULL,inlineSpacingPre:o.Lu.NULL},getDelta(){},getLines(t){let{transform:e}=t,i=e.parent,r=[{type:o.IG.DIVERGE_LINE,from:i.pre.outputPoint,to:e.inputPoint}];return!e.entity.isNodeEnd&&r.push({type:o.IG.MERGE_LINE,from:e.outputPoint,to:i.outputPoint}),r},getOriginDeltaX(t){let{firstChild:e}=t;return e?e.originDeltaX:0},getLabels(t){let{inputPoint:e}=t.transform,{isVertical:i}=t.entity,r=t.transform,n={x:i?e.x:e.x-20,y:i?e.y-20:e.y};return r.collapsed?[]:[{type:o.nx.CUSTOM_LABEL,renderKey:a.kD.BRANCH_ADDER,offset:n,props:{activated:t.entity.getData(o.Lz).activated,transform:r,node:r.originParent?.entity}}]},getInputPoint(t,e){let i=o.XP.isVertical(e),r=t.firstChild;return r?r.inputPoint:i?t.bounds.topCenter:t.bounds.rightCenter},getOutputPoint(t,e){let i=o.XP.isVertical(e);if(t.collapsed)return t.inputPoint;let r=t.firstChild;return r?i?{x:r.outputPoint?.x,y:t.bounds.bottom}:{x:t.bounds.right,y:r.outputPoint?.y}:i?t.bounds.bottomCenter:t.bounds.rightCenter}},w={extend:o.Sy.INLINE_BLOCKS,type:"mainInlineBlocks",meta:{inlineSpacingPre:20,inlineSpacingAfter:40},getLines(t){let{transform:e}=t,i=e.firstChild;return[{type:o.IG.STRAIGHT_LINE,from:i.outputPoint,to:e.originParent.outputPoint}]},getLabels(t){let{transform:e}=t,{isVertical:i}=t.entity,r=e.children[1],n=i?(e.parent.outputPoint.x+r.inputPoint.x)/2:e.inputPoint.x-54,s=i?e.inputPoint.y-54:(e.parent.outputPoint.y+r.inputPoint.y)/2;return[{type:o.nx.TEXT_LABEL,renderKey:a.oC.TRY_START_TEXT,offset:{x:i?e.inputPoint.x:e.inputPoint.x+-20,y:i?e.inputPoint.y+-20:e.inputPoint.y}},{type:o.nx.TEXT_LABEL,renderKey:a.oC.TRY_END_TEXT,offset:{x:i?e.inputPoint.x:e.originParent.outputPoint.x+-20,y:i?e.originParent.outputPoint.y+-20:e.inputPoint.y}},{type:o.nx.CUSTOM_LABEL,renderKey:a.kD.TRY_CATCH_COLLAPSE,offset:{x:n,y:s},props:{node:e.lastChild?.entity}}]},getInputPoint:t=>t.firstChild.inputPoint,getOutputPoint(t,e){let i=t.firstChild;return o.XP.isVertical(e)?{x:i.outputPoint.x,y:t.bounds.bottom+20}:{x:t.bounds.right+20,y:i.outputPoint.y}},getDelta(){},getChildDelta(t,e){let i=t.entity.pre?.getData(o.eG),r=o.XP.isVertical(e);if(i){let{localBounds:e}=i,n=0;return n=r?Math.max(t.parent.minInlineBlockSpacing,-t.originDeltaX+o.Lu.MARGIN_RIGHT):Math.max(t.parent.minInlineBlockSpacing,-t.originDeltaY+o.Lu.MARGIN_RIGHT),{x:r?e.right+n:0,y:r?0:e.bottom+n}}return{x:0,y:0}}},S={extend:o.Sy.BLOCK,type:"tryBlock",meta:{hidden:!0,spacing:o.Lu.NULL},getLines:()=>[],getLabels:()=>[]},T={type:"tryCatch",meta:{hidden:!0,inlineSpacingAfter:0},onCreate(t,e){let{document:i}=t,[r,...n]=e.blocks||[],s=[],a=i.addNode({id:`$tryCatchIcon$${t.id}`,type:o.Sy.BLOCK_ICON,originParent:t,parent:t}),l=i.addNode({id:`$mainInlineBlocks$${t.id}`,type:"mainInlineBlocks",originParent:t,parent:t}),h=i.addNode({id:r.id,type:"tryBlock",originParent:t,parent:l,data:r.data}),d=i.addNode({id:`$trySlot$${r.id}`,hidden:!0,type:"trySlot",originParent:t,parent:h}),u=i.addNode({id:`$catchInlineBlocks$${t.id}`,type:"catchInlineBlocks",originParent:t,parent:l});return s.push(a,l,h,d,u),(r.blocks||[]).forEach(t=>{i.addNode({...t,parent:h},s)}),n.forEach(e=>{i.addBlock(t,e,s)}),s},onBlockChildCreate(t,e,i){let r=t.document.getNode(`$catchInlineBlocks$${t.id}`),n=t.document.addNode({id:e.id,type:"catchBlock",originParent:t,parent:r,data:e.data}),s=t.document.addNode({id:`$blockOrderIcon$${e.id}`,type:o.Sy.BLOCK_ORDER_ICON,originParent:t,parent:n});return e.blocks&&t.document.addBlocksAsChildren(n,e.blocks||[],i),i?.push(n,s),n},getInputPoint:t=>t.firstChild.inputPoint,getOutputPoint(t,e){let i=o.XP.isVertical(e),r=t.firstChild;return i?{x:r.inputPoint.x,y:t.bounds.bottom}:{x:t.bounds.right,y:r.inputPoint.y}},extendChildRegistries:[{type:o.Sy.BLOCK_ICON,meta:{spacing:54},getLabels:()=>[]},w,A,S,_,{type:"trySlot",meta:{inlineSpacingAfter:16,spacing:0,size:{width:16,height:0}},onAfterUpdateLocalTransform(t){t.entity.isVertical?t.data.size={width:16,height:0}:t.data.size={width:0,height:16},t.transform.update({size:t.data.size})},getLabels:t=>[{offset:t.transform.bounds.center,type:o.nx.ADDER_LABEL}]}]},k={SPACING:16,COLLAPSE_INLINE_SPACING_BOTTOM:60,[o.cc.INLINE_SPACING_BOTTOM]:48,MIN_INLINE_BLOCK_SPACING:280,HORIZONTAL_MIN_INLINE_BLOCK_SPACING:180,LEFT_EMPTY_BLOCK_WIDTH:80,EMPTY_BRANCH_SPACING:20,LOOP_BLOCK_ICON_SPACING:13,[o.cc.INLINE_BLOCKS_INLINE_SPACING_BOTTOM]:23,INLINE_BLOCKS_INLINE_SPACING_TOP:30},B={type:"loopLeftEmptyBlock",meta:{inlineSpacingAfter:0,spacing:0,size:{width:k.LEFT_EMPTY_BLOCK_WIDTH,height:0}},onAfterUpdateLocalTransform(t){t.entity.isVertical?t.data.size={width:k.LEFT_EMPTY_BLOCK_WIDTH,height:0}:t.data.size={width:0,height:k.LEFT_EMPTY_BLOCK_WIDTH},t.transform.update({size:t.data.size})},getLines:()=>[],getLabels:()=>[]},C={...m,type:"loopRightEmptyBlock",meta:{...m.meta,inlineSpacingAfter:0}},E={type:"loopEmptyBranch",meta:{inlineSpacingAfter:0,spacing:k.EMPTY_BRANCH_SPACING,size:{width:100,height:0}},getLabels(t){let{isVertical:e}=t.entity,i=t.transform;return e?[{type:o.nx.ADDER_LABEL,offset:{x:i.inputPoint.x,y:i.bounds.center.y+8}}]:[{type:o.nx.ADDER_LABEL,offset:{x:i.bounds.center.x+8,y:i.inputPoint.y}}]},onAfterUpdateLocalTransform(t){t.entity.isVertical?t.data.size={width:100,height:0}:t.data.size={width:0,height:100},t.transform.update({size:t.data.size})}},M={type:o.Sy.INLINE_BLOCKS,meta:{inlineSpacingPre:t=>(0,o.yI)(t.entity,o.cc.INLINE_BLOCKS_INLINE_SPACING_TOP,k.INLINE_BLOCKS_INLINE_SPACING_TOP),inlineSpacingAfter:t=>(0,o.yI)(t.entity,o.cc.INLINE_BLOCKS_INLINE_SPACING_BOTTOM,k.INLINE_BLOCKS_INLINE_SPACING_BOTTOM),minInlineBlockSpacing:t=>t.entity.isVertical?k.MIN_INLINE_BLOCK_SPACING:k.HORIZONTAL_MIN_INLINE_BLOCK_SPACING},getLines(t){let e=t.transform,i=e.parent,{isVertical:r}=t.entity,n=[{type:o.IG.STRAIGHT_LINE,from:e.outputPoint,to:i.outputPoint}];if(e.collapsed)return n;let[s]=e.children;return[...n,{type:o.IG.ROUNDED_LINE,from:e.outputPoint,to:s.outputPoint,vertices:[r?{x:s.inputPoint.x,y:e.bounds.bottom}:{x:e.bounds.right,y:s.inputPoint.y}]},{type:o.IG.ROUNDED_LINE,from:s.outputPoint,to:h.E9.move(e.inputPoint,r?{x:-12,y:10}:{x:10,y:-12}),vertices:[r?{x:s.inputPoint.x,y:e.bounds.top+10}:{x:e.bounds.left+10,y:s.inputPoint.y}],arrow:!0}]},getLabels(t){let e=t.transform,{isVertical:i}=t.entity,r=[];if(e.collapsed)return r;let n=e.children[0],s=e.children[1];return t.entity.originParent?.id.startsWith("while_")?r.push({type:o.nx.TEXT_LABEL,renderKey:a.oC.LOOP_WHILE_TEXT,rotate:i?"":"-90deg",offset:i?{x:(e.inputPoint.x+s.inputPoint.x)/2,y:e.inputPoint.y+10}:{x:e.inputPoint.x+10,y:(e.inputPoint.y+s.inputPoint.y)/2}}):r.push({type:o.nx.TEXT_LABEL,renderKey:a.oC.LOOP_TRAVERSE_TEXT,offset:i?{x:n.inputPoint.x,y:e.bounds.center.y+5}:{x:e.bounds.center.x+5,y:n.inputPoint.y}}),r}},P={type:"loop",meta:{hidden:!0,inlineSpacingAfter:t=>t.collapsed?k.COLLAPSE_INLINE_SPACING_BOTTOM:(0,o.yI)(t.entity,o.cc.INLINE_SPACING_BOTTOM,k.INLINE_SPACING_BOTTOM),spacing:k.SPACING},onCreate(t,e){let{document:i}=t,r=e.blocks||[],n=i.addNode({id:`$blockIcon$${t.id}`,type:o.Sy.BLOCK_ICON,originParent:t,parent:t}),s=i.addNode({id:`$inlineBlocks$${t.id}`,hidden:!0,type:o.Sy.INLINE_BLOCKS,originParent:t,parent:t}),a=i.addNode({id:`$loopLeftEmpty$${t.id}`,hidden:!0,type:"loopLeftEmptyBlock",originParent:t,parent:s}),l=i.addNode({id:`$block$${t.id}`,hidden:!0,type:o.Sy.BLOCK,originParent:t,parent:s}),h=i.addNode({id:`$loopRightEmpty$${t.id}`,hidden:!0,type:"loopEmptyBranch",originParent:t,parent:l}),d=[];return r.forEach(t=>i.addNode({...t,type:t.type,parent:l},d)),[n,a,s,l,h,...d]},getLabels(t){let e=t.transform,{isVertical:i}=t.entity;return[{type:o.nx.TEXT_LABEL,renderKey:a.oC.LOOP_END_TEXT,props:i?void 0:{style:{maxWidth:"20px",lineHeight:"12px",whiteSpace:"pre-wrap"}},offset:h.E9.move(e.outputPoint,i?{y:-26}:{x:-26})},{type:o.nx.ADDER_LABEL,offset:e.outputPoint}]},getInputPoint(t){let{isVertical:e}=t.entity;return e?{x:t.pre?.outputPoint.x||t.firstChild?.outputPoint.x||0,y:t.bounds.top}:{x:t.bounds.left,y:t.pre?.outputPoint.y||t.firstChild?.outputPoint.y||0}},getOutputPoint(t){let{isVertical:e}=t.entity;return e?{x:t.pre?.outputPoint.x||t.firstChild?.outputPoint.x||0,y:t.bounds.bottom}:{x:t.bounds.right,y:t.pre?.outputPoint.y||t.firstChild?.outputPoint.y||0}},extendChildRegistries:[{type:o.Sy.BLOCK_ICON,meta:{spacing:k.LOOP_BLOCK_ICON_SPACING}},B,E,C,M],addChild(t,e,i={}){let{index:r}=i,n=t.document;return n.addNode({...e,...i,parent:n.getNode(`$block$${t.id}`),index:"number"==typeof r?r+1:void 0})}},O={type:o.Sy.ROOT,meta:{spacing:o.Lu.NULL,hidden:!0},getInputPoint:t=>t.firstChild?.inputPoint||t.bounds.topCenter,getOutputPoint:t=>t.firstChild?.outputPoint||t.bounds.bottomCenter},R={type:o.Sy.EMPTY,meta:{spacing:t=>(0,o.yI)(t.entity,o.cc.NODE_SPACING)/2,size:{width:0,height:0},hidden:!0},getLabels:t=>[{offset:t.transform.bounds,type:o.nx.ADDER_LABEL}]},I={type:o.OT.SIMPLE_SPLIT,extend:o.OT.DYNAMIC_SPLIT,onBlockChildCreate(t,e,i=[]){let{document:r}=t,n=r.getNode(`$inlineBlocks$${t.id}`),s=r.addNode({id:`$block$${e.id}`,type:o.Sy.BLOCK,originParent:t,parent:n}),a=r.addNode({...e,type:e.type||o.Sy.BLOCK,parent:s},i);return i.push(s,a),s}},L=class{registerDocument(t){t.registerFlowNodes(O,x,g,f,I,m,v,y,b,T,p,P,R),t.registerNodeDatas(o.Lz,o.Xr,o.eG)}registerRenderer(t){t.registerLayers(a.V7,a.Em,a.HW,a.Eq,l.wY,a.qq,a.lV)}onReady(){}onDispose(){}};L=((t,e,i,r)=>{for(var n=r>1?void 0:r?c(e,i):e,s,a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r?s(e,i,n):s(n))||n);return r&&n&&u(e,i,n),n})([(0,d.b)()],L);var D=new s.n(t=>{(0,h.KV)(t,L,[o.Lw,a.OK,l.qY])}),j={BlockIconRegistry:y,BlockOrderIconRegistry:b,BlockRegistry:m,DynamicSplitRegistry:g,EmptyRegistry:R,LoopRegistry:P,StaticSplitRegistry:f,TryCatchRegistry:T,StartRegistry:x,RootRegistry:O,InlineBlocksRegistry:v,EndRegistry:p},N=i("455069"),F=(0,l.M1)({onInit(t,e){!1!==e.enable&&t.playground.registerLayer(a.EU,{onDrop:e.onDrop?e.onDrop.bind(null,t):void 0,canDrop:e.canDrop?e.canDrop.bind(null,t):void 0})}}),G=i("163455"),z=i("195852"),Z=i("160724"),H=i("107392"),U=i("771531"),V=Object.defineProperty,W=Object.getOwnPropertyDescriptor,$=(t,e,i,r)=>{for(var n=r>1?void 0:r?W(e,i):e,s,a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r?s(e,i,n):s(n))||n);return r&&n&&V(e,i,n),n},Y=class{constructor(){this.nodeToJSON=t=>t.toJSON(),this.getNodeLabelById=t=>t,this.getNodeLabel=t=>t.id,this.getBlockLabel=t=>t.id,this.getNodeURI=t=>`node:${t}`}init(t,e){e.nodeToJSON&&(this.nodeToJSON=e.nodeToJSON(t)),e.getNodeLabelById&&(this.getNodeLabelById=e.getNodeLabelById(t)),e.getNodeLabel&&(this.getNodeLabel=e.getNodeLabel(t)),e.getBlockLabel&&(this.getBlockLabel=e.getBlockLabel(t)),e.getNodeURI&&(this.getNodeURI=e.getNodeURI(t))}getParentName(t){return t?this.getNodeLabelById(t):"root"}};Y=$([(0,d.b)()],Y);var X=class{setSource(t){this.historyService.context.source=t}registerOperationMetas(t){t.forEach(t=>{this.operationRegistry.registerOperationMeta(t)})}transact(t){this.historyService.transact(t)}async undo(){await this.historyService.undo()}async redo(){await this.historyService.redo()}canRedo(){return this.historyService.canRedo()}canUndo(){return this.historyService.canUndo()}pushHistoryOperation(t){return this.historyService.pushOperation(t)}getHistoryOperations(){return this.historyService.getHistoryOperations()}addFromNode(t,e){let i={fromId:"string"==typeof t?t:t.id,data:e};return this.historyService.pushOperation({type:o.C8.addFromNode,value:i,uri:this.config.getNodeURI(e.id)})}deleteNode(t){let{originParent:e,parent:i}=t,r=this.config.getNodeURI(t.id),n=this.config.nodeToJSON(t);if(!n&&(n={id:t.id,type:t.flowNodeType}),i){let s=i.children.findIndex(e=>e===t);if(e){let t=e.id;if(!t){console.warn("no parent found");return}let i={targetId:t,blockData:n};return s>=0&&(i.index=s),this.historyService.pushOperation({type:o.C8.deleteBlock,value:i,uri:r})}{let t={data:n,parentId:i.id};return s>=0&&(t.index=s),this.historyService.pushOperation({type:o.C8.deleteChildNode,value:t,uri:r})}}if(!t.pre){console.warn("no pre found");return}return this.historyService.pushOperation({type:o.C8.deleteFromNode,value:{fromId:t.pre.id,data:n,uri:r}})}addChildNode(t,e,i,r){let n={data:t,parentId:e?.id,originParentId:r?.id,index:i};return this.historyService.pushOperation({type:o.C8.addChildNode,value:n,uri:this.config.getNodeURI(t.id)})}deleteNodes(t){if(0!==t.length)this.historyService.transact(()=>{t.reverse().forEach(t=>{this.deleteNode(t)})})}addFromNodes(t,e){if(0!==e.length)return this.historyService.pushOperation({type:o.C8.addNodes,value:{fromId:t.id,nodes:e.map(t=>this.config.nodeToJSON(t)),uri:this.config.getNodeURI(e[0].id)}})}addBlock(t,e,i,r){let n={targetId:"string"==typeof t?t:t.id,blockData:e,index:r};return i&&(n.parentId=i.id),this.historyService.pushOperation({type:o.C8.addBlock,value:n,uri:this.config.getNodeURI(n.blockData.id)})}changeFormData(t,e){return this.historyService.pushOperation({type:o.C8.changeNode,value:{...e,id:t.id},uri:this.config.getNodeURI(t.id)},{noApply:!0})}moveNode(t,e){return this.fixedHistoryOperationService.dragNodes({dropNode:e,nodes:[t]})}};$([(0,U.f)(H.qp)],X.prototype,"historyService",2),$([(0,U.f)(H.CD)],X.prototype,"operationRegistry",2),$([(0,U.f)(o.VO)],X.prototype,"fixedHistoryOperationService",2),$([(0,U.f)(o.pQ)],X.prototype,"document",2),$([(0,U.f)(Y)],X.prototype,"config",2),X=$([(0,d.b)()],X);var K=class extends o.D9{apply(t){return this.historyService.pushOperation(t)}originApply(t){return super.apply(t)}transact(t){this.historyService.transact(t)}};$([(0,U.f)(H.qp)],K.prototype,"historyService",2),K=$([(0,d.b)()],K);var q=class{constructor(){this._cache=new Map,this._formValueChangeByHistoryEmitter=new h.Q5,this.onFormValueChangeByHistory=this._formValueChangeByHistoryEmitter.event}resetCache(t,e){Object.keys(e).forEach(i=>{this.setCache(t,i,e[i])})}setCache(t,e,i){!this._cache.has(t)&&this._cache.set(t,new Map),this._cache.get(t).set(e,(0,z.cloneDeep)(i))}getCache(t,e){if(!!this._cache.has(t))return this._cache.get(t).get(e)}getFormDataByNodeId(t){let e=this.document.getNode(t);if(!!e)return e.getData(Z.Ps)}getFormItemValue(t,e){let i=this.getFormItem(t,e);if(!!i)return i.value}setFormItemValue(t,e,i){let r=this.getFormItem(t,e);r&&(r.value=i,this._formValueChangeByHistoryEmitter.fire({formData:t,path:e,value:i}))}getFormItem(t,e){if(void 0!==e)return e.endsWith("/")&&(e=e.slice(0,-1)),!e.startsWith("/")&&(e="/"+e),t.getFormModel().getFormItemByPath(e)}dispose(){this._formValueChangeByHistoryEmitter.dispose(),this._cache.clear()}};$([(0,U.f)(o.pQ)],q.prototype,"document",2),q=$([(0,d.b)()],q);var J={apply:(t,e)=>e.get(o.VO).originApply(t)},Q={...J,type:o.C8.addFromNode,inverse:t=>({...t,type:o.C8.deleteFromNode}),getLabel:(t,e)=>{let i=e.get(Y),{value:r}=t;return`Create ${i.getNodeLabel(r.data)}`},getDescription:(t,e)=>{let i=e.get(Y),{value:r}=t,n=i.getNodeLabel(r.data),s=i.getNodeLabelById(r.fromId);return`Create ${r.data.type} node ${n} after ${s}`}},tt={...J,type:o.C8.ungroup,inverse:t=>({...t,type:o.C8.createGroup}),getLabel:(t,e)=>{let i=t.value;return`Ungroup ${i.groupId}`},getDescription:(t,e)=>{let i=t.value;return`Ungroup with nodes ${i.nodeIds.join(", ")}`}},te={...J,type:o.C8.moveNodes,inverse:t=>({...t,value:{...t.value,fromId:t.value.toId,toId:t.value.fromId}}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`${r.nodeIds.map(t=>`Move ${i.getNodeLabelById(t)}`).join(";")}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value;return`${r.nodeIds.map(t=>`Move ${i.getNodeLabelById(t)} to ${i.getNodeLabelById(r.toId)}`).join(";")}`},getURI:(t,e)=>{let i=e.get(Y),r=t.value.nodeIds;if(0!==r.length)return i.getNodeURI(r[0])}},ti={...J,type:o.C8.moveChildNodes,inverse:t=>({...t,value:{...t.value,fromIndex:t.value.toIndex,toIndex:t.value.fromIndex,fromParentId:t.value.toParentId,toParentId:t.value.fromParentId}}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`Move ${r.nodeIds.map(t=>i.getNodeLabelById(t)).join(",")}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=void 0!==r.toIndex?`position ${r.toIndex}`:"the end";return`Move nodes ${r.nodeIds.map(t=>i.getNodeLabelById(t)).join(",")} to ${n}`}},tr={...J,type:o.C8.moveBlock,inverse:t=>({...t,value:{...t.value,fromIndex:t.value.toIndex,toIndex:t.value.fromIndex,fromParentId:t.value.toParentId,toParentId:t.value.fromParentId}}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`Move ${i.getNodeLabelById(r.nodeId)}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=void 0!==r.toIndex?`position ${r.toIndex}`:"the end";return`Move branch ${i.getNodeLabelById(r.nodeId)} to ${n}`}},tn={...J,type:o.C8.deleteNodes,inverse:t=>({...t,type:o.C8.addNodes}),getLabel:(t,e)=>{let i=e.get(Y);return t.value.nodes.map(t=>`Delete ${i.getNodeLabel(t)}`).join(";")},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=i.getNodeLabelById(r.fromId);return r.nodes.map(t=>`Delete ${t.type} node ${i.getNodeLabel(t)} after ${n}`).join(";")},shouldMerge:(t,e,i)=>!!e&&(!!(Date.now()-i.getTimestamp()<500)||!1)},ts={...J,type:o.C8.deleteNode,inverse:t=>({...t,type:o.C8.addNode}),apply:({value:{data:t}},e)=>e.get(o.VO).deleteNode(t.id),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`Create ${i.getNodeLabel(r.data)}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=i.getNodeLabel(r.data),s=i.getParentName(r.parentId),a=void 0!==r.index?`position ${r.index}`:"the end";return`Delete ${r.data.type} node ${n} in ${s} at ${a}`}},ta={...J,type:o.C8.deleteFromNode,inverse:t=>({...t,type:o.C8.addFromNode}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`Delete ${i.getNodeLabel(r.data)}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=i.getNodeLabel(r.data),s=i.getNodeLabelById(r.fromId);return`Delete ${r.data.type} node ${n} after ${s}`}},to={...J,type:o.C8.deleteChildNode,inverse:t=>({...t,type:o.C8.addChildNode}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`Delete ${i.getNodeLabel(r.data)}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=i.getNodeLabel(r.data),s=i.getParentName(r.parentId),a=void 0!==r.index?`position ${r.index}`:"the end";return`Delete ${r.data.type} node ${n} in ${s} at ${a}`}},tl={...J,type:o.C8.deleteBlock,inverse:t=>({...t,type:o.C8.addBlock}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`Delete ${i.getBlockLabel(r.blockData)}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=i.getBlockLabel(r.blockData),s=i.getNodeLabelById(r.targetId),a=void 0!==r.index?`position ${r.index}`:"the end";return`Delete branch ${n} in ${s} at ${a}`}},th={...J,type:o.C8.createGroup,inverse:t=>({...t,type:o.C8.ungroup}),getLabel:(t,e)=>{let i=t.value;return`Create group ${i.groupId} from ${i.targetId}`},getDescription:(t,e)=>{let i=t.value;return`Create group with nodes ${i.nodeIds.join(", ")}`}},td={...J,type:o.C8.changeNode,inverse:t=>({...t,value:{...t.value,value:t.value.oldValue,oldValue:t.value.value}}),apply:(t,e)=>{let i=e.get(q),r=i.getFormDataByNodeId(t.value.id);if(!!r)i.setFormItemValue(r,t.value.path,t.value.value)},shouldMerge:(t,e)=>!!(e&&e?.value?.path===t.value?.path&&e?.type===o.C8.changeNode&&["string","number"].includes(typeof t.value.value))&&{type:o.C8.changeNode,value:{...t.value,oldValue:e.value.oldValue,value:t.value.value}},getLabel:t=>{let e=t.value;return`\u5C06\u8282\u70B9${e.id}\u7684${e.path.split("/").filter(Boolean).join(".")}\u5C5E\u6027\u4FEE\u6539\u4E3A${e.value}`}},tu={...J,type:o.C8.addNodes,inverse:t=>({...t,type:o.C8.deleteNodes}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`${r.nodes.map(t=>`Create ${i.getNodeLabel(t)}`).join(";")}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=i.getNodeLabelById(r.fromId);return`${r.nodes.map(t=>`Create ${t.type} node ${i.getNodeLabel(t)} after ${n}`).join(";")}`}},tc={type:o.C8.addNode,inverse:t=>({...t,type:o.C8.deleteNode}),apply:({value:{data:t,parentId:e,index:i,hidden:r}},n)=>n.get(o.VO).addNode(t,{parent:e,index:i,hidden:r}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`Create ${i.getNodeLabel(r.data)}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=i.getNodeLabel(r.data),s=i.getParentName(r.parentId),a=void 0!==r.index?`position ${r.index}`:"the end";return`Create ${r.data.type} node ${n} in ${s} at ${a}`}},tp={...J,type:o.C8.addChildNode,inverse:t=>({...t,type:o.C8.deleteChildNode}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`Create ${i.getNodeLabel(r.data)}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=i.getNodeLabel(r.data),s=i.getParentName(r.parentId),a=void 0!==r.index?`position ${r.index}`:"the end";return`Create ${r.data.type} node ${n} in ${s} at ${a}`}},tg=[ta,Q,{...J,type:o.C8.addBlock,inverse:t=>({...t,type:o.C8.deleteBlock}),getLabel:(t,e)=>{let i=e.get(Y),r=t.value;return`Create ${i.getBlockLabel(r.blockData)}`},getDescription:(t,e)=>{let i=e.get(Y),r=t.value,n=i.getBlockLabel(r.blockData),s=i.getNodeLabelById(r.targetId),a=void 0!==r.index?`position ${r.index}`:"the end";return`Create branch ${n} in ${s} at ${a}`}},tl,th,tt,te,tn,tu,td,tr,tp,to,ti,tc,ts],tf=class{registerOperationMeta(t){tg.forEach(e=>{t.registerOperationMeta(e)})}};tf=$([(0,d.b)()],tf);var tm=(0,l.M1)({onBind:({bind:t,rebind:e})=>{var i,r;i=t,r=e,(0,h.KV)(i,tf,[H.FU]),i(X).toSelf().inSingletonScope(),i(q).toSelf().inSingletonScope(),i(Y).toSelf().inSingletonScope(),r(o.VO).to(K).inSingletonScope()},onInit(t,e){let i=t.get(X),r=t.get(q);i.setSource(t);let n=t.get(o.pQ);if(e?.uri&&(i.historyService.context.uri=e.uri),e?.getDocumentJSON?i.historyService.config.getSnapshot=e.getDocumentJSON(t):i.historyService.config.getSnapshot=()=>n.toJSON(),i.config.init(t,e),e?.operationMetas&&i.registerOperationMetas(e.operationMetas),e.onApply&&t.get(H.f9).onApply(e.onApply.bind(null,t)),!!e?.enableChangeNode)n.onNodeCreate(({node:t,data:e})=>{let n=t.getData(Z.Ps);r.setCache(n,"/",e.data),n.formModel.onInitialized(()=>{n.onDetailChange(e=>{let{path:s,initialized:a}=e;"/"!==s&&s.split("/").filter(Boolean)[0];let o=r.getFormItemValue(n,s),l=r.getCache(n,s);if(!(0,z.isEqual)(o,l))a&&i.changeFormData(t,{path:s,value:o,oldValue:l}),r.setCache(n,s,o)})})})},containerModules:[H.Xn]}),tv=i("259674");i("613921");var ty=Object.defineProperty,tb=Object.getOwnPropertyDescriptor,tx=(t,e,i,r)=>{for(var n=r>1?void 0:r?tb(e,i):e,s,a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r?s(e,i,n):s(n))||n);return r&&n&&ty(e,i,n),n};(r||(r={})).DEFAULT=n.nYJ.DEFAULT;var t_=Symbol("FlowOperationService"),tA=class extends n.D9C{createGroup(t){return this.groupService.createGroup(t)}ungroup(t){return this.groupService.ungroup(t)}setFormValue(t,e,i){let r=this.toNodeEntity(t),s=r?.getData(n.Psq)?.getFormModel();if(!!s)if((0,n.THq)(s))s.setValueIn(e,i);else{let t=s.getFormItemByPath(e);if(!t)return;t.value=i}}startTransaction(){}endTransaction(){}};tx([(0,U.f)(n.QUv)],tA.prototype,"groupService",2),tA=tx([(0,d.b)()],tA);var tw=class extends tA{init(){this.toDispose.push(this.onNodeAdd(this.handleNodeAdd.bind(this)))}addFromNode(t,e){return this.fixedHistoryService.addFromNode(t,e)}addBlock(t,e,i={}){let{parent:r,index:n}=i;return this.fixedHistoryService.addBlock(t,e,r,n)}deleteNode(t){let e=this.toNodeEntity(t);if(!!e)this.fixedHistoryService.deleteNode(e)}deleteNodes(t){let e=t.map(t=>"string"==typeof t?this.document.getNode(t):t);return this.fixedHistoryService.deleteNodes(e)}startTransaction(){this.historyService.startTransaction()}endTransaction(){this.historyService.endTransaction()}apply(t){this.historyService.pushOperation(t)}doMoveNode(t,e,i){if(!t.parent?.id)return;let r={nodeIds:[this.toId(t)],fromParentId:t.parent.id,toParentId:this.toId(e),fromIndex:this.getNodeIndex(t),toIndex:i};return this.historyService.pushOperation({type:n.C8.moveChildNodes,value:r})}handleNodeAdd({data:t}){let{parent:e,index:i,hidden:r,originParent:s,...a}=t,o={data:a,parentId:e?.id,index:i,hidden:r};return this.historyService.pushOperation({type:n.C8.addNode,value:o,uri:this.fixedHistoryService.config.getNodeURI(a.id)},{noApply:!0})}};tx([(0,U.f)(X)],tw.prototype,"fixedHistoryService",2),tx([(0,U.f)(H.qp)],tw.prototype,"historyService",2),tx([(0,U.f)(n.pQ4)],tw.prototype,"document",2),tx([(0,tv.z)()],tw.prototype,"init",1),tw=tx([(0,d.b)()],tw);var tS=(0,l.M1)({onBind:({bind:t},e)=>{t(t_).to(e?.history?.enable?tw:tA).inSingletonScope()},onDispose:t=>{t.container.get(t_).dispose()}}),tT=(0,N.forwardRef)(function(t,e){let{parentContainer:i,children:s,...a}=t,o=(0,N.useMemo)(()=>{var t;return t=a,e=>{let i=[tS(t={...r.DEFAULT,...t})];return i.push((0,n.cL)({registerShortcuts(i){let r=e.get(n.z2R);if(i.addHandlers({commandId:n.mYg.Default.DELETE,shortcuts:["backspace","delete"],isEnabled:()=>r.selection.length>0&&!e.playground.config.readonlyOrDisabled,execute:()=>{let t=r.selection.filter(t=>t instanceof n.GAy);e.get(t_).deleteNodes(t),r.selection=r.selection.filter(t=>!t.disposed)}}),t?.history?.enable){let r=e.get(X);!t.history.disableShortcuts&&(i.addHandlers({commandId:n.mYg.Default.UNDO,shortcuts:["meta z","ctrl z"],isEnabled:()=>!0,execute:()=>{r.undo()}}),i.addHandlers({commandId:n.mYg.Default.REDO,shortcuts:["meta shift z","ctrl shift z"],isEnabled:()=>!0,execute:()=>{r.redo()}}))}}}),(0,G.Y)({canSelect:t=>0===t.button&&!e.get(n.pQ4).renderState.config.nodeHoveredId,...t.selectBox||{}}),F(t.dragdrop||{})),i=(0,n.Fu1)(t,i)(e),t.variableEngine?.enable&&i.push((0,n.Ys9)({...t.variableEngine,layout:"fixed"})),t.history?.enable&&i.push(tm(t.history)),i.push((0,n.d3V)({containerModules:[D],onBind(e){!e.isBound(n.h3M)&&e.bind(n.h3M).toConstantValue({...n.XsM,defaultLayout:t.defaultLayout,toNodeJSON:t.toNodeJSON,fromNodeJSON:t.fromNodeJSON,allNodesDefaultExpanded:t.allNodesDefaultExpanded})},onInit:e=>{e.playground.registerLayers(n.Emw,n.V7e),!t.scroll?.disableScrollLimit&&e.playground.registerLayer(n.qq0),!t.scroll?.disableScrollBar&&e.playground.registerLayer(n.lVg),t.nodeRegistries&&e.document.registerFlowNodes(...t.nodeRegistries)}})),(0,n.esp)(t,i)(e)}},[]),l=(0,N.useCallback)(t=>({...(0,n.FwO)(t),get document(){return t.get(n.pQ4)},get operation(){return t.get(t_)},get clipboard(){return t.get(n.YvH)},get selection(){return t.get(n.z2R)},get history(){return t.get(H.qp)}}),[]);return N.createElement(n.W6u,{ref:e,plugins:o,customPluginContext:l,parentContainer:i},s)});(0,N.forwardRef)(function(t,e){let{children:i,...r}=t;return N.createElement(tT,{ref:e,...r},N.createElement(n.R6T,null,i))});var tk=(t,e,i)=>{let{maxZoom:r,minZoom:s,padding:a,easing:o=!0,easingDuration:l=50}=i,d=h.Ae.enlarge(t.getAllNodes().map(t=>t.getData(n.VOn).bounds)).pad(a,a),u=e.getViewport(!1),c=h.rM.fixSize(d,u);return c>r?c=r:c<s&&(c=s),e.scrollToView({bounds:d,zoom:c,easing:o,scrollToCenter:!0,easingDuration:l})};function tB(t){let{maxZoom:e=2,minZoom:i=.25,padding:r=30}=t||{},s=(0,n.Dcz)(),a=(0,n.KUq)(),o=a.isBound(H.qp)?a.get(H.qp):void 0,l=(0,n.G2Z)(n.pQ4),[d,u]=(0,N.useState)(1),[c,p]=(0,N.useState)(l.layout),[g,f]=(0,N.useState)(!1),[m,v]=(0,N.useState)(!1),y={maxZoom:e,minZoom:i,padding:r},b=(0,N.useCallback)(t=>{let e=l.getAllNodes();t=t||(l.layout.name===n.XPE.HORIZONTAL_FIXED_LAYOUT?n.XPE.VERTICAL_FIXED_LAYOUT:n.XPE.HORIZONTAL_FIXED_LAYOUT),e.map(t=>{t.getData(n.LzJ).node.classList.add("gedit-transition-ease")}),setTimeout(()=>{tk(l,s.config,{...y,easingDuration:300})},10),setTimeout(()=>{e.map(t=>{t.getData(n.LzJ).node.classList.remove("gedit-transition-ease")})},500),l.setLayout(t),p(l.layout)},[l,s]),x=(0,N.useCallback)(t=>{if(!(d<i))s?.config.zoomout(t)},[d,s]),_=(0,N.useCallback)(t=>{if(!(d>e))s?.config.zoomin(t)},[d,s]),A=(0,N.useCallback)((t,e)=>{tk(l,s.config,{...y,easing:t,easingDuration:e})},[l,s]),w=(0,N.useCallback)((t,e,i)=>{s.config.updateZoom(t,e,i)},[s]),S=(0,N.useCallback)(()=>o?.undo(),[o]),T=(0,N.useCallback)(()=>o?.redo(),[o]);return(0,N.useEffect)(()=>{let t=new h.K4;return s&&t.push(s.onZoom(t=>u(t))),o&&t.push(o.undoRedoService.onChange(()=>{f(o.canUndo()),v(o.canRedo())})),()=>t.dispose()},[s,o]),{zoomin:_,zoomout:x,fitView:A,updateZoom:w,zoom:d,isVertical:c.name===n.XPE.VERTICAL_FIXED_LAYOUT,changeLayout:b,canRedo:m,canUndo:g,undo:S,redo:T}}},794810:function(t,e,i){i.d(e,{Z:()=>y});var r=i("515680"),n=i("236476"),s=i("455069"),a=i("711281"),o=i("317911"),l=i("923337"),h=i("320013"),d=i("521531"),u=i("151064");let c=["className","component"];var p=i("418839"),g=i("332955"),f=i("615496");let m=(0,i("239109").Z)("MuiBox",["root"]),v=(0,g.Z)();var y=function(t={}){let{themeId:e,defaultTheme:i,defaultClassName:p="MuiBox-root",generateClassName:g}=t,f=(0,o.default)("div",{shouldForwardProp:t=>"theme"!==t&&"sx"!==t&&"as"!==t})(l.Z);return s.forwardRef(function(t,s){let o=(0,d.Z)(i),l=(0,h.Z)(t),{className:m,component:v="div"}=l,y=(0,n.Z)(l,c);return(0,u.jsx)(f,(0,r.Z)({as:v,ref:s,className:(0,a.Z)(m,g?g(p):p),theme:e&&o[e]||o},y))})}({themeId:f.Z,defaultTheme:v,defaultClassName:m.root,generateClassName:p.Z.generate})},638719:function(t,e,i){i.d(e,{i:function(){return n}}),i(455069);var r=i(54715);function n(t){return(0,r.i)(t)}i(151064)},240119:function(t,e,i){i.d(e,{ZP:()=>G});var r=i("236476"),n=i("515680"),s=i("488784"),a=i("455069"),o=i("711281"),l=i("505637"),h=function(t){return"string"==typeof t};function d(...t){return a.useMemo(()=>t.every(t=>null==t)?null:e=>{t.forEach(t=>{var i,r;i=t,r=e,"function"==typeof i?i(r):i&&(i.current=r)})},t)}function u(t){var e;return((e=t)&&e.ownerDocument||document).defaultView||window}var c=i("700623"),p=function(t){let e=a.useRef(t);return(0,c.Z)(()=>{e.current=t}),a.useRef((...t)=>(0,e.current)(...t)).current},g=i("151064");let f=["onChange","maxRows","minRows","style","value"];function m(t){return parseInt(t,10)||0}let v={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function y(t){return function(t){for(let e in t)return!1;return!0}(t)||0===t.outerHeightStyle&&!t.overflowing}let b=a.forwardRef(function(t,e){let{onChange:i,maxRows:s,minRows:o=1,style:l,value:h}=t,b=(0,r.Z)(t,f),{current:x}=a.useRef(null!=h),_=a.useRef(null),A=d(e,_),w=a.useRef(null),S=a.useRef(null),T=a.useCallback(()=>{let e=_.current,i=S.current;if(!e||!i)return;let r=u(e).getComputedStyle(e);if("0px"===r.width)return{outerHeightStyle:0,overflowing:!1};i.style.width=r.width,i.value=e.value||t.placeholder||"x","\n"===i.value.slice(-1)&&(i.value+=" ");let n=r.boxSizing,a=m(r.paddingBottom)+m(r.paddingTop),l=m(r.borderBottomWidth)+m(r.borderTopWidth),h=i.scrollHeight;i.value="x";let d=i.scrollHeight,c=h;o&&(c=Math.max(Number(o)*d,c)),s&&(c=Math.min(Number(s)*d,c));let p=(c=Math.max(c,d))+("border-box"===n?a+l:0);return{outerHeightStyle:p,overflowing:1>=Math.abs(c-h)}},[s,o,t.placeholder]),k=p(()=>{let t=_.current,e=T();if(!t||!e||y(e))return!1;let i=e.outerHeightStyle;return null!=w.current&&w.current!==i}),B=a.useCallback(()=>{let t=_.current,e=T();if(!t||!e||y(e))return;let i=e.outerHeightStyle;w.current!==i&&(w.current=i,t.style.height=`${i}px`),t.style.overflow=e.overflowing?"hidden":""},[T]),C=a.useRef(-1);return(0,c.Z)(()=>{let t;let e=function(t,e=166){let i;function r(...n){clearTimeout(i),i=setTimeout(()=>{t.apply(this,n)},e)}return r.clear=()=>{clearTimeout(i)},r}(B),i=null==_?void 0:_.current;if(!i)return;let r=u(i);return r.addEventListener("resize",e),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(()=>{k()&&(t.unobserve(i),cancelAnimationFrame(C.current),B(),C.current=requestAnimationFrame(()=>{t.observe(i)}))})).observe(i),()=>{e.clear(),cancelAnimationFrame(C.current),r.removeEventListener("resize",e),t&&t.disconnect()}},[T,B,k]),(0,c.Z)(()=>{B()}),(0,g.jsxs)(a.Fragment,{children:[(0,g.jsx)("textarea",(0,n.Z)({value:h,onChange:t=>{!x&&B(),i&&i(t)},ref:A,rows:o,style:l},b)),(0,g.jsx)("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:S,tabIndex:-1,style:(0,n.Z)({},v,l,{paddingTop:0,paddingBottom:0})})]})}),x=a.createContext(void 0);var _=i("657404"),A=i("638719"),w=i("720240"),S=c.Z,T=i("288161"),k=i("521531"),B=function({styles:t,themeId:e,defaultTheme:i={}}){let r=(0,k.Z)(i),n="function"==typeof t?t(e&&r[e]||r):t;return(0,g.jsx)(T.Z,{styles:n})},C=i("604893"),E=i("615496");function M(t){return null!=t&&!(Array.isArray(t)&&0===t.length)}var P=i("239109"),O=i("960456");function R(t){return(0,O.ZP)("MuiInputBase",t)}let I=(0,P.Z)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),L=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],D=t=>{let{classes:e,color:i,disabled:r,error:n,endAdornment:s,focused:a,formControl:o,fullWidth:h,hiddenLabel:d,multiline:u,readOnly:c,size:p,startAdornment:g,type:f}=t,m={root:["root",`color${(0,w.Z)(i)}`,r&&"disabled",n&&"error",h&&"fullWidth",a&&"focused",o&&"formControl",p&&"medium"!==p&&`size${(0,w.Z)(p)}`,u&&"multiline",g&&"adornedStart",s&&"adornedEnd",d&&"hiddenLabel",c&&"readOnly"],input:["input",r&&"disabled","search"===f&&"inputTypeSearch",u&&"inputMultiline","small"===p&&"inputSizeSmall",d&&"inputHiddenLabel",g&&"inputAdornedStart",s&&"inputAdornedEnd",c&&"readOnly"]};return(0,l.Z)(m,R,e)},j=(0,_.ZP)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:(t,e)=>{let{ownerState:i}=t;return[e.root,i.formControl&&e.formControl,i.startAdornment&&e.adornedStart,i.endAdornment&&e.adornedEnd,i.error&&e.error,"small"===i.size&&e.sizeSmall,i.multiline&&e.multiline,i.color&&e[`color${(0,w.Z)(i.color)}`],i.fullWidth&&e.fullWidth,i.hiddenLabel&&e.hiddenLabel]}})(({theme:t,ownerState:e})=>(0,n.Z)({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${I.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&(0,n.Z)({padding:"4px 0 5px"},"small"===e.size&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),N=(0,_.ZP)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:(t,e)=>{let{ownerState:i}=t;return[e.input,"small"===i.size&&e.inputSizeSmall,i.multiline&&e.inputMultiline,"search"===i.type&&e.inputTypeSearch,i.startAdornment&&e.inputAdornedStart,i.endAdornment&&e.inputAdornedEnd,i.hiddenLabel&&e.inputHiddenLabel]}})(({theme:t,ownerState:e})=>{let i="light"===t.palette.mode,r=(0,n.Z)({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:i?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),s={opacity:"0 !important"},a=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:i?.42:.5};return(0,n.Z)({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${I.formControl} &`]:{"&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus::-webkit-input-placeholder":a,"&:focus::-moz-placeholder":a,"&:focus:-ms-input-placeholder":a,"&:focus::-ms-input-placeholder":a},[`&.${I.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},"small"===e.size&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},"search"===e.type&&{MozAppearance:"textfield"})}),F=(0,g.jsx)(function(t){return(0,g.jsx)(B,(0,n.Z)({},t,{defaultTheme:C.Z,themeId:E.Z}))},{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}});var G=a.forwardRef(function(t,e){var i;let l=(0,A.i)({props:t,name:"MuiInputBase"}),{"aria-describedby":u,autoComplete:c,autoFocus:p,className:f,components:m={},componentsProps:v={},defaultValue:y,disabled:_,disableInjectingGlobalStyles:w,endAdornment:T,fullWidth:k=!1,id:B,inputComponent:C="input",inputProps:E={},inputRef:P,maxRows:O,minRows:R,multiline:I=!1,name:G,onBlur:z,onChange:Z,onClick:H,onFocus:U,onKeyDown:V,onKeyUp:W,placeholder:$,readOnly:Y,renderSuffix:X,rows:K,slotProps:q={},slots:J={},startAdornment:Q,type:tt="text",value:te}=l,ti=(0,r.Z)(l,L),tr=null!=E.value?E.value:te,{current:tn}=a.useRef(null!=tr),ts=a.useRef(),ta=a.useCallback(t=>{},[]),to=d(ts,P,E.ref,ta),[tl,th]=a.useState(!1),td=a.useContext(x),tu=function({props:t,states:e,muiFormControl:i}){return e.reduce((e,r)=>(e[r]=t[r],i&&void 0===t[r]&&(e[r]=i[r]),e),{})}({props:l,muiFormControl:td,states:["color","disabled","error","hiddenLabel","size","required","filled"]});tu.focused=td?td.focused:tl,a.useEffect(()=>{!td&&_&&tl&&(th(!1),z&&z())},[td,_,tl,z]);let tc=td&&td.onFilled,tp=td&&td.onEmpty,tg=a.useCallback(t=>{(function(t,e=!1){return t&&(M(t.value)&&""!==t.value||e&&M(t.defaultValue)&&""!==t.defaultValue)})(t)?tc&&tc():tp&&tp()},[tc,tp]);S(()=>{tn&&tg({value:tr})},[tr,tg,tn]);a.useEffect(()=>{tg(ts.current)},[]);let tf=C,tm=E;I&&"input"===tf&&(tm=K?(0,n.Z)({type:void 0,minRows:K,maxRows:K},tm):(0,n.Z)({type:void 0,maxRows:O,minRows:R},tm),tf=b);a.useEffect(()=>{td&&td.setAdornedStart(!!Q)},[td,Q]);let tv=(0,n.Z)({},l,{color:tu.color||"primary",disabled:tu.disabled,endAdornment:T,error:tu.error,focused:tu.focused,formControl:td,fullWidth:k,hiddenLabel:tu.hiddenLabel,multiline:I,size:tu.size,startAdornment:Q,type:tt}),ty=D(tv),tb=J.root||m.Root||j,tx=q.root||v.root||{},t_=J.input||m.Input||N;return tm=(0,n.Z)({},tm,null!=(i=q.input)?i:v.input),(0,g.jsxs)(a.Fragment,{children:[!w&&F,(0,g.jsxs)(tb,(0,n.Z)({},tx,!h(tb)&&{ownerState:(0,n.Z)({},tv,tx.ownerState)},{ref:e,onClick:t=>{ts.current&&t.currentTarget===t.target&&ts.current.focus(),H&&H(t)}},ti,{className:(0,o.Z)(ty.root,tx.className,f,Y&&"MuiInputBase-readOnly"),children:[Q,(0,g.jsx)(x.Provider,{value:null,children:(0,g.jsx)(t_,(0,n.Z)({ownerState:tv,"aria-invalid":tu.error,"aria-describedby":u,autoComplete:c,autoFocus:p,defaultValue:y,disabled:tu.disabled,id:B,onAnimationStart:t=>{tg("mui-auto-fill-cancel"===t.animationName?ts.current:{value:"x"})},name:G,placeholder:$,readOnly:Y,required:tu.required,rows:K,value:tr,onKeyDown:V,onKeyUp:W,type:tt},tm,!h(t_)&&{as:tf,ownerState:(0,n.Z)({},tv,tm.ownerState)},{ref:to,className:(0,o.Z)(ty.input,tm.className,Y&&"MuiInputBase-readOnly"),onBlur:t=>{z&&z(t),E.onBlur&&E.onBlur(t),td&&td.onBlur?td.onBlur(t):th(!1)},onChange:(t,...e)=>{if(!tn){let e=t.target||ts.current;if(null==e)throw Error((0,s.Z)(1));tg({value:e.value})}E.onChange&&E.onChange(t,...e),Z&&Z(t,...e)},onFocus:t=>{if(tu.disabled){t.stopPropagation();return}U&&U(t),E.onFocus&&E.onFocus(t),td&&td.onFocus?td.onFocus(t):th(!0)}}))}),T,X?X((0,n.Z)({},tu,{startAdornment:Q})):null]}))]})})},808054:function(t,e,i){var r=i(455069),n=i(700623),s=i(151064);e.Z=function(t){let{children:e,defer:i=!1,fallback:a=null}=t,[o,l]=r.useState(!1);return(0,n.Z)(()=>{!i&&l(!0)},[i]),r.useEffect(()=>{i&&l(!0)},[i]),(0,s.jsx)(r.Fragment,{children:o?e:a})}},319894:function(t,e,i){i.d(e,{Z:()=>b});var r=i("236476"),n=i("515680"),s=i("455069"),a=i("711281"),o=i("505637"),l=i("564570"),h=i("657404"),d=t=>{let e;return((e=t<1?5.11916*t**2:4.5*Math.log(t+1)+2)/100).toFixed(2)},u=i("638719"),c=i("239109"),p=i("960456");function g(t){return(0,p.ZP)("MuiPaper",t)}(0,c.Z)("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);var f=i("151064");let m=["className","component","elevation","square","variant"],v=t=>{let{square:e,elevation:i,variant:r,classes:n}=t,s={root:["root",r,!e&&"rounded","elevation"===r&&`elevation${i}`]};return(0,o.Z)(s,g,n)},y=(0,h.ZP)("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{let{ownerState:i}=t;return[e.root,e[i.variant],!i.square&&e.rounded,"elevation"===i.variant&&e[`elevation${i.elevation}`]]}})(({theme:t,ownerState:e})=>{var i;return(0,n.Z)({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},"outlined"===e.variant&&{border:`1px solid ${(t.vars||t).palette.divider}`},"elevation"===e.variant&&(0,n.Z)({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&"dark"===t.palette.mode&&{backgroundImage:`linear-gradient(${(0,l.alpha)("#fff",d(e.elevation))}, ${(0,l.alpha)("#fff",d(e.elevation))})`},t.vars&&{backgroundImage:null==(i=t.vars.overlays)?void 0:i[e.elevation]}))});var b=s.forwardRef(function(t,e){let i=(0,u.i)({props:t,name:"MuiPaper"}),{className:s,component:o="div",elevation:l=1,square:h=!1,variant:d="elevation"}=i,c=(0,r.Z)(i,m),p=(0,n.Z)({},i,{component:o,elevation:l,square:h,variant:d}),g=v(p);return(0,f.jsx)(y,(0,n.Z)({as:o,ownerState:p,className:(0,a.Z)(g.root,s),ref:e},c))})},283697:function(t,e,i){i.d(e,{Z:()=>b});var r=i("515680"),n=i("236476"),s=i("455069"),a=i("711281"),o=i("505637"),l=i("720240"),h=i("638719"),d=i("657404"),u=i("239109"),c=i("960456");function p(t){return(0,c.ZP)("MuiSvgIcon",t)}(0,u.Z)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var g=i("151064");let f=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],m=t=>{let{color:e,fontSize:i,classes:r}=t,n={root:["root","inherit"!==e&&`color${(0,l.Z)(e)}`,`fontSize${(0,l.Z)(i)}`]};return(0,o.Z)(n,p,r)},v=(0,d.ZP)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{let{ownerState:i}=t;return[e.root,"inherit"!==i.color&&e[`color${(0,l.Z)(i.color)}`],e[`fontSize${(0,l.Z)(i.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var i,r,n,s,a,o,l,h,d,u,c,p,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(i=t.transitions)||null==(r=i.create)?void 0:r.call(i,"fill",{duration:null==(n=t.transitions)||null==(n=n.duration)?void 0:n.shorter}),fontSize:({inherit:"inherit",small:(null==(s=t.typography)||null==(a=s.pxToRem)?void 0:a.call(s,20))||"1.25rem",medium:(null==(o=t.typography)||null==(l=o.pxToRem)?void 0:l.call(o,24))||"1.5rem",large:(null==(h=t.typography)||null==(d=h.pxToRem)?void 0:d.call(h,35))||"2.1875rem"})[e.fontSize],color:null!=(u=null==(c=(t.vars||t).palette)||null==(c=c[e.color])?void 0:c.main)?u:({action:null==(p=(t.vars||t).palette)||null==(p=p.action)?void 0:p.active,disabled:null==(g=(t.vars||t).palette)||null==(g=g.action)?void 0:g.disabled,inherit:void 0})[e.color]}}),y=s.forwardRef(function(t,e){let i=(0,h.i)({props:t,name:"MuiSvgIcon"}),{children:o,className:l,color:d="inherit",component:u="svg",fontSize:c="medium",htmlColor:p,inheritViewBox:y=!1,titleAccess:b,viewBox:x="0 0 24 24"}=i,_=(0,n.Z)(i,f),A=s.isValidElement(o)&&"svg"===o.type,w=(0,r.Z)({},i,{color:d,component:u,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:y,viewBox:x,hasSvgAsChild:A}),S={};!y&&(S.viewBox=x);let T=m(w);return(0,g.jsxs)(v,(0,r.Z)({as:u,className:(0,a.Z)(T.root,l),focusable:"false",color:p,"aria-hidden":!b||void 0,role:b?"img":void 0,ref:e},S,_,A&&o.props,{ownerState:w,children:[A?o.props.children:o,b?(0,g.jsx)("title",{children:b}):null]}))});y.muiName="SvgIcon";var b=y},39138:function(t,e,i){i.d(e,{Z:()=>A});var r=i("515680"),n=i("236476"),s=i("455069");let a=s.createContext(null);function o(){let t=s.useContext(a);return t}var l="function"==typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__",h=i("151064"),d=function(t){let{children:e,theme:i}=t,n=o(),d=s.useMemo(()=>{let t=null===n?i:function(t,e){if("function"==typeof e){let i=e(t);return i}return(0,r.Z)({},t,e)}(n,i);return null!=t&&(t[l]=null!==n),t},[i,n]);return(0,h.jsx)(a.Provider,{value:d,children:e})},u=i("222759"),c=i("963284");let p=["value"],g=s.createContext();var f=function(t){let{value:e}=t,i=(0,n.Z)(t,p);return(0,h.jsx)(g.Provider,(0,r.Z)({value:null==e||e},i))},m=i("54715");let v={};function y(t,e,i,n=!1){return s.useMemo(()=>{let s=t&&e[t]||e;if("function"==typeof i){let a=i(s),o=t?(0,r.Z)({},e,{[t]:a}):a;return n?()=>o:o}return t?(0,r.Z)({},e,{[t]:i}):(0,r.Z)({},e,i)},[t,e,i,n])}var b=function(t){let{children:e,theme:i,themeId:r}=t,n=(0,c.Z)(v),s=o()||v,a=y(r,n,i),l=y(r,s,i,!0),p="rtl"===a.direction;return(0,h.jsx)(d,{theme:l,children:(0,h.jsx)(u.T.Provider,{value:a,children:(0,h.jsx)(f,{value:p,children:(0,h.jsx)(m.Z,{value:null==a?void 0:a.components,children:e})})})})},x=i("615496");let _=["theme"];function A(t){let{theme:e}=t,i=(0,n.Z)(t,_),s=e[x.Z],a=s||e;return"function"!=typeof e&&(s&&!s.vars?a=(0,r.Z)({},s,{vars:null}):e&&!e.vars&&(a=(0,r.Z)({},e,{vars:null}))),(0,h.jsx)(b,(0,r.Z)({},i,{themeId:s?x.Z:void 0,theme:a}))}},332955:function(t,e,i){i.d(e,{Z:()=>L});var r=i("515680"),n=i("236476"),s=i("488784"),a=i("212259"),o=i("186512"),l=i("923337"),h=i("312284"),d=i("564570"),u={black:"#000",white:"#fff"},c={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},p={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},g={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},f={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},m={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},v={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},y={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};let b=["mode","contrastThreshold","tonalOffset"],x={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:u.white,default:u.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},_={text:{primary:u.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:u.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function A(t,e,i,r){let n=r.light||r,s=r.dark||1.5*r;!t[e]&&(t.hasOwnProperty(i)?t[e]=t[i]:"light"===e?t.light=(0,d.lighten)(t.main,n):"dark"===e&&(t.dark=(0,d.darken)(t.main,s)))}let w=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"],S={textTransform:"uppercase"},T='"Roboto", "Helvetica", "Arial", sans-serif';function k(...t){return`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,0.2),${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,0.14),${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,0.12)`}let B=["none",k(0,2,1,-1,0,1,1,0,0,1,3,0),k(0,3,1,-2,0,2,2,0,0,1,5,0),k(0,3,3,-2,0,3,4,0,0,1,8,0),k(0,2,4,-1,0,4,5,0,0,1,10,0),k(0,3,5,-1,0,5,8,0,0,1,14,0),k(0,3,5,-1,0,6,10,0,0,1,18,0),k(0,4,5,-2,0,7,10,1,0,2,16,1),k(0,5,5,-3,0,8,10,1,0,3,14,2),k(0,5,6,-3,0,9,12,1,0,3,16,2),k(0,6,6,-3,0,10,14,1,0,4,18,3),k(0,6,7,-4,0,11,15,1,0,4,20,3),k(0,7,8,-4,0,12,17,2,0,5,22,4),k(0,7,8,-4,0,13,19,2,0,5,24,4),k(0,7,9,-4,0,14,21,2,0,5,26,4),k(0,8,9,-5,0,15,22,2,0,6,28,5),k(0,8,10,-5,0,16,24,2,0,6,30,5),k(0,8,11,-5,0,17,26,2,0,6,32,5),k(0,9,11,-5,0,18,28,2,0,7,34,6),k(0,9,12,-6,0,19,29,2,0,7,36,6),k(0,10,13,-6,0,20,31,3,0,8,38,7),k(0,10,13,-6,0,21,33,3,0,8,40,7),k(0,10,14,-6,0,22,35,3,0,8,42,7),k(0,11,14,-7,0,23,36,3,0,9,44,8),k(0,11,15,-7,0,24,38,3,0,9,46,8)],C=["duration","easing","delay"],E={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},M={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function P(t){return`${Math.round(t)}ms`}function O(t){if(!t)return 0;let e=t/36;return Math.round((4+15*e**.25+e/5)*10)}var R={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};let I=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];var L=function(t={},...e){var i,k;let{mixins:L={},palette:D={},transitions:j={},typography:N={}}=t,F=(0,n.Z)(t,I);if(t.vars&&void 0===t.generateCssVars)throw Error((0,s.Z)(18));let G=function(t){let{mode:e="light",contrastThreshold:i=3,tonalOffset:o=.2}=t,l=(0,n.Z)(t,b),h=t.primary||function(t="light"){return"dark"===t?{main:m["200"],light:m["50"],dark:m["400"]}:{main:m["700"],light:m["400"],dark:m["800"]}}(e),w=t.secondary||function(t="light"){return"dark"===t?{main:p["200"],light:p["50"],dark:p["400"]}:{main:p["500"],light:p["300"],dark:p["700"]}}(e),S=t.error||function(t="light"){return"dark"===t?{main:g["500"],light:g["300"],dark:g["700"]}:{main:g["700"],light:g["400"],dark:g["800"]}}(e),T=t.info||function(t="light"){return"dark"===t?{main:v["400"],light:v["300"],dark:v["700"]}:{main:v["700"],light:v["500"],dark:v["900"]}}(e),k=t.success||function(t="light"){return"dark"===t?{main:y["400"],light:y["300"],dark:y["700"]}:{main:y["800"],light:y["500"],dark:y["900"]}}(e),B=t.warning||function(t="light"){return"dark"===t?{main:f["400"],light:f["300"],dark:f["700"]}:{main:"#ed6c02",light:f["500"],dark:f["900"]}}(e);function C(t){let e=(0,d.getContrastRatio)(t,_.text.primary)>=i?_.text.primary:x.text.primary;return e}let E=({color:t,name:e,mainShade:i=500,lightShade:n=300,darkShade:a=700})=>{if(!(t=(0,r.Z)({},t)).main&&t[i]&&(t.main=t[i]),!t.hasOwnProperty("main"))throw Error((0,s.Z)(11,e?` (${e})`:"",i));if("string"!=typeof t.main)throw Error((0,s.Z)(12,e?` (${e})`:"",JSON.stringify(t.main)));return A(t,"light",n,o),A(t,"dark",a,o),!t.contrastText&&(t.contrastText=C(t.main)),t};return(0,a.Z)((0,r.Z)({common:(0,r.Z)({},u),mode:e,primary:E({color:h,name:"primary"}),secondary:E({color:w,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:E({color:S,name:"error"}),warning:E({color:B,name:"warning"}),info:E({color:T,name:"info"}),success:E({color:k,name:"success"}),grey:c,contrastThreshold:i,getContrastText:C,augmentColor:E,tonalOffset:o},{dark:_,light:x}[e]),l)}(D),z=(0,h.Z)(t);let Z=(0,a.Z)(z,{mixins:(i=z.breakpoints,k=L,(0,r.Z)({toolbar:{minHeight:56,[i.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[i.up("sm")]:{minHeight:64}}},k)),palette:G,shadows:B.slice(),typography:function(t,e){let i="function"==typeof e?e(t):e,{fontFamily:s=T,fontSize:o=14,fontWeightLight:l=300,fontWeightRegular:h=400,fontWeightMedium:d=500,fontWeightBold:u=700,htmlFontSize:c=16,allVariants:p,pxToRem:g}=i,f=(0,n.Z)(i,w),m=o/14,v=g||(t=>`${t/c*m}rem`),y=(t,e,i,n,a)=>(0,r.Z)({fontFamily:s,fontWeight:t,fontSize:v(e),lineHeight:i},s===T?{letterSpacing:`${Math.round(n/e*1e5)/1e5}em`}:{},a,p),b={h1:y(l,96,1.167,-1.5),h2:y(l,60,1.2,-.5),h3:y(h,48,1.167,0),h4:y(h,34,1.235,.25),h5:y(h,24,1.334,0),h6:y(d,20,1.6,.15),subtitle1:y(h,16,1.75,.15),subtitle2:y(d,14,1.57,.1),body1:y(h,16,1.5,.15),body2:y(h,14,1.43,.15),button:y(d,14,1.75,.4,S),caption:y(h,12,1.66,.4),overline:y(h,12,2.66,1,S),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,a.Z)((0,r.Z)({htmlFontSize:c,pxToRem:v,fontFamily:s,fontSize:o,fontWeightLight:l,fontWeightRegular:h,fontWeightMedium:d,fontWeightBold:u},b),f,{clone:!1})}(G,N),transitions:function(t){let e=(0,r.Z)({},E,t.easing),i=(0,r.Z)({},M,t.duration);return(0,r.Z)({getAutoHeightDuration:O,create:(t=["all"],r={})=>{let{duration:s=i.standard,easing:a=e.easeInOut,delay:o=0}=r;return(0,n.Z)(r,C),(Array.isArray(t)?t:[t]).map(t=>`${t} ${"string"==typeof s?s:P(s)} ${a} ${"string"==typeof o?o:P(o)}`).join(",")}},t,{easing:e,duration:i})}(j),zIndex:(0,r.Z)({},R)});return Z=(0,a.Z)(Z,F),Z=e.reduce((t,e)=>(0,a.Z)(t,e),Z),Z.unstable_sxConfig=(0,r.Z)({},o.Z,null==F?void 0:F.unstable_sxConfig),Z.unstable_sx=function(t){return(0,l.Z)({sx:t,theme:this})},Z}},604893:function(t,e,i){let r=(0,i(332955).Z)();e.Z=r},615496:function(t,e){e.Z="$$material"},657404:function(t,e,i){i.d(e,{ZP:()=>a});var r=i("866312"),n=i("604893"),s=i("615496"),a=(0,r.default)({themeId:s.Z,defaultTheme:n.Z,rootShouldForwardProp:t=>{var e;return"ownerState"!==(e=t)&&"theme"!==e&&"sx"!==e&&"as"!==e&&"classes"!==t}})},720240:function(t,e,i){var r=i(117196);e.Z=r.Z},288161:function(t,e,i){i.d(e,{Z:function(){return s}}),i(455069);var r=i(261117),n=i(151064);function s(t){let{styles:e,defaultTheme:i={}}=t,s="function"==typeof e?t=>{var r;return e(null==(r=t)||0===Object.keys(r).length?i:t)}:e;return(0,n.jsx)(r.xB,{styles:s})}},317911:function(t,e,i){let r;i.r(e),i.d(e,{StyledEngineProvider:()=>_,GlobalStyles:()=>A.Z,default:()=>w,css:()=>y.iv,internal_processStyles:()=>S,keyframes:()=>y.F4,ThemeContext:()=>h.T});var n=i("515680"),s=i("455069"),a=i("16921"),o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,l=(0,a.Z)(function(t){return o.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&91>t.charCodeAt(2)}),h=i("222759"),d=i("740897"),u=i("942406"),c=i("950240"),p=function(t){return"theme"!==t},g=function(t){return"string"==typeof t&&t.charCodeAt(0)>96?l:p},f=function(t,e,i){var r;if(e){var n=e.shouldForwardProp;r=t.__emotion_forwardProp&&n?function(e){return t.__emotion_forwardProp(e)&&n(e)}:n}return"function"!=typeof r&&i&&(r=t.__emotion_forwardProp),r},m=function(t){var e=t.cache,i=t.serialized,r=t.isStringTag;return(0,d.hC)(e,i,r),(0,c.L)(function(){return(0,d.My)(e,i,r)}),null},v=(function t(e,i){var r,a,o=e.__emotion_real===e,l=o&&e.__emotion_base||e;void 0!==i&&(r=i.label,a=i.target);var c=f(e,i,o),p=c||g(l),v=!p("as");return function(){var y=arguments,b=o&&void 0!==e.__emotion_styles?e.__emotion_styles.slice(0):[];if(void 0!==r&&b.push("label:"+r+";"),null==y[0]||void 0===y[0].raw)b.push.apply(b,y);else{b.push(y[0][0]);for(var x=y.length,_=1;_<x;_++)b.push(y[_],y[0][_])}var A=(0,h.w)(function(t,e,i){var r=v&&t.as||l,n="",o=[],f=t;if(null==t.theme){for(var y in f={},t)f[y]=t[y];f.theme=s.useContext(h.T)}"string"==typeof t.className?n=(0,d.fp)(e.registered,o,t.className):null!=t.className&&(n=t.className+" ");var x=(0,u.O)(b.concat(o),e.registered,f);n+=e.key+"-"+x.name,void 0!==a&&(n+=" "+a);var _=v&&void 0===c?g(r):p,A={};for(var w in t)(!v||"as"!==w)&&_(w)&&(A[w]=t[w]);return A.className=n,A.ref=i,s.createElement(s.Fragment,null,s.createElement(m,{cache:e,serialized:x,isStringTag:"string"==typeof r}),s.createElement(r,A))});return A.displayName=void 0!==r?r:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",A.defaultProps=e.defaultProps,A.__emotion_real=A,A.__emotion_base=l,A.__emotion_styles=b,A.__emotion_forwardProp=c,Object.defineProperty(A,"toString",{value:function(){return"."+a}}),A.withComponent=function(e,r){return t(e,(0,n.Z)({},i,r,{shouldForwardProp:f(A,r,!0)})).apply(void 0,b)},A}}).bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(t){v[t]=v(t)});var y=i("261117"),b=i("860256"),x=i("151064");function _(t){let{injectFirst:e,children:i}=t;return e&&r?(0,x.jsx)(h.C,{value:r,children:i}):i}"object"==typeof document&&(r=(0,b.Z)({key:"css",prepend:!0}));var A=i("288161");function w(t,e){let i=v(t,e);return i}let S=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}},564570:function(t,e,i){var r,n=i(377416);e.alpha=g;e.darken=f;e.getContrastRatio=function(t,e){let i=p(t),r=p(e);return(Math.max(i,r)+.05)/(Math.min(i,r)+.05)};e.lighten=m;var s=n(i(545273)),a=n(i(802239));function o(t,e=0,i=1){return(0,a.default)(t,e,i)}function l(t){t=t.slice(1);let e=RegExp(`.{1,${t.length>=6?2:1}}`,"g"),i=t.match(e);return i&&1===i[0].length&&(i=i.map(t=>t+t)),i?`rgb${4===i.length?"a":""}(${i.map((t,e)=>e<3?parseInt(t,16):Math.round(parseInt(t,16)/255*1e3)/1e3).join(", ")})`:""}function h(t){let e;if(t.type)return t;if("#"===t.charAt(0))return h(l(t));let i=t.indexOf("("),r=t.substring(0,i);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw Error((0,s.default)(9,t));let n=t.substring(i+1,t.length-1);if("color"===r){if(e=(n=n.split(" ")).shift(),4===n.length&&"/"===n[3].charAt(0)&&(n[3]=n[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(e))throw Error((0,s.default)(10,e))}else n=n.split(",");return{type:r,values:n=n.map(t=>parseFloat(t)),colorSpace:e}}let d=t=>{let e=h(t);return e.values.slice(0,3).map((t,i)=>-1!==e.type.indexOf("hsl")&&0!==i?`${t}%`:t).join(" ")};function u(t){let{type:e,colorSpace:i}=t,{values:r}=t;return -1!==e.indexOf("rgb")?r=r.map((t,e)=>e<3?parseInt(t,10):t):-1!==e.indexOf("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=-1!==e.indexOf("color")?`${i} ${r.join(" ")}`:`${r.join(", ")}`,`${e}(${r})`}function c(t){let{values:e}=t=h(t),i=e[0],r=e[1]/100,n=e[2]/100,s=r*Math.min(n,1-n),a=(t,e=(t+i/30)%12)=>n-s*Math.max(Math.min(e-3,9-e,1),-1),o="rgb",l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===t.type&&(o+="a",l.push(e[3])),u({type:o,values:l})}function p(t){let e="hsl"===(t=h(t)).type||"hsla"===t.type?h(c(t)).values:t.values;return Number((.2126*(e=e.map(e=>("color"!==t.type&&(e/=255),e<=.03928?e/12.92:((e+.055)/1.055)**2.4)))[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function g(t,e){return t=h(t),e=o(e),("rgb"===t.type||"hsl"===t.type)&&(t.type+="a"),"color"===t.type?t.values[3]=`/${e}`:t.values[3]=e,u(t)}function f(t,e){if(t=h(t),e=o(e),-1!==t.type.indexOf("hsl"))t.values[2]*=1-e;else if(-1!==t.type.indexOf("rgb")||-1!==t.type.indexOf("color"))for(let i=0;i<3;i+=1)t.values[i]*=1-e;return u(t)}function m(t,e){if(t=h(t),e=o(e),-1!==t.type.indexOf("hsl"))t.values[2]+=(100-t.values[2])*e;else if(-1!==t.type.indexOf("rgb"))for(let i=0;i<3;i+=1)t.values[i]+=(255-t.values[i])*e;else if(-1!==t.type.indexOf("color"))for(let i=0;i<3;i+=1)t.values[i]+=(1-t.values[i])*e;return u(t)}function v(t,e=.15){return p(t)>.5?f(t,e):m(t,e)}},866312:function(t,e,i){var r,n=i(377416);e.default=function(t={}){let{themeId:e,defaultTheme:i=m,rootShouldForwardProp:r=f,slotShouldForwardProp:n=f}=t,h=t=>(0,d.default)((0,s.default)({},t,{theme:y((0,s.default)({},t,{defaultTheme:i,themeId:e}))}));return h.__mui_systemSx=!0,(t,d={})=>{var u,c;let g;(0,o.internal_processStyles)(t,t=>t.filter(t=>!(null!=t&&t.__mui_systemSx)));let{name:m,slot:x,skipVariantsResolver:_,skipSx:A,overridesResolver:w=(u=v(x))?(t,e)=>e[u]:null}=d,S=(0,a.default)(d,p),T=void 0!==_?_:x&&"Root"!==x&&"root"!==x||!1,k=A||!1,B=f;if("Root"===x||"root"===x)B=r;else if(x)B=n;else{;if("string"==typeof(c=t)&&c.charCodeAt(0)>96)B=void 0}let C=(0,o.default)(t,(0,s.default)({shouldForwardProp:B,label:g},S)),E=t=>"function"==typeof t&&t.__emotion_real!==t||(0,l.isPlainObject)(t)?r=>b(t,(0,s.default)({},r,{theme:y({theme:r.theme,defaultTheme:i,themeId:e})})):t,M=(r,...n)=>{let a=E(r),o=n?n.map(E):[];m&&w&&o.push(t=>{let r=y((0,s.default)({},t,{defaultTheme:i,themeId:e}));if(!r.components||!r.components[m]||!r.components[m].styleOverrides)return null;let n=r.components[m].styleOverrides,a={};return Object.entries(n).forEach(([e,i])=>{a[e]=b(i,(0,s.default)({},t,{theme:r}))}),w(t,a)}),m&&!T&&o.push(t=>{var r;let n=y((0,s.default)({},t,{defaultTheme:i,themeId:e}));return b({variants:null==n||null==(r=n.components)||null==(r=r[m])?void 0:r.variants},(0,s.default)({},t,{theme:n}))}),!k&&o.push(h);let l=o.length-n.length;if(Array.isArray(r)&&l>0){let t=Array(l).fill("");(a=[...r,...t]).raw=[...r.raw,...t]}let d=C(a,...o);return t.muiName&&(d.muiName=t.muiName),d};return C.withConfig&&(M.withConfig=C.withConfig),M}};var s=n(i(950292)),a=n(i(344365)),o=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var i=g(e);if(i&&i.has(t))return i.get(t);var r={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var a=n?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=t[s]}return r.default=t,i&&i.set(t,r),r}(i(317911)),l=i(874305);n(i(954548)),n(i(33696));var h=n(i(27358)),d=n(i(732193));let u=["ownerState"],c=["variants"],p=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function g(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,i=new WeakMap;return(g=function(t){return t?i:e})(t)}function f(t){return"ownerState"!==t&&"theme"!==t&&"sx"!==t&&"as"!==t}let m=(0,h.default)(),v=t=>t?t.charAt(0).toLowerCase()+t.slice(1):t;function y({defaultTheme:t,theme:e,themeId:i}){return 0===Object.keys(e).length?t:e[i]||e}function b(t,e){let{ownerState:i}=e,r=(0,a.default)(e,u),n="function"==typeof t?t((0,s.default)({ownerState:i},r)):t;if(Array.isArray(n))return n.flatMap(t=>b(t,(0,s.default)({ownerState:i},r)));if(n&&"object"==typeof n&&Array.isArray(n.variants)){let{variants:t=[]}=n,e=(0,a.default)(n,c);return t.forEach(t=>{let n=!0;"function"==typeof t.props?n=t.props((0,s.default)({ownerState:i},r,i)):Object.keys(t.props).forEach(e=>{(null==i?void 0:i[e])!==t.props[e]&&r[e]!==t.props[e]&&(n=!1)}),n&&(!Array.isArray(e)&&(e=[e]),e.push("function"==typeof t.style?t.style((0,s.default)({ownerState:i},r,i)):t.style))}),e}return n}},54715:function(t,e,i){i.d(e,{i:()=>l,Z:()=>h});var r=i("455069"),n=i("515680");function s(t,e){let i=(0,n.Z)({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))i[r]=(0,n.Z)({},t[r],i[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){let a=t[r]||{},o=e[r];i[r]={},o&&Object.keys(o)?a&&Object.keys(a)?(i[r]=(0,n.Z)({},o),Object.keys(a).forEach(t=>{i[r][t]=s(a[t],o[t])})):i[r]=o:i[r]=a}else void 0===i[r]&&(i[r]=t[r])}),i}var a=i("151064");let o=r.createContext(void 0);function l({props:t,name:e}){return function(t){let{theme:e,name:i,props:r}=t;if(!e||!e.components||!e.components[i])return r;let n=e.components[i];return n.defaultProps?s(n.defaultProps,r):n.styleOverrides||n.variants?r:s(n,r)}({props:t,name:e,theme:{components:r.useContext(o)}})}var h=function({value:t,children:e}){return(0,a.jsx)(o.Provider,{value:t,children:e})}},529525:function(t,e,i){i.d(e,{L7:function(){return o},VO:function(){return r},W8:function(){return a},k9:function(){return s}});let r={xs:0,sm:600,md:900,lg:1200,xl:1536},n={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${r[t]}px)`};function s(t,e,i){let s=t.theme||{};if(Array.isArray(e)){let t=s.breakpoints||n;return e.reduce((r,n,s)=>(r[t.up(t.keys[s])]=i(e[s]),r),{})}if("object"==typeof e){let t=s.breakpoints||n;return Object.keys(e).reduce((n,s)=>(-1!==Object.keys(t.values||r).indexOf(s)?n[t.up(s)]=i(e[s],s):n[s]=e[s],n),{})}return i(e)}function a(t={}){var e;return(null==(e=t.keys)?void 0:e.reduce((e,i)=>(e[t.up(i)]={},e),{}))||{}}function o(t,e){return t.reduce((t,e)=>{let i=t[e];return(!i||0===Object.keys(i).length)&&delete t[e],t},e)}},588507:function(t,e,i){i.d(e,{Z:function(){return r}});function r(t,e){return this.vars&&"function"==typeof this.getColorSchemeSelector?{[this.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:this.palette.mode===t?e:{}}},613375:function(t,e,i){i.d(e,{Z:function(){return o}});var r=i(236476),n=i(515680);let s=["values","unit","step"],a=t=>{let e=Object.keys(t).map(e=>({key:e,val:t[e]}))||[];return e.sort((t,e)=>t.val-e.val),e.reduce((t,e)=>(0,n.Z)({},t,{[e.key]:e.val}),{})};function o(t){let{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:i="px",step:o=5}=t,l=(0,r.Z)(t,s),h=a(e),d=Object.keys(h);function u(t){let r="number"==typeof e[t]?e[t]:t;return`@media (min-width:${r}${i})`}function c(t){let r="number"==typeof e[t]?e[t]:t;return`@media (max-width:${r-o/100}${i})`}function p(t,r){let n=d.indexOf(r);return`@media (min-width:${"number"==typeof e[t]?e[t]:t}${i}) and (max-width:${(-1!==n&&"number"==typeof e[d[n]]?e[d[n]]:r)-o/100}${i})`}return(0,n.Z)({keys:d,values:h,up:u,down:c,between:p,only:function(t){return d.indexOf(t)+1<d.length?p(t,d[d.indexOf(t)+1]):u(t)},not:function(t){let e=d.indexOf(t);return 0===e?u(d[1]):e===d.length-1?c(d[e]):p(t,d[d.indexOf(t)+1]).replace("@media","@media not all and")},unit:i},l)}},312284:function(t,e,i){i.d(e,{Z:()=>p});var r=i("515680"),n=i("236476"),s=i("212259"),a=i("613375"),o={borderRadius:4},l=i("916256"),h=i("923337"),d=i("186512"),u=i("588507");let c=["breakpoints","palette","spacing","shape"];var p=function(t={},...e){let{breakpoints:i={},palette:p={},spacing:g,shape:f={}}=t,m=(0,n.Z)(t,c),v=(0,a.Z)(i),y=function(t=8){if(t.mui)return t;let e=(0,l.hB)({spacing:t}),i=(...t)=>(0===t.length?[1]:t).map(t=>{let i=e(t);return"number"==typeof i?`${i}px`:i}).join(" ");return i.mui=!0,i}(g),b=(0,s.Z)({breakpoints:v,direction:"ltr",components:{},palette:(0,r.Z)({mode:"light"},p),spacing:y,shape:(0,r.Z)({},o,f)},m);return b.applyStyles=u.Z,(b=e.reduce((t,e)=>(0,s.Z)(t,e),b)).unstable_sxConfig=(0,r.Z)({},d.Z,null==m?void 0:m.unstable_sxConfig),b.unstable_sx=function(t){return(0,h.Z)({sx:t,theme:this})},b}},27358:function(t,e,i){i.r(e),i.d(e,{default:function(){return r.Z},private_createBreakpoints:function(){return n.Z},unstable_applyStyles:function(){return s.Z}});var r=i(312284),n=i(613375),s=i(588507)},628651:function(t,e,i){var r=i(212259);e.Z=function(t,e){return e?(0,r.Z)(t,e,{clone:!1}):t}},916256:function(t,e,i){i.d(e,{NA:()=>f,hB:()=>g,e6:()=>v,o3:()=>y,eI:()=>p});var r=i("529525"),n=i("942051"),s=i("628651");let a={m:"margin",p:"padding"},o={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},l={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},h=function(t){let e={};return i=>(void 0===e[i]&&(e[i]=t(i)),e[i])}(t=>{if(t.length>2){if(!l[t])return[t];t=l[t]}let[e,i]=t.split(""),r=a[e],n=o[i]||"";return Array.isArray(n)?n.map(t=>r+t):[r+n]}),d=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],u=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],c=[...d,...u];function p(t,e,i,r){var s;let a=null!=(s=(0,n.DW)(t,e,!1))?s:i;return"number"==typeof a?t=>"string"==typeof t?t:a*t:Array.isArray(a)?t=>"string"==typeof t?t:a[t]:"function"==typeof a?a:()=>void 0}function g(t){return p(t,"spacing",8,"spacing")}function f(t,e){if("string"==typeof e||null==e)return e;let i=t(Math.abs(e));return e>=0?i:"number"==typeof i?-i:`-${i}`}function m(t,e){let i=g(t.theme);return Object.keys(t).map(n=>(function(t,e,i,n){var s,a;if(-1===e.indexOf(i))return null;let o=(s=h(i),a=n,t=>s.reduce((e,i)=>(e[i]=f(a,t),e),{})),l=t[i];return(0,r.k9)(t,l,o)})(t,e,n,i)).reduce(s.Z,{})}function v(t){return m(t,d)}function y(t){return m(t,u)}function b(t){return m(t,c)}v.propTypes={},v.filterProps=d,y.propTypes={},y.filterProps=u,b.propTypes={},b.filterProps=c},942051:function(t,e,i){i.d(e,{DW:function(){return s},Jq:function(){return a}});var r=i(117196),n=i(529525);function s(t,e,i=!0){if(!e||"string"!=typeof e)return null;if(t&&t.vars&&i){let i=`vars.${e}`.split(".").reduce((t,e)=>t&&t[e]?t[e]:null,t);if(null!=i)return i}return e.split(".").reduce((t,e)=>t&&null!=t[e]?t[e]:null,t)}function a(t,e,i,r=i){let n;return n="function"==typeof t?t(i):Array.isArray(t)?t[i]||r:s(t,i)||r,e&&(n=e(n,r,t)),n}e.ZP=function(t){let{prop:e,cssProperty:i=t.prop,themeKey:o,transform:l}=t,h=t=>{if(null==t[e])return null;let h=t[e],d=s(t.theme,o)||{};return(0,n.k9)(t,h,t=>{let n=a(d,l,t);return(t===n&&"string"==typeof t&&(n=a(d,l,`${e}${"default"===t?"":(0,r.Z)(t)}`,t)),!1===i)?n:{[i]:n}})};return h.propTypes={},h.filterProps=[e],h}},186512:function(t,e,i){i.d(e,{Z:()=>U});var r=i("916256"),n=i("942051"),s=i("628651"),a=function(...t){let e=t.reduce((t,e)=>(e.filterProps.forEach(i=>{t[i]=e}),t),{}),i=t=>Object.keys(t).reduce((i,r)=>e[r]?(0,s.Z)(i,e[r](t)):i,{});return i.propTypes={},i.filterProps=t.reduce((t,e)=>t.concat(e.filterProps),[]),i},o=i("529525");function l(t){return"number"!=typeof t?t:`${t}px solid`}function h(t,e){return(0,n.ZP)({prop:t,themeKey:"borders",transform:e})}let d=h("border",l),u=h("borderTop",l),c=h("borderRight",l),p=h("borderBottom",l),g=h("borderLeft",l),f=h("borderColor"),m=h("borderTopColor"),v=h("borderRightColor"),y=h("borderBottomColor"),b=h("borderLeftColor"),x=h("outline",l),_=h("outlineColor"),A=t=>{if(void 0!==t.borderRadius&&null!==t.borderRadius){let e=(0,r.eI)(t.theme,"shape.borderRadius",4,"borderRadius");return(0,o.k9)(t,t.borderRadius,t=>({borderRadius:(0,r.NA)(e,t)}))}return null};A.propTypes={},A.filterProps=["borderRadius"],a(d,u,c,p,g,f,m,v,y,b,A,x,_);let w=t=>{if(void 0!==t.gap&&null!==t.gap){let e=(0,r.eI)(t.theme,"spacing",8,"gap");return(0,o.k9)(t,t.gap,t=>({gap:(0,r.NA)(e,t)}))}return null};w.propTypes={},w.filterProps=["gap"];let S=t=>{if(void 0!==t.columnGap&&null!==t.columnGap){let e=(0,r.eI)(t.theme,"spacing",8,"columnGap");return(0,o.k9)(t,t.columnGap,t=>({columnGap:(0,r.NA)(e,t)}))}return null};S.propTypes={},S.filterProps=["columnGap"];let T=t=>{if(void 0!==t.rowGap&&null!==t.rowGap){let e=(0,r.eI)(t.theme,"spacing",8,"rowGap");return(0,o.k9)(t,t.rowGap,t=>({rowGap:(0,r.NA)(e,t)}))}return null};T.propTypes={},T.filterProps=["rowGap"];let k=(0,n.ZP)({prop:"gridColumn"}),B=(0,n.ZP)({prop:"gridRow"}),C=(0,n.ZP)({prop:"gridAutoFlow"}),E=(0,n.ZP)({prop:"gridAutoColumns"}),M=(0,n.ZP)({prop:"gridAutoRows"}),P=(0,n.ZP)({prop:"gridTemplateColumns"}),O=(0,n.ZP)({prop:"gridTemplateRows"}),R=(0,n.ZP)({prop:"gridTemplateAreas"});function I(t,e){return"grey"===e?e:t}a(w,S,T,k,B,C,E,M,P,O,R,(0,n.ZP)({prop:"gridArea"}));let L=(0,n.ZP)({prop:"color",themeKey:"palette",transform:I}),D=(0,n.ZP)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:I});function j(t){return t<=1&&0!==t?`${100*t}%`:t}a(L,D,(0,n.ZP)({prop:"backgroundColor",themeKey:"palette",transform:I}));let N=(0,n.ZP)({prop:"width",transform:j}),F=t=>void 0!==t.maxWidth&&null!==t.maxWidth?(0,o.k9)(t,t.maxWidth,e=>{var i,r;let n=(null==(i=t.theme)||null==(i=i.breakpoints)||null==(i=i.values)?void 0:i[e])||o.VO[e];return n?(null==(r=t.theme)||null==(r=r.breakpoints)?void 0:r.unit)!=="px"?{maxWidth:`${n}${t.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:j(e)}}):null;F.filterProps=["maxWidth"];let G=(0,n.ZP)({prop:"minWidth",transform:j}),z=(0,n.ZP)({prop:"height",transform:j}),Z=(0,n.ZP)({prop:"maxHeight",transform:j}),H=(0,n.ZP)({prop:"minHeight",transform:j});(0,n.ZP)({prop:"size",cssProperty:"width",transform:j}),(0,n.ZP)({prop:"size",cssProperty:"height",transform:j}),a(N,F,G,z,Z,H,(0,n.ZP)({prop:"boxSizing"}));var U={border:{themeKey:"borders",transform:l},borderTop:{themeKey:"borders",transform:l},borderRight:{themeKey:"borders",transform:l},borderBottom:{themeKey:"borders",transform:l},borderLeft:{themeKey:"borders",transform:l},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:l},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:A},color:{themeKey:"palette",transform:I},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:I},backgroundColor:{themeKey:"palette",transform:I},p:{style:r.o3},pt:{style:r.o3},pr:{style:r.o3},pb:{style:r.o3},pl:{style:r.o3},px:{style:r.o3},py:{style:r.o3},padding:{style:r.o3},paddingTop:{style:r.o3},paddingRight:{style:r.o3},paddingBottom:{style:r.o3},paddingLeft:{style:r.o3},paddingX:{style:r.o3},paddingY:{style:r.o3},paddingInline:{style:r.o3},paddingInlineStart:{style:r.o3},paddingInlineEnd:{style:r.o3},paddingBlock:{style:r.o3},paddingBlockStart:{style:r.o3},paddingBlockEnd:{style:r.o3},m:{style:r.e6},mt:{style:r.e6},mr:{style:r.e6},mb:{style:r.e6},ml:{style:r.e6},mx:{style:r.e6},my:{style:r.e6},margin:{style:r.e6},marginTop:{style:r.e6},marginRight:{style:r.e6},marginBottom:{style:r.e6},marginLeft:{style:r.e6},marginX:{style:r.e6},marginY:{style:r.e6},marginInline:{style:r.e6},marginInlineStart:{style:r.e6},marginInlineEnd:{style:r.e6},marginBlock:{style:r.e6},marginBlockStart:{style:r.e6},marginBlockEnd:{style:r.e6},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:w},rowGap:{style:T},columnGap:{style:S},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:j},maxWidth:{style:F},minWidth:{transform:j},height:{transform:j},maxHeight:{transform:j},minHeight:{transform:j},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}}},320013:function(t,e,i){i.d(e,{Z:function(){return h}});var r=i(515680),n=i(236476),s=i(212259),a=i(186512);let o=["sx"],l=t=>{var e,i;let r={systemProps:{},otherProps:{}},n=null!=(e=null==t||null==(i=t.theme)?void 0:i.unstable_sxConfig)?e:a.Z;return Object.keys(t).forEach(e=>{n[e]?r.systemProps[e]=t[e]:r.otherProps[e]=t[e]}),r};function h(t){let e;let{sx:i}=t,{systemProps:a,otherProps:h}=l((0,n.Z)(t,o));return e=Array.isArray(i)?[a,...i]:"function"==typeof i?(...t)=>{let e=i(...t);return(0,s.P)(e)?(0,r.Z)({},a,e):a}:(0,r.Z)({},a,i),(0,r.Z)({},h,{sx:e})}},732193:function(t,e,i){i.r(e),i.d(e,{default:function(){return r.Z},extendSxProp:function(){return n.Z},unstable_createStyleFunctionSx:function(){return r.n},unstable_defaultSxConfig:function(){return s.Z}});var r=i(923337),n=i(320013),s=i(186512)},923337:function(t,e,i){i.d(e,{n:function(){return l}});var r=i(117196),n=i(628651),s=i(942051),a=i(529525),o=i(186512);function l(){function t(t,e,i,n){let o={[t]:e,theme:i},l=n[t];if(!l)return{[t]:e};let{cssProperty:h=t,themeKey:d,transform:u,style:c}=l;if(null==e)return null;if("typography"===d&&"inherit"===e)return{[t]:e};let p=(0,s.DW)(i,d)||{};return c?c(o):(0,a.k9)(o,e,e=>{let i=(0,s.Jq)(p,u,e);return(e===i&&"string"==typeof e&&(i=(0,s.Jq)(p,u,`${t}${"default"===e?"":(0,r.Z)(e)}`,e)),!1===h)?i:{[h]:i}})}return function e(i){var r;let{sx:s,theme:l={}}=i||{};if(!s)return null;let h=null!=(r=l.unstable_sxConfig)?r:o.Z;function d(i){let r=i;if("function"==typeof i)r=i(l);else if("object"!=typeof i)return i;if(!r)return null;let s=(0,a.W8)(l.breakpoints),o=Object.keys(s),d=s;return Object.keys(r).forEach(i=>{var s,o;let u=(s=r[i],o=l,"function"==typeof s?s(o):s);if(null!=u){if("object"==typeof u){if(h[i])d=(0,n.Z)(d,t(i,u,l,h));else{let t=(0,a.k9)({theme:l},u,t=>({[i]:t}));(function(...t){let e=new Set(t.reduce((t,e)=>t.concat(Object.keys(e)),[]));return t.every(t=>e.size===Object.keys(t).length)})(t,u)?d[i]=e({sx:u,theme:l}):d=(0,n.Z)(d,t)}}else d=(0,n.Z)(d,t(i,u,l,h))}}),(0,a.L7)(o,d)}return Array.isArray(s)?s.map(d):d(s)}}let h=l();h.filterProps=["sx"],e.Z=h},521531:function(t,e,i){var r=i(312284),n=i(963284);let s=(0,r.Z)();e.Z=function(t=s){return(0,n.Z)(t)}},963284:function(t,e,i){var r=i(455069),n=i(222759);e.Z=function(t=null){let e=r.useContext(n.T);return e&&0!==Object.keys(e).length?e:t}},418839:function(t,e){let i,r=t=>t;let n=(i=r,{configure(t){i=t},generate:t=>i(t),reset(){i=r}});e.Z=n},117196:function(t,e,i){i.d(e,{Z:function(){return n}});var r=i(488784);function n(t){if("string"!=typeof t)throw Error((0,r.Z)(7));return t.charAt(0).toUpperCase()+t.slice(1)}},954548:function(t,e,i){i.r(e),i.d(e,{default:function(){return r.Z}});var r=i(117196)},802239:function(t,e,i){i.r(e),i.d(e,{default:()=>r});var r=function(t,e=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,i))}},505637:function(t,e,i){i.d(e,{Z:function(){return r}});function r(t,e,i){let r={};return Object.keys(t).forEach(n=>{r[n]=t[n].reduce((t,r)=>{if(r){let n=e(r);""!==n&&t.push(n),i&&i[r]&&t.push(i[r])}return t},[]).join(" ")}),r}},212259:function(t,e,i){i.d(e,{P:function(){return s},Z:function(){return function t(e,i,a={clone:!0}){let o=a.clone?(0,r.Z)({},e):e;return s(e)&&s(i)&&Object.keys(i).forEach(r=>{n.isValidElement(i[r])?o[r]=i[r]:s(i[r])&&Object.prototype.hasOwnProperty.call(e,r)&&s(e[r])?o[r]=t(e[r],i[r],a):a.clone?o[r]=s(i[r])?function t(e){if(n.isValidElement(e)||!s(e))return e;let i={};return Object.keys(e).forEach(r=>{i[r]=t(e[r])}),i}(i[r]):i[r]:o[r]=i[r]}),o}}});var r=i(515680),n=i(455069);function s(t){if("object"!=typeof t||null===t)return!1;let e=Object.getPrototypeOf(t);return(null===e||e===Object.prototype||null===Object.getPrototypeOf(e))&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}},874305:function(t,e,i){i.r(e),i.d(e,{default:function(){return r.Z},isPlainObject:function(){return r.P}});var r=i(212259)},488784:function(t,e,i){i.d(e,{Z:function(){return r}});function r(t){let e="https://mui.com/production-error/?code="+t;for(let t=1;t<arguments.length;t+=1)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified MUI error #"+t+"; visit "+e+" for the full message."}},545273:function(t,e,i){i.r(e),i.d(e,{default:function(){return r.Z}});var r=i(488784)},960456:function(t,e,i){i.d(e,{ZP:function(){return s}});var r=i(418839);let n={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function s(t,e,i="Mui"){let a=n[e];return a?`${i}-${a}`:`${r.Z.generate(t)}-${e}`}},239109:function(t,e,i){i.d(e,{Z:function(){return n}});var r=i(960456);function n(t,e,i="Mui"){let s={};return e.forEach(e=>{s[e]=(0,r.ZP)(t,e,i)}),s}},33696:function(t,e,i){i.r(e),i.d(e,{getFunctionName:()=>s,default:()=>l});var r=i("818301");let n=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function s(t){let e=`${t}`.match(n);return e&&e[1]||""}function a(t,e=""){return t.displayName||t.name||s(t)||e}function o(t,e,i){let r=a(e);return t.displayName||(""!==r?`${i}(${r})`:i)}function l(t){if(null!=t){if("string"==typeof t)return t;if("function"==typeof t)return a(t,"Component");if("object"==typeof t)switch(t.$$typeof){case r.ForwardRef:return o(t,t.render,"ForwardRef");case r.Memo:return o(t,t.type,"memo")}}}},700623:function(t,e,i){var r=i(455069);let n="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;e.Z=n},768863:function(t,e,i){e.createFuzzySearchImpl=function(t,e){var i=e.strategy,r=void 0===i?"aggressive":i,o=e.getText,l=t.map(function(t){if(o)i=o(t);else{var i;i=[e.key?t[e.key]:t]}return[t,i.map(function(t){var e=t||"",i=(0,n.default)(e),r=new Set(i.split(" "));return[e,i,r]})]});return function(t){var e=[],i=(0,n.default)(t),o=i.split(" ");return i.length?(l.forEach(function(n){for(var a=n[0],l=n[1],h=s,u=[],c=0,p=l.length;c<p;c+=1){var g=l[c],f=d(g[0],g[1],g[2],t,i,o,r);f?(h=Math.min(h,f[0]),u.push(f[1])):u.push(null)}h<s&&e.push({item:a,score:h,matches:u})}),e.sort(a),e):[]}};e.fuzzyMatchImpl=function(t,e){var i=(0,n.default)(e),r=i.split(" "),s=(0,n.default)(t),a=new Set(s.split(" ")),o=d(t,s,a,e,i,r,"smart");return o?{item:t,score:o[0],matches:[o[1]]}:null};var r,n=function(t){return t&&t.__esModule?t:{default:t}}(i(335091)),s=Number.MAX_SAFE_INTEGER,a=function(t,e){return t.score-e.score},o=function(t,e){return t[0]-e[0]},l=new Set(" \xa0[]()-–—'\"“”".split(""));function h(t){return l.has(t)}function d(t,e,i,r,n,s,a){if(t===r)return[0,[[0,t.length-1]]];var h,d,p=r.length,g=e.length,f=n.length;if(e===n)return[.1,[[0,g-1]]];if(e.startsWith(n))return[.5,[[0,f-1]]];var m=t.indexOf(r);if(m>-1&&(h=t[m-1],l.has(h)))return[.9,[[m,m+p-1]]];var v=e.indexOf(n);if(v>-1&&(d=e[v-1],l.has(d)))return[1,[[v,v+p-1]]];var y=s.length;return y>1&&s.every(function(t){return i.has(t)})?[1.5+.2*y,s.map(function(t){var i=e.indexOf(t);return[i,i+t.length-1]}).sort(o)]:v>-1?[2,[[v,v+p-1]]]:"aggressive"===a?u(e,n):"smart"===a?c(e,n):null}function u(t,e){for(var i=t.length,r=e.length,n=0,s=e[0],a=[],o=-1,l=-2,h=0;h<i;h+=1)if(t[h]===s){if(h!==l+1&&(o>=0&&a.push([o,l]),o=h),l=h,(n+=1)===r)return a.push([o,l]),p(a,t);s=e[n]}return null}function c(t,e){for(var i=t.length,r=[],n=0,s=e[0],a=-1,o=-2;;){var h,d=t.indexOf(s,o+1);if(-1===d)break;if(0===d||(h=t[d-1],l.has(h)))a=d;else{var u=Math.min(3,e.length-n,t.length-d),c=e.slice(n,n+u);if(t.slice(d,d+u)===c)a=d;else{o+=1;continue}}for(o=a;o<i&&t[o]===s;o+=1){;n+=1,s=e[n]}if(o-=1,r.push([a,o]),n===e.length)return p(r,t)}return null}function p(t,e){var i=2;return t.forEach(function(t){var r=t[0],n=t[1],s=0===r||" "===e[r]||" "===e[r-1],a=n===e.length-1||" "===e[n]||" "===e[n+1];s&&a?i+=.2:s?i+=.4:n-r+1>=3?i+=.8:i+=1.6}),[i,t]}},317607:function(t,e,i){var r;e.default=function(t,e){return void 0===e&&(e={}),i(768863).createFuzzySearchImpl(t,e)};(function(t){return t&&t.__esModule?t:{default:t}})(i(335091)).default},335091:function(t,e){e.__esModule=!0,e.default=function(t){return t.toLowerCase().normalize("NFD").replace(i,"").replace(r,"l").replace(n,"n").trim()};var i=/[\u0300-\u036f]/g,r=/ł/g,n=/ñ/g},789034:function(t,e,i){i.d(e,{k:function(){return r}});function r(t,e){for(var i,r=arguments.length,n=Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(!t){if(void 0===e)i=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=Error(e.replace(/%s/g,function(){return n[a++]}))).name="Invariant Violation"}throw i.framesToPop=1,i}}},712003:function(t,e,i){i.d(e,{w:function(){return r}});function r(t,e,i,r){var n=i?i.call(r,t,e):void 0;if(void 0!==n)return!!n;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var s=Object.keys(t),a=Object.keys(e);if(s.length!==a.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(e),l=0;l<s.length;l++){var h=s[l];if(!o(h))return!1;var d=t[h],u=e[h];if(!1===(n=i?i.call(r,d,u,h):void 0)||void 0===n&&d!==u)return!1}return!0}},775834:function(t,e,i){i.d(e,{w:()=>tt,_:()=>l,E:()=>W,h:()=>K,s:()=>Q,C:()=>$,f:()=>J,d:()=>c,b:()=>x,m:()=>q,S:()=>N,i:()=>m,t:()=>f,r:()=>Y,e:()=>X,p:()=>g,c:()=>B,a:()=>a});let r={toVector:(t,e)=>(void 0===t&&(t=e),Array.isArray(t)?t:[t,t]),add:(t,e)=>[t[0]+e[0],t[1]+e[1]],sub:(t,e)=>[t[0]-e[0],t[1]-e[1]],addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function n(t,e,i){return 0===e||Math.abs(e)===1/0?Math.pow(t,5*i):t*e*i/(e+i*t)}function s(t,e,i,r=.15){if(0===r)return Math.max(e,Math.min(t,i));return t<e?-n(e-t,i-e,r)+e:t>i?+n(t-i,i-e,r)+i:t}function a(t,e,i){var r;return(e="symbol"==typeof(r=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?r:String(r))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function o(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)}return i}function l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach(function(e){a(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}let h={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function d(t){return t?t[0].toUpperCase()+t.slice(1):""}let u=["enter","leave"];function c(t,e="",i=!1){let r=h[t],n=r&&r[e]||e;return"on"+d(t)+d(n)+(!function(t=!1,e){return t&&!u.includes(e)}(i,n)?"":"Capture")}let p=["gotpointercapture","lostpointercapture"];function g(t){let e=t.substring(2).toLowerCase(),i=!!~e.indexOf("passive");i&&(e=e.replace("passive",""));let r=p.includes(e)?"capturecapture":"capture",n=!!~e.indexOf(r);return n&&(e=e.replace("capture","")),{device:e,capture:n,passive:i}}function f(t,e=""){let i=h[t];return t+(i&&i[e]||e)}function m(t){return"touches"in t}function v(t){return m(t)?"touch":"pointerType"in t?t.pointerType:"mouse"}function y(t){var e;return m(t)?("touchend"===(e=t).type||"touchcancel"===e.type?e.changedTouches:e.targetTouches)[0]:t}function b(t,e){try{let i=e.clientX-t.clientX,r=e.clientY-t.clientY,n=(e.clientX+t.clientX)/2,s=(e.clientY+t.clientY)/2,a=Math.hypot(i,r),o=-(180*Math.atan2(i,r))/Math.PI;return{angle:o,distance:a,origin:[n,s]}}catch(t){}return null}function x(t){var e;return Array.from((e=t).touches).filter(t=>{var i,r;return t.target===e.currentTarget||(null===(i=e.currentTarget)||void 0===i||null===(r=i.contains)||void 0===r?void 0:r.call(i,t.target))}).map(t=>t.identifier)}function _(t,e){let[i,r]=Array.from(t.touches).filter(t=>e.includes(t.identifier));return b(i,r)}function A(t){let e=y(t);return m(t)?e.identifier:e.pointerId}function w(t){let e=y(t);return[e.clientX,e.clientY]}function S(t){let{deltaX:e,deltaY:i,deltaMode:r}=t;return 1===r?(e*=40,i*=40):2===r&&(e*=800,i*=800),[e,i]}function T(t,...e){return"function"==typeof t?t(...e):t}function k(){}function B(...t){return 0===t.length?k:1===t.length?t[0]:function(){let e;for(let i of t)e=i.apply(this,arguments)||e;return e}}function C(t,e){return Object.assign({},e,t||{})}class E{constructor(t,e,i){this.ctrl=t,this.args=e,this.key=i,!this.state&&(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:t,shared:e,ingKey:i,args:r}=this;e[i]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=r,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){let e=this.state,i=this.config;!e._active&&(this.reset(),this.computeInitial(),e._active=!0,e.target=t.target,e.currentTarget=t.currentTarget,e.lastOffset=i.from?T(i.from,e):e.offset,e.offset=e.lastOffset,e.startTime=e.timeStamp=t.timeStamp)}computeValues(t){let e=this.state;e._values=t,e.values=this.config.transform(t)}computeInitial(){let t=this.state;t._initial=t._values,t.initial=t.values}compute(t){let{state:e,config:i,shared:n}=this;e.args=this.args;let a=0;if(t&&(e.event=t,i.preventDefault&&t.cancelable&&e.event.preventDefault(),e.type=t.type,n.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,n.locked=!!document.pointerLockElement,Object.assign(n,function(t){let e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){let{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s}=t;Object.assign(e,{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s})}return e}(t)),n.down=n.pressed=n.buttons%2==1||n.touches>0,a=t.timeStamp-e.timeStamp,e.timeStamp=t.timeStamp,e.elapsedTime=e.timeStamp-e.startTime),e._active){let t=e._delta.map(Math.abs);r.addTo(e._distance,t)}this.axisIntent&&this.axisIntent(t);let[o,l]=e._movement,[h,d]=i.threshold,{_step:u,values:c}=e;if(i.hasCustomTransform?(!1===u[0]&&(u[0]=Math.abs(o)>=h&&c[0]),!1===u[1]&&(u[1]=Math.abs(l)>=d&&c[1])):(!1===u[0]&&(u[0]=Math.abs(o)>=h&&Math.sign(o)*h),!1===u[1]&&(u[1]=Math.abs(l)>=d&&Math.sign(l)*d)),e.intentional=!1!==u[0]||!1!==u[1],!e.intentional)return;let p=[0,0];if(i.hasCustomTransform){let[t,e]=c;p[0]=!1!==u[0]?t-u[0]:0,p[1]=!1!==u[1]?e-u[1]:0}else p[0]=!1!==u[0]?o-u[0]:0,p[1]=!1!==u[1]?l-u[1]:0;this.restrictToAxis&&!e._blocked&&this.restrictToAxis(p);let g=e.offset,f=e._active&&!e._blocked||e.active;f&&(e.first=e._active&&!e.active,e.last=!e._active&&e.active,e.active=n[this.ingKey]=e._active,t&&(e.first&&("bounds"in i&&(e._bounds=T(i.bounds,e)),this.setup&&this.setup()),e.movement=p,this.computeOffset()));let[m,v]=e.offset,[[y,b],[x,_]]=e._bounds;e.overflow=[m<y?-1:m>b?1:0,v<x?-1:v>_?1:0],e._movementBound[0]=!!e.overflow[0]&&(!1===e._movementBound[0]?e._movement[0]:e._movementBound[0]),e._movementBound[1]=!!e.overflow[1]&&(!1===e._movementBound[1]?e._movement[1]:e._movementBound[1]);let A=e._active&&i.rubberband||[0,0];if(e.offset=function(t,[e,i],[r,n]){let[[a,o],[l,h]]=t;return[s(e,a,o,r),s(i,l,h,n)]}(e._bounds,e.offset,A),e.delta=r.sub(e.offset,g),this.computeMovement(),f&&(!e.last||a>32)){e.delta=r.sub(e.offset,g);let t=e.delta.map(Math.abs);r.addTo(e.distance,t),e.direction=e.delta.map(Math.sign),e._direction=e._delta.map(Math.sign),!e.first&&a>0&&(e.velocity=[t[0]/a,t[1]/a],e.timeDelta=a)}}emit(){let t=this.state,e=this.shared,i=this.config;if(!t._active&&this.clean(),(t._blocked||!t.intentional)&&!t._force&&!i.triggerAllEvents)return;let r=this.handler(l(l(l({},e),t),{},{[this.aliasKey]:t.values}));void 0!==r&&(t.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class M extends E{constructor(...t){super(...t),a(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=r.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=r.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){let e=this.state,i=this.config;if(!e.axis&&t){let r="object"==typeof i.axisThreshold?i.axisThreshold[v(t)]:i.axisThreshold;e.axis=function([t,e],i){let r=Math.abs(t),n=Math.abs(e);return r>n&&r>i?"x":n>r&&n>i?"y":void 0}(e._movement,r)}e._blocked=(i.lockDirection||!!i.axis)&&!e.axis||!!i.axis&&i.axis!==e.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0}}}let P=t=>t,O={enabled:(t=!0)=>t,eventOptions:(t,e,i)=>l(l({},i.shared.eventOptions),t),preventDefault:(t=!1)=>t,triggerAllEvents:(t=!1)=>t,rubberband(t=0){switch(t){case!0:return[.15,.15];case!1:return[0,0];default:return r.toVector(t)}},from:t=>"function"==typeof t?t:null!=t?r.toVector(t):void 0,transform(t,e,i){let r=t||i.shared.transform;return this.hasCustomTransform=!!r,r||P},threshold:t=>r.toVector(t,0)},R=0,I=l(l({},O),{},{axis(t,e,{axis:i}){if(this.lockDirection="lock"===i,!this.lockDirection)return i},axisThreshold:(t=R)=>t,bounds(t={}){if("function"==typeof t)return e=>I.bounds(t(e));if("current"in t)return()=>t.current;if("function"==typeof HTMLElement&&t instanceof HTMLElement)return t;let{left:e=-1/0,right:i=1/0,top:r=-1/0,bottom:n=1/0}=t;return[[e,i],[r,n]]}}),L={ArrowRight:(t,e=1)=>[t*e,0],ArrowLeft:(t,e=1)=>[-1*t*e,0],ArrowUp:(t,e=1)=>[0,-1*t*e],ArrowDown:(t,e=1)=>[0,t*e]},D="undefined"!=typeof window&&window.document&&window.document.createElement;function j(){return D&&"ontouchstart"in window}let N={isBrowser:D,gesture:function(){try{return"constructor"in GestureEvent}catch(t){return!1}}(),touch:j(),touchscreen:j()||D&&window.navigator.maxTouchPoints>1,pointer:D&&"onpointerdown"in window,pointerLock:D&&"exitPointerLock"in window.document},F=10,G={mouse:0,touch:0,pen:8},z=l(l({},I),{},{device(t,e,{pointer:{touch:i=!1,lock:r=!1,mouse:n=!1}={}}){return(this.pointerLock=r&&N.pointerLock,N.touch&&i)?"touch":this.pointerLock?"mouse":N.pointer&&!n?"pointer":N.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:i}){if(this.preventScrollDelay="number"==typeof i?i:i||void 0===i&&t?250:void 0,N.touchscreen&&!1!==i)return t||(void 0!==i?"y":void 0)},pointerCapture(t,e,{pointer:{capture:i=!0,buttons:r=1,keys:n=!0}={}}){return this.pointerButtons=r,this.keys=n,!this.pointerLock&&"pointer"===this.device&&i},threshold(t,e,{filterTaps:i=!1,tapsThreshold:n=3,axis:s}){let a=r.toVector(t,i?n:s?1:0);return this.filterTaps=i,this.tapsThreshold=n,a},swipe({velocity:t=.5,distance:e=50,duration:i=250}={}){return{velocity:this.transform(r.toVector(t)),distance:this.transform(r.toVector(e)),duration:i}},delay(t=0){switch(t){case!0:return 180;case!1:return 0;default:return t}},axisThreshold:t=>t?l(l({},G),t):G,keyboardDisplacement:(t=F)=>t});function Z(t){let[e,i]=t.overflow,[r,n]=t._delta,[s,a]=t._direction;(e<0&&r>0&&s<0||e>0&&r<0&&s>0)&&(t._movement[0]=t._movementBound[0]),(i<0&&n>0&&a<0||i>0&&n<0&&a>0)&&(t._movement[1]=t._movementBound[1])}let H=l(l({},O),{},{device(t,e,{shared:i,pointer:{touch:r=!1}={}}){if(i.target&&!N.touch&&N.gesture)return"gesture";if(N.touch&&r)return"touch";if(N.touchscreen){if(N.pointer)return"pointer";if(N.touch)return"touch"}},bounds(t,e,{scaleBounds:i={},angleBounds:r={}}){let n=t=>{let e=C(T(i,t),{min:-1/0,max:1/0});return[e.min,e.max]},s=t=>{let e=C(T(r,t),{min:-1/0,max:1/0});return[e.min,e.max]};return"function"!=typeof i&&"function"!=typeof r?[n(),s()]:t=>[n(t),s(t)]},threshold(t,e,i){return this.lockDirection="lock"===i.axis,r.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey:t=>void 0===t?"ctrlKey":t,pinchOnWheel:(t=!0)=>t}),U=l(l({},I),{},{mouseOnly:(t=!0)=>t}),V=l(l({},I),{},{mouseOnly:(t=!0)=>t}),W=new Map,$=new Map;function Y(t){W.set(t.key,t.engine),$.set(t.key,t.resolver)}let X={key:"drag",engine:class t extends M{constructor(...t){super(...t),a(this,"ingKey","dragging")}reset(){super.reset();let t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){let t=this.state;if(t._bounds instanceof HTMLElement){let e=t._bounds.getBoundingClientRect(),i=t.currentTarget.getBoundingClientRect(),r={left:e.left-i.left+t.offset[0],right:e.right-i.right+t.offset[0],top:e.top-i.top+t.offset[1],bottom:e.bottom-i.bottom+t.offset[1]};t._bounds=I.bounds(r)}}cancel(){let t=this.state;!t.canceled&&(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){let e=this.config,i=this.state;if(null!=t.buttons&&(Array.isArray(e.pointerButtons)?!e.pointerButtons.includes(t.buttons):-1!==e.pointerButtons&&e.pointerButtons!==t.buttons))return;let r=this.ctrl.setEventIds(t);e.pointerCapture&&t.target.setPointerCapture(t.pointerId),(!r||!(r.size>1)||!i._pointerActive)&&(this.start(t),this.setupPointer(t),i._pointerId=A(t),i._pointerActive=!0,this.computeValues(w(t)),this.computeInitial(),e.preventScrollAxis&&"mouse"!==v(t)?(i._active=!1,this.setupScrollPrevention(t)):e.delay>0?(this.setupDelayTrigger(t),e.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){let e=this.state;e._active=!0,e._preventScroll=!0,e._delayed=!1,this.compute(t),this.emit()}pointerMove(t){let e=this.state,i=this.config;if(!e._pointerActive)return;let n=A(t);if(void 0!==e._pointerId&&n!==e._pointerId)return;let s=w(t);if(document.pointerLockElement===t.target?e._delta=[t.movementX,t.movementY]:(e._delta=r.sub(s,e._values),this.computeValues(s)),r.addTo(e._movement,e._delta),this.compute(t),e._delayed&&e.intentional){this.timeoutStore.remove("dragDelay"),e.active=!1,this.startPointerDrag(t);return}if(i.preventScrollAxis&&!e._preventScroll){if(!e.axis)return;if(e.axis===i.preventScrollAxis||"xy"===i.preventScrollAxis){e._active=!1,this.clean();return}this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch(t){}let e=this.state,i=this.config;if(!e._active||!e._pointerActive)return;let r=A(t);if(void 0!==e._pointerId&&r!==e._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);let[n,s]=e._distance;if(e.tap=n<=i.tapsThreshold&&s<=i.tapsThreshold,e.tap&&i.filterTaps)e._force=!0;else{let[t,r]=e._delta,[n,s]=e._movement,[a,o]=i.swipe.velocity,[l,h]=i.swipe.distance,d=i.swipe.duration;if(e.elapsedTime<d){let i=Math.abs(t/e.timeDelta),d=Math.abs(r/e.timeDelta);i>a&&Math.abs(n)>l&&(e.swipe[0]=Math.sign(t)),d>o&&Math.abs(s)>h&&(e.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){let e=this.config,i=e.device;e.pointerLock&&t.currentTarget.requestPointerLock(),!e.pointerCapture&&(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,function(t){"persist"in t&&"function"==typeof t.persist&&t.persist()}(t);let e=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",e),this.eventStore.add(this.sharedConfig.window,"touch","cancel",e),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){let e=L[t.key];if(e){let i=this.state,n=t.shiftKey?10:t.altKey?.1:1;this.start(t),i._delta=e(this.config.keyboardDisplacement,n),i._keyboardActive=!0,r.addTo(i._movement,i._delta),this.compute(t),this.emit()}}keyUp(t){t.key in L&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){let e=this.config.device;t(e,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(e,"change",this.pointerMove.bind(this)),t(e,"end",this.pointerUp.bind(this)),t(e,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:z},K={key:"hover",engine:class t extends M{constructor(...t){super(...t),a(this,"ingKey","hovering")}enter(t){(!this.config.mouseOnly||"mouse"===t.pointerType)&&(this.start(t),this.computeValues(w(t)),this.compute(t),this.emit())}leave(t){if(this.config.mouseOnly&&"mouse"!==t.pointerType)return;let e=this.state;if(!e._active)return;e._active=!1;let i=w(t);e._movement=e._delta=r.sub(i,e._values),this.computeValues(i),this.compute(t),e.delta=e.movement,this.emit()}bind(t){t("pointer","enter",this.enter.bind(this)),t("pointer","leave",this.leave.bind(this))}},resolver:V},q={key:"move",engine:class t extends M{constructor(...t){super(...t),a(this,"ingKey","moving")}move(t){(!this.config.mouseOnly||"mouse"===t.pointerType)&&(this.state._active?this.moveChange(t):this.moveStart(t),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(t){this.start(t),this.computeValues(w(t)),this.compute(t),this.computeInitial(),this.emit()}moveChange(t){if(!this.state._active)return;let e=w(t),i=this.state;i._delta=r.sub(e,i._values),r.addTo(i._movement,i._delta),this.computeValues(e),this.compute(t),this.emit()}moveEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}bind(t){t("pointer","change",this.move.bind(this)),t("pointer","leave",this.moveEnd.bind(this))}},resolver:U},J={key:"pinch",engine:class t extends E{constructor(...t){super(...t),a(this,"ingKey","pinching"),a(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();let t=this.state;t._touchIds=[],t.canceled=!1,t.cancel=this.cancel.bind(this),t.turns=0}computeOffset(){let{type:t,movement:e,lastOffset:i}=this.state;"wheel"===t?this.state.offset=r.add(e,i):this.state.offset=[(1+e[0])*i[0],e[1]+i[1]]}computeMovement(){let{offset:t,lastOffset:e}=this.state;this.state.movement=[t[0]/e[0],t[1]-e[1]]}axisIntent(){let t=this.state,[e,i]=t._movement;if(!t.axis){let r=30*Math.abs(e)-Math.abs(i);r<0?t.axis="angle":r>0&&(t.axis="scale")}}restrictToAxis(t){this.config.lockDirection&&("scale"===this.state.axis?t[1]=0:"angle"===this.state.axis&&(t[0]=0))}cancel(){let t=this.state;!t.canceled&&setTimeout(()=>{t.canceled=!0,t._active=!1,this.compute(),this.emit()},0)}touchStart(t){this.ctrl.setEventIds(t);let e=this.state,i=this.ctrl.touchIds;if(e._active&&e._touchIds.every(t=>i.has(t))||i.size<2)return;this.start(t),e._touchIds=Array.from(i).slice(0,2);let r=_(t,e._touchIds);r&&this.pinchStart(t,r)}pointerStart(t){if(null!=t.buttons&&t.buttons%2!=1)return;this.ctrl.setEventIds(t),t.target.setPointerCapture(t.pointerId);let e=this.state,i=e._pointerEvents,r=this.ctrl.pointerIds;if(e._active&&Array.from(i.keys()).every(t=>r.has(t)))return;if(i.size<2&&i.set(t.pointerId,t),e._pointerEvents.size<2)return;this.start(t);let n=b(...Array.from(i.values()));n&&this.pinchStart(t,n)}pinchStart(t,e){this.state.origin=e.origin,this.computeValues([e.distance,e.angle]),this.computeInitial(),this.compute(t),this.emit()}touchMove(t){if(!this.state._active)return;let e=_(t,this.state._touchIds);e&&this.pinchMove(t,e)}pointerMove(t){let e=this.state._pointerEvents;if(e.has(t.pointerId)&&e.set(t.pointerId,t),!this.state._active)return;let i=b(...Array.from(e.values()));i&&this.pinchMove(t,i)}pinchMove(t,e){let i=this.state,r=i._values[1],n=e.angle-r,s=0;Math.abs(n)>270&&(s+=Math.sign(n)),this.computeValues([e.distance,e.angle-360*s]),i.origin=e.origin,i.turns=s,i._movement=[i._values[0]/i._initial[0]-1,i._values[1]-i._initial[1]],this.compute(t),this.emit()}touchEnd(t){this.ctrl.setEventIds(t),this.state._active&&this.state._touchIds.some(t=>!this.ctrl.touchIds.has(t))&&(this.state._active=!1,this.compute(t),this.emit())}pointerEnd(t){let e=this.state;this.ctrl.setEventIds(t);try{t.target.releasePointerCapture(t.pointerId)}catch(t){}e._pointerEvents.has(t.pointerId)&&e._pointerEvents.delete(t.pointerId),e._active&&e._pointerEvents.size<2&&(e._active=!1,this.compute(t),this.emit())}gestureStart(t){t.cancelable&&t.preventDefault();let e=this.state;!e._active&&(this.start(t),this.computeValues([t.scale,t.rotation]),e.origin=[t.clientX,t.clientY],this.compute(t),this.emit())}gestureMove(t){if(t.cancelable&&t.preventDefault(),!this.state._active)return;let e=this.state;this.computeValues([t.scale,t.rotation]),e.origin=[t.clientX,t.clientY];let i=e._movement;e._movement=[t.scale-1,t.rotation],e._delta=r.sub(e._movement,i),this.compute(t),this.emit()}gestureEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}wheel(t){let e=this.config.modifierKey;(!e||(Array.isArray(e)?!!e.find(e=>t[e]):!!t[e]))&&(this.state._active?this.wheelChange(t):this.wheelStart(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(t){this.start(t),this.wheelChange(t)}wheelChange(t){!("uv"in t)&&t.cancelable&&t.preventDefault();let e=this.state;e._delta=[-S(t)[1]/100*e.offset[0],0],r.addTo(e._movement,e._delta),Z(e),this.state.origin=[t.clientX,t.clientY],this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){let e=this.config.device;e&&(t(e,"start",this[e+"Start"].bind(this)),t(e,"change",this[e+"Move"].bind(this)),t(e,"end",this[e+"End"].bind(this)),t(e,"cancel",this[e+"End"].bind(this)),t("lostPointerCapture","",this[e+"End"].bind(this))),this.config.pinchOnWheel&&t("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:H},Q={key:"scroll",engine:class t extends M{constructor(...t){super(...t),a(this,"ingKey","scrolling")}scroll(t){!this.state._active&&this.start(t),this.scrollChange(t),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(t){t.cancelable&&t.preventDefault();let e=this.state,i=function(t){var e,i;let{scrollX:r,scrollY:n,scrollLeft:s,scrollTop:a}=t.currentTarget;return[null!==(e=null!=r?r:s)&&void 0!==e?e:0,null!==(i=null!=n?n:a)&&void 0!==i?i:0]}(t);e._delta=r.sub(i,e._values),r.addTo(e._movement,e._delta),this.computeValues(i),this.compute(t),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("scroll","",this.scroll.bind(this))}},resolver:I},tt={key:"wheel",engine:class t extends M{constructor(...t){super(...t),a(this,"ingKey","wheeling")}wheel(t){!this.state._active&&this.start(t),this.wheelChange(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(t){let e=this.state;e._delta=S(t),r.addTo(e._movement,e._delta),Z(e),this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("wheel","",this.wheel.bind(this))}},resolver:I}},868398:function(t,e,i){i.d(e,{Q:function(){return h},V:function(){return g}});var r=i(775834);let n={target(t){if(t)return()=>"current"in t?t.current:t},enabled:(t=!0)=>t,window:(t=r.S.isBrowser?window:void 0)=>t,eventOptions:({passive:t=!0,capture:e=!1}={})=>({passive:t,capture:e}),transform:t=>t},s=["target","eventOptions","window","enabled","transform"];function a(t={},e){let i={};for(let[r,n]of Object.entries(e))switch(typeof n){case"function":i[r]=n.call(i,t[r],r,t);break;case"object":i[r]=a(t[r],n);break;case"boolean":n&&(i[r]=t[r])}return i}class o{constructor(t,e){(0,r.a)(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=e}add(t,e,i,n,s){let a=this._listeners,o=(0,r.t)(e,i),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},h=(0,r._)((0,r._)({},l),s);t.addEventListener(o,n,h);let d=()=>{t.removeEventListener(o,n,h),a.delete(d)};return a.add(d),d}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class l{constructor(){(0,r.a)(this,"_timeouts",new Map)}add(t,e,i=140,...r){this.remove(t),this._timeouts.set(t,window.setTimeout(e,i,...r))}remove(t){let e=this._timeouts.get(t);e&&window.clearTimeout(e)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class h{constructor(t){(0,r.a)(this,"gestures",new Set),(0,r.a)(this,"_targetEventStore",new o(this)),(0,r.a)(this,"gestureEventStores",{}),(0,r.a)(this,"gestureTimeoutStores",{}),(0,r.a)(this,"handlers",{}),(0,r.a)(this,"config",{}),(0,r.a)(this,"pointerIds",new Set),(0,r.a)(this,"touchIds",new Set),(0,r.a)(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(t,e){e.drag&&d(t,"drag"),e.wheel&&d(t,"wheel"),e.scroll&&d(t,"scroll"),e.move&&d(t,"move"),e.pinch&&d(t,"pinch"),e.hover&&d(t,"hover")}(this,t)}setEventIds(t){return(0,r.i)(t)?(this.touchIds=new Set((0,r.b)(t)),this.touchIds):"pointerId"in t?("pointerup"===t.type||"pointercancel"===t.type?this.pointerIds.delete(t.pointerId):"pointerdown"===t.type&&this.pointerIds.add(t.pointerId),this.pointerIds):void 0}applyHandlers(t,e){this.handlers=t,this.nativeHandlers=e}applyConfig(t,e){this.config=function(t,e,i={}){let{target:o,eventOptions:l,window:h,enabled:d,transform:u}=t,c=function(t,e){if(null==t)return{};var i,r,n=function(t,e){if(null==t)return{};var i,r,n={},s=Object.keys(t);for(r=0;r<s.length;r++)i=s[r],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++){if(i=s[r],!(e.indexOf(i)>=0))Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}}return n}(t,s);if(i.shared=a({target:o,eventOptions:l,window:h,enabled:d,transform:u},n),e){let t=r.C.get(e);i[e]=a((0,r._)({shared:i.shared},c),t)}else for(let t in c){let e=r.C.get(t);e&&(i[t]=a((0,r._)({shared:i.shared},c[t]),e))}return i}(t,e,this.config)}clean(){for(let t of(this._targetEventStore.clean(),this.gestures))this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){let e;let i=this.config.shared,n={};if(!i.target||!!(e=i.target())){if(i.enabled){for(let i of this.gestures){let s=this.config[i],a=u(n,s.eventOptions,!!e);s.enabled&&new(r.E.get(i))(this,t,i).bind(a)}let s=u(n,i.eventOptions,!!e);for(let e in this.nativeHandlers)s(e,"",i=>this.nativeHandlers[e]((0,r._)((0,r._)({},this.state.shared),{},{event:i,args:t})),void 0,!0)}for(let t in n)n[t]=(0,r.c)(...n[t]);if(!e)return n;for(let t in n){let{device:i,capture:s,passive:a}=(0,r.p)(t);this._targetEventStore.add(e,i,"",n[t],{capture:s,passive:a})}}}}function d(t,e){t.gestures.add(e),t.gestureEventStores[e]=new o(t,e),t.gestureTimeoutStores[e]=new l}let u=(t,e,i)=>(n,s,a,o={},l=!1)=>{var h,d;let u=null!==(h=o.capture)&&void 0!==h?h:e.capture,c=null!==(d=o.passive)&&void 0!==d?d:e.passive,p=l?n:(0,r.d)(n,s,u);i&&c&&(p+="Passive"),t[p]=t[p]||[],t[p].push(a)},c=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function p(t,e,i,n,s,a){if(!t.has(i)||!r.E.has(n))return;let o=i+"Start",l=i+"End";s[n]=t=>{let r;return t.first&&o in e&&e[o](t),i in e&&(r=e[i](t)),t.last&&l in e&&e[l](t),r},a[n]=a[n]||{}}function g(t,e){let[i,r,n]=function(t){let e={},i={},r=new Set;for(let n in t)c.test(n)?(r.add(RegExp.lastMatch),i[n]=t[n]):e[n]=t[n];return[i,e,r]}(t),s={};return p(n,i,"onDrag","drag",s,e),p(n,i,"onWheel","wheel",s,e),p(n,i,"onScroll","scroll",s,e),p(n,i,"onPinch","pinch",s,e),p(n,i,"onMove","move",s,e),p(n,i,"onHover","hover",s,e),{handlers:s,config:e,nativeHandlers:r}}},129614:function(t,e,i){i.d(e,{Gesture:function(){return l}});var r=i(775834),n=i(868398);function s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)}return i}function a(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach(function(e){!function(t,e,i){var r;(e="symbol"==typeof(r=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?r:String(r))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}class o{constructor(t,e,i,r,s){this._target=t,this._gestureKey=r,this._ctrl=new n.Q(e),this._ctrl.applyHandlers(e,s),this._ctrl.applyConfig(a(a({},i),{},{target:t}),r),this._ctrl.effect()}destroy(){this._ctrl.clean()}setConfig(t){this._ctrl.clean(),this._ctrl.applyConfig(a(a({},t),{},{target:this._target}),this._gestureKey),this._ctrl.effect()}}let l=function(t,e,i){return([r.e,r.f,r.s,r.w,r.m,r.h].forEach(r.r),function(t,e,i){let{handlers:r,nativeHandlers:s,config:a}=(0,n.V)(e,i||{});return new o(t,r,a,void 0,s)})(t,e,i||{})}},261164:function(t,e,i){let r,n,s,a,o,l,h,d;i.d(e,{G7x:()=>uL,Cmj:()=>tF,zHd:()=>tG});var u,c,p,g,f,m,v,y,b,x,_,A,w,S,T,k,B,C,E,M,P,O,R,I,L,D,j,N,F,G,z,Z,H,U,V,W,$,Y,X,K,q,J,Q,tt,te,ti,tr,tn,ts,ta,to,tl,th,td,tu,tc,tp,tg,tf,tm,tv,ty,tb,tx,t_,tA,tw,tS,tT,tk,tB,tC,tE,tM,tP,tO,tR,tI,tL,tD,tj,tN,tF,tG,tz,tZ,tH,tU,tV,tW,t$,tY,tX,tK,tq,tJ,tQ,t0,t1,t2,t5,t3,t4,t6,t8,t7,t9,et,ee,ei,er,en,es,ea,eo,el,eh={};i.r(eh),i.d(eh,{Color:()=>n_,DEFAULT_COLORS:()=>nf,RGB:()=>nA,hexToRgb:()=>cT,hslToRgb:()=>nu,interpolateRgb:()=>cB,rgbToHex:()=>ck,rgbToHsl:()=>nc});var ed={};i.r(ed),i.d(ed,{Color:()=>yE,DEFAULT_COLORS:()=>yS,RGB:()=>yM,hexToRgb:()=>yP,hslToRgb:()=>yx,interpolateRgb:()=>yR,rgbToHex:()=>yO,rgbToHsl:()=>y_});var eu=i("954446"),ec=i.n(eu),ep=i("200007"),eg=i("269658");let ef=!1;try{ef="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){ef=!1}ef=!1;var em=function(t,e,i){let r,n,s,a,o,l,h=0,d=!1,u=!1,c=!0,p=!e&&0!==e&&ef;if("function"!=typeof t)throw TypeError("Expected a function");function g(e){let i=r,s=n;return r=n=void 0,h=e,a=t.apply(s,i)}function f(t,e){return p?(cancelAnimationFrame(o),requestAnimationFrame(t)):setTimeout(t,e)}function m(t){let i=t-l;return void 0===l||i>=e||i<0||u&&t-h>=s}function v(){let t=Date.now();if(m(t))return y(t);o=f(v,function(t){let i=t-h,r=e-(t-l);return u?Math.min(r,s-i):r}(t))}function y(t){return o=void 0,c&&r?g(t):(r=n=void 0,a)}function b(...t){let i=Date.now(),s=m(i);if(r=t,n=this,l=i,s){if(void 0===o){var c;return h=c=l,o=f(v,e),d?g(c):a}if(u)return o=f(v,e),g(l)}return void 0===o&&(o=f(v,e)),a}return e=+e||0,(0,ep.Z)(i)&&(d=!!i.leading,(u="maxWait"in i)&&(s=Math.max((0,eg.Z)(i.maxWait)?i.maxWait:0,e)),c="trailing"in i?!!i.trailing:c),b.cancel=function(){void 0!==o&&function(t){if(p)return cancelAnimationFrame(t);clearTimeout(t)}(o),h=0,r=l=n=o=void 0},b.flush=function(){return void 0===o?a:y(Date.now())},b.pending=function(){return void 0!==o},b},ev=i("464283"),ey=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},eb=t=>null!=t;function ex(t){return eb(t)?(0,ev.Z)(t)?t:[t]:[]}function e_(t){if(ey(t))return t[t.length-1]}let eA=(t,e)=>{var i;if(0===t.length)return;let r=t[0];for(let n=1;n<t.length;n++){let s=t[n];(null!==(i=null==e?void 0:e(s,r))&&void 0!==i?i:s-r>0)&&(r=s)}return r},ew=(t,e)=>{var i;if(0===t.length)return;let r=t[0];for(let n=1;n<t.length;n++){let s=t[n];(null!==(i=null==e?void 0:e(s,r))&&void 0!==i?i:s-r<0)&&(r=s)}return r};function eS(t,e){if(!(0,ev.Z)(t)||!(0,ev.Z)(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function eT(t){if(!(0,ev.Z)(t))return[t];let e=[];for(let i of t)e.push(...eT(i));return e}var ek=i("681747"),eB=i("843020"),eC=i("780114");class eE{static GenAutoIncrementId(){return eE.auto_increment_id++}}eE.auto_increment_id=0;class eM{constructor(t){this.id=eE.GenAutoIncrementId(),this.registry=t}}let eP="named",eO="inject",eR="multi_inject",eI="inversify:tagged",eL="inversify:paramtypes";var eD=function(t){var e;return function(t){let e=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,r=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",n=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,a=({__proto__:[]})instanceof Array,o=!s&&!a,l={create:s?function(){return _(Object.create(null))}:a?function(){return _({__proto__:null})}:function(){return _({})},has:o?function(t,i){return e.call(t,i)}:function(t,e){return e in t},get:o?function(t,i){return e.call(t,i)?t[i]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),d="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,u=d||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){let t={},e=[],i=function(){function t(t,e,i){this._index=0,this._keys=t,this._values=e,this._selector=i}return t.prototype["@@iterator"]=function(){return this},t.prototype[n]=function(){return this},t.prototype.next=function(){let t=this._index;if(t>=0&&t<this._keys.length){let i=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:i,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){let e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){let i=this._find(t,!0);return this._values[i]=e,this},e.prototype.delete=function(e){let i=this._find(e,!1);if(i>=0){let r=this._keys.length;for(let t=i+1;t<r;t++)this._keys[t-1]=this._keys[t],this._values[t-1]=this._values[t];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new i(this._keys,this._values,r)},e.prototype.values=function(){return new i(this._keys,this._values,s)},e.prototype.entries=function(){return new i(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[n]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function s(t,e){return e}function a(t,e){return[t,e]}}():Map,c=(d||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){return function(){function t(){this._map=new u}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[n]=function(){return this.keys()},t}()}():Set,new(d||"function"!=typeof WeakMap?function(){let t=l.create(),i=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){let e=n(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){let e=n(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return n(t,!0)[this._key]=e,this},t.prototype.delete=function(t){let e=n(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){let e;do e="@@WeakMap@@"+function(){var t;let e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(16)):s(new Uint8Array(t),t):s(Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;let i="";for(let t=0;t<16;++t){let r=e[t];4!==t&&6!==t&&8!==t||(i+="-"),r<16&&(i+="0"),i+=r.toString(16).toLowerCase()}return i}();while(l.has(t,e));return t[e]=!0,e}function n(t,r){if(!e.call(t,i)){if(!r)return;Object.defineProperty(t,i,{value:l.create()})}return t[i]}function s(t,e){for(let i=0;i<e;++i)t[i]=255*Math.random()|0;return t}}():WeakMap));function p(t,e,i){let r=c.get(t);if(f(r)){if(!i)return;r=new u,c.set(t,r)}let n=r.get(e);if(f(n)){if(!i)return;n=new u,r.set(e,n)}return n}function g(t,e,i){let r=p(e,i,!1);return!f(r)&&function(t){return!!t}(r.has(t))}function f(t){return void 0===t}function m(t){return null===t}function v(t){return"object"==typeof t?null!==t:"function"==typeof t}function y(t){let e=function(t,e){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}let i="string",n=function(t,e){let i=t[e];if(null!=i){if(!b(i))throw TypeError();return i}}(t,r);if(void 0!==n){let e=n.call(t,i);if(v(e))throw TypeError();return e}return function(t,e){if("string"===e){let e=t.toString;if(b(e)){let i=e.call(t);if(!v(i))return i}let i=t.valueOf;if(b(i)){let e=i.call(t);if(!v(e))return e}}else{let e=t.valueOf;if(b(e)){let i=e.call(t);if(!v(i))return i}let i=t.toString;if(b(i)){let e=i.call(t);if(!v(e))return e}}throw TypeError()}(t,"default"===i?"number":i)}(t,3);return"symbol"==typeof e?e:""+e}function b(t){return"function"==typeof t}function x(t){let e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h||e!==h)return e;let i=t.prototype,r=i&&Object.getPrototypeOf(i);if(null==r||r===Object.prototype)return e;let n=r.constructor;return"function"!=typeof n||n===t?e:n}function _(t){return t.__=void 0,delete t.__,t}t("defineMetadata",function(t,e,i,r){if(!v(i))throw TypeError();return function(t,e,i,r){p(i,r,!0).set(t,e)}(t,e,i,r)}),t("hasMetadata",function(t,e,i){if(!v(e))throw TypeError();return f(i)||(i=y(i)),function t(e,i,r){if(g(e,i,r))return!0;let n=x(i);return!function(t){return null===t}(n)&&t(e,n,r)}(t,e,i)}),t("hasOwnMetadata",function(t,e,i){if(!v(e))throw TypeError();return f(i)||(i=y(i)),g(t,e,i)}),t("getMetadata",function(t,e,i){if(!v(e))throw TypeError();return f(i)||(i=y(i)),function t(e,i,r){if(g(e,i,r))return function(t,e,i){let r=p(e,i,!1);if(!f(r))return r.get(t)}(e,i,r);let n=x(i);return function(t){return null===t}(n)?void 0:t(e,n,r)}(t,e,i)})}(function(i,r){"function"!=typeof t[i]&&Object.defineProperty(t,i,{configurable:!0,writable:!0,value:r}),e&&e(i,r)}),t}({});function ej(){return function(t){return eD.defineMetadata(eL,null,t),t}}class eN{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===eP?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}function eF(t){return(e,i,r)=>{var n,s,a,o,l,h,d,u;let c,p;n=e,s=0,a=r,o=t,l=eI,h=n,d=a.toString(),u=o,c={},eD.hasOwnMetadata(l,h)&&(c=eD.getMetadata(l,h)),void 0===(p=c[d])&&(p=[]),p.push(u),c[d]=p,eD.defineMetadata(l,c,h)}}function eG(t){return e=>(i,r,n)=>eF(new eN(t,e))(i,r,n)}let ez=eG(eO);function eZ(t){return eF(new eN(eP,t))}let eH=Symbol("ContributionProvider");class eU{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function eV(t,e){t(eH).toDynamicValue(({container:t})=>new eU(e,t)).inSingletonScope().whenTargetNamed(e)}class eW{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){let i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter(t=>t.name!==i&&(!e||t.fn===e)))}_parseOptions(t,e,i){let r;if("string"==typeof e)r={name:e.trim()};else if("object"!=typeof e||null===e)throw Error("Invalid tap options");if("string"!=typeof r.name||""===r.name)throw Error("Missing name for tap");return Object.assign({type:t,fn:i},r)}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let r=this.taps.length;for(;r>0;){r--;let t=this.taps[r];this.taps[r+1]=t;let n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){r++;break}}this.taps[r]=t}}class e$ extends eW{call(...t){this.taps.map(t=>t.fn).forEach(e=>e(...t))}}let eY=Symbol.for("EnvContribution"),eX=Symbol.for("VGlobal");var eK=function(t,e){return function(i,r){e(i,r,t)}};let eq=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=eE.GenAutoIncrementId(),this.hooks={onSetEnv:new e$(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){let e=[];if(this.contributions.getContributions().forEach(i=>{let r=i.configure(this,t);r&&r.then&&e.push(r)}),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){let i=this._env;this._env=t;let r=this.bindContribution(e);if(r&&r.then)return r.then(()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)});this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}};eq=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),eK(0,ez(eH)),eK(0,eZ(eY)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],eq);var eJ=i("791228");function eQ(t){return Math.PI/180*t}function e0(t){return 180*t/Math.PI}let e1=(t=0)=>{if(t<0)for(;t<-eJ.BZ;)t+=eJ.BZ;else if(t>0)for(;t>eJ.BZ;)t-=eJ.BZ;return t};function e2(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function e5(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}class e3{constructor(t=1,e=0,i=0,r=1,n=0,s=0){this.a=t,this.b=e,this.c=i,this.d=r,this.e=n,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,r,n,s){return!(this.e!==n||this.f!==s||this.a!==t||this.d!==r||this.b!==e||this.c!==i)}setValue(t,e,i,r,n,s){return this.a=t,this.b=e,this.c=i,this.d=r,this.e=n,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){let t=this.a,e=this.b,i=this.c,r=this.d,n=this.e,s=this.f,a=new e3,o=t*r-e*i;return a.a=r/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*s-r*n)/o,a.f=-(t*s-e*n)/o,a}rotate(t){let e=Math.cos(t),i=Math.sin(t),r=this.a*e+this.c*i,n=this.b*e+this.d*i,s=-(this.a*i)+this.c*e,a=-(this.b*i)+this.d*e;return this.a=r,this.b=n,this.c=s,this.d=a,this}rotateByCenter(t,e,i){let r=Math.cos(t),n=Math.sin(t),s=r*this.a-n*this.b,a=n*this.a+r*this.b,o=r*this.c-n*this.d,l=n*this.c+r*this.d,h=r*this.e-n*this.f+((1-r)*e+n*i),d=n*this.e+r*this.f+((1-r)*i-n*e);return this.a=s,this.b=a,this.c=o,this.d=l,this.e=h,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,r,n,s){return this.multiply(t,e,i,r,n,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){let{a:t,b:e,c:i,d:r,e:n,f:s}=this;return this.a=e,this.b=t,this.c=r,this.d=i,this.e=s,this.f=n,this}multiply(t,e,i,r,n,s){let a=this.a,o=this.b,l=this.c,h=this.d,d=a*n+l*s+this.e,u=o*n+h*s+this.f;return this.a=a*t+l*e,this.b=o*t+h*e,this.c=a*i+l*r,this.d=o*i+h*r,this.e=d,this.f=u,this}interpolate(t,e){let i=new e3;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){let{a:i,b:r,c:n,d:s,e:a,f:o}=this,l=i*s-r*n,{x:h,y:d}=t;e.x=s/l*h+-n/l*d+(n*o-s*a)/l,e.y=-r/l*h+i/l*d+-(i*o-r*a)/l}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new e3(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){let t=this.a,e=this.b,i=this.c,r=this.d,n=t*r-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){let a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=n/a,s.skewX=(t*i+e*r)/n,s.skewY=0}else if(0!==i||0!==r){let a=Math.sqrt(i*i+r*r);s.rotateDeg=Math.PI/2-(r>0?Math.acos(-i/a):-Math.acos(i/a)),s.scaleX=n/a,s.scaleY=a,s.skewX=0,s.skewY=(t*i+e*r)/n}return s.rotateDeg=e0(s.rotateDeg),s}}let e4=eJ.BZ-1e-8;class e6{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,r,n,s){if(Math.abs(n-r)>e4)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,d=1/0,u=-Infinity,c=1/0,p=-Infinity;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),l<d&&(d=l),l>u&&(u=l),h<c&&(c=h),h>p&&(p=h)}if(g(r),g(n),n!==r){if((r%=eJ.BZ)<0&&(r+=eJ.BZ),(n%=eJ.BZ)<0&&(n+=eJ.BZ),n<r&&(s=!s,a=r,r=n,n=a),s)for(n-=eJ.BZ,a=r-r%eJ.ou,o=0;o<4&&a>n;++o,a-=eJ.ou)g(a);else for(a=r-r%eJ.ou+eJ.ou,o=0;o<4&&a<n;++o,a+=eJ.ou)g(a)}this.bounds.add(t+d,e+c),this.bounds.add(t+u,e+p)}arcTo(t,e,i,r,n){throw Error("不支持arcTo")}bezierCurveTo(t,e,i,r,n,s){this.bounds.add(t,e),this.bounds.add(i,r),this.bounds.add(n,s)}closePath(){}ellipse(){throw Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,r){this.bounds.add(t,e),this.bounds.add(i,r)}rect(t,e,i,r){this.bounds.add(t,e),this.bounds.add(t+i,e+r)}clear(){this.bounds.clear()}release(...t){}}function e8(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function e7(t,e,i,r){let n=t[0],s=e[0],a=i[0],o=r[0];return s<n&&([n,s]=[s,n]),o<a&&([o,a]=[a,o]),!(s<a||o<n)&&(n=t[1],s=e[1],a=i[1],o=r[1],s<n&&([n,s]=[s,n]),o<a&&([o,a]=[a,o]),!(s<a||o<n))}(of=oM||(oM={}))[of.NONE=0]="NONE",of[of.BBOX1=1]="BBOX1",of[of.BBOX2=2]="BBOX2";let e9=(t,e,i)=>{let r=t.x1,n=t.x2,s=t.y1,a=t.y2,o=e.x1,l=e.x2,h=e.y1,d=e.y2;return i&&(r>n&&([r,n]=[n,r]),s>a&&([s,a]=[a,s]),o>l&&([o,l]=[l,o]),h>d&&([h,d]=[d,h])),{x11:r,x12:n,y11:s,y12:a,x21:o,x22:l,y21:h,y22:d}};function it(t,e,i){if(t&&e){if(!i)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);let{x11:r,x12:n,y11:s,y12:a,x21:o,x22:l,y21:h,y22:d}=e9(t,e,!0);return!(r>l||n<o||s>d||a<h)}return!0}function ie(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function ii({x:t,y:e},i,r={x:0,y:0}){return{x:(t-r.x)*Math.cos(i)-(e-r.y)*Math.sin(i)+r.x,y:(t-r.x)*Math.sin(i)+(e-r.y)*Math.cos(i)+r.y}}function ir(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function is(t,e){let i=e?eQ(t.angle):t.angle,r=ir(t);return[ii({x:t.x1,y:t.y1},i,r),ii({x:t.x2,y:t.y1},i,r),ii({x:t.x2,y:t.y2},i,r),ii({x:t.x1,y:t.y2},i,r)]}function ia(t,e,i){let{x1:r,y1:n,x2:s,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f)):(t.clear(),t.add(i.a*r+i.c*n+i.e,i.b*r+i.d*n+i.f),t.add(i.a*s+i.c*n+i.e,i.b*s+i.d*n+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f)),e}class io{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new io(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,i=0,r=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=r,this}set(t=0,e=0,i=0,r=0){return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this}add(t=0,e=0){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return(0,ev.Z)(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){let r=this.rotatedPoints(t,e,i);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])}scale(t=0,e=0,i=0,r=0){let n=this.scalePoints(t,e,i,r);return this.clear().add(n[0],n[1]).add(n[2],n[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(t=0,e=0){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return ia(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){let{x1:r,y1:n,x2:s,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,d=i-e*l-i*o;return[o*r-l*n+h,l*r+o*n+d,o*r-l*a+h,l*r+o*a+d,o*s-l*n+h,l*s+o*n+d,o*s-l*a+h,l*s+o*a+d]}scalePoints(t,e,i,r){let{x1:n,y1:s,x2:a,y2:o}=this;return[t*n+(1-t)*i,e*s+(1-e)*r,t*a+(1-t)*i,e*o+(1-e)*r]}}class il extends io{}class ih{constructor(){this.curves=[],this.bounds=new il}getCurveLengths(){return this.curves.map(t=>t.getLength())}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}let id=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,iu={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},ic={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};(om=oP||(oP={}))[om.NONE=0]="NONE",om[om.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",om[om.UPDATE_SHAPE=2]="UPDATE_SHAPE",om[om.CLEAR_SHAPE=253]="CLEAR_SHAPE",om[om.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",om[om.INIT=179]="INIT",om[om.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",om[om.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",om[om.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",om[om.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",om[om.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",om[om.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",om[om.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",om[om.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",(ov=oO||(oO={}))[ov.GLOBAL=1]="GLOBAL",ov[ov.LOCAL=16]="LOCAL",ov[ov.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",ov[ov.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",(oy=oR||(oR={}))[oy.INIT=0]="INIT",oy[oy.DEFAULT=1]="DEFAULT",oy[oy.STATE=2]="STATE",oy[oy.ANIMATE_BIND=10]="ANIMATE_BIND",oy[oy.ANIMATE_PLAY=11]="ANIMATE_PLAY",oy[oy.ANIMATE_START=12]="ANIMATE_START",oy[oy.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",oy[oy.ANIMATE_END=14]="ANIMATE_END",oy[oy.TRANSLATE=20]="TRANSLATE",oy[oy.TRANSLATE_TO=21]="TRANSLATE_TO",oy[oy.SCALE=22]="SCALE",oy[oy.SCALE_TO=23]="SCALE_TO",oy[oy.ROTATE=24]="ROTATE",oy[oy.ROTATE_TO=25]="ROTATE_TO",(ob=oI||(oI={}))[ob.INITIAL=0]="INITIAL",ob[ob.RUNNING=1]="RUNNING",ob[ob.PAUSED=2]="PAUSED",ob[ob.END=3]="END",(ox=oL||(oL={}))[ox.NORMAL=0]="NORMAL",ox[ox.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",(o_=oD||(oD={})).wait="wait",o_.from="from",o_.to="to",o_.customAnimate="customAnimate",(oA=oj||(oj={}))[oA.ROW=1]="ROW",oA[oA.COLUMN=2]="COLUMN",(ow=oN||(oN={}))[ow.CubicBezierCurve=0]="CubicBezierCurve",ow[ow.QuadraticBezierCurve=1]="QuadraticBezierCurve",ow[ow.ArcCurve=2]="ArcCurve",ow[ow.LineCurve=3]="LineCurve",ow[ow.EllipseCurve=4]="EllipseCurve",ow[ow.MoveCurve=5]="MoveCurve",(oS=oF||(oF={}))[oS.beforeFillStroke=0]="beforeFillStroke",oS[oS.afterFillStroke=1]="afterFillStroke";function ip(t,e,i,r){let n=function(t,e,i,r,n,s,a,o,l){let h=eQ(a),d=Math.sin(h),u=Math.cos(h),c=u*(o-t)*.5+d*(l-e)*.5,p=u*(l-e)*.5-d*(o-t)*.5,g=c*c/((i=Math.abs(i))*i)+p*p/((r=Math.abs(r))*r);g>1&&(i*=g=Math.sqrt(g),r*=g);let f=u/i,m=d/i,v=-d/r,y=u/r,b=f*o+m*l,x=v*o+y*l,_=f*t+m*e,A=v*t+y*e,w=1/((_-b)*(_-b)+(A-x)*(A-x))-.25;w<0&&(w=0);let S=Math.sqrt(w);s===n&&(S=-S);let T=.5*(b+_)-S*(A-x),k=.5*(x+A)+S*(_-b),B=Math.atan2(x-k,b-T),C=Math.atan2(A-k,_-T)-B;C<0&&1===s?C+=eJ.BZ:C>0&&0===s&&(C-=eJ.BZ);let E=Math.ceil(Math.abs(C/(eJ.ou+.001))),M=[];for(let t=0;t<E;++t){let e=B+t*C/E,n=B+(t+1)*C/E;M[t]=[T,k,e,n,i,r,d,u]}return M}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,i);for(let e=0;e<n.length;++e){let i=function(t){let e=t[0],i=t[1],r=t[2],n=t[3],s=t[4],a=t[5],o=t[6],l=t[7],h=l*s,d=-o*a,u=o*s,c=l*a,p=Math.cos(r),g=Math.sin(r),f=Math.cos(n),m=Math.sin(n),v=.5*(n-r),y=Math.sin(.5*v),b=8/3*y*y/Math.sin(v),x=e+p-b*g,_=i+g+b*p,A=e+f,w=i+m,S=A+b*m,T=w-b*f;return[h*x+d*_,u*x+c*_,h*S+d*T,u*S+c*T,h*A+d*w,u*A+c*w]}(n[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}let ig=(t,e,i,r,n,s,a)=>{let o=4*Math.tan(Math.abs(i-e)/4)/3,l=i<e?-1:1,h=Math.cos(e),d=Math.sin(e),u=Math.cos(i),c=Math.sin(i),p=u*s+r,g=c*a+n,f=s*o*l,m=a*o*l;t.push(h*s+r-f*d,d*a+n+m*h,p+f*c,g-m*u,p,g)},im=[(t,e,i,r,n,s,a)=>e.arc(t[1]*n+i,t[2]*s+r,t[3]*(n+s)/2,t[4],t[5],t[6],a),(t,e,i,r,n,s,a)=>e.arcTo(t[1]*n+i,t[2]*s+r,t[3]*n+i,t[4]*s+r,t[5]*(n+s)/2,a),(t,e,i,r,n,s,a)=>e.bezierCurveTo(t[1]*n+i,t[2]*s+r,t[3]*n+i,t[4]*s+r,t[5]*n+i,t[6]*s+r,a),(t,e,i,r)=>e.closePath(),(t,e,i,r,n,s)=>e.ellipse(t[1]*n+i,t[2]*s+r,t[3]*n,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,i,r,n,s,a)=>e.lineTo(t[1]*n+i,t[2]*s+r,a),(t,e,i,r,n,s,a)=>e.moveTo(t[1]*n+i,t[2]*s+r,a),(t,e,i,r,n,s,a)=>e.quadraticCurveTo(t[1]*n+i,t[2]*s+r,t[3]*n+i,t[4]*s+r,a),(t,e,i,r,n,s,a)=>e.rect(t[1]*n+i,t[2]*s+r,t[3]*n,t[4]*s,a)];function iv(t,e,i=0,r=0,n=1,s=1,a){for(let o=0;o<t.length;o++){let l=t[o];im[l[0]](l,e,i,r,n,s,a)}}var iy=i("131045");class ib{constructor(t=0,e=0,i,r){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=r}clone(){return new ib(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return(0,iy.Z)(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return(0,iy.Z)(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw Error("暂不支持")}div(t){throw Error("暂不支持")}}class ix{static distancePP(t,e){return(0,eJ._b)((0,eJ.sQ)(t.x-e.x,2)+(0,eJ.sQ)(t.y-e.y,2))}static distanceNN(t,e,i,r){return(0,eJ._b)((0,eJ.sQ)(t-i,2)+(0,eJ.sQ)(e-r,2))}static distancePN(t,e,i){return(0,eJ._b)((0,eJ.sQ)(e-t.x,2)+(0,eJ.sQ)(i-t.y,2))}static pointAtPP(t,e,i){return new ib((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}class i_{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function iA(t,e,i,r,n){let s=1-n;return s*s*s*t+3*e*n*s*s+3*i*n*n*s+r*n*n*n}function iw(t,e,i,r,n){let s=iA(t.x,e.x,i.x,r.x,n);return new ib(s,iA(t.y,e.y,i.y,r.y,n))}function iS(t,e){let{p0:i,p1:r,p2:n,p3:s}=t,a=iw(i,r,n,s,e),o=ix.pointAtPP(i,r,e),l=ix.pointAtPP(r,n,e),h=ix.pointAtPP(n,s,e),d=ix.pointAtPP(o,l,e),u=ix.pointAtPP(l,h,e);return[new iT(i,o,d,a),new iT(a,u,h,s)]}class iT extends i_{constructor(t,e,i,r){super(),this.type=oN.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=r}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return iw(this.p0,this.p1,this.p2,this.p3,t);throw Error("defined为false的点不能getPointAt")}calcLength(){var t,e,i,r,n;return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,r=this.p3,n=0,function(t,e){let i=0,r=t.length;for(let n=0;n<r;n++){let s=t[n],a=e[n],o=t[(n+1)%r],l=e[(n+1)%r];i+=ix.distanceNN(s,a,o,l)}return i/2}([t.x,e.x,i.x,r.x],[t.y,e.y,i.y,r.y])):60}calcProjLength(t){return t===oj.ROW?(0,eJ.Wn)(this.p0.x-this.p3.x):t===oj.COLUMN?(0,eJ.Wn)(this.p0.y-this.p3.y):0}getAngleAt(t){let e=(0,eJ.Fp)(t-.01,0),i=(0,eJ.VV)(t+.01,1),r=this.getPointAt(e),n=this.getPointAt(i);return(0,eJ.fv)(n.y-r.y,n.x-r.x)}}function ik(t,e){let{p0:i,p1:r}=t,n=ix.pointAtPP(i,r,e);return[new iB(i,n),new iB(n,r)]}class iB extends i_{constructor(t,e){super(),this.type=oN.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return ix.pointAtPP(this.p0,this.p1,t);throw Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=(0,eJ.fv)(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?ix.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===oj.ROW?(0,eJ.Wn)(this.p0.x-this.p1.x):t===oj.COLUMN?(0,eJ.Wn)(this.p0.y-this.p1.y):0}}class iC{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,r,n,s,a,o){let l=new iT(new ib(this._lastX,this._lastY),new ib(t,e),new ib(i,r),new ib(n,s));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=n,this._lastY=s,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;let t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw Error("SegContext不支持调用ellipse")}lineTo(t,e,i,r){let n=this.addLinearCurve(t,e,i,this._lastOriginP,r);this.curves.push(n),this._lastX=t,this._lastY=e,this._lastOriginP=r}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,r){throw Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,r,n){let s=new iB(new ib(this._lastX,this._lastY),new ib(t,e));return s.originP1=r,s.originP2=n,s.defined=i,s}getPointAt(t){throw Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===oj.COLUMN){if(!this.curves.length)return 0;let t=this.curves[0],i=this.curves[this.curves.length-1],r=null!==(e=i.p3)&&void 0!==e?e:i.p1;return(0,eJ.Wn)(t.p0.y-r.y)}if(t===oj.ROW){if(!this.curves.length)return 0;let t=this.curves[0],e=this.curves[this.curves.length-1],r=null!==(i=e.p3)&&void 0!==i?i:e.p1;return(0,eJ.Wn)(t.p0.x-r.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((t,e)=>t+e.getLength(),0)),this.length}}class iE extends iC{bezierCurveTo(t,e,i,r,n,s,a,o){return super.bezierCurveTo(e,t,r,i,s,n,a,o)}lineTo(t,e,i,r){return super.lineTo(e,t,i,r)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function iM(t,e,i=1){let r=!1;for(let i=0,n=e.length;i<=n;i++)i>=n===r&&((r=!r)?t.lineStart():t.lineEnd()),r&&t.point(e[i])}function iP(t,e,i){let r=null!=e?e:(0,eJ.Wn)(i[i.length-1].x-i[0].x)>(0,eJ.Wn)(i[i.length-1].y-i[0].y)?oj.ROW:oj.COLUMN;return"monotoneY"===t?new iE(t,r):new iC(t,r)}class iO{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function iR(t,e={}){let{direction:i,startPoint:r}=e;if(t.length<2-Number(!!r))return null;let n=iP("linear",i,t);return function(t,e){iM(t,e,1)}(new iO(n,r),t),n}function iI(t,e,i,r,n){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,r,t.lastPoint1)}class iL{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&iI(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:iI(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function iD(t,e={}){let{direction:i,startPoint:r}=e;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return iR(t,e);let n=iP("basis",i,t);return iM(new iL(n,r),t,2),n}function ij(t){return t<0?-1:1}function iN(t,e,i){let r=t._x1-t._x0,n=e-t._x1,s=(t._y1-t._y0)/(r||Number(n<0&&-0)),a=(i-t._y1)/(n||Number(r<0&&-0)),o=(s*n+a*r)/(r+n);return((s<0?-1:1)+(a<0?-1:1))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function iF(t,e){let i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function iG(t,e,i,r,n){let s=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-s)/3;t.context.bezierCurveTo(s+h,a+h*e,o-h,l-h*i,o,l,r,t.lastPoint1)}class iz{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:iG(this,this._t0,iF(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN,i=t.x,r=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,r,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,r,t);break;case 1:this._point=2;break;case 2:this._point=3,iG(this,iF(this,e=iN(this,i,r)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2,t);break;default:iG(this,this._t0,e=iN(this,i,r),!1!==this._lastDefined1&&!1!==this._lastDefined2,t)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=r,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class iZ extends iz{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function iH(t,e={}){let{direction:i,startPoint:r}=e;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return iR(t,e);let n=iP("monotoneX",i,t);return iM(new iz(n,r),t,2),n}function iU(t,e={}){let{direction:i,startPoint:r}=e;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return iR(t,e);let n=iP("monotoneY",i,t);return iM(new iZ(n,r),t,2),n}class iV{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){let e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{let r=this._x*(1-this._t)+e*this._t;this.context.lineTo(r,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(r,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function iW(t,e,i={}){let{direction:r,startPoint:n}=i;if(t.length<2-Number(!!n))return null;let s=new iC("step",null!=r?r:(0,eJ.Wn)(t[t.length-1].x-t[0].x)>(0,eJ.Wn)(t[t.length-1].y-t[0].y)?oj.ROW:oj.COLUMN);return function(t,e){iM(t,e,1)}(new iV(s,e,n),t),s}class i$ extends iO{lineEnd(){this.context.closePath()}}function iY(t,e={}){let{direction:i,startPoint:r}=e;if(t.length<2-Number(!!r))return null;let n=iP("linear",i,t);return function(t,e){iM(t,e,1)}(new i$(n,r),t),n}function iX(t,e,i){switch(e){case"linear":default:return iR(t,i);case"basis":return iD(t,i);case"monotoneX":return iH(t,i);case"monotoneY":return iU(t,i);case"step":return iW(t,.5,i);case"stepBefore":return iW(t,0,i);case"stepAfter":return iW(t,1,i);case"linearClosed":return iY(t,i)}}class iK extends ih{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new e6(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([ic.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([ic.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,r){return this.commandList.push([ic.Q,t,e,i,r]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,r),this}bezierCurveTo(t,e,i,r,n,s){return this.commandList.push([ic.C,t,e,i,r,n,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,r,n,s),this}arcTo(t,e,i,r,n){return this.commandList.push([ic.AT,t,e,i,r,n]),this._ctx&&this._ctx.arcTo(t,e,i,r,n),this}ellipse(t,e,i,r,n,s,a,o){return this.commandList.push([ic.E,t,e,i,r,n,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,r,n,s,a,o),this}rect(t,e,i,r){return this.commandList.push([ic.R,t,e,i,r]),this._ctx&&this._ctx.rect(t,e,i,r),this}arc(t,e,i,r,n,s){return this.commandList.push([ic.A,t,e,i,r,n,s]),this._ctx&&this._ctx.arc(t,e,i,r,n,s),this}closePath(){return this.commandList.push([ic.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){let t=[];t[ic.M]=t=>`M${t[1]} ${t[2]}`,t[ic.L]=t=>`L${t[1]} ${t[2]}`,t[ic.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[ic.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ic.A]=t=>{let e=[];ig(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[ic.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ic.Z]=t=>"Z",this.toStringCbList=t}let t=this.toStringCbList,e="";return this.commandList.forEach(i=>{e+=t[i[0]](i)}),e}fromString(t,e,i,l,h){this.clear();let d=function(t){let e,i;if(!t)return[];let l=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===l)return[];let h=[];for(let t=0,d=l.length;t<d;t++)if(n=(r=l[t]).slice(1),e=[s=r[0]],null!==(i=n.match(id))){for(let t=0,r=i.length;t<r;t++)Number.isNaN(a=parseFloat(i[t]))||e.push(a);if(o=iu[s],e.length-1>o){let t;for(let i=1,r=e.length;i<r;i+=o){t=[s];for(let r=i,n=i+o;r<n;r++)t.push(e[r]);h.push(t)}}else h.push(e)}else h.push(e);return h}(t);return this._runCommandStrList(d,e,i,l,h),this._updateBounds(),this}fromLine(t){let{points:e,curveType:i,clipRangeByDimension:r}=t.attribute;if(!e)return;let n=iX(e,i);"x"===r?this.direction=oj.ROW:"y"===r?this.direction=oj.COLUMN:"auto"===r&&(this.direction=n.direction),this.curves=n.curves}fromCustomPath2D(t,e,i,r,n){return this.clear(),this._runCommandList(t.commandList,e,i,r,n),this._updateBounds(),this}transform(t,e,i,r){let n=this.commandList;if(!this.transformCbList){let t=[];t[ic.M]=this.moveToTransform,t[ic.L]=this.lineToTransform,t[ic.Q]=this.quadraticCurveToTransform,t[ic.C]=this.bezierCurveToTransform,t[ic.AT]=this.arcToTransform,t[ic.E]=this.ellipseTransform,t[ic.R]=this.rectTransform,t[ic.A]=this.arcTransform,t[ic.Z]=this.closePathTransform,this.transformCbList=t}n.forEach(n=>{this.transformCbList[n[0]](n,t,e,i,r)}),this._updateBounds()}moveToTransform(t,e,i,r,n){t[1]=t[1]*r+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,r,n){t[1]=t[1]*r+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,r,n){t[1]=t[1]*r+e,t[2]=t[2]*n+i,t[3]=t[3]*r+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,r,n){t[1]=t[1]*r+e,t[2]=t[2]*n+i,t[3]=t[3]*r+e,t[4]=t[4]*n+i,t[5]=t[5]*r+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,r,n){t[1]=t[1]*r+e,t[2]=t[2]*n+i,t[3]=t[3]*r+e,t[4]=t[4]*n+i,t[5]=t[5]*(r+n)/2}ellipseTransform(t,e,i,r,n){t[1]=t[1]*r+e,t[2]=t[2]*n+i,t[3]=t[3]*r,t[4]=t[4]*n}rectTransform(t,e,i,r,n){t[1]=t[1]*r+e,t[2]=t[2]*n+i,t[3]=t[3]*r,t[4]=t[4]*n}arcTransform(t,e,i,r,n){t[1]=t[1]*r+e,t[2]=t[2]*n+i,t[3]=t[3]*(r+n)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,r=1,n=1){let s,a,o,l,h,d=null,u=0,c=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(s=t[f],1===r&&1===n||(s=function(t,e,i){let r=iq[0]=t[0];if("a"===r||"A"===r)iq[1]=e*t[1],iq[2]=i*t[2],iq[3]=t[3],iq[4]=t[4],iq[5]=t[5],iq[6]=e*t[6],iq[7]=i*t[7];else if("h"===r||"H"===r)iq[1]=e*t[1];else if("v"===r||"V"===r)iq[1]=i*t[1];else for(let r=1,n=t.length;r<n;++r)iq[r]=(r%2==1?e:i)*t[r];return iq}(s,r,n)),s[0]){case"l":u+=s[1],c+=s[2],this.lineTo(u+e,c+i);break;case"L":u=s[1],c=s[2],this.lineTo(u+e,c+i);break;case"h":u+=s[1],this.lineTo(u+e,c+i);break;case"H":u=s[1],this.lineTo(u+e,c+i);break;case"v":c+=s[1],this.lineTo(u+e,c+i);break;case"V":c=s[1],this.lineTo(u+e,c+i);break;case"m":u+=s[1],c+=s[2],this.moveTo(u+e,c+i);break;case"M":u=s[1],c=s[2],this.moveTo(u+e,c+i);break;case"c":a=u+s[5],o=c+s[6],p=u+s[3],g=c+s[4],this.bezierCurveTo(u+s[1]+e,c+s[2]+i,p+e,g+i,a+e,o+i),u=a,c=o;break;case"C":u=s[5],c=s[6],p=s[3],g=s[4],this.bezierCurveTo(s[1]+e,s[2]+i,p+e,g+i,u+e,c+i);break;case"s":a=u+s[3],o=c+s[4],p=2*u-p,g=2*c-g,this.bezierCurveTo(p+e,g+i,u+s[1]+e,c+s[2]+i,a+e,o+i),p=u+s[1],g=c+s[2],u=a,c=o;break;case"S":a=s[3],o=s[4],p=2*u-p,g=2*c-g,this.bezierCurveTo(p+e,g+i,s[1]+e,s[2]+i,a+e,o+i),u=a,c=o,p=s[1],g=s[2];break;case"q":a=u+s[3],o=c+s[4],p=u+s[1],g=c+s[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,c=o;break;case"Q":a=s[3],o=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,a+e,o+i),u=a,c=o,p=s[1],g=s[2];break;case"t":a=u+s[1],o=c+s[2],null===d[0].match(/[QqTt]/)?(p=u,g=c):"t"===d[0]?(p=2*u-l,g=2*c-h):"q"===d[0]&&(p=2*u-p,g=2*c-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,c=o,p=u+s[1],g=c+s[2];break;case"T":a=s[1],o=s[2],p=2*u-p,g=2*c-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,c=o;break;case"a":ip(this,u+e,c+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+e,s[7]+c+i]),u+=s[6],c+=s[7];break;case"A":ip(this,u+e,c+i,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+i]),u=s[6],c=s[7];break;case"z":case"Z":this.closePath()}d=s}}_runCommandList(t,e=0,i=0,r=1,n=1){if(0!==e||0!==i||1!==r||1!==n)for(let s=0,a=t.length;s<a;++s){let a=t[s].slice();switch(a[0]){case ic.L:this.lineToTransform(a,e,i,r,n);break;case ic.M:this.moveToTransform(a,e,i,r,n);break;case ic.C:this.bezierCurveToTransform(a,e,i,r,n);break;case ic.Q:this.quadraticCurveToTransform(a,e,i,r,n);break;case ic.A:this.arcToTransform(a,e,i,r,n);break;case ic.E:this.ellipseTransform(a,e,i,r,n);break;case ic.R:this.rectTransform(a,e,i,r,n);break;case ic.AT:this.arcToTransform(a,e,i,r,n);break;case ic.Z:this.closePath()}}else this.commandList=t.map(t=>t.slice())}_updateBounds(){this.bounds.clear(),iv(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===oj.COLUMN){if(!this.curves.length)return 0;let t=this.curves[0],e=this.curves[this.curves.length-1];return(0,eJ.Wn)(t.p0.y-e.p1.y)}if(this.direction===oj.ROW){if(!this.curves.length)return 0;let t=this.curves[0],e=this.curves[this.curves.length-1];return(0,eJ.Wn)(t.p0.x-e.p1.x)}return this.curves.reduce((t,e)=>t+e.getLength(),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let r=0;r<this.curves.length;r++){let n=(e=this.curves[r]).getLength(this.direction);if(i+n>=t)break;i+=n}let r=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(r),angle:e.getAngleAt(r)}}}let iq=["l",0,0,0,0,0,0,0],iJ={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new e3},iQ={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},i0={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},i1=Object.assign({outerBorder:Object.assign(Object.assign({},i0),{distance:0}),innerBorder:Object.assign(Object.assign({},i0),{distance:0})},i0),i2={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},i5=Object.assign(Object.assign(Object.assign(Object.assign({opacity:1,background:null,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},iQ),i1),{alignSelf:"auto"}),{pickStrokeBuffer:0}),i3={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},i4=Object.assign(Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden"},{_debug_bounds:!1}),i5),iJ),i6=Object.assign(Object.assign({},i4),{startAngle:0,endAngle:eJ.f7,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),i8=Object.assign(Object.assign(Object.assign({},i4),i3),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),i7=Object.assign(Object.assign({},i4),{radius:1,startAngle:0,endAngle:eJ.f7}),i9=Object.assign(Object.assign({},i4),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start"}),rt=Object.assign(Object.assign({},i4),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),re=Object.assign(Object.assign(Object.assign({},i4),i3),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),ri=Object.assign(Object.assign({},i4),{path:new iK,customPath:()=>{eC.Y.getInstance().warn("空函数")}}),rr=Object.assign(Object.assign({},i4),{points:[],cornerRadius:0,closePath:!0}),rn=Object.assign(Object.assign({},i4),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),rs=Object.assign(Object.assign({},i4),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),ra=Object.assign(Object.assign({},i4),{symbolType:"circle",size:10,keepDirIn3d:!0}),ro=Object.assign(Object.assign(Object.assign({},i4),i2),{strokeBoundsBuffer:0,keepDirIn3d:!0}),rl=Object.assign(Object.assign(Object.assign({},i4),i2),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1}),rh=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},i4),{fill:!0,cornerRadius:0}),rd=Object.assign(Object.assign({},rh),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1}),ru=new class t{},rc={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},rp={fill:!0,stroke:!1};String.fromCharCode(160);let rg=/\w|\(|\)|-/,rf=/[.?!,;:/,。?!、;:]/,rm=/\S/;function rv(t,e,i,r,n){if(!e||e<=0)return 0;let s=ru.graphicUtil.textMeasure,a=r,o=t.slice(0,a),l=Math.floor(s.measureText(o,i).width),h=t.slice(0,a+1),d=Math.floor(s.measureText(h,i).width);for(;l>e||d<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(s.measureText(o,i).width),h=t.slice(0,a+1),d=Math.floor(s.measureText(h,i).width)}return n&&(a=ry(t,a)),a}function ry(t,e){let i=e;for(;rg.test(t[i-1])&&rg.test(t[i])||rf.test(t[i]);)if(--i<=0)return e;return i}function rb(t,e){let i=ru.graphicUtil.textMeasure.measureText(t,e),r={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(r.width=Math.floor(i.width),r.height=e.fontSize||0,r.ascent=r.height,r.descent=0):(r.width=Math.floor(i.width),r.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),r.ascent=Math.floor(i.actualBoundingBoxAscent),r.descent=r.height-r.ascent),r}let rx=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,{fontSize:e=ro.fontSize}){let i=0,r=0;for(let e=0;e<t.length;e++)128>t.charCodeAt(e)?i++:r++;return{width:~~(.8*i*e+r*e),height:e}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:i2.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);let r=this.context.measureText(t);return Math.abs(r.actualBoundingBoxAscent-r.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:i2.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);let r=this.context.measureText(t);return Math.abs(r.fontBoundingBoxAscent-r.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,r){if(0===t.length)return{verticalList:t,width:0};let{fontSize:n=12}=e;t.forEach(t=>{t.width=0===t.direction?n:this.measureTextWidth(t.text,e)});let s=[],a=0,o=0;for(;o<t.length&&a+t[o].width<i;o++)a+=t[o].width,s.push(t[o]);if(t[o]&&t[o].text.length>1){let n=this._clipText(t[o].text,e,i-a,0,t[o].text.length-1,"end",!1);if(r&&n.str!==t[o].text){let i="",r=0;for(let e=0;e<o;e++){let n=t[e];i+=n.text,r+=n.text.length}i+=t[o].text;let s=void 0,a=ry(i,r+n.str.length);(a-=r)!=n.str.length-1&&(n.str=n.str.substring(0,a),n.width=this.measureTextWidth(n.str,e))}s.push(Object.assign(Object.assign({},t[o]),{text:n.str,width:n.width})),a+=n.width}return{verticalList:s,width:a}}clipText(t,e,i,r){if(0===t.length)return{str:"",width:0};let n=this.measureTextWidth(t,e);if(n<=i)return{str:t,width:n};if((n=this.measureTextWidth(t[0],e))>i)return{str:"",width:0};let s=this._clipText(t,e,i,0,t.length-1,"end",!1);if(r&&s.str!==t){let i=ry(t,s.str.length);i!==s.str.length&&(s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,r,n,s,a){let o;if("start"===s)o=this._clipTextStart(t,e,i,r,n),a&&(o.result=a+o.str);else if("middle"===s){let r=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:r.width,result:r.left+a+r.right}}else o=this._clipTextEnd(t,e,i,r,n),a&&(o.result=o.str+a);return o}_clipTextEnd(t,e,i,r,n){let s;let a=Math.floor((r+n)/2),o=t.substring(0,a+1),l=this.measureTextWidth(o,e);if(l>i){if(o.length<=1)return{str:"",width:0};let n=t.substring(0,a);return(s=this.measureTextWidth(n,e))<=i?{str:n,width:s}:this._clipTextEnd(t,e,i,r,a)}if(l<i){if(a>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};let r=t.substring(0,a+2);return(s=this.measureTextWidth(r,e))>=i?{str:o,width:l}:this._clipTextEnd(t,e,i,a,n)}return{str:o,width:l}}_clipTextStart(t,e,i,r,n){let s;let a=Math.ceil((r+n)/2),o=t.substring(a-1,t.length-1),l=this.measureTextWidth(o,e);if(l>i){if(o.length<=1)return{str:"",width:0};let r=t.substring(a,t.length-1);return(s=this.measureTextWidth(r,e))<=i?{str:r,width:s}:this._clipTextStart(t,e,i,a,t.length-1)}if(l<i){if(a<=0)return{str:t,width:this.measureTextWidth(t,e)};let n=t.substring(a-2,t.length-1);return(s=this.measureTextWidth(n,e))>=i?{str:o,width:l}:this._clipTextStart(t,e,i,r,a)}return{str:o,width:l}}_clipTextMiddle(t,e,i,r,n,s,a,o){let l=t.substring(0,o),h=this.measureTextWidth(l,e);if(h+a>i)return{left:r,right:n,width:s+a};let d=t.substring(t.length-o,t.length),u=this.measureTextWidth(d,e);return h+u>i?{left:l,right:n,width:h+a}:this._clipTextMiddle(t,e,i,l,d,h,u,o+1)}clipTextWithSuffixVertical(t,e,i,r,n,s){let a;if(""===r)return this.clipTextVertical(t,e,i,n);if(0===t.length)return{verticalList:t,width:0};let o=this.clipTextVertical(t,e,i,n);if(o.verticalList.length===t.length&&o.verticalList[o.verticalList.length-1].width===t[t.length-1].width)return o;let l=this.measureTextWidth(r,e);if(l>i)return o;if(i-=l,"start"===s){let s=this.revertVerticalList(t);a=this.clipTextVertical(s,e,i,n);let o=this.revertVerticalList(a.verticalList);o.unshift({text:r,direction:1,width:l}),a.verticalList=o}else if("middle"===s){let s=this.clipTextVertical(t,e,i/2,n),o=this.revertVerticalList(t),h=this.clipTextVertical(o,e,i/2,n);s.verticalList.push({text:r,direction:1,width:l}),this.revertVerticalList(h.verticalList).forEach(t=>s.verticalList.push(t)),a={verticalList:s.verticalList,width:s.width+h.width}}else(a=this.clipTextVertical(t,e,i,n)).verticalList.push({text:r,direction:1,width:l});return a.width+=l,a}revertVerticalList(t){return t.reverse().map(t=>{let e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})})}clipTextWithSuffix(t,e,i,r,n,s){if(""===r)return this.clipText(t,e,i,n);if(0===t.length)return{str:"",width:0};let a=this.measureTextWidth(t,e);if(a<=i)return{str:t,width:a};let o=this.measureTextWidth(r,e);if(o>i)return{str:"",width:0};i-=o;let l=this._clipText(t,e,i,0,t.length-1,s,r);if(n&&l.str!==t){let i=ry(t,l.str.length);i!==l.str.length&&(l.str=t.substring(0,i),l.width=this.measureTextWidth(l.str,e))}return l.str=l.result,l.width+=o,l}};rx=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],rx);let r_=Symbol.for("TextMeasureContribution"),rA=class extends rx{};rA=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],rA);var rw=i("373390"),rS=i("203459");class rT{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),eb(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=eb(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if((0,eB.Z)(this._canvas)&&(eb(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),(0,eB.Z)(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&eb(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),(0,eB.Z)(this._context)&&eb(this._canvas)){let t=this._canvas.getContext("2d");eb(t)&&(t.save(),t.font=(0,rS.U)(this.textSpec),this._contextSaved=!0,this._context=t)}return!(0,eB.Z)(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;let{defaultFontParams:r={}}=this._option,{fontStyle:n=r.fontStyle,fontVariant:s=r.fontVariant,fontWeight:a=null!==(t=r.fontWeight)&&void 0!==t?t:"normal",fontSize:o=null!==(e=r.fontSize)&&void 0!==e?e:12,fontFamily:l=null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif",align:h,textAlign:d=null!=h?h:"center",baseline:u,textBaseline:c=null!=u?u:"middle",ellipsis:p,limit:g}=this._userSpec,{lineHeight:f=o}=this._userSpec;return(0,ek.Z)(f)&&"%"===f[f.length-1]&&(f=o*(Number.parseFloat(f.substring(0,f.length-1))/100)),{fontStyle:n,fontVariant:s,fontFamily:l,fontSize:o,fontWeight:a,textAlign:d,textBaseline:c,ellipsis:p,limit:g,lineHeight:f}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){let e;if((0,eB.Z)(t))return{width:0,height:0};if((0,eB.Z)(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);let{fontFamily:i,fontSize:r,fontWeight:n,textAlign:s,textBaseline:a,ellipsis:o,limit:l,lineHeight:h}=this.textSpec;try{let d=this._option.getTextBounds({text:t,fontFamily:i,fontSize:r,fontWeight:n,textAlign:s,textBaseline:a,ellipsis:!!o,maxLineWidth:l||1/0,lineHeight:h});e={width:d.width(),height:d.height()}}catch(i){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);let e=this._context.measureText(t),{fontSize:i,lineHeight:r}=this.textSpec;return{width:e.width,height:null!=r?r:i}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){let e={width:0,height:0};for(let i=0;i<t.length;i++){let r=t[i],n=this._measureSpecialChar(r);(0,eB.Z)(n)&&rT.NUMBERS_CHAR_SET.includes(r)&&(n=this._measureNumberChar()),(0,eB.Z)(n)&&["F","W"].includes((0,rw.F)(r))&&(n=this._measureFullSizeChar()),(0,eB.Z)(n)&&(n=this._measureLetterChar()),e.width+=n.width,e.height=Math.max(e.height,n.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){let e={width:0,height:0},{fontSize:i,lineHeight:r}=this.textSpec;for(let r=0;r<t.length;r++){let n=t[r],s=["F","W"].includes((0,rw.F)(n))?1:.53;e.width+=s*i}return e.height=null!=r?r:i,e}_measureReduce(t,e){let{fontSize:i,lineHeight:r}=this.textSpec,n={width:0,height:0};if((0,eB.Z)(t))return n;if((0,ev.Z)(t)){let s=t.filter(eb).map(t=>t.toString());return 0===s.length?n:1===s.length?e(s[0]):{width:s.reduce((t,i)=>Math.max(t,e(i).width),0),height:s.length*((null!=r?r:i)+1)+1}}return e(t.toString())}_measureNumberChar(){if((0,eB.Z)(this._numberCharSize)){let t=this._standardMethod(rT.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/rT.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return(0,eB.Z)(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(rT.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if((0,eB.Z)(this._letterCharSize)){let t=this._standardMethod(rT.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/rT.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return eb(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){eb(this._canvas)&&(this._canvas=null),eb(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}rT.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",rT.NUMBERS_CHAR_SET="0123456789",rT.FULL_SIZE_CHAR="字";let rk={Singleton:"Singleton",Transient:"Transient"},rB={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid"};class rC{constructor(t,e){this.id=eE.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=rB.Invalid,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){let t=new rC(this.serviceIdentifier,this.scope);return t.activated=t.scope===rk.Singleton&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class rE{getConstructorMetadata(t){return{compilerGeneratedMetadata:eD.getMetadata(eL,t),userGeneratedMetadata:eD.getMetadata(eI,t)||{}}}getPropertiesMetadata(t){throw Error("暂未实现")}}let rM=(d=eP,t=>{let e=e=>{if(null==e)return!1;if(e.key===d&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;let i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===d&&i[e].value===t)return!0;return!1};return e.metaData=new eN(d,t),e});class rP{constructor(t){this._binding=t}inRequestScope(){throw Error("暂未实现")}inSingletonScope(){return this._binding.scope=rk.Singleton,this}inTransientScope(){return this._binding.scope=rk.Transient,this}whenTargetNamed(t){return this._binding.constraint=rM(t),this}}class rO{constructor(t){this._binding=t}to(t){return this._binding.type=rB.Instance,this._binding.implementationType=t,new rP(this._binding)}toSelf(){let t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=rB.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new rP(this._binding)}toConstantValue(t){return this._binding.type=rB.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=rk.Singleton,new rP(this._binding)}toFactory(t){return this._binding.type=rB.Factory,this._binding.factory=t,this._binding.scope=rk.Singleton,new rP(this._binding)}toService(t){this.toDynamicValue(e=>e.container.get(t))}}let rR=new class t{constructor(t){let e=t||{};e.defaultScope=e.defaultScope||rk.Transient,this.options=e,this.id=eE.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new rE}load(t){let e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){let e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){let e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){let r=this._getNotAllArgs(t,!1,e,i);return this._get(r)}getNamed(t,e){return this.getTagged(t,eP,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){let e=new rC(t,this.options.defaultScope),i=this._bindingDictionary.get(t)||[];return i.push(e),this._bindingDictionary.set(t,i),new rO(e)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){let t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{let r=this.bind(i);return t(r,e),r},i=()=>t=>this.unbind(t),r=()=>t=>this.isBound(t),n=e=>i=>{let r=this.rebind(i);return t(r,e),r};return t=>({bindFunction:e(t),isboundFunction:r(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,r){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:r}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){let e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter(e=>e.constraint(t)).forEach(t=>{e.push(this._resolveFromBinding(t))}),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){let e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),r=Object.keys(i),n=[];for(let t=0;t<r.length;t++){let e=i[t],r={};e.forEach(t=>{r[t.key]=t.value});let s={inject:r[eO],multiInject:r[eR]},a=s.inject||s.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter(t=>t.constraint(o))};n.push(l)}return n}_resolveFromBinding(t){let e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case rB.ConstantValue:case rB.Function:e=t.cache;break;case rB.Instance:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;let i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map(t=>t.bindings.length>1?t.bindings.map(t=>this._resolveFromBinding(t)):this._resolveFromBinding(t.bindings[0]))}_saveToScope(t,e){t.scope===rk.Singleton&&(t.cache=e,t.activated=!0)}},rI=Symbol.for("CanvasFactory"),rL=Symbol.for("Context2dFactory");function rD(t){return rR.getNamed(rI,ru.global.env)(t)}let rj=new class t{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){let e=rD(Object.assign({nativeCanvas:ru.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}let e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){let e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=rD(Object.assign({nativeCanvas:ru.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}let e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},rN=Symbol.for("VWindow"),rF=Symbol.for("WindowHandlerContribution"),rG=class{get width(){if(this._handler){let t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){let t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new e$(["x","y","width","height"])},this.active=()=>{let t=this.global;t.env&&!this.actived&&(rR.getNamed(rF,t.env).configure(this,t),this.actived=!0)},this._uid=eE.GenAutoIncrementId(),this.global=ru.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);let r=this._handler.getWH();this._width=r.width,this._height=r.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,r,n,s){this._handler.setViewBoxTransform(t,e,i,r,n,s)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){let i=this._handler.getViewBox(),r={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},r),r.x-=i.x1,r.y-=i.y1,r}hasSubView(){let t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};rG=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],rG);var rz=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},rZ=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rH=function(t,e){return function(i,r){e(i,r,t)}};let rU=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=ru.global,this.global.hooks.onSetEnv.tap("graphic-util",(t,e,i)=>{this.configured=!1,this.configure(i,e)})}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach(t=>{t.configure(this,e)}),this.configured=!0)}tryInitCanvas(){if(!this._canvas){let t=rj.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){var r;this.configure(this.global,this.global.env);let n=this.global.measureTextMethod;this.global.measureTextMethod=i;let s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(r=e.fontSize)&&void 0!==r?r:i2.fontSize};return this.global.measureTextMethod=n,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new rT(Object.assign({defaultFontParams:{fontFamily:i2.fontFamily,fontSize:i2.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+rT.ALPHABET_CHAR_SET+rT.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;let r=rR.get(rN),n=t.AABBBounds,s=n.width(),a=n.height(),o=-n.x1,l=-n.y1;r.create({viewBox:{x1:o,y1:l,x2:n.x2,y2:n.y2},width:s,height:a,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});let h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(r,[t],{transMatrix:r.getViewBoxTransform(),viewBox:r.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;let d=r.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};rU=rz([ej(),rH(0,ez(eH)),rH(0,eZ(r_)),rZ("design:paramtypes",[Object])],rU),(oT=oG||(oG={}))[oT.transform=0]="transform",oT[oT.matrix=1]="matrix";let rV=new e3,rW=class{constructor(){this.matrix=new e3}init(t){return this.mode=oG.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=oG.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){let r=this.outSourceMatrix;if(rV.setValue(r.a,r.b,r.c,r.d,r.e,r.f),this.outTargetMatrix.reset(),i){let{x:r,y:n}=i;this.outTargetMatrix.translate(r,n),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-r,-n)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(rV.a,rV.b,rV.c,rV.d,rV.e,rV.f),this}rotateMatrix(t,e){let i=this.outSourceMatrix;if(rV.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){let{x:i,y:r}=e;this.outTargetMatrix.translate(i,r),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-r)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(rV.a,rV.b,rV.c,rV.d,rV.e,rV.f),this}scale(t,e,i){return this.mode===oG.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===oG.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){let i=this.outSourceMatrix;return rV.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(rV.a,rV.b,rV.c,rV.d,rV.e,rV.f),this}translate(t,e){return this.mode===oG.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===oG.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};rW=rz([ej(),rZ("design:paramtypes",[])],rW);let r$={arc:i6,area:i8,circle:i7,line:re,path:ri,symbol:ra,text:ro,rect:rn,rect3d:rs,polygon:rr,richtext:rl,richtextIcon:rd,image:rh,group:i9,glyph:rt},rY=Object.keys(r$);function rX(t,e){Object.keys(e).forEach(i=>{t[i]=e[i]})}let rK={arc:Object.assign({},r$.arc),area:Object.assign({},r$.area),circle:Object.assign({},r$.circle),line:Object.assign({},r$.line),path:Object.assign({},r$.path),symbol:Object.assign({},r$.symbol),text:Object.assign({},r$.text),rect:Object.assign({},r$.rect),rect3d:Object.assign({},r$.rect3d),polygon:Object.assign({},r$.polygon),richtext:Object.assign({},r$.richtext),richtextIcon:Object.assign({},r$.richtextIcon),image:Object.assign({},r$.image),group:Object.assign({},r$.group),glyph:Object.assign({},r$.glyph)};class rq{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},rY.forEach(t=>{this._defaultTheme[t]=Object.create(rK[t])}),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t||!this.dirty)return this.combinedTheme;let e={},i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){let r=this.getParentWithTheme(t);if(r){let t=r.theme;(t.dirty||i)&&t.applyTheme(r,e,!0)}this.userTheme?this.doCombine(r&&r.theme.combinedTheme):(r?this.combinedTheme=r.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,eC.Y.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){let e=this.userTheme,i=this.combinedTheme;rY.forEach(r=>{let n=Object.create(rK[r]);t&&t[r]&&rX(n,t[r]),i[r]&&rX(n,i[r]),e[r]&&rX(n,e[r]),this.combinedTheme[r]=n}),e.common&&rY.forEach(t=>{rX(this.combinedTheme[t],e.common)}),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach(e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])}):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren(t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))})}}let rJ=new rq;function rQ(t,e){return t.glyphHost?rQ(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):rJ.getTheme()}return null}(t)||t.attachedThemeGraphic&&rQ(t.attachedThemeGraphic)||rJ.getTheme()}let r0=Object.prototype.hasOwnProperty;var r1=(t,e)=>null!=t&&r0.call(t,e),r2=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t),r5=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t),r3=i("876058"),r4=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||(0,r3.Z)(t,"Boolean"),r6=t=>"function"==typeof t;class r8 extends ec(){get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=eE.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){var i,r,n,s;return i=this,r=void 0,n=void 0,s=function*(){if(e){let e=this._lastChild,i=0;for(;e;){let r=t(e,i++);if(r.then&&(r=yield r),r)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let r=t(e,i++);if(r.then&&(r=yield r),r)return;e=e._next}}},new(n||(n=Promise))(function(t,e){function a(t){try{l(s.next(t))}catch(t){e(t)}}function o(t){try{l(s.throw(t))}catch(t){e(t)}}function l(e){var i;e.done?t(e.value):((i=e.value)instanceof n?i:new n(function(t){t(i)})).then(a,o)}l((s=s.apply(i,r||[])).next())})}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&eC.Y.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){let i;if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){let i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}this._nodeList[e]=t;for(let t=e-1;t>=0&&!(i=this._nodeList[t]);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;let r=this.insertInto(t,0);return this._ignoreWarn=!1,r}removeChild(t){if(!this._idMap||!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){let e=this._nodeList.findIndex(e=>e===t);e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;let e=this._firstChild;for(;e;){let t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren((e,r)=>!(e===this||!t(e,r))&&(i=e,!0)),e&&this.forEachChildren(e=>{if(e.isContainer){let r=e.find(t,!0);if(r)return i=r,!0}return!1}),i}findAll(t,e=!1){let i=[];return this.forEachChildren((e,r)=>{e!==this&&t(e,r)&&i.push(e)}),e&&this.forEachChildren(e=>{if(e.isContainer){let r=e.findAll(t,!0);r.length&&(i=i.concat(r))}}),i}getElementById(t){return this.find(e=>e.id===t,!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll(e=>e.name===t,!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll(e=>e.type===t,!0)}getChildByName(t,e=!1){return this.find(e=>e.name===t,e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){let t=[],e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do e._count+=t,e=e.parent;while(null!==e)}clone(){throw Error("暂不支持")}cloneTo(t){throw Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){let r=r4(i,!0)&&i||(0,ep.Z)(i)&&i.capture,n=(0,ep.Z)(i)&&i.once,s=r6(e)?void 0:e;return t=r?`${t}capture`:t,e=r6(e)?e:e.handleEvent,n?super.once(t,e,s):super.on(t,e,s),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){let r=r4(i,!0)&&i||(0,ep.Z)(i)&&i.capture,n=r6(e)?void 0:e;t=r?`${t}capture`:t,e=r6(e)?e:e.handleEvent;let s=(0,ep.Z)(i)&&i.once;return super.off(t,e,n,s),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return(0,ep.Z)(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class r7{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=r7.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation(),this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw Error("Method not implemented.")}}class r9 extends r7{constructor(t,e){super(),this.type=t,this.detail=e}}class nt{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(-(e*t)+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-nt.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*nt.bounceIn(2*t):.5*nt.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;let r=e/eJ.f7*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-r)*eJ.f7/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;let r=e/eJ.f7*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-r)*eJ.f7/e)+1}}static getElasticInOut(t,e){return function(i){let r=e/eJ.f7*Math.asin(1/t);return(i*=2)<1?-(t*Math.pow(2,10*(i-=1))*Math.sin((i-r)*eJ.f7/e)*.5):t*Math.pow(2,-10*(i-=1))*Math.sin((i-r)*eJ.f7/e)*.5+1}}}nt.quadIn=nt.getPowIn(2),nt.quadOut=nt.getPowOut(2),nt.quadInOut=nt.getPowInOut(2),nt.cubicIn=nt.getPowIn(3),nt.cubicOut=nt.getPowOut(3),nt.cubicInOut=nt.getPowInOut(3),nt.quartIn=nt.getPowIn(4),nt.quartOut=nt.getPowOut(4),nt.quartInOut=nt.getPowInOut(4),nt.quintIn=nt.getPowIn(5),nt.quintOut=nt.getPowOut(5),nt.quintInOut=nt.getPowInOut(5),nt.backIn=nt.getBackIn(1.7),nt.backOut=nt.getBackOut(1.7),nt.backInOut=nt.getBackInOut(1.7),nt.elasticIn=nt.getElasticIn(1,.3),nt.elasticOut=nt.getElasticOut(1,.3),nt.elasticInOut=nt.getElasticInOut(1,.3*1.5);class ne{constructor(){this.id=eE.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===oI.END?this.removeAnimate(e):e.status===oI.RUNNING||e.status===oI.INITIAL?(this.animateCount++,e.advance(t)):e.status===oI.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach(t=>t()),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}let ni=new ne;class nr{constructor(t,e,i,r,n){this.from=t,this.to=e,this.duration=i,this.easing=r,this.params=n,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){}getFromProps(){return this.from}getMergedEndProps(){var t;let e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();let t=this.step.getLastProps();Object.keys(t).forEach(e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])})}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class nn extends nr{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class ns{constructor(t=eE.GenAutoIncrementId(),e=ni){this.id=t,this.timeline=e,this.status=oI.INITIAL,this.tailAnimate=new na(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce((t,e)=>t+e.totalDuration,0)}after(t){let e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-Infinity;return t.forEach(t=>{e=(0,eJ.Fp)(t.getDuration(),e)}),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){ns.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){let t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t,e=ns.mode){t&&e&oL.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:oR.ANIMATE_PLAY})}runCb(t){let e=new nn(()=>{t(this,e.step.prev)});return this.tailAnimate.play(e),this}customInterpolate(t,e,i,r,n,s){let a=ns.interpolateMap.get(t)||ns.interpolateMap.get("");return!!a&&a(t,e,i,r,n,s)}pause(){this.status===oI.RUNNING&&(this.status=oI.PAUSED)}resume(){this.status===oI.PAUSED&&(this.status=oI.RUNNING)}to(t,e,i,r){if(this.tailAnimate.to(t,e,i,r),this.target){let t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,r){if(this.tailAnimate.from(t,e,i,r),this.target){let t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){let t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){let t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){let t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){let t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){let t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){let t=new na(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach(t=>this.preventAttr(t))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach(e=>{e.bind(t)}),this}advance(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===oI.INITIAL&&(this.status=oI.RUNNING,this._onStart&&this._onStart.forEach(t=>t())),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===oI.RUNNING&&(this.status=oI.END,this._onEnd&&this._onEnd.forEach(t=>t()))}setPosition(t){let e,i=0,r=this.rawPosition,n=this.subAnimates.reduce((t,e)=>t+e.totalDuration,0);t<0&&(t=0);let s=t>=n;if(s&&(t=n),t===r)return s;for(let r=0;r<this.subAnimates.length&&!(i+(e=this.subAnimates[r]).totalDuration>=t);r++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=oI.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}ns.mode=oL.NORMAL,ns.interpolateMap=new Map;class na{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new no(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);let i=t.easing,r="string"==typeof i?nt[i]:i,n=this._addStep(e,null,r);return n.type=oD.customAnimate,this._appendProps(t.getEndProps(),n,!1),this._appendCustomAnimate(t,n),this}to(t,e,i,r){(null==e||e<0)&&(e=0);let n="string"==typeof i?nt[i]:i,s=this._addStep(e,null,n);return s.type=oD.to,this._appendProps(t,s,!!r&&r.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),r&&r.noPreventAttrs||this.target.animates.forEach(t=>{t.id!==this.animate.id&&t.preventAttrs(s.propKeys)}),this}from(t,e,i,r){this.to(t,0,i,r);let n={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach(t=>{n[t]=this.getLastPropByName(t,this.stepTail)}),this.to(n,e,i,r),this.stepTail.type=oD.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){let e=this._addStep(+t,null);e.type=oD.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){let r=new no(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(r),this.stepTail=r,r}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let r=e.prev,n=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach(t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))});r.prev;)r.props&&(r.propKeys||(r.propKeys=Object.keys(r.props)),r.propKeys.forEach(t=>{void 0===n[t]&&(n[t]=r.props[t])})),e.propKeys=Object.keys(e.props),r=r.prev;let s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),e.propKeys.forEach(t=>{if(void 0===s[t]){let e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}}),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;let i=this.duration,r=this.loop,n=this.rawPosition,s,a,o=!1,l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,i<=0)return!0;if(s=Math.floor(t/i),a=t-s*i,(o=t>=r*i+i)&&(t=(a=i)*(s=r)+i),t===n)return o;let h=!this.reversed!=!(this.bounce&&s%2);return h&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next,r=this.position,n=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=r;)s=(i=s).next;let a=t?0===n?1:r/n:(r-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach(t=>t(i,a))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e){if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){let e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return eC.Y.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class no{constructor(t,e,i,r){this.duration=e,this.position=t,this.props=i,this.easing=r}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}let nl={duration:200,easing:"cubicOut"},nh={duration:1e3,easing:"quadInOut"};var nd=function(t,e,i){return t<e?e:t>i?i:t};function nu(t,e,i){e/=100;let r=(1-Math.abs(2*(i/=100)-1))*e,n=r*(1-Math.abs(t/60%2-1)),s=i-r/2,a=0,o=0,l=0;return 0<=t&&t<60?(a=r,o=n,l=0):60<=t&&t<120?(a=n,o=r,l=0):120<=t&&t<180?(a=0,o=r,l=n):180<=t&&t<240?(a=0,o=n,l=r):240<=t&&t<300?(a=n,o=0,l=r):300<=t&&t<360&&(a=r,o=0,l=n),{r:a=Math.round(255*(a+s)),g:o=Math.round(255*(o+s)),b:l=Math.round(255*(l+s))}}function nc(t,e,i){t/=255,e/=255;let r=Math.min(t,e,i/=255),n=Math.max(t,e,i),s=n-r,a=0,o=0,l=0;return(a=Math.round(60*(a=0===s?0:n===t?(e-i)/s%6:n===e?(i-t)/s+2:(t-e)/s+4)))<0&&(a+=360),l=(n+r)/2,o=+(100*(o=0===s?0:s/(1-Math.abs(2*l-1)))).toFixed(1),{h:a,s:o,l:l=+(100*l).toFixed(1)}}let np=/^#([0-9a-f]{3,8})$/,ng={transparent:0xffffff00},nf={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function nm(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function nv(t){return(0,iy.Z)(t)?new nA(t>>16,t>>8&255,255&t,1):(0,ev.Z)(t)?new nA(t[0],t[1],t[2]):new nA(255,255,255)}function ny(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function nb(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let nx=(t,e)=>{let i=np.exec(t);if(e||i){let t=parseInt(i[1],16),e=i[1].length;return 3===e?new nA((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?nv(t):8===e?new nA(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class n_{static Brighter(t,e=1){return 1===e?t:new n_(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new n_(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){let i=t instanceof n_?t:new n_(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(eb(ng[t])){var e;return e=ng[t],(0,iy.Z)(e)?new nA(e>>>24,e>>>16&255,e>>>8&255,255&e):(0,ev.Z)(e)?new nA(e[0],e[1],e[2],e[3]):new nA(255,255,255,1)}if(eb(nf[t]))return nv(nf[t]);let i=`${t}`.trim().toLowerCase(),r=nx(i);if(void 0!==r)return r;if(/^(rgb|RGB|rgba|RGBA)/.test(i)){let t=i.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new nA(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(i)){let t=i.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),e=nu(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new nA(e.r,e.g,e.b,parseFloat(t[3]))}}constructor(t){let e=n_.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new nA(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){let{r:e,g:i,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t))),this}add(t){let{r:e,g:i,b:r}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,r+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){let{r:e,g:i,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return .5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){let r=this.color.opacity,n=nc(this.color.r,this.color.g,this.color.b),s=nu((0,eB.Z)(t)?n.h:nd(t,0,360),(0,eB.Z)(e)?n.s:e>=0&&e<=1?100*e:e,(0,eB.Z)(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new nA(s.r,s.g,s.b,r),this}setRGB(t,e,i){return(0,eB.Z)(t)||(this.color.r=t),(0,eB.Z)(e)||(this.color.g=e),(0,eB.Z)(i)||(this.color.b=i),this}setHex(t){let e=nx(`${t}`.trim().toLowerCase(),!0);return null!=e?e:this}setColorName(t){let e=nf[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new n_(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){let i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=ny(t.color.r),this.color.g=ny(t.color.g),this.color.b=ny(t.color.b),this}copyLinearToSRGB(t){return this.color.r=nb(t.color.r),this.color.g=nb(t.color.g),this.color.b=nb(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class nA{constructor(t,e,i,r){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),eb(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}formatHex(){return`#${nm(this.r)+nm(this.g)+nm(this.b)+(1===this.opacity?"":nm(255*this.opacity))}`}formatRgb(){let t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){let t=this.opacity,{h:e,s:i,l:r}=nc(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${r}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}(ok=oz||(oz={}))[ok.Color255=0]="Color255",ok[ok.Color1=1]="Color1";class nw{static Get(t,e=oz.Color1,i=[0,0,0,1]){if(e===oz.Color1){let e=nw.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;let r=n_.parseColorString(t);if(r){let e=[r.r/255,r.g/255,r.b/255,r.opacity];nw.store1[t]=e,nw.store255[t]=[r.r,r.g,r.b,r.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}let r=nw.store255[t];if(r)return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i;let n=n_.parseColorString(t);return n&&(nw.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],nw.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===oz.Color1)!nw.store1[t]&&(nw.store1[t]=i,nw.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]);else{if(nw.store255[t])return;nw.store255[t]=i,nw.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function nS(t,e=!1){return Array.isArray(t)?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function nT(t,e,i,r,n){if(!t||!e)return t&&nS(t)||e&&nS(e)||!1;let s,a,o=!1,l=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=nw.Get(t,oz.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=nw.Get(e,oz.Color255):l=!0,o!==l){let s=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},s),{stops:s.stops.map(t=>Object.assign(Object.assign({},t),{color:nS(a)}))});return o?nT(s,l,i,r,n):nT(l,s,i,r,n)}if(o){if(t.gradient===e.gradient){let r=t.stops,n=e.stops;if(r.length!==n.length)return!1;if("linear"===t.gradient)return function(t,e,i){let r=t.stops,n=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:Array(r.length).fill(0).map((t,e)=>({color:nC(r[e].color,n[e].color,i),offset:r[e].offset+(n[e].offset-r[e].offset)*i}))}}(t,e,i);if("radial"===t.gradient)return function(t,e,i){let r=t.stops,n=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:Array(r.length).fill(0).map((t,e)=>({color:nC(r[e].color,n[e].color,i),offset:r[e].offset+(n[e].offset-r[e].offset)*i}))}}(t,e,i);if("conical"===t.gradient)return function(t,e,i){let r=t.stops,n=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:Array(r.length).fill(0).map((t,e)=>({color:nC(r[e].color,n[e].color,i),offset:r[e].offset+(n[e].offset-r[e].offset)*i}))}}(t,e,i)}return!1}return n&&n(s,a),nS(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(s,a,i),r)}nw.store255={},nw.store1={};let nk=[0,0,0,0],nB=[0,0,0,0];function nC(t,e,i){return nw.Get(t,oz.Color255,nk),nw.Get(e,oz.Color255,nB),`rgba(${Math.round(nk[0]+(nB[0]-nk[0])*i)},${Math.round(nk[1]+(nB[1]-nk[1])*i)},${Math.round(nk[2]+(nB[2]-nk[2])*i)},${nk[3]+(nB[3]-nk[3])*i})`}class nE{static GetImage(t,e){var i;let r=nE.cache.get(t);r?"fail"===r.loadState?ru.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,r.data):nE.loadImage(t,e)}static GetSvg(t,e){var i;let r=nE.cache.get(t);r?"fail"===r.loadState?ru.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,r.data):(r={type:"image",loadState:"init"},nE.cache.set(t,r),r.dataPromise=ru.global.loadSvg(t),r.dataPromise?(r.waitingMark=[e],r.dataPromise.then(e=>{var i;r.loadState=(null==e?void 0:e.data)?"success":"fail",r.data=null==e?void 0:e.data,null===(i=r.waitingMark)||void 0===i||i.map((i,n)=>{(null==e?void 0:e.data)?(r.loadState="success",r.data=e.data,i.imageLoadSuccess(t,e.data)):(r.loadState="fail",i.imageLoadFail(t))})})):(r.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=nE.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then(t=>t.data):Promise.resolve(i.data):(i={type:e,loadState:"init"},nE.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=ru.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=ru.global.loadBlob(t):"json"===e&&(i.dataPromise=ru.global.loadJson(t)),i.dataPromise.then(t=>t.data))}static loading(){setTimeout(()=>{if(!nE.isLoading&&nE.toLoadAueue.length){nE.isLoading=!0;let t=nE.toLoadAueue.splice(0,10),e=[];t.forEach(t=>{let{url:i,marks:r}=t,n={type:"image",loadState:"init"};if(nE.cache.set(i,n),n.dataPromise=ru.global.loadImage(i),n.dataPromise){n.waitingMark=r;let t=n.dataPromise.then(t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map((e,r)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})});e.push(t)}else n.loadState="fail",r.forEach(t=>t.imageLoadFail(i))}),Promise.all(e).then(()=>{nE.isLoading=!1,nE.loading()}).catch(t=>{console.error(t),nE.isLoading=!1,nE.loading()})}},0)}static loadImage(t,e){let i=nM(t,nE.toLoadAueue);if(-1!==i)return nE.toLoadAueue[i].marks.push(e),void nE.loading();nE.toLoadAueue.push({url:t,marks:[e]}),nE.loading()}static improveImageLoading(t){let e=nM(t,nE.toLoadAueue);if(-1!==e){let t=nE.toLoadAueue.splice(e,1);nE.toLoadAueue.unshift(t[0])}}}function nM(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return -1}nE.cache=new Map,nE.isLoading=!1,nE.toLoadAueue=[];let nP=new e3,nO=new il,nR=["lineWidth","scaleX","scaleY","angle","anchor","visible"],nI=["x","y"],nL=["scaleX","scaleY"],nD=["angle"],nj=new ib,nN={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class nF extends r8{static mixin(t){let e=Object.keys(t);for(let i=0;i<e.length;++i){let r=e[i];Object.defineProperty(nF.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new il,this._updateTag=oP.INIT,this.attribute=t,this.valid=this.isValid(),t.background&&this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,r;let{dx:n=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){let t=this.parent.attribute;nj.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),nj.y=s+(null!==(r=t.scrollY)&&void 0!==r?r:0)}else nj.x=n,nj.y=s;return nj}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;ru.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);let e=this.doUpdateAABBBounds(t);return ru.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){let e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){let t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){let t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new e3),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&oP.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&oP.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&oP.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&oP.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&oP.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;let i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&oP.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=oP.CLEAR_SHAPE}containsPoint(t,e,i,r){if(!r)return!1;if(i===oO.GLOBAL){let i=new ib(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return r.containsPoint(this,{x:t,y:e})}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){let r=Object.keys(t);for(let e=0;e<r.length;e++){let i=r[e];this.attribute[i]=t[i]}this.valid=this.isValid(),!this.updateShapeAndBoundsTagSetted()&&(e||this.needUpdateTags(r))?this.addUpdateShapeAndBoundsTag():this.addUpdateBoundTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,r){var n;let s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,r);s?this._setAttributes(s,i,r):(0,eB.Z)(null===(n=this.normalAttrs)||void 0===n?void 0:n[t])?(this.attribute[t]=e,this.valid=this.isValid(),!this.updateShapeAndBoundsTagSetted()&&(i||this.needUpdateTag(t))?this.addUpdateShapeAndBoundsTag():this.addUpdateBoundTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t,e=nR){for(let i=0;i<e.length;i++){let r=e[i];if(-1!==t.indexOf(r))return!0}return!1}needUpdateTag(t,e=nR){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){let e={type:oR.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=oP.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,r;if(0===t&&0===e)return this;let n={type:oR.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,nI,n);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));let a=this.attribute,o=a.postMatrix;return o?ru.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:iJ.x)+t,a.y=(null!==(r=a.y)&&void 0!==r?r:iJ.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}translateTo(t,e){let i=this.attribute;if(i.x===t&&i.y===e)return this;let r={type:oR.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,nI,r);return n?this._setAttributes(n,!1,r):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r)),this}scale(t,e,i){var r,n;if(1===t&&1===e)return this;let s={type:oR.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,nL,s);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));let o=this.attribute;if(i){let{postMatrix:r}=this.attribute;r||(r=new e3,o.postMatrix=r),ru.transformUtil.fromMatrix(r,r).scale(t,e,i)}else o.scaleX=(null!==(r=o.scaleX)&&void 0!==r?r:iJ.scaleX)*t,o.scaleY=(null!==(n=o.scaleY)&&void 0!==n?n:iJ.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){let i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;let r={type:oR.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,nL,r);return n?this._setAttributes(n,!1,r):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r)),this}rotate(t,e){var i;if(0===t)return this;let r={type:oR.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,nD,r);n&&(delete n.angle,this._setAttributes(n,!1,r));let s=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new e3,s.postMatrix=i),ru.transformUtil.fromMatrix(i,i).rotate(t,e)}else s.angle=(null!==(i=s.angle)&&void 0!==i?i:iJ.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}rotateTo(t){let e=this.attribute;if(e.angle===t)return this;let i={type:oR.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,nD,i);return r?this._setAttributes(r,!1,i):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)),this}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);let e=new ns(null==t?void 0:t.id,this.stage&&this.stage.getTimeline()).bind(this);if(t){let{onStart:i,onFrame:r,onEnd:n,onRemove:s}=t;null!=i&&e.onStart(i),null!=r&&e.onFrame(r),null!=n&&e.onEnd(n),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove(()=>{this.animates.delete(e.id)}),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(ru.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!(0,eB.Z)(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,r){var n,s,a,o;if(i){let i;let l=Object.keys(t),h=this.getNoWorkAnimateAttr(),d={};r?l.forEach(e=>{h[e]?(i||(i={}),i[e]=t[e]):d[e]=void 0===t[e]?this.getDefaultAttribute(e):t[e]}):l.forEach(e=>{h[e]?(i||(i={}),i[e]=t[e]):d[e]=t[e]});let u=this.animate();u.stateNames=e,u.to(d,null!==(s=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==s?s:nl.duration,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:nl.easing),i&&this.setAttributes(i,!1,{type:oR.STATE})}else this.setAttributes(t,!1,{type:oR.STATE})}updateNormalAttrs(t){let e={};this.normalAttrs?(Object.keys(t).forEach(t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)}),Object.keys(this.normalAttrs).forEach(e=>{t[e]=this.normalAttrs[e]})):Object.keys(t).forEach(t=>{e[t]=this.getNormalAttribute(t)}),this.normalAttrs=e}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach(i=>{if(i.stateNames){let r=i.getEndProps();r1(r,t)&&(e=r[t])}}),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){let i=this.currentStates.filter(e=>e!==t);this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){let i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var r;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;let n=e&&(null===(r=this.currentStates)||void 0===r?void 0:r.length)?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some((t,e)=>this.currentStates[e]!==t)))return;let r={};t.forEach(e=>{var i;let n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(r,n)}),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}addUpdateBoundTag(){this._updateTag|=oP.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=oP.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=oP.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&oP.UPDATE_SHAPE_AND_BOUNDS)===oP.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=oP.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=oP.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=oP.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=oP.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=oP.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=oP.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=oP.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&oP.UPDATE_LAYOUT)}getAnchor(t,e){let i=[0,0],r=()=>{if(e.b)return e.b;let{scaleX:t,scaleY:i,angle:r}=this.attribute;return nO.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(nO),this.setAttributes({scaleX:t,scaleY:i,angle:r}),e.b};if("string"==typeof t[0]){let e=parseFloat(t[0])/100,n=r();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){let e=parseFloat(t[1])/100,n=r();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){let{x:t=iJ.x,y:e=iJ.y,scaleX:i=iJ.scaleX,scaleY:r=iJ.scaleY,angle:n=iJ.angle,scaleCenter:s,anchor:a,postMatrix:o}=this.attribute,l=[0,0],h={};if(a&&(l=this.getAnchor(a,h)),s&&(1!==i||1!==r)){let a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(n),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(s,h),ru.transformUtil.fromMatrix(a,a).scale(i,r,{x:l[0],y:l[1]})}else!function(t,e,i,r,n,s,a,o){let l,h;let d=e.a,u=e.b,c=e.c,p=e.d,g=e.e,f=e.f,m=(0,eJ.mC)(a),v=(0,eJ.O$)(a);o?(l=o[0],h=o[1]):(l=i,h=r);let y=l-i,b=h-r,x=d*m+c*v,_=u*m+p*v,A=c*m-d*v,w=p*m-u*v;t.a=n*x,t.b=n*_,t.c=s*A,t.d=s*w,t.e=g+d*l+c*h-x*y-A*b,t.f=f+u*l+p*h-_*y-w*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,r,n,a&&l);let d=this.getOffsetXY(iJ);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,o){let t=nP.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);let{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){let e=t.getTimeline();this.animates.forEach(t=>{t.setTimeline(e)})}this._onSetStage&&this._onSetStage(this,t,e),ru.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:oR.ANIMATE_END})}onStep(t,e,i,r,n){let s={};if(i.customAnimate)i.customAnimate.update(n,r,s);else{let a=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,s,i,r,n,a,void 0,o,l)}this.setAttributes(s,!1,{type:oR.ANIMATE_UPDATE,animationState:{ratio:r,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,r,n,s,a,o,l,h){h||(h=Object.keys(a),r.propKeys=h),s?r.propKeys.forEach(t=>{e.validAttr(t)&&(i[t]=a[t])}):h.forEach(s=>{var h;let d;if(!e.validAttr(s))return;let u=a[s],c=null!==(h=o&&o[s])&&void 0!==h?h:t.getLastPropByName(s,r);if(null==u||null==c)return void(i[s]=u);(d=e.interpolateFunc&&e.interpolateFunc(s,n,c,u,i))||(d=e.customInterpolate(s,n,c,u,this,i))||this.defaultInterpolate(u,c,s,i,l,n)||this._interpolate(s,n,c,u,i)}),r.parsedProps=l}defaultInterpolate(t,e,i,r,n,s){if(Number.isFinite(t))return r[i]=e+(t-e)*s,!0;if("fill"===i){n||(n={});let a=n.fillColorArray,o=nT(e,null!=a?a:t,s,!1,(t,e)=>{n.fillColorArray=e});return o&&(r[i]=o),!0}if("stroke"===i){n||(n={});let a=n.strokeColorArray,o=nT(e,null!=a?a:t,s,!1,(t,e)=>{n.strokeColorArray=e});return o&&(r[i]=o),!0}if("shadowColor"===i){n||(n={});let a=n.shadowColorArray,o=nT(e,null!=a?a:t,s,!0,(t,e)=>{n.shadowColorArray=e});return o&&(r[i]=o),!0}return!1}_interpolate(t,e,i,r,n){}getDefaultAttribute(t){return rQ(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:ru.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map(t=>t.toJson())}}createPathProxy(t){return(0,ek.Z)(t,!0)?this.pathProxy=(new iK).fromString(t):this.pathProxy=new iK,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;this.resources||(this.resources=new Map);let i={data:"init",state:null};this.resources.set(t,i),"string"==typeof t?(i.state="loading",t.startsWith("<svg")?(nE.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(r2(t)||t.includes("/")||r5(t))&&(nE.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):(0,ep.Z)(t)?(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e):i.state="fail"}imageLoadSuccess(t,e,i){if(!this.resources)return;let r=this.resources.get(t);r&&(r.state="success",r.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;let i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach(t=>{t.stop()})}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren(e=>{e.stopAnimates(t)})}release(){this.releaseStatus="released",ru.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,r;if(this._events&&t in this._events){let n=new r9(t,e);n.bubbles=!1,n.manager=null===(r=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===r?void 0:r.manager,this.dispatchEvent(n)}}}nF.mixin({pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof r7))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new r9(t,e))}}),(oB=oZ||(oZ={}))[oB.Top=1]="Top",oB[oB.Right=2]="Right",oB[oB.Bottom=4]="Bottom",oB[oB.Left=8]="Left",oB[oB.ALL=15]="ALL";let nG=[!1,!1,!1,!1],nz=t=>{var e;let i=!0;if(r4(t,!0)){for(let r=0;r<4;r++)nG[r]=t,i&&(i=!(null!==(e=nG[r])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)nG[e]=!!t[e],i&&(i=!!nG[e]);else nG[0]=!1,nG[1]=!1,nG[2]=!1,nG[3]=!1;return{isFullStroke:i,stroke:nG}},nZ=[0,0,0,0],nH=t=>t?(0,ev.Z)(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(nZ[0]=t[0],nZ[2]=t[0],nZ[1]=t[1],nZ[3]=t[1],nZ):t:t:0,nU=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],nV=[1,2,3,0,1,2,3,0];function nW(t,e,i,r){for(;t>=eJ.f7;)t-=eJ.f7;for(;t<0;)t+=eJ.f7;for(;t>e;)e+=eJ.f7;nU[0].x=i,nU[1].y=i,nU[2].x=-i,nU[3].y=-i;let n=Math.ceil(t/eJ.ou)%4,s=Math.ceil(e/eJ.ou)%4;if(r.add((0,eJ.mC)(t)*i,(0,eJ.O$)(t)*i),r.add((0,eJ.mC)(e)*i,(0,eJ.O$)(e)*i),n!==s||e-t>eJ.pi){let t=!1;for(let e=0;e<nV.length;e++)if(t||n!==nV[e]){if(t&&s===nV[e])break;if(t){let t=nU[nV[e]];r.add(t.x,t.y)}}else{t=!0;let e=nU[n];r.add(e.x,e.y)}}}function n$(t,e,i){let{x:r,y:n}=(0,eJ.KU)(t.x,t.y,e.x,e.y,i),{x:s,y:a}=(0,eJ.KU)(t.x1,t.y1,e.x1,e.y1,i),o=new ib(r,n,s,a);return o.defined=e.defined,o}function nY(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let r=[];if(t.length>e.length){r=e.map(t=>{let e=new ib(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e});for(let n=0;n<e.length;n++)r[n]=n$(t[n],e[n],i)}else{r=e.map(t=>{let e=new ib(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e});for(let n=0;n<t.length;n++)r[n]=n$(t[n],e[n],i)}return r}let nX=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],nK=t=>nX.includes(t);function nq(t,e){if((0,ev.Z)(t)){let i;for(let r=0;r<t.length&&void 0===i;r++)i=t[r][e];return i}return t[e]}class nJ{constructor(){this.durations=[],this.timeout=nJ.TimeOut,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout(()=>{this.appendDuration(Date.now()-this.lastDate),t(0)},this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce((t,e)=>t+e,0)/this.durations.length,1e3/60),1e3/30)}}nJ.TimeOut=1e3/60;let nQ=new nJ,n0=(t,e)=>(0,ek.Z)(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t;function n1(t,e,i,r=0){return t.expand(e+(r/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let n2=0;function n5(){return n2++}function n3(t){let e=[],i=0,r="";for(let n=0;n<t.length;n++)(function(t){if(n4.has(t))return!0;if(n6.has(t))return!1;let e=!1;return 256>t.codePointAt(0)&&(e=!0),e})(t[n])?i?r+=t[n]:(i=1,r=t[n]):(i&&(e.push({text:r,direction:oH.VERTICAL}),r="",i=0),e.push({text:t[n],direction:oH.HORIZONTAL}));return r&&e.push({text:r,direction:oH.VERTICAL}),e}(oC=oH||(oH={}))[oC.HORIZONTAL=0]="HORIZONTAL",oC[oC.VERTICAL=1]="VERTICAL";let n4=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach(t=>n4.set(t,!0));let n6=new Map;[""].forEach(t=>n6.set(t,!0));let n8=n5(),n7=n5(),n9=n5(),st=n5(),se=n5(),si=n5(),sr=n5(),sn=n5(),ss=n5(),sa=n5(),so=n5(),sl=n5(),sh=n5(),sd=n5(),su=n5(),sc=n5(),sp=Symbol.for("GraphicService"),sg=Symbol.for("GraphicCreator"),sf={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},sm=Object.keys(sf);(oE=oU||(oU={}))[oE.LESS_GROUP=0]="LESS_GROUP",oE[oE.MORE_GROUP=1]="MORE_GROUP";class sv extends nF{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=si,this._childUpdateTag=oP.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new rq),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new rq)}hideAll(){this.setAttribute("visible",!1),this.forEachChildren(t=>{t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)})}showAll(){this.setAttribute("visible",!0),this.forEachChildren(t=>{t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)})}containsPoint(t,e,i){if(i===oO.GLOBAL){let i=new ib(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&oP.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;ru.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);let t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),ru.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){let{x:t=iJ.x,y:e=iJ.y,dx:i=iJ.dx,dy:r=iJ.dy,scaleX:n=iJ.scaleX,scaleY:s=iJ.scaleY,angle:a=iJ.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==r||1!==n||1!==s||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}doUpdateAABBBounds(){let t=this.attribute,e=rQ(this).group;this._AABBBounds.clear();let i=ru.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),{boundsPadding:r=e.boundsPadding}=t,n=nH(r);return n&&i.expand(n),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}clearUpdateBoundTag(){this._updateTag&=oP.CLEAR_BOUNDS,this._childUpdateTag&=oP.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=oP.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&oP.UPDATE_BOUNDS||(this._childUpdateTag|=oP.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){let e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),ru.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),ru.graphicService.onClearIncremental(this,this.stage)}appendChild(t,e=!0){let i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){let i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){let i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){let i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){let e=super.removeChild(t);return t.stage=null,ru.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren(e=>{ru.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)}),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),ru.graphicService.onSetStage(this,t),this.forEachChildren(e=>{e.setStage(t,this.layer)}))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren(t=>{t.isContainer&&t.addUpdateGlobalPositionTag()})}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren(t=>{t.isContainer&&t.addUpdateGlobalPositionTag()})}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){let t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&oP.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find(e=>e.name===t,e)}createOrUpdateChild(t,e,i){let r=this._getChildByName(t);return r?r.setAttributes(e):((r=ru.graphicService.creator[i](e)).name=t,this.add(r)),r}clone(){return new sv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sv.NOWORK_ANIMATE_ATTR}}function sy(t){return new sv(t)}sv.NOWORK_ANIMATE_ATTR=nN;class sb extends sv{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,r){var n;super({}),this.stage=t,this.global=e,this.window=i,this.main=r.main,this.layerHandler=r.layerHandler,this.layerHandler.init(this,i,{main:r.main,canvasId:r.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(n=r.zIndex)&&void 0!==n?n:0}),this.layer=this,this.subLayers=new Map,this.theme=new rq,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){let e=Array.from(this.subLayers.values()).sort((t,e)=>t.zIndex-e.zIndex);this.layerHandler.merge(e.map(e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler()))),t&&e.forEach(t=>{t.group&&(t.group.incremental=0)}),e.forEach(t=>{ru.layerService.releaseLayer(this.stage,t.layer)}),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach(i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)})}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach(t=>t(this)),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw Error("暂不支持")}setToFrame(t){throw Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach(t=>{ru.layerService.releaseLayer(this.stage,t.layer)})}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach(t=>t(this))}}let sx=Symbol.for("TransformUtil"),s_=Symbol.for("GraphicUtil"),sA=Symbol.for("LayerService"),sw=Symbol.for("StaticLayerHandlerContribution"),sS=Symbol.for("DynamicLayerHandlerContribution"),sT=Symbol.for("VirtualLayerHandlerContribution");let sk=oV=class{static GenerateLayerId(){return`${oV.idprefix}_${oV.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=ru.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return"static"===t?rR.get(sw):"dynamic"===t?rR.get(sS):rR.get(sT)}createLayer(t,e={main:!1}){var i;this.tryInit();let r=this.getRecommendedLayerType(e.layerMode);r=e.main||e.canvasId?"static":r;let n=this.getLayerHandler(r),s=new sb(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:r,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:oV.GenerateLayerId(),layerHandler:n})),a=this.layerMap.get(t)||[];return a.push(s),this.layerMap.set(t,a),this.staticLayerCountInEnv--,s}prepareStageLayer(t){let e;t.forEachChildren(t=>{let i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i).secondaryHandlers=[]})}releaseLayer(t,e){e.release();let i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter(t=>t!==e))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}};sk.idprefix="visactor_layer",sk.prefix_count=0,sk=oV=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],sk);var sB=new eM(t=>{t(eX).to(eq).inSingletonScope(),t(rN).to(rG),t(s_).to(rU).inSingletonScope(),t(sx).to(rW).inSingletonScope(),t(sA).to(sk).inSingletonScope()});let sC=Symbol.for("IncrementalDrawContribution"),sE=Symbol.for("ArcRender"),sM=Symbol.for("Arc3dRender"),sP=Symbol.for("AreaRender"),sO=Symbol.for("CircleRender"),sR=Symbol.for("GraphicRender"),sI=Symbol.for("GroupRender"),sL=Symbol.for("LineRender"),sD=Symbol.for("PathRender"),sj=Symbol.for("PolygonRender"),sN=Symbol.for("RectRender"),sF=Symbol.for("Rect3DRender"),sG=Symbol.for("SymbolRender"),sz=Symbol.for("TextRender"),sZ=Symbol.for("RichTextRender"),sH=Symbol.for("Pyramid3dRender"),sU=Symbol.for("GlyphRender"),sV=Symbol.for("ImageRender");Symbol.for("RenderSelector");let sW=Symbol.for("DrawContribution"),s$=Symbol.for("RenderService");Symbol.for("BeforeRenderConstribution");let sY=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach(e=>{this._prepare(e,t)})}_prepare(t,e){t.forEachChildren(t=>{this._prepare(t,e)}),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;let i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}};sY=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(oW=0,o$=ez(sW),function(t,e){o$(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],sY);var sX=new eM(t=>{t(s$).to(sY).inSingletonScope()});Symbol.for("GraphicPicker");let sK=Symbol.for("PickerService");Symbol.for("BoundsPicker");let sq=Symbol.for("GlobalPickerService");function sJ(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}Symbol.for("MatrixAllocate"),Symbol.for("Mat4Allocate");class sQ{constructor(){this.pools=[]}static identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}allocate(){if(!this.pools.length)return sJ();let t=this.pools.pop();return sQ.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():sJ();for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}let s0=new class t{constructor(){this.pools=[]}allocate(t,e,i,r,n,s){if(!this.pools.length)return new e3(t,e,i,r,n,s);let a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=r,a.e=n,a.f=s,a}allocateByObj(t){if(!this.pools.length)return new e3(t.a,t.b,t.c,t.d,t.e,t.f);let e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},s1=new sQ;var s2=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let s5=Symbol.for("PickItemInterceptor"),s3=class{constructor(){this.order=1}afterPickItem(t,e,i,r,n){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,r,n):null}beforePickItem(t,e,i,r,n){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,r,n):null}_pickItem(t,e,i,r,n){if(!t.shadowRoot)return null;let{parentMatrix:s}=n||{};if(!s)return null;let a=e.pickContext;a.highPerformanceSave();let o=t.shadowRoot,l=s0.allocateByObj(s),h=new ib(l.a*i.x+l.c*i.y+l.e,l.b*i.x+l.d*i.y+l.f),d=e.pickGroup(o,h,l,r);return a.highPerformanceRestore(),d}};s3=s2([ej()],s3);let s4=class{constructor(){this.order=1}beforePickItem(t,e,i,r,n){let s=t.baseGraphic;if(s&&s.parent){let t=new ib(i.x,i.y),n=e.pickContext;n.highPerformanceSave();let a=s.parent.globalTransMatrix;a.transformPoint(t,t);let o=s.isContainer?e.pickGroup(s,t.clone(),a,r):e.pickItem(s,t.clone(),a,r);return n.highPerformanceRestore(),o}return null}};s4=s2([ej()],s4);let s6=class{constructor(){this.order=1}beforePickItem(t,e,i,r,n){if(!t.in3dMode||r.in3dInterceptor)return null;let s=e.pickContext,a=t.stage;if(!s||!a)return null;if(r.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=a.camera,t.isContainer){let a,o=!1,l=!1;if(t.forEachChildren(t=>!(o=t.numberType===n7)),t.forEachChildren(t=>!(l=!!t.findFace)),o){let s=t.getChildren(),o=[...s];o.sort((t,e)=>{var i,r,n,s;let a=(null!==(r=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==r?r:0)/2,o=(null!==(s=null!==(n=e.attribute.startAngle)&&void 0!==n?n:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;a<0;)a+=eJ.f7;for(;o<0;)o+=eJ.f7;return o-a}),o.forEach(t=>{t._next=null,t._prev=null}),t.removeAllChild(),t.update(),o.forEach(e=>{t.appendChild(e)}),r.hack_pieFace="outside",(a=e.pickGroup(t,i,n.parentMatrix,r)).graphic||(r.hack_pieFace="inside",a=e.pickGroup(t,i,n.parentMatrix,r)),a.graphic||(r.hack_pieFace="top",a=e.pickGroup(t,i,n.parentMatrix,r)),t.removeAllChild(),s.forEach(t=>{t._next=null,t._prev=null}),s.forEach(e=>{t.appendChild(e)})}else if(l){let o=t.getChildren(),l=o.map(t=>({ave_z:t.findFace().vertices.map(e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]}).reduce((t,e)=>t+e,0),g:t}));l.sort((t,e)=>e.ave_z-t.ave_z),t.removeAllChild(),l.forEach(t=>{t.g._next=null,t.g._prev=null}),t.update(),l.forEach(e=>{t.add(e.g)}),a=e.pickGroup(t,i,n.parentMatrix,r),t.removeAllChild(),o.forEach(t=>{t._next=null,t._prev=null}),t.update(),o.forEach(e=>{t.add(e)})}else a=e.pickGroup(t,i,n.parentMatrix,r);return s.camera=null,r.in3dInterceptor=!1,s.restore(),a}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};s6=s2([ej()],s6);var s8=new eM((t,e,i)=>{i(sK)||(t(sq).toSelf(),t(sK).toService(sq)),t(s6).toSelf().inSingletonScope(),t(s5).toService(s6),t(s3).toSelf().inSingletonScope(),t(s5).toService(s3),t(s4).toSelf().inSingletonScope(),t(s5).toService(s4),eV(t,s5)});class s7{updateBounds(t,e,i,r){let{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){let t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(r+(s+a)/2)}return i}}class s9 extends s7{updateBounds(t,e,i,r){let{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:a=e.strokeBoundsBuffer}=t;if(n){let t=e.outerBorder,{distance:r=t.distance,lineWidth:o=t.lineWidth}=n;n1(i,r+(s+o)/2,!0,a)}return i}}function at(t,e,i){let r,n,s,a,o,l,h,d,u,c,p,g;let f=i[0],m=i[1],v=i[2];return e===t?(t[12]=e[0]*f+e[4]*m+e[8]*v+e[12],t[13]=e[1]*f+e[5]*m+e[9]*v+e[13],t[14]=e[2]*f+e[6]*m+e[10]*v+e[14],t[15]=e[3]*f+e[7]*m+e[11]*v+e[15]):(r=e[0],n=e[1],s=e[2],a=e[3],o=e[4],l=e[5],h=e[6],d=e[7],u=e[8],c=e[9],p=e[10],g=e[11],t[0]=r,t[1]=n,t[2]=s,t[3]=a,t[4]=o,t[5]=l,t[6]=h,t[7]=d,t[8]=u,t[9]=c,t[10]=p,t[11]=g,t[12]=r*f+o*m+u*v+e[12],t[13]=n*f+l*m+c*v+e[13],t[14]=s*f+h*m+p*v+e[14],t[15]=a*f+d*m+g*v+e[15]),t}function ae(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function ai(t,e,i){let r=e[0],n=e[1],s=e[2],a=e[3],o=e[4],l=e[5],h=e[6],d=e[7],u=e[8],c=e[9],p=e[10],g=e[11],f=e[12],m=e[13],v=e[14],y=e[15],b=i[0],x=i[1],_=i[2],A=i[3];return t[0]=b*r+x*o+_*u+A*f,t[1]=b*n+x*l+_*c+A*m,t[2]=b*s+x*h+_*p+A*v,t[3]=b*a+x*d+_*g+A*y,b=i[4],x=i[5],_=i[6],A=i[7],t[4]=b*r+x*o+_*u+A*f,t[5]=b*n+x*l+_*c+A*m,t[6]=b*s+x*h+_*p+A*v,t[7]=b*a+x*d+_*g+A*y,b=i[8],x=i[9],_=i[10],A=i[11],t[8]=b*r+x*o+_*u+A*f,t[9]=b*n+x*l+_*c+A*m,t[10]=b*s+x*h+_*p+A*v,t[11]=b*a+x*d+_*g+A*y,b=i[12],x=i[13],_=i[14],A=i[15],t[12]=b*r+x*o+_*u+A*f,t[13]=b*n+x*l+_*c+A*m,t[14]=b*s+x*h+_*p+A*v,t[15]=b*a+x*d+_*g+A*y,t}function ar(t,e,i){var r,n;let{x:s=i.x,y:a=i.y,z:o=i.z,dx:l=i.dx,dy:h=i.dy,dz:d=i.dz,scaleX:u=i.scaleX,scaleY:c=i.scaleY,scaleZ:p=i.scaleZ,alpha:g=i.alpha,beta:f=i.beta,angle:m=i.angle,anchor3d:v=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(v){if("string"==typeof v[0]){let t=parseFloat(v[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=v[0];if("string"==typeof v[1]){let t=parseFloat(v[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=v[1];b[2]=null!==(r=v[2])&&void 0!==r?r:0}if((n=t)[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,at(t,t,[s+l,a+h,o+d]),at(t,t,[b[0],b[1],b[2]]),function(t,e,i){let r=Math.sin(i),n=Math.cos(i),s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],d=e[9],u=e[10],c=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*n+h*r,t[5]=a*n+d*r,t[6]=o*n+u*r,t[7]=l*n+c*r,t[8]=h*n-s*r,t[9]=d*n-a*r,t[10]=u*n-o*r,t[11]=c*n-l*r}(t,t,f),function(t,e,i){let r=Math.sin(i),n=Math.cos(i),s=e[0],a=e[1],o=e[2],l=e[3],h=e[8],d=e[9],u=e[10],c=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*n-h*r,t[1]=a*n-d*r,t[2]=o*n-u*r,t[3]=l*n-c*r,t[8]=s*r+h*n,t[9]=a*r+d*n,t[10]=o*r+u*n,t[11]=l*r+c*n}(t,t,g),at(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){let r=i[0],n=i[1],s=i[2];t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[u,c,p]),m){let i=s1.allocate(),r=[0,0];if(y){if("string"==typeof v[0]){let t=parseFloat(v[0])/100,i=e.AABBBounds;r[0]=i.x1+(i.x2-i.x1)*t}else r[0]=v[0];if("string"==typeof v[1]){let t=parseFloat(v[1])/100,i=e.AABBBounds;r[1]=i.x1+(i.x2-i.x1)*t}else r[1]=v[1]}at(i,i,[r[0],r[1],0]),function(t,e,i){let r=Math.sin(i),n=Math.cos(i),s=e[0],a=e[1],o=e[2],l=e[3],h=e[4],d=e[5],u=e[6],c=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*n+h*r,t[1]=a*n+d*r,t[2]=o*n+u*r,t[3]=l*n+c*r,t[4]=h*n-s*r,t[5]=d*n-a*r,t[6]=u*n-o*r,t[7]=c*n-l*r}(i,i,m),at(i,i,[-r[0],-r[1],0]),ai(t,t,i)}}let an=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new e$(["graphic"]),onSetStage:new e$(["graphic","stage"]),onRemove:new e$(["graphic"]),onRelease:new e$(["graphic"]),onAddIncremental:new e$(["graphic","group","stage"]),onClearIncremental:new e$(["graphic","group","stage"]),beforeUpdateAABBBounds:new e$(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new e$(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new il,this.tempAABBBounds2=new il,this._rectBoundsContribitions=[new s7],this._symbolBoundsContribitions=[new s9],this._circleBoundsContribitions=[new s7],this._arcBoundsContribitions=[new s7],this._pathBoundsContribitions=[new s7]}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,r){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,r)}afterUpdateAABBBounds(t,e,i,r,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,r,n)}updatePathProxyAABBBounds(t,e){let i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;let r=new e6(t);return iv(i.commandList,r,0,0),!0}updateRectAABBBounds(t,e,i,r){if(!this._validCheck(t,e,i,r))return i;if(!this.updatePathProxyAABBBounds(i,r)){let{width:e,height:r}=t,{x1:n,y1:s,x:a,y:o}=t;e=null!=e?e:n-a,r=null!=r?r:s-o,i.set(0,0,e||0,r||0)}let n=this.tempAABBBounds1,s=this.tempAABBBounds2;return n.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach(a=>{a.updateBounds(t,e,n,r),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2)}),this.transformAABBBounds(t,i,e,!1,r),i}updateGroupAABBBounds(t,e,i,r){let{width:n,height:s,path:a,clip:o=e.clip}=t;a&&a.length?a.forEach(t=>{i.union(t.AABBBounds)}):null!=n&&null!=s&&i.set(0,0,n,s),o||r.forEachChildren(t=>{i.union(t.AABBBounds)});let l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,r),i}updateGlyphAABBBounds(t,e,i,r){return this._validCheck(t,e,i,r)&&r.getSubGraphic().forEach(t=>{i.union(t.AABBBounds)}),i}updateRichTextAABBBounds(t,e,i,r){if(!this._validCheck(t,e,i,r)||!r)return i;let{width:n=e.width,height:s=e.height,maxWidth:a=e.maxWidth,maxHeight:o=e.maxHeight,textAlign:l=e.textAlign,textBaseline:h=e.textBaseline}=t;if(n>0&&s>0)i.set(0,0,n,s);else{let{width:t,height:e}=r.getFrameCache().getActualSize(),l=n||t||0,h=s||e||0;h="number"==typeof o&&h>o?o:h||0,l="number"==typeof a&&l>a?a:l||0,i.set(0,0,l,h)}let d=0;switch(h){case"top":d=0;break;case"middle":d=-i.height()/2;break;case"bottom":d=-i.height()}let u=0;switch(l){case"left":u=0;break;case"center":u=-i.width()/2;break;case"right":u=-i.width()}i.translate(u,d);let c=this.tempAABBBounds1,p=this.tempAABBBounds2;return c.setValue(i.x1,i.y1,i.x2,i.y2),p.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,r),i}updateTextAABBBounds(t,e,i,r){if(!this._validCheck(t,e,i,r)||!r)return i;let{text:n=e.text}=r.attribute;Array.isArray(n)?r.updateMultilineAABBBounds(n):r.updateSingallineAABBBounds(n);let s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);let{scaleX:o=e.scaleX,scaleY:l=e.scaleY,shadowBlur:h=e.shadowBlur,strokeBoundsBuffer:d=e.strokeBoundsBuffer}=t;return h&&(n1(s,h/Math.abs(o+l),!0,d),i.union(s)),this.combindShadowAABBBounds(i,r),ia(i,i,r.transMatrix),i}updatePathAABBBounds(t,e,i,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||this.updatePathAABBBoundsImprecise(t,e,i,r);let n=this.tempAABBBounds1,s=this.tempAABBBounds2;n.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach(a=>{a.updateBounds(t,e,n,r),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2)});let{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updatePathAABBBoundsImprecise(t,e,i,r){if(!r)return i;let n=r.getParsedPathShape();return i.union(n.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,r){if(!r)return i;let n=r.stage;if(!n||!n.camera)return i;r.findFace().vertices.forEach(t=>{let e=t[0],r=t[1];i.add(e,r)});let s=this.tempAABBBounds1,a=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,r),i}updateArc3dAABBBounds(t,e,i,r){if(!r)return i;let n=r.stage;if(!n||!n.camera)return i;let{outerRadius:s=e.outerRadius,height:a=0}=t,o=s+a;i.setValue(-o,-o,o,o);let l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,r),i}updatePolygonAABBBounds(t,e,i,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||this.updatePolygonAABBBoundsImprecise(t,e,i,r);let n=this.tempAABBBounds1,s=this.tempAABBBounds2;n.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);let{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updatePolygonAABBBoundsImprecise(t,e,i,r){let{points:n=e.points}=t;return n.forEach(t=>{i.add(t.x,t.y)}),i}updateLineAABBBounds(t,e,i,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,r):this.updateLineAABBBoundsByPoints(t,e,i,r));let n=this.tempAABBBounds1,s=this.tempAABBBounds2;n.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);let{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateLineAABBBoundsByPoints(t,e,i,r){let{points:n=e.points}=t;return n.forEach(t=>{i.add(t.x,t.y)}),i}updateLineAABBBoundsBySegments(t,e,i,r){let{segments:n=e.segments}=t;return n.forEach(t=>{t.points.forEach(t=>{i.add(t.x,t.y)})}),i}updateAreaAABBBounds(t,e,i,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,r):this.updateAreaAABBBoundsByPoints(t,e,i,r));let n=this.tempAABBBounds1,s=this.tempAABBBounds2;n.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);let{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateAreaAABBBoundsByPoints(t,e,i,r){let{points:n=e.points}=t;return n.forEach(t=>{var e,r;i.add(t.x,t.y),i.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(r=t.y1)&&void 0!==r?r:t.y)}),i}updateAreaAABBBoundsBySegments(t,e,i,r){let{segments:n=e.segments}=t;return n.forEach(t=>{t.points.forEach(t=>{var e,r;i.add(t.x,t.y),i.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(r=t.y1)&&void 0!==r?r:t.y)})}),i}updateCircleAABBBounds(t,e,i,r,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(r?this.updateCircleAABBBoundsImprecise(t,e,i,n):this.updateCircleAABBBoundsAccurate(t,e,i,n));let s=this.tempAABBBounds1,a=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach(r=>{r.updateBounds(t,e,s,n),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)}),this.transformAABBBounds(t,i,e,!1,n),i}updateCircleAABBBoundsImprecise(t,e,i,r){let{radius:n=e.radius}=t;return i.set(-n,-n,n,n),i}updateCircleAABBBoundsAccurate(t,e,i,r){let{startAngle:n=e.startAngle,endAngle:s=e.endAngle,radius:a=e.radius}=t;return s-n>eJ.f7-eJ.Ho?i.set(-a,-a,a,a):nW(n,s,a,i),i}updateArcAABBBounds(t,e,i,r,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(r?this.updateArcAABBBoundsImprecise(t,e,i,n):this.updateArcAABBBoundsAccurate(t,e,i,n));let s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach(r=>{r.updateBounds(t,e,s,n),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)});let{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateArcAABBBoundsImprecise(t,e,i,r){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t,{outerPadding:a=e.outerPadding,innerPadding:o=e.innerPadding}=t;return(n+=a)<(s-=o)&&(n=s),i.set(-n,-n,n,n),i}updateArcAABBBoundsAccurate(t,e,i,r){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t,{outerPadding:a=e.outerPadding,innerPadding:o=e.innerPadding}=t;if((n+=a)<(s-=o)){let t=n;n=s,s=t}let{endAngle:l=e.endAngle,startAngle:h=e.startAngle}=t;if(h>l){let t=h;h=l,l=t}return n<=eJ.Ho?i.set(0,0,0,0):Math.abs(l-h)>eJ.f7-eJ.Ho?i.set(-n,-n,n,n):(nW(h,l,n,i),nW(h,l,s,i)),i}updateSymbolAABBBounds(t,e,i,r,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(r?this.updateSymbolAABBBoundsImprecise(t,e,i,n):this.updateSymbolAABBBoundsAccurate(t,e,i,n));let s=this.tempAABBBounds1,a=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach(r=>{r.updateBounds(t,e,s,n),i.union(s),s.setValue(a.x1,a.y1,a.x2,a.y2)});let{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateSymbolAABBBoundsImprecise(t,e,i,r){let{size:n=e.size}=t;if((0,ev.Z)(n))i.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{let t=n/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i,r){if(!r)return i;let{size:n=e.size}=t;return r.getParsedPath().bounds(n,i),i}updateImageAABBBounds(t,e,i,r){if(!this._validCheck(t,e,i,r))return i;if(!this.updatePathProxyAABBBounds(i,r)){let{width:r=e.width,height:n=e.height}=t;i.set(0,0,r,n)}let n=this.tempAABBBounds1,s=this.tempAABBBounds2;return n.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,r),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){let i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,r,n){if(!e.empty()){let{scaleX:n=i.scaleX,scaleY:s=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:d=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,c=this.tempAABBBounds2;if(a&&l&&(n1(u,(l+h)/Math.abs(n+s),r,d),e.union(u),u.setValue(c.x1,c.y1,c.x2,c.y2)),o){let{shadowOffsetX:r=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;n1(u,o/Math.abs(n+s)*2,!1,d+1),u.translate(r,a),e.union(u)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let s=!0,a=n.transMatrix;n&&n.isContainer&&(s=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),s&&ia(e,e,a)}_validCheck(t,e,i,r){if(!r)return!0;if(!r.valid)return i.clear(),!1;let{visible:n=e.visible}=t;return!!n||(i.clear(),!1)}};an=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(oY=0,oX=ez(sg),function(t,e){oX(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],an);let as=new class t{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){let i=this.store.get(t);return i?i(e):null}};var aa=new eM(t=>{t(sp).to(an).inSingletonScope(),t(sg).toConstantValue(as)});let ao=Symbol.for("AutoEnablePlugins"),al=Symbol.for("PluginService");var ah=function(t,e){return function(i,r){e(i,r,t)}};let ad=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;let{pluginList:i}=e;i&&rR.isBound(ao)&&this.autoEnablePlugins.getContributions().forEach(t=>{i.includes(t.name)&&this.register(t)})}findPluginsByName(t){let e=[];return this.onStartupFinishedPlugin.forEach(i=>{i.name===t&&e.push(i)}),this.onRegisterPlugin.forEach(i=>{i.name===t&&e.push(i)}),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(...t){this.onStartupFinishedPlugin.forEach(t=>{t.deactivate(this)}),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach(t=>{t.deactivate(this)}),this.onRegisterPlugin=[]}};ad=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),ah(0,ez(eH)),ah(0,eZ(ao)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ad);var au=new eM(t=>{t(al).to(ad),function(t,e){t(eH).toDynamicValue(({container:t})=>new eU(e,t)).whenTargetNamed(e)}(t,ao)}),ac=new eM(t=>{eV(t,eY)}),ap=new eM(t=>{t(r_).to(rA).inSingletonScope(),eV(t,r_)});let ag=class{constructor(){this.type="static",this.offscreen=!1,this.global=ru.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");let r=e.getContext().getCanvas().nativeCanvas,n=rD({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:r.offsetLeft,y:r.offsetTop});n.applyPosition(),this.canvas=n,this.context=n.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var r;if(!this.main){let t=this.window.getContext().getCanvas().nativeCanvas;t&&(this.canvas.x!==t.offsetLeft||this.canvas.y!==t.offsetTop)&&(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(r=e.background)&&void 0!==r?r:"#ffffff"},e),i))}merge(t){t.forEach(t=>{let e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)})}prepare(t,e){}drawTo(t,e,i){var r;let n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(r=i.background)&&void 0!==r?r:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};ag=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],ag);let af=class{constructor(){this.offscreen=!1,this.type="virtual",this.global=ru.global}setDpr(t){}init(t,e,i){if(this.layer=t,this.window=e,i.main)throw Error("virtual layer不能作为main layer");this.main=!1,this.canvas=null,this.context=null}resize(t,e){}resizeView(t,e){}render(t,e,i){this.mainHandler.render(t,e,Object.assign(Object.assign({},i),{clear:!1}))}merge(t){}prepare(t,e){}drawTo(t,e,i){var r;let n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(r=i.background)&&void 0!==r?r:"#fff":void 0}))}getContext(){return null}release(){}};af=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],af);let am=class{constructor(){this.offscreen=!0,this.type="dynamic",this.global=ru.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;let r=rD({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=r,this.context=r.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context,viewBox:e.stage.window.getViewBox(),transMatrix:e.stage.window.getViewBoxTransform()},e),{clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"}))}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,i){let r=t.getContext(),n=t.dpr,{viewBox:s}=i,a=s.x1,o=s.y1,l=s.width(),h=s.height();r.nativeContext.save(),r.nativeContext.setTransform(n,0,0,n,0,0),i.clear&&r.clearRect(a,o,l,h),r.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,a,o,l,h),r.nativeContext.restore()}merge(t){}};am=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],am);var av=new eM(t=>{t(ag).toSelf(),t(am).toSelf(),t(af).toSelf(),t(sw).toService(ag),t(sS).toService(am),t(sT).toService(af)});let ay=eG(eR);function ab(t,e,i,r=!1,n=!1){let s={},a=[],o=!1;if(n)o=!0;else{let i;t.forEachChildren((t,r)=>{let{zIndex:n=e}=t.attribute;if(0===r)i=n;else if(i!==n)return o=!0,!0;return!1},r)}if(o){t.forEachChildren(t=>{let{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],a.push(i))},r),a.sort((t,e)=>r?e-t:t-e);let o=!1;for(let t=0;t<a.length&&!o;t++){let e=s[a[t]];n&&e.sort((t,e)=>{var i,n;return(r?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))});for(let t=0;t<e.length;t++)if(i(e[t],t)){o=!0;break}}}else t.forEachChildren(i,r)}function ax(t,e,i,r=!1){var n,s,a,o;return n=this,s=void 0,a=void 0,o=function*(){yield t.forEachChildrenAsync(i,r)},new(a||(a=Promise))(function(t,e){function i(t){try{l(o.next(t))}catch(t){e(t)}}function r(t){try{l(o.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):((n=e.value)instanceof a?n:new a(function(t){t(n)})).then(i,r)}l((o=o.apply(n,s||[])).next())})}let a_=Symbol.for("DrawItemInterceptor"),aA=new il;class aw{constructor(){this.order=1}afterDrawItem(t,e,i,r,n){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,r,n),!1}beforeDrawItem(t,e,i,r,n){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,r,n),!1}drawItem(t,e,i,r,n){if(!t.shadowRoot)return!1;let{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),r.dirtyBounds&&r.backupDirtyBounds){aA.copy(r.dirtyBounds);let e=t.globalTransMatrix.getInverse();r.dirtyBounds.copy(r.backupDirtyBounds).transformWithMatrix(e)}return r.renderGroup(t.shadowRoot,i,t.parent.globalTransMatrix),s.highPerformanceRestore(),r.dirtyBounds&&r.backupDirtyBounds&&r.dirtyBounds.copy(aA),!0}}class aS{constructor(){this.order=1}afterDrawItem(t,e,i,r,n){return t.attribute._debug_bounds&&this.drawItem(t,e,i,r,n),!1}drawItem(t,e,i,r,n){if(!t.attribute._debug_bounds)return!1;let{context:s}=i;s.highPerformanceSave(),t.parent&&s.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&s.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);let a=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(s,t),s.strokeRect(a.x1,a.y1,a.width(),a.height()),s.highPerformanceRestore(),!0}}let aT=class{constructor(){this.order=1,this.interceptors=[new aw,new aB,new ak,new aS]}afterDrawItem(t,e,i,r,n){for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].afterDrawItem&&this.interceptors[s].afterDrawItem(t,e,i,r,n))return!0;return!1}beforeDrawItem(t,e,i,r,n){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].beforeDrawItem&&this.interceptors[s].beforeDrawItem(t,e,i,r,n))return!0;return!1}};aT=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],aT);class ak{constructor(){this.order=1}beforeDrawItem(t,e,i,r,n){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,r,n):this.beforeSetInteractive(t,e,i,r,n))}beforeSetInteractive(t,e,i,r,n){let s=t.interactiveGraphic;if(t.attribute.globalZIndex){s||(s=t.clone(),t.interactiveGraphic=s,s.baseGraphic=t),s.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();let e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(s),!0}if(s){i.stage.tryInitInteractiveLayer();let e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(s),t.interactiveGraphic=null,s.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,r,n){let s=t.baseGraphic;if(s){this.processing=!0;let{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(s.parent.globalTransMatrix,!0),s.isContainer?r.renderGroup(s,i,s.parent.globalTransMatrix):r.renderItem(s,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||((i=as.CreateGraphic("group",{})).id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class aB{constructor(){this.order=1}beforeDrawItem(t,e,i,r,n){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;let{context:s,stage:a}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=a.camera;let o=s.currentMatrix;o.a/=s.dpr,o.b/=s.dpr,o.c/=s.dpr,o.d/=s.dpr,o.e/=s.dpr,o.f/=s.dpr;let l=s1.allocate();ae(l,o);let h=s.modelMatrix;if(h){if(l){let t=s1.allocate();s.modelMatrix=ai(t,h,l)}}else s.modelMatrix=l;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,n=!1;if(t.forEachChildren(t=>!(e=t.numberType===n7)),t.forEachChildren(t=>!(n=!!t.findFace)),e){let e=t.getChildren(),n=[...e];n.sort((t,e)=>{var i,r,n,s;let a=((null!==(i=t.attribute.startAngle)&&void 0!==i?i:0)+(null!==(r=t.attribute.endAngle)&&void 0!==r?r:0))/2,o=((null!==(n=e.attribute.startAngle)&&void 0!==n?n:0)+(null!==(s=e.attribute.endAngle)&&void 0!==s?s:0))/2;for(;a<0;)a+=eJ.f7;for(;o<0;)o+=eJ.f7;return o-a}),n.forEach(t=>{t._next=null,t._prev=null}),t.removeAllChild(),t.update(),n.forEach(e=>{t.appendChild(e)});let s=t.parent.globalTransMatrix;i.hack_pieFace="outside",r.renderGroup(t,i,s),i.hack_pieFace="inside",r.renderGroup(t,i,s),i.hack_pieFace="top",r.renderGroup(t,i,s),t.removeAllChild(),e.forEach(t=>{t._next=null,t._prev=null}),e.forEach(e=>{t.appendChild(e)})}else if(n){let e=t.getChildren(),n=e.map(t=>({ave_z:t.findFace().vertices.map(e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]}).reduce((t,e)=>t+e,0),g:t}));n.sort((t,e)=>e.ave_z-t.ave_z),t.removeAllChild(),n.forEach(t=>{t.g._next=null,t.g._prev=null}),t.update(),n.forEach(e=>{t.add(e.g)}),r.renderGroup(t,i,t.parent.globalTransMatrix,!0),t.removeAllChild(),e.forEach(t=>{t._next=null,t._prev=null}),t.update(),e.forEach(e=>{t.add(e)})}else r.renderGroup(t,i,t.parent.globalTransMatrix)}else r.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==h&&s1.free(s.modelMatrix),s.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}let aC=function(){let t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i},e="";function i(t){let i=Error(e+": "+t);throw i.source=e,i}function r(){return n("linear",t.linearGradient,s)||n("radial",t.radialGradient,o)||n("conic",t.conicGradient,a)}function n(e,r,n){return function(e,r){let n=v(e);if(n){v(t.startCall)||i("Missing (");let e=r(n);return v(t.endCall)||i("Missing )"),e}}(r,function(r){let s=n();return s&&(v(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:c(p)}})}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let i,r,n=l();return n&&((i=[]).push(n),r=e,v(t.comma)&&((n=l())?i.push(n):e=r)),i}function l(){let t=function(){let t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){let t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=d();else{let e=h();if(e){t=e;let i=d();i&&(t.at=i)}else{let e=u();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function d(){if(m("position",/^at/,0)){let t=u();return t||i("Missing positioning value"),t}}function u(){let t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function c(e){let r=e(),n=[];if(r)for(n.push(r);v(t.comma);)(r=e())?n.push(r):i("One extra comma");return n}function p(){let e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){let r=v(e);if(r)return{type:t,value:r[i]}}function v(t){let i=/^[\n\r\t\s]+/.exec(e);i&&y(i[0].length);let r=t.exec(e);return r&&y(r[0].length),r}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){let t=c(r);return e.length>0&&i("Invalid input not EOF"),t}()}}();class aE{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(aE.IsGradientStr(t))try{let e=aC(t)[0];if(e){if("linear"===e.type)return aE.ParseLinear(e);if("radial"===e.type)return aE.ParseRadial(e);if("conic"===e.type)return aE.ParseConic(e)}}catch(t){}return t}static ParseConic(t){let{orientation:e,colorStops:i=[]}=t,r=eJ.pi/2,n=parseFloat(e.value)/180*eJ.pi-r;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+eJ.f7,stops:i.map(t=>({color:t.value,offset:parseFloat(t.length.value)/100}))}}static ParseRadial(t){let{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map(t=>({color:t.value,offset:parseFloat(t.length.value)/100}))}}static ParseLinear(t){let{orientation:e,colorStops:i=[]}=t,r=eJ.pi/2,n="angular"===e.type?parseFloat(e.value)/180*eJ.pi:0;for(;n<0;)n+=eJ.f7;for(;n>eJ.f7;)n-=eJ.f7;let s=0,a=0,o=0,l=0;return n<r?(s=0,a=1,o=Math.sin(n),l=Math.cos(n)):n<eJ.pi?(s=0,a=0,o=Math.cos(n-r),l=Math.sin(n-r)):n<eJ.pi+r?(a=0,o=(s=1)-Math.sin(n-eJ.pi),l=Math.cos(n-eJ.pi)):(o=(s=1)-Math.cos(n-r-eJ.pi),l-=Math.sin(n-r-eJ.pi)),{gradient:"linear",x0:s,y0:a,x1:o,y1:l,stops:i.map(t=>({color:t.value,offset:parseFloat(t.length.value)/100}))}}}function aM(t,e,i){let r=e,{a:n,b:s,c:a,d:o}=t.currentMatrix,l=Math.sign(n)*Math.sqrt(n*n+s*s),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:r=r/Math.abs(l+h)*2*i}function aP(t,e,i,r,n){let s,a;if(!e||!0===e)return"black";if((0,ev.Z)(e))for(let t=0;t<e.length&&!(a=e[t]);t++);else a=e;return"string"==typeof(a=aE.Parse(a))?a:("linear"===a.gradient?s=function(t,e,i,r=0,n=0){var s,a,o,l;let h=i.AABBBounds;if(!h)return;let d=h.x2-h.x1,u=h.y2-h.y1,c=h.x1-r,p=h.y1-n;if(i.attribute){let{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;d/=t,u/=e,c/=t,p/=e}let g=t.createLinearGradient(c+(null!==(s=e.x0)&&void 0!==s?s:0)*d,p+(null!==(a=e.y0)&&void 0!==a?a:0)*u,c+(null!==(o=e.x1)&&void 0!==o?o:1)*d,p+(null!==(l=e.y1)&&void 0!==l?l:0)*u);return e.stops.forEach(t=>{g.addColorStop(t.offset,t.color)}),g}(t,a,i,r,n):"conical"===a.gradient?s=function(t,e,i,r=0,n=0){var s,a;let o=i.AABBBounds;if(!o)return;let l=o.x2-o.x1,h=o.y2-o.y1,d=o.x1-r,u=o.y1-n;if(i.attribute){let{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;l/=t,h/=e,d/=t,u/=e}let c=t.createConicGradient(d+(null!==(s=e.x)&&void 0!==s?s:0)*l,u+(null!==(a=e.y)&&void 0!==a?a:0)*h,e.startAngle,e.endAngle);return e.stops.forEach(t=>{c.addColorStop(t.offset,t.color)}),c.GetPattern(l+d,h+u,void 0)}(t,a,i,r,n):"radial"===a.gradient&&(s=function(t,e,i,r=0,n=0){var s,a,o,l,h,d;let u=i.AABBBounds;if(!u)return;let c=u.x2-u.x1,p=u.y2-u.y1,g=u.x1-r,f=u.y1-n;if(i.attribute){let{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;g/=t,f/=e,c/=t,p/=e}let m=t.createRadialGradient(g+(null!==(s=e.x0)&&void 0!==s?s:.5)*c,f+(null!==(a=e.y0)&&void 0!==a?a:.5)*p,Math.max(c,p)*(null!==(o=e.r0)&&void 0!==o?o:0),g+(null!==(l=e.x1)&&void 0!==l?l:.5)*c,f+(null!==(h=e.y1)&&void 0!==h?h:.5)*p,Math.max(c,p)*(null!==(d=e.r1)&&void 0!==d?d:.5));return e.stops.forEach(t=>{m.addColorStop(t.offset,t.color)}),m}(t,a,i,r,n)),s||"orange")}Symbol.for("BoundsAllocate");let aO=new class t{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new il)}allocate(t,e,i,r){if(!this.pools.length)return(new il).setValue(t,e,i,r);let n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=r,n}allocateByObj(t){if(!this.pools.length)return new il(t);let e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};var aR=function(t,e){return function(i,r){e(i,r,t)}};let aI=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new io,this.backupDirtyBounds=new io,this.global=ru.global,this.layerService=ru.layerService,this.init()}init(){this.contributions.forEach(t=>{if(t.style){let e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)}),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort((t,e)=>t.order-e.order)}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;let{context:i,stage:r,viewBox:n,transMatrix:s}=e;if(!i)return;let a=this.dirtyBounds.setValue(0,0,n.width(),n.height());if(r.dirtyBounds&&!r.dirtyBounds.empty()){let t=function(t,e,i){if(null===t)return e;if(null===e)return t;let{x11:r,x12:n,y11:s,y12:a,x21:o,x22:l,y21:h,y22:d}=e9(t,e,i);return r>=l||n<=o||s>=d||a<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(r,o),y1:Math.max(s,h),x2:Math.min(n,l),y2:Math.min(a,d)}}(a,r.dirtyBounds,!1);a.x1=Math.floor(t.x1),a.y1=Math.floor(t.y1),a.x2=Math.ceil(t.x2),a.y2=Math.ceil(t.y2)}let o=i.dpr%1;(o||.5!==o)&&(a.x1=Math.floor(a.x1*i.dpr)/i.dpr,a.y1=Math.floor(a.y1*i.dpr)/i.dpr,a.x2=Math.ceil(a.x2*i.dpr)/i.dpr,a.y2=Math.ceil(a.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(a),i.inuse=!0,i.setClearMatrix(s.a,s.b,s.c,s.d,s.e,s.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(n.x1,n.y1,!0),i.beginPath(),i.rect(a.x1,a.y1,a.width(),a.height()),i.clip(),r.camera&&(this.dirtyBounds.setValue(-Infinity,-Infinity,1/0,1/0),this.backupDirtyBounds.setValue(-Infinity,-Infinity,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort((t,e)=>{var i,r;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:i4.zIndex)-(null!==(r=e.attribute.zIndex)&&void 0!==r?r:i4.zIndex)}).forEach(t=>{t.isContainer?this.renderGroup(t,e,s0.allocate(1,0,0,1,0,0)):this.renderItem(t,e)}),i.restore(),i.draw(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1}doRegister(){throw Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){let t=function(t,e,i,r=!1){let n={},s=[],a=!1;t.forEachChildren((t,e)=>{let{zIndex:r=i}=t.attribute;if(0===e);else if(void 0!==r)return a=!0,!0;return!1},r);let o=null,l=!1;if(a){t.forEachChildren(t=>{let{zIndex:e=i}=t.attribute;n[e]?n[e].push(t):(n[e]=[t],s.push(e))},r),s.sort((t,e)=>r?e-t:t-e);let a=!1;for(let t=0;t<s.length&&!a;t++){let i=n[s[t]];for(let t=0;t<i.length;t++){if(l){a=!0,o=i[t];break}i[t]._uid!==e||(l=!0)}}}else t.forEachChildren(t=>l?(o=t,!0):(t._uid===e&&(l=!0),!1),r);return o}(e,i,i4.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,r){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!it(t.AABBBounds,this.dirtyBounds,!1))return;let n,s=i;if(this.useDirtyBounds){n=aO.allocateByObj(this.dirtyBounds);let e=t.transMatrix;s=s0.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(s.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;r?t.forEachChildren(t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))}):ab(t,i4.zIndex,t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))},!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(n),aO.free(n),s0.free(s))}_increaseRender(t,e){let{layer:i,stage:r}=e,{subLayers:n}=i,s=n.get(t._uid);s||(s={layer:this.layerService.createLayer(r),zIndex:n.size,group:t},n.set(t._uid,s));let a=s.layer.getNativeHandler().getContext(),o=s.drawContribution||rR.get(sC);o.dirtyBounds.setValue(-Infinity,-Infinity,1/0,1/0),o.backupDirtyBounds.setValue(-Infinity,-Infinity,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:s.layer,context:a,startAtId:t._uid,break:!1})),s.drawContribution=o;let l=this._findNextGraphic(t);if(l){if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=n.get(l._uid);t||(t={layer:this.layerService.createLayer(r),zIndex:n.size},n.set(l._uid,t));let i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:l._uid,break:!1}))}}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){let n=this.InterceptorContributions[r];if(n.beforeDrawItem&&n.beforeDrawItem(t,this.currentRenderService,e,this,i))return}let r=this.getRenderContribution(t);if(!r)return;let n,s=!1;if(t.parent){let{scrollX:e=0,scrollY:i=0}=t.parent.attribute;if(s=!(!e&&!i)){n=this.dirtyBounds.clone();let r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.dirtyBounds.translate(-e,-i)}}if(this.useDirtyBounds&&!t.isContainer&&!it(t.AABBBounds,this.dirtyBounds,!1))return void(s&&this.dirtyBounds.copy(n));let a=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=a),a?t.isContainer&&r.draw(t,this.currentRenderService,e,i):r.draw(t,this.currentRenderService,e,i),s&&this.dirtyBounds.copy(n),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){let r=this.InterceptorContributions[i];if(r.afterDrawItem&&r.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return eC.Y.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t,e){let i;if(e.attribute.renderStyle){let r=this.styleRenderMap.get(e.attribute.renderStyle);i=r&&r.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){var r,n;let{clear:s,viewBox:a}=i,o=a.width(),l=a.height();if(s){e.clearRect(0,0,o,l);let i=null===(r=t.drawParams)||void 0===r?void 0:r.stage;if(i&&(e.globalAlpha=null!==(n=i.attribute.opacity)&&void 0!==n?n:1),i&&i.backgroundImg&&i.resources){let t=i.resources.get(s);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,o,l)}else e.fillStyle=aP(e,s,{AABBBounds:{x1:0,y1:0,x2:0+o,y2:0+l}},0,0),e.fillRect(0,0,o,l)}}afterDraw(t,e){}};aI=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),aR(0,ay(sR)),aR(1,ez(eH)),aR(1,eZ(a_)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object])],aI);let aL=eJ.pi/2;function aD(t,e,i,r,n,s){let a;if(r<0&&(e+=r,r=-r),n<0&&(i+=n,n=-n),(0,iy.Z)(s,!0))a=[s=(0,eJ.Wn)(s),s,s,s];else if(Array.isArray(s)){let t,e;let i=s;switch(i.length){case 0:a=[0,0,0,0];break;case 1:a=[t=(0,eJ.Wn)(i[0]),t,t,t];break;case 2:case 3:t=(0,eJ.Wn)(i[0]),a=[t,e=(0,eJ.Wn)(i[1]),t,e];break;default:(a=i)[0]=(0,eJ.Wn)(a[0]),a[1]=(0,eJ.Wn)(a[1]),a[2]=(0,eJ.Wn)(a[2]),a[3]=(0,eJ.Wn)(a[3])}}else a=[0,0,0,0];if(r<0||a[0]+a[1]+a[2]+a[3]<1e-12)return t.rect(e,i,r,n);let[o,l,h,d]=[[e,i],[e+r,i],[e+r,i+n],[e,i+n]],u=Math.min(r/2,n/2),c=[Math.min(u,a[0]),Math.min(u,a[1]),Math.min(u,a[2]),Math.min(u,a[3])],p=[o[0]+c[0],o[1]],g=[o[0],o[1]+c[0]],f=[l[0]-c[1],l[1]],m=[l[0],l[1]+c[1]],v=[h[0]-c[2],h[1]],y=[h[0],h[1]-c[2]],b=[d[0]+c[3],d[1]],x=[d[0],d[1]-c[3]];if(t.moveTo(p[0],p[1]),t.lineTo(f[0],f[1]),!eS(f,m)){let e=f[0],i=f[1]+c[1];t.arc(e,i,c[1],-aL,0,!1)}if(t.lineTo(y[0],y[1]),!eS(v,y)){let e=y[0]-c[2],i=y[1];t.arc(e,i,c[2],0,aL,!1)}if(t.lineTo(b[0],b[1]),!eS(b,x)){let e=b[0],i=b[1]-c[3];t.arc(e,i,c[3],aL,eJ.pi,!1)}if(t.lineTo(g[0],g[1]),!eS(p,g)){let e=p[0],i=p[1]+c[0];t.arc(e,i,c[0],eJ.pi,eJ.pi+aL,!1)}return t.closePath(),t}function aj(t,e){return!(!t&&!e)}function aN(t,e){return((0,ev.Z)(t)?t.some(t=>t||void 0===t):!!t)&&e>0}function aF(t,e,i){return i&&t*e>0}function aG(t,e,i,r,n){return n&&t*e>0&&0!==i&&0!==r}function az(t,e){return t*e>0}function aZ(t,e,i,r){return t*e>0&&0!==i&&0!==r}function aH(t,e,i,r,n,s,a,o){let l=i-t,h=r-e,d=a-n,u=o-s,c=u*l-d*h;return c*c<eJ.Ho?[]:(c=(d*(e-s)-u*(t-n))/c,[t+c*l,e+c*h])}function aU(t,e,i,r,n,s,a){let o=t-i,l=e-r,h=(a?s:-s)/Math.sqrt(o*o+l*l),d=h*l,u=-h*o,c=t+d,p=e+u,g=i+d,f=r+u,m=(c+g)/2,v=(p+f)/2,y=g-c,b=f-p,x=y*y+b*b,_=n-s,A=c*f-g*p,w=(b<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A)),S=(A*b-y*w)/x,T=(-A*y-b*w)/x,k=(A*b+y*w)/x,B=(-A*y+b*w)/x,C=S-m,E=T-v,M=k-m,P=B-v;return C*C+E*E>M*M+P*P&&(S=k,T=B),{cx:S,cy:T,x01:-d,y01:-u,x11:S*(n/_-1),y11:T*(n/_-1)}}function aV(t,e,i,r,n,s,a){let{startAngle:o,endAngle:l}=t.getParsedAngle(),h=(0,eJ.Wn)(l-o),d=l>o,u=!1;if(n<s){let t=n;n=s,s=t}if(n<=eJ.Ho)e.moveTo(i,r);else if(h>=eJ.f7-eJ.Ho)e.moveTo(i+n*(0,eJ.mC)(o),r+n*(0,eJ.O$)(o)),e.arc(i,r,n,o,l,!d),s>eJ.Ho&&(e.moveTo(i+s*(0,eJ.mC)(l),r+s*(0,eJ.O$)(l)),e.arc(i,r,s,l,o,d));else{let c,p,g,f;let m=t.getParsedCornerRadius(),{outerDeltaAngle:v,innerDeltaAngle:y,outerStartAngle:b,outerEndAngle:x,innerEndAngle:_,innerStartAngle:A}=t.getParsePadAngle(o,l),w=Math.max(m,m),S=Math.max(m,m),T=w,k=S,B=n*(0,eJ.mC)(b),C=n*(0,eJ.O$)(b),E=s*(0,eJ.mC)(_),M=s*(0,eJ.O$)(_);if((S>eJ.Ho||w>eJ.Ho)&&(c=n*(0,eJ.mC)(x),p=n*(0,eJ.O$)(x),g=s*(0,eJ.mC)(A),f=s*(0,eJ.O$)(A),h<eJ.pi)){let t=aH(B,C,g,f,c,p,E,M);if(t){let e=B-t[0],i=C-t[1],r=c-t[0],a=p-t[1],o=1/(0,eJ.O$)((0,eJ.Kh)((e*r+i*a)/((0,eJ._b)(e*e+i*i)*(0,eJ._b)(r*r+a*a)))/2),l=(0,eJ._b)(t[0]*t[0]+t[1]*t[1]);k=(0,eJ.VV)(S,(s-l)/(o-1)),T=(0,eJ.VV)(w,(n-l)/(o+1))}}if(v<.001)a&&(a[3]||a[1])&&e.moveTo(i+B,r+C),u=!0;else if(T>eJ.Ho){let t=(0,eJ.VV)(m,T),s=(0,eJ.VV)(m,T),o=aU(g,f,B,C,n,t,Number(d)),l=aU(c,p,E,M,n,s,Number(d));T<w&&t===s?!a||a[0]?(e.moveTo(i+o.cx+o.x01,r+o.cy+o.y01),e.arc(i+o.cx,r+o.cy,T,(0,eJ.fv)(o.y01,o.x01),(0,eJ.fv)(l.y01,l.x01),!d)):e.moveTo(i+o.cx+T*(0,eJ.mC)((0,eJ.fv)(l.y01,l.x01)),r+o.cy+T*(0,eJ.O$)((0,eJ.fv)(l.y01,l.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,r+o.cy+o.y01),t>0&&e.arc(i+o.cx,r+o.cy,t,(0,eJ.fv)(o.y01,o.x01),(0,eJ.fv)(o.y11,o.x11),!d),e.arc(i,r,n,(0,eJ.fv)(o.cy+o.y11,o.cx+o.x11),(0,eJ.fv)(l.cy+l.y11,l.cx+l.x11),!d),s>0&&e.arc(i+l.cx,r+l.cy,s,(0,eJ.fv)(l.y11,l.x11),(0,eJ.fv)(l.y01,l.x01),!d)):s>0?e.moveTo(i+l.cx+s*(0,eJ.mC)((0,eJ.fv)(l.y01,l.x01)),r+l.cy+s*(0,eJ.O$)((0,eJ.fv)(l.y01,l.x01))):e.moveTo(i+c,r+n*(0,eJ.O$)(x))}else!a||a[0]?(e.moveTo(i+B,r+C),e.arc(i,r,n,b,x,!d)):e.moveTo(i+n*(0,eJ.mC)(x),r+n*(0,eJ.O$)(x));if(!(s>eJ.Ho)||y<.001)!a||a[1]?e.lineTo(i+E,r+M):e.moveTo(i+E,r+M),u=!0;else if(k>eJ.Ho){let t=(0,eJ.VV)(m,k),n=(0,eJ.VV)(m,k),o=aU(E,M,c,p,s,-n,Number(d)),l=aU(B,C,g,f,s,-t,Number(d));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,r+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,r+o.cy+o.y01),k<S&&t===n){let t=(0,eJ.fv)(l.y01,l.x01);!a||a[2]?e.arc(i+o.cx,r+o.cy,k,(0,eJ.fv)(o.y01,o.x01),t,!d):e.moveTo(i+o.cx+(0,eJ.mC)(t),r+o.cy+(0,eJ.O$)(t))}else!a||a[2]?(n>0&&e.arc(i+o.cx,r+o.cy,n,(0,eJ.fv)(o.y01,o.x01),(0,eJ.fv)(o.y11,o.x11),!d),e.arc(i,r,s,(0,eJ.fv)(o.cy+o.y11,o.cx+o.x11),(0,eJ.fv)(l.cy+l.y11,l.cx+l.x11),d),t>0&&e.arc(i+l.cx,r+l.cy,t,(0,eJ.fv)(l.y11,l.x11),(0,eJ.fv)(l.y01,l.x01),!d)):t>0?e.moveTo(i+l.cx+t*(0,eJ.mC)((0,eJ.fv)(l.y01,l.x01)),r+l.cy+t*(0,eJ.O$)((0,eJ.fv)(l.y01,l.x01))):e.moveTo(i+g,r+f)}else!a||a[1]?e.lineTo(i+E,r+M):e.moveTo(i+E,r+M),!a||a[2]?e.arc(i,r,s,_,A,d):e.moveTo(i+s*(0,eJ.mC)(A),r+s*(0,eJ.O$)(A))}return a?a[3]&&e.lineTo(i+n*(0,eJ.mC)(o),r+n*(0,eJ.O$)(o)):e.closePath(),u}let aW=Symbol.for("ArcRenderContribution"),a$=Symbol.for("AreaRenderContribution"),aY=Symbol.for("CircleRenderContribution"),aX=Symbol.for("GroupRenderContribution"),aK=Symbol.for("ImageRenderContribution"),aq=Symbol.for("PathRenderContribution"),aJ=Symbol.for("PolygonRenderContribution"),aQ=Symbol.for("RectRenderContribution"),a0=Symbol.for("SymbolRenderContribution"),a1=Symbol.for("TextRenderContribution");Symbol.for("CommonRenderContribution");let a2=Symbol.for("InteractiveSubRenderContribution");var a5=function(t,e){return function(i,r){e(i,r,t)}};class a3{constructor(){this.time=oF.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,r,n,s,a,o,l,h,d,u,c){let{background:p,backgroundMode:g=l.backgroundMode,backgroundFit:f=l.backgroundFit}=t.attribute;if(p){if(t.backgroundImg&&t.resources){let n=t.resources.get(p);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){let i=rQ(t.parent).group,{scrollX:r=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(r,n)}e.clip();let s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,r,l),this.doDrawImage(e,n.data,s,g,f),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,r,l),e.fillStyle=p,e.fill(),e.highPerformanceRestore()}}doDrawImage(t,e,i,r,n){if("no-repeat"===r)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{let s=i.width(),a=i.height(),o=s,l=a;if(n&&"repeat"!==r&&(e.width||e.height)){let i=e.width,n=e.height;"repeat-x"===r?(o=a/n*i,l=a):"repeat-y"===r&&(l=s/i*n,o=s);let h=t.dpr,d=rj.allocate({width:o,height:l,dpr:h}),u=d.getContext("2d");u&&(u.inuse=!0,u.clearMatrix(),u.setTransformForCurrent(!0),u.clearRect(0,0,o,l),u.drawImage(e,0,0,o,l),e=d.nativeCanvas),rj.free(d)}let h=t.dpr,d=t.createPattern(e,r);d.setTransform&&d.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=d,t.translate(i.x1,i.y1),t.fillRect(0,0,s,a),t.translate(-i.x1,-i.y1)}}}let a4=new a3,a6=class{constructor(t){this.subRenderContribitions=t,this.time=oF.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,r,n,s,a,o,l,h,d,u,c){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach(p=>{p.render(t,e,i,r,n,s,a,o,l,h,d,u,c)})}};a6=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),a5(0,ez(eH)),a5(0,eZ(a2)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],a6);let a8=new class t extends a3{constructor(){super(...arguments),this.time=oF.beforeFillStroke}drawShape(t,e,i,r,n,s,a,o,l,h,d,u){let{background:c,backgroundMode:p=l.backgroundMode,backgroundFit:g=l.backgroundFit}=t.attribute;if(c){if(t.backgroundImg&&t.resources){let i=t.resources.get(c);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);let r=t.AABBBounds;this.doDrawImage(e,i.data,r,p,g),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=c,e.fill(),e.highPerformanceRestore()}}};var a7=function(t,e){return function(i,r){e(i,r,t)}};let a9=class{constructor(t){this.groupRenderContribitions=t,this.numberType=si}drawShape(t,e,i,r,n,s,a,o){var l,h;let d=rQ(t,null==s?void 0:s.theme).group,{fill:u=d.fill,background:c,stroke:p=d.stroke,opacity:g=d.opacity,width:f=d.width,height:m=d.height,clip:v=d.clip,fillOpacity:y=d.fillOpacity,strokeOpacity:b=d.strokeOpacity,cornerRadius:x=d.cornerRadius,path:_=d.path,lineWidth:A=d.lineWidth,visible:w=d.visible}=t.attribute,S=aG(g,y,f,m,u),T=aZ(g,b,f,m),k=(l=u,h=c,!(!l&&!h)),B=aN(p,A);if(!t.valid||!w||!v&&(!k&&!B||!(S||T||a||o||c)))return;if(_&&_.length&&n.drawContribution){let t=e.disableFill,i=e.disableStroke,r=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,_.forEach(t=>{n.drawContribution.getRenderContribution(t).draw(t,n.renderService,n,s)}),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=r}else 0===x||(0,ev.Z)(x)&&x.every(t=>0===t)?(e.beginPath(),e.rect(i,r,f,m)):(e.beginPath(),aD(e,i,r,f,m,x));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(a8));let C={doFill:k,doStroke:B};this._groupRenderContribitions.forEach(s=>{s.time===oF.beforeFillStroke&&s.drawShape(t,e,i,r,k,B,S,T,d,n,a,o,C)}),v&&e.clip(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),C.doFill&&(a?a(e,t.attribute,d):S&&(e.setCommonStyle(t,t.attribute,i,r,d),e.fill())),C.doStroke&&(o?o(e,t.attribute,d):T&&(e.setStrokeStyle(t,t.attribute,i,r,d),e.stroke())),this._groupRenderContribitions.forEach(s=>{s.time===oF.afterFillStroke&&s.drawShape(t,e,i,r,k,B,S,T,d,n,a,o)})}draw(t,e,i,r){let n;let{context:s}=i;if(!s)return;let{clip:a}=t.attribute;a?s.save():s.highPerformanceSave();let o=rQ(t,null==r?void 0:r.theme).group,l=s.modelMatrix;if(s.camera){let e=s1.allocate(),i=s1.allocate();ar(i,t,o),ai(e,l||e,i),s.modelMatrix=e,s1.free(i),s.setTransform(1,0,0,1,0,0,!0)}else s.transformFromMatrix(t.transMatrix,!0);s.beginPath(),r.skipDraw?this.drawShape(t,s,0,0,i,r,()=>!1,()=>!1):this.drawShape(t,s,0,0,i);let{scrollX:h=o.scrollX,scrollY:d=o.scrollY}=t.attribute;(h||d)&&s.translate(h,d),r&&r.drawingCb&&(n=r.drawingCb()),s.modelMatrix!==l&&s1.free(s.modelMatrix),s.modelMatrix=l,n&&n.then?n.then(()=>{a?s.restore():s.highPerformanceRestore()}):a?s.restore():s.highPerformanceRestore()}};a9=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),a7(0,ez(eH)),a7(0,eZ(aX)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],a9);let ot={x:0,y:0,z:0,lastModelMatrix:null};class oe{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach(t=>this._renderContribitions.push(t)),this._renderContribitions.length&&(this._renderContribitions.sort((t,e)=>e.order-t.order),this._beforeRenderContribitions=this._renderContribitions.filter(t=>t.time===oF.beforeFillStroke),this._afterRenderContribitions=this._renderContribitions.filter(t=>t.time===oF.afterFillStroke))}beforeRenderStep(t,e,i,r,n,s,a,o,l,h,d,u,c){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach(p=>{p.drawShape(t,e,i,r,n,s,a,o,l,h,d,u,c)})}afterRenderStep(t,e,i,r,n,s,a,o,l,h,d,u,c){this._afterRenderContribitions&&this._afterRenderContribitions.forEach(p=>{p.drawShape(t,e,i,r,n,s,a,o,l,h,d,u,c)})}valid(t,e,i,r){var n,s,a,o;let{fill:l=e.fill,background:h,stroke:d=e.stroke,opacity:u=e.opacity,fillOpacity:c=e.fillOpacity,lineWidth:p=e.lineWidth,strokeOpacity:g=e.strokeOpacity,visible:f=e.visible}=t.attribute,m=(n=u,s=c,l&&n*s>0),v=u*g>0,y=(a=l,o=h,!(!a&&!o)),b=aN(d,p);return!(!t.valid||!f)&&!(!y&&!b)&&!!(m||v||i||r||h)&&{fVisible:m,sVisible:v,doFill:y,doStroke:b}}transform(t,e,i,r=!1){let{x:n=e.x,y:s=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:d}=t.attribute,u=i.modelMatrix,c=i.camera;ot.x=n,ot.y=s,ot.z=a,ot.lastModelMatrix=u;let p=c&&(r||function(t){let{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!d:1===o&&1===l&&0===h&&!d;if(p){let r=s1.allocate(),n=s1.allocate();ar(n,t,e),ai(r,u||r,n),ot.x=0,ot.y=0,ot.z=0,i.modelMatrix=r,i.setTransform(1,0,0,1,0,0,!0),s1.free(n)}if(g&&!u){let r=t.getOffsetXY(e);ot.x+=r.x,ot.y+=r.y,ot.z=a,i.setTransformForCurrent()}else if(p)ot.x=0,ot.y=0,ot.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(c&&i.project){let r=t.getOffsetXY(e);ot.x+=r.x,ot.y+=r.y,this.transformWithoutTranslate(i,ot.x,ot.y,ot.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),ot.x=0,ot.y=0,ot.z=0;return ot}transformUseContext2d(t,e,i,r){let n=r.camera;if(this.camera=n,n){let e=t.AABBBounds,n=e.x2-e.x1,s=e.y2-e.y1,a=r.project(0,0,i),o=r.project(n,0,i),l=r.project(n,s,i),h={x:0,y:0},d={x:n,y:0},u={x:n,y:s};r.camera=null;let c=1/(h.x*(u.y-d.y)-d.x*u.y+u.x*d.y+(d.x-u.x)*h.y),p=-(h.y*(l.x-o.x)-d.y*l.x+u.y*o.x+(d.y-u.y)*a.x)*c,g=(d.y*l.y+h.y*(o.y-l.y)-u.y*o.y+(u.y-d.y)*a.y)*c,f=(h.x*(l.x-o.x)-d.x*l.x+u.x*o.x+(d.x-u.x)*a.x)*c,m=-(d.x*l.y+h.x*(o.y-l.y)-u.x*o.y+(u.x-d.x)*a.y)*c,v=(h.x*(u.y*o.x-d.y*l.x)+h.y*(d.x*l.x-u.x*o.x)+(u.x*d.y-d.x*u.y)*a.x)*c,y=(h.x*(u.y*o.y-d.y*l.y)+h.y*(d.x*l.y-u.x*o.y)+(u.x*d.y-d.x*u.y)*a.y)*c;r.setTransform(p,g,f,m,v,y,!0)}}restoreTransformUseContext2d(t,e,i,r){this.camera&&(r.camera=this.camera)}transformWithoutTranslate(t,e,i,r,n,s,a){let o=t.project(e,i,r);t.translate(o.x,o.y,!1),t.scale(n,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,r,n){let{context:s}=r;if(!s)return;s.highPerformanceSave();let{x:a,y:o,z:l,lastModelMatrix:h}=this.transform(t,e,s,i);this.z=l,function(t,e,i,r,n,s,a,o){var l,h,d;if(!t.pathProxy)return!1;let u=rQ(t,null==s?void 0:s.theme)[t.type],{fill:c=u.fill,stroke:p=u.stroke,opacity:g=u.opacity,fillOpacity:f=u.fillOpacity,lineWidth:m=u.lineWidth,strokeOpacity:v=u.strokeOpacity,visible:y=u.visible}=t.attribute,b=(l=g,h=f,c&&l*h>0),x=g*v>0,_=!!c,A=aN(p,m);return!y||!_&&!A||!b&&!x&&!!1||(e.beginPath(),iv(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,r),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),A&&(o?o(e,t.attribute,u):x&&(e.setStrokeStyle(t,t.attribute,i,r,u),e.stroke())),_&&(a?a(e,t.attribute,u):b&&(e.setCommonStyle(t,t.attribute,i,r,u),e.fill())),!0)}(t,s,a,o,0,n)||(this.drawShape(t,s,a,o,r,n),this.z=0,s.modelMatrix!==h&&s1.free(s.modelMatrix),s.modelMatrix=h),s.highPerformanceRestore()}}function oi(t,e,i,r){if(!e.p1)return;let{offsetX:n=0,offsetY:s=0,offsetZ:a=0}=r||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,s+e.p1.y,n+e.p2.x,s+e.p2.y,n+e.p3.x,s+e.p3.y,a):t.lineTo(n+e.p1.x,s+e.p1.y,a);else if(e.p2&&e.p3){let[r]=iS(e,i);t.bezierCurveTo(n+r.p1.x,s+r.p1.y,n+r.p2.x,s+r.p2.y,n+r.p3.x,s+r.p3.y,a)}else{let r=e.getPointAt(i);t.lineTo(n+r.x,s+r.y,a)}}function or(t,e,i,r,n){var s;let a;let{offsetX:o=0,offsetY:l=0,offsetZ:h=0,mode:d="none",drawConnect:u=!1,zeroX:c=0,zeroY:p=0}=n||{};if(u&&"none"===d||!e)return;let g=!0,{curves:f}=e;if(i>=1){if(u){let e,i=!0;f.forEach((r,n)=>{var s;let a=r.p0;if(r.originP1!==r.originP2){if(e&&e.originP1===e.originP2&&(a=e.p0),r.defined)i||(t.lineTo(a.x+o,a.y+l,h),i=!i);else{let e;let{originP1:n,originP2:d}=r;if(n&&!1!==n.defined?e=a:n&&!1!==d.defined&&(e=null!==(s=r.p3)&&void 0!==s?s:r.p1),i){i=!i;let n=e?e.x:r.p0.x,s=e?e.y:r.p0.y;t.moveTo(n+o,s+l,h)}else e&&(i=!i,t.lineTo(e.x+o,e.y+l,h))}e=r}else e=r})}else f.forEach(e=>{e.defined?(g&&t.moveTo(e.p0.x+o,e.p0.y+l,h),oi(t,e,1,n),g=!1):g=!0});return}if(i<=0)return;"x"===r?a=oj.ROW:"y"===r?a=oj.COLUMN:"auto"===r&&(a=e.direction);let m=i*e.tryUpdateLength(a),v=0,y=!0,b=null;for(let e=0,i=f.length;e<i;e++){let i=f[e],r=i.getLength(a),d=(m-v)/r;if(v+=r,d<0)break;if(u){let e=i.p0;if(i.originP1===i.originP2){b=i;continue}if(b&&b.originP1===b.originP2&&(e=b.p0),i.defined)y||(t.lineTo(e.x+o,e.y+l,h),y=!y);else{let r;let{originP1:n,originP2:a}=i;if(n&&!1!==n.defined?r=e:n&&!1!==a.defined&&(r=null!==(s=i.p3)&&void 0!==s?s:i.p1),y){y=!y;let e=r?r.x:i.p0.x,n=r?r.y:i.p0.y;t.moveTo(e+o,n+l,h)}else r&&(y=!y,t.lineTo(r.x+o,r.y+l,h))}b=i}else{if(!i.defined){g=!0;continue}g&&t.moveTo(i.p0.x+o,i.p0.y+l,h),oi(t,i,(0,eJ.VV)(d,1),n),g=!1}}}let on=class extends oe{constructor(){super(...arguments),this.numberType=sn}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).line;this._draw(t,n,!1,i,r)}drawSegmentItem(t,e,i,r,n,s,a,o,l,h,d,u,c,p,g){var f,m,v,y,b;if(!e)return;t.beginPath();let x=null!==(f=this.z)&&void 0!==f?f:0;or(t.camera?t:t.nativeContext,e,l,h,{offsetX:d,offsetY:u,offsetZ:x}),c.cache&&!(0,ev.Z)(c.cache)&&c.cache.curves.every(t=>t.defined)&&c.attribute.curveType&&c.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(c,a,o);let{x:_=0,x:A=0}=a;!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(c,a,_-d,A-u,o),t.fill())),!1!==r&&(g?g(t,a,o):s&&(t.setStrokeStyle(c,a,_-d,A-u,o),t.stroke()));let{connectedType:w,connectedX:S,connectedY:T,connectedStyle:k}=a;if((0,ev.Z)(o)?(w=null!==(m=null!=w?w:o[0].connectedType)&&void 0!==m?m:o[1].connectedType,S=null!==(v=null!=S?S:o[0].connectedX)&&void 0!==v?v:o[1].connectedX,T=null!==(y=null!=T?T:o[0].connectedY)&&void 0!==y?y:o[1].connectedY,k=null!==(b=null!=k?k:o[0].connectedStyle)&&void 0!==b?b:o[1].connectedStyle):(w=null!=w?w:o.connectedType,S=null!=S?S:o.connectedX,T=null!=T?T:o.connectedY,k=null!=k?k:o.connectedStyle),"connect"!==w&&"zero"!==w&&(w="none"),"none"!==w){t.beginPath(),or(t.camera?t:t.nativeContext,e,l,h,{offsetX:d,offsetY:u,offsetZ:x,drawConnect:!0,mode:w,zeroX:S,zeroY:T});let f=[];(0,ev.Z)(o)?o.forEach(t=>f.push(t)):f.push(o),f.push(a),!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(c,k,_-d,A-u,f),t.fill())),!1!==r&&(g?g(t,a,o):s&&(t.setStrokeStyle(c,k,_-d,A-u,f),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,r,n,s,a,o,l,h,d,u,c){var p;e.beginPath();let g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t<f.length;t++){let i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);let{x:v=0,x:y=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,v-a,y-o,l),e.fill())),!1!==r&&(c?c(e,t.attribute,l):s&&(e.setStrokeStyle(t,t.attribute,v-a,y-o,l),e.stroke()))}drawShape(t,e,i,r,n,s,a,o){let l=rQ(t,null==s?void 0:s.theme).line,{fill:h=l.fill,stroke:d=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:c=l.strokeOpacity,segments:p,points:g,closePath:f}=t.attribute;if(!this.valid(t,l,a,o))return;let{curveType:m=l.curveType}=t.attribute;f&&"linear"===m&&(m="linearClosed");let{clipRange:v=l.clipRange,clipRangeByDimension:y=l.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!g.some(t=>!1===t.defined)&&"linear"===m)return this.drawLinearLineHighPerformance(t,e,!!h,!!d,u,c,i,r,l,n,s,a,o);if(t.shouldUpdateShape()){let{points:e,segments:i}=t.attribute;if(i&&i.length){let e,r;if(t.cache=i.map((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(r={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:r.endX,y:r.endY,defined:r.curves[r.curves.length-1].defined}:i>1&&(e.x=r.endX,e.y=r.endY,e.defined=r.curves[r.curves.length-1].defined);let n=iX(t.points,m,{startPoint:e});return r=n,n}).filter(t=>!!t),"linearClosed"===m){let e;for(let i=0;i<t.cache.length;i++){let r=t.cache[i];for(let t=0;t<r.curves.length;t++)if(r.curves[t].defined){e=r.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=iX(e,m)}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){let n=t.attribute.segments.filter(t=>t.points.length);if(1===n[0].points.length&&n.shift(),1===v){let s=!1;t.cache.forEach((p,g)=>{s||(s=this.drawSegmentItem(e,p,!!h,!!d,u,c,n[g],[l,t.attribute],v,y,i,r,t,a,o))})}else{let s=v*t.cache.reduce((t,e)=>t+e.getLength(),0),p=0,g=!1;t.cache.forEach((f,m)=>{if(g)return;let v=f.getLength(),b=(s-p)/v;p+=v,b>0&&(g=this.drawSegmentItem(e,f,!!h,!!d,u,c,n[m],[l,t.attribute],(0,eJ.VV)(b,1),y,i,r,t,a,o))})}}else this.drawSegmentItem(e,t.cache,!!h,!!d,u,c,t.attribute,l,v,y,i,r,t,a,o)}};on=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],on);let os=class extends on{constructor(){super(...arguments),this.numberType=sn}drawShape(t,e,i,r,n,s,a,o){if(t.incremental&&n.multiGraphicOptions){var l,h,d;let{startAtIdx:e,length:s}=n.multiGraphicOptions,{segments:u=[]}=t.attribute;if(e>u.length)return;let c=rQ(t).line,{fill:p=c.fill,stroke:g=c.stroke,opacity:f=c.opacity,fillOpacity:m=c.fillOpacity,strokeOpacity:v=c.strokeOpacity,lineWidth:y=c.lineWidth,visible:b=c.visible}=t.attribute,x=(l=f,h=m,p&&l*h>0),_=f*v>0,A=!!p,w=aN(g,y);if(!t.valid||!b||!A&&!w||!(x||_||a||o))return;let{context:S}=n;for(let n=e;n<e+s;n++)this.drawIncreaseSegment(t,S,u[n-1],u[n],t.attribute.segments[n],[c,t.attribute],i,r)}else super.drawShape(t,e,i,r,n,s,a,o)}drawIncreaseSegment(t,e,i,r,n,s,a,o){r&&(e.beginPath(),function(t,e,i,r){let{offsetX:n=0,offsetY:s=0}=r||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+n,a.y+s),i.points.forEach(e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+s):t.moveTo(e.x+n,e.y+s)})}(e.nativeContext,i,r,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,s),e.setStrokeStyle(t,n,a,o,s),e.stroke())}};os=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],os);function oa(t,e,i,r){if(e.length<2)return;let{offsetX:n=0,offsetY:s=0,offsetZ:a=0,mode:o}=r||{},l=e[0];t.moveTo(l.p0.x+n,l.p0.y+s,a);let h=(l=e[e.length-1]).p3||l.p1;t.lineTo(h.x+n,h.y+s,a),l=i[i.length-1],t.lineTo(l.p0.x+n,l.p0.y+s,a),h=(l=i[0]).p3||l.p1,t.lineTo(h.x+n,h.y+s,a),t.closePath()}function oo(t,e,i,r){let{offsetX:n=0,offsetY:s=0,offsetZ:a=0}=r||{},o=!0;e.forEach(e=>{e.defined?(o&&t.moveTo(e.p0.x+n,e.p0.y+s,a),oi(t,e,1,r),o=!1):o=!0}),o=!0;for(let e=i.length-1;e>=0;e--){let l=i[e];l.defined?(o&&t.lineTo(l.p0.x+n,l.p0.y+s,a),oi(t,l,1,r),o=!1):o=!0}t.closePath()}class ol{constructor(){this.time=oF.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,r,n){let s=(t-2*e)/2,a=r.dpr,o=rj.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),n(s,l);let h=r.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),rj.free(o),h}createCirclePattern(t,e,i,r){return this.createCommonPattern(t,e,i,r,(t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,eJ.f7),e.fill()})}createDiamondPattern(t,e,i,r){return this.createCommonPattern(t,e,i,r,(e,r)=>{let n=t/2;r.fillStyle=i,r.moveTo(n,n-e),r.lineTo(e+n,n),r.lineTo(n,n+e),r.lineTo(n-e,n),r.closePath(),r.fill()})}createRectPattern(t,e,i,r){return this.createCommonPattern(t,e,i,r,(t,r)=>{r.fillStyle=i,r.fillRect(e,e,2*t,2*t)})}createVerticalLinePattern(t,e,i,r){return this.createCommonPattern(t,e,i,r,(r,n)=>{n.fillStyle=i,n.fillRect(e,0,2*r,t)})}createHorizontalLinePattern(t,e,i,r){return this.createCommonPattern(t,e,i,r,(r,n)=>{n.fillStyle=i,n.fillRect(0,e,t,2*r)})}createBiasLRLinePattern(t,e,i,r){return this.createCommonPattern(t,e,i,r,(e,r)=>{r.strokeStyle=i,r.lineWidth=e,r.moveTo(0,0),r.lineTo(t,t);let n=t/2,s=-n;r.moveTo(n,s),r.lineTo(n+t,s+t),r.moveTo(-n,-s),r.lineTo(-n+t,-s+t),r.stroke()})}createBiasRLLinePattern(t,e,i,r){return this.createCommonPattern(t,e,i,r,(e,r)=>{r.strokeStyle=i,r.lineWidth=e,r.moveTo(t,0),r.lineTo(0,t);let n=t/2;r.moveTo(t+n,n),r.lineTo(n,n+t),r.moveTo(t-n,-n),r.lineTo(-n,-n+t),r.stroke()})}createGridPattern(t,e,i,r){return this.createCommonPattern(t,e,i,r,(t,r)=>{r.fillStyle=i,r.fillRect(e,e,t,t),r.fillRect(e+t,e+t,t,t)})}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,r,n,s,a,o,l,h,d,u,c){this.textureMap||this.initTextureMap(e,t.stage);let{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,r,l,g,f,m)}drawTexture(t,e,i,r,n,s,a,o,l){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(o,l,a,i);break;case"diamond":h=this.createDiamondPattern(o,l,a,i);break;case"rect":h=this.createRectPattern(o,l,a,i);break;case"vertical-line":h=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":h=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":h=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":h=this.createGridPattern(o,l,a,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,r,n,s),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}}let oh=new ol,od=new class t extends ol{constructor(){super(...arguments),this.time=oF.afterFillStroke}drawShape(t,e,i,r,n,s,a,o,l,h,d,u,c){var p,g,f,m;this.textureMap||this.initTextureMap(e,t.stage);let{attribute:v=t.attribute}=c||{},{texture:y=null!==(p=t.attribute.texture)&&void 0!==p?p:nq(l,"texture"),textureColor:b=null!==(g=t.attribute.textureColor)&&void 0!==g?g:nq(l,"textureColor"),textureSize:x=null!==(f=t.attribute.textureSize)&&void 0!==f?f:nq(l,"textureSize"),texturePadding:_=null!==(m=t.attribute.texturePadding)&&void 0!==m?m:nq(l,"texturePadding")}=v;y&&this.drawTexture(y,t,e,i,r,l,b,x,_)}};var ou=function(t,e){return function(i,r){e(i,r,t)}};function oc(t,e,i){switch(e){case"linear":default:return iR(t,i);case"basis":return iD(t,i);case"monotoneX":return iH(t,i);case"monotoneY":return iU(t,i);case"step":return iW(t,.5,i);case"stepBefore":return iW(t,0,i);case"stepAfter":return iW(t,1,i);case"linearClosed":return iY(t,i)}}let op=class extends oe{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=n9,this.builtinContributions=[od,a4],this.init(t)}drawLinearAreaHighPerformance(t,e,i,r,n,s,a,o,l,h,d,u,c){var p,g,f,m,v;let{points:y}=t.attribute;if(y.length<2)return;e.beginPath();let b=null!==(p=this.z)&&void 0!==p?p:0,x=y[0];e.moveTo(x.x+a,x.y+o,b);for(let t=1;t<y.length;t++){let i=y[t];e.lineTo(i.x+a,i.y+o,b)}for(let t=y.length-1;t>=0;t--){let i=y[t];e.lineTo((null!==(g=i.x1)&&void 0!==g?g:i.x)+a,(null!==(f=i.y1)&&void 0!==f?f:i.y)+o,b)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,u,null,{attribute:t.attribute});let{x:_=0,x:A=0}=t.attribute;if(!1!==i&&(u?u(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,_-a,A-o,l),e.fill())),this.afterRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,u,null,{attribute:t.attribute}),r){let{stroke:i=l&&l.stroke}=t.attribute;if((0,ev.Z)(i)&&(i[0]||i[2])&&!1===i[1]){if(e.beginPath(),i[0]){e.moveTo(x.x+a,x.y+o,b);for(let t=1;t<y.length;t++){let i=y[t];e.lineTo(i.x+a,i.y+o,b)}}else if(i[2]){let t=y[y.length-1];e.moveTo(t.x+a,t.y+o,b);for(let t=y.length-2;t>=0;t--){let i=y[t];e.lineTo((null!==(m=i.x1)&&void 0!==m?m:i.x)+a,(null!==(v=i.y1)&&void 0!==v?v:i.y)+o,b)}}}c?c(e,t.attribute,l):(e.setStrokeStyle(t,t.attribute,_-a,A-o,l),e.stroke())}}drawShape(t,e,i,r,n,s,a,o){var l,h,d,u,c,p;let g=rQ(t,null==s?void 0:s.theme).area,{fill:f=g.fill,stroke:m=g.stroke,fillOpacity:v=g.fillOpacity,z:y=g.z,strokeOpacity:b=g.strokeOpacity}=t.attribute,x=this.valid(t,g,a,o);if(!x)return;let{doFill:_,doStroke:A}=x,{clipRange:w=g.clipRange,closePath:S,points:T,segments:k}=t.attribute,{curveType:B=g.curveType}=t.attribute;if(S&&"linear"===B&&(B="linearClosed"),1===w&&!k&&!T.some(t=>!1===t.defined)&&"linear"===B)return this.drawLinearAreaHighPerformance(t,e,!!f,A,v,b,i,r,g,n,s,a,o);if(t.shouldUpdateShape()){if(k&&k.length){let e,i,r;let n=k.map((t,r)=>{if(t.points.length<=1&&0===r)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===r?e={x:i.endX,y:i.endY}:r>1&&(e.x=i.endX,e.y=i.endY);let n=oc(t.points,B,{startPoint:e});return i=n,n}).filter(t=>!!t),s=[];for(let t=k.length-1;t>=0;t--){let e=k[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){let e=k[t-1].points,r=e[e.length-1];r&&i.push({x:null!==(d=r.x1)&&void 0!==d?d:r.x,y:null!==(u=r.y1)&&void 0!==u?u:r.y})}i.length>1&&(r=oc(i,"stepBefore"===B?"stepAfter":"stepAfter"===B?"stepBefore":B),s.unshift(r))}t.cacheArea=s.map((t,e)=>({top:n[e],bottom:t}))}else{if(!T||!T.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{let e=[];for(let t=T.length-1;t>=0;t--)e.push({x:null!==(c=T[t].x1)&&void 0!==c?c:T[t].x,y:null!==(p=T[t].y1)&&void 0!==p?p:T[t].y});let i=oc(T,B),r=oc(e,"stepBefore"===B?"stepAfter":"stepAfter"===B?"stepBefore":B);t.cacheArea={top:i,bottom:r}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){let s=t.attribute.segments.filter(t=>t.points.length);if(1===s[0].points.length&&s.shift(),1===w){let l=!1;t.cacheArea.forEach((h,d)=>{l||(l=this.drawSegmentItem(e,h,_,v,A,b,s[d],[g,t.attribute],w,i,r,y,t,n,a,o))})}else{let l=w*t.cacheArea.reduce((t,e)=>t+e.top.getLength(),0),h=0,d=!1;t.cacheArea.forEach((u,c)=>{if(d)return;let p=u.top.getLength(),f=(l-h)/p;h+=p,f>0&&(d=this.drawSegmentItem(e,u,_,v,A,b,s[c],[g,t.attribute],(0,eJ.VV)(f,1),i,r,y,t,n,a,o))})}}else this.drawSegmentItem(e,t.cacheArea,_,v,A,b,t.attribute,g,w,i,r,y,t,n,a,o)}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).area;this._draw(t,n,!1,i,r)}drawSegmentItem(t,e,i,r,n,s,a,o,l,h,d,u,c,p,g,f){let m=!1;return(m=this._drawSegmentItem(t,e,i,r,n,s,a,o,l,h,d,u,c,p,!1,g,f))||this._drawSegmentItem(t,e,i,r,n,s,a,o,l,h,d,u,c,p,!0,g,f)}_drawSegmentItem(t,e,i,r,n,s,a,o,l,h,d,u,c,p,g,f,m){var v,y,b,x;if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;let{connectedType:_,connectedX:A,connectedY:w,connectedStyle:S}=a,T=[];if(g&&((0,ev.Z)(o)?(_=null!==(v=null!=_?_:o[0].connectedType)&&void 0!==v?v:o[1].connectedType,A=null!==(y=null!=A?A:o[0].connectedX)&&void 0!==y?y:o[1].connectedX,w=null!==(b=null!=w?w:o[0].connectedY)&&void 0!==b?b:o[1].connectedY,S=null!==(x=null!=S?S:o[0].connectedStyle)&&void 0!==x?x:o[1].connectedStyle):(_=null!=_?_:o.connectedType,A=null!=A?A:o.connectedX,w=null!=w?w:o.connectedY,S=null!=S?S:o.connectedStyle),"connect"!==_&&"zero"!==_&&(_="none"),(0,ev.Z)(o)?o.forEach(t=>T.push(t)):T.push(o),T.push(a)),g&&"none"===_)return!1;t.beginPath();let{points:k,segments:B}=c.attribute,C,E,M=oj.ROW;if(B){let t=B[B.length-1];E=B[0].points[0],C=t.points[t.points.length-1]}else E=k[0],C=k[k.length-1];M=(0,eJ.Wn)(C.x-E.x)>(0,eJ.Wn)(C.y-E.y)?oj.ROW:oj.COLUMN,function(t,e,i,r){var n;let{drawConnect:s=!1,mode:a="none"}=r||{};if(s&&"none"===a)return;let{top:o,bottom:l}=e;if(o.curves.length!==l.curves.length)return;if(i>=1){let e=[],i=[],n=!0;if(s){let n,s,a=!0,h=o.curves.length;o.curves.forEach((o,d)=>{let u=l.curves[h-d-1],c=o,p=u;if(o.originP1===o.originP2)return n=o,void(s=u);if(n&&n.originP1===n.originP2&&(c=n,p=s),o.defined)a||(e.push(c),i.push(p),oa(t,e,i,r),e.length=0,i.length=0,a=!a);else{let n,s;let{originP1:l,originP2:h}=o;l&&!1!==l.defined?(n=c,s=p):l&&!1!==h.defined&&(n=o,s=u),a?(a=!a,e.push(n||o),i.push(s||u)):n&&(a=!a,e.push(n||o),i.push(s||u),oa(t,e,i,r),e.length=0,i.length=0)}n=o}),oa(t,e,i,r)}else{for(let s=0,a=o.curves.length;s<a;s++){let h=o.curves[s];n!==h.defined?(n?(oo(t,e,i,r),e.length=0,i.length=0):(e.push(h),i.push(l.curves[a-s-1])),n=!n):n&&(e.push(h),i.push(l.curves[a-s-1]))}oo(t,e,i,r)}return}if(i<=0)return;let{direction:h}=r||{},{curves:d}=o,u=null!==(n=d[d.length-1].p3)&&void 0!==n?n:d[d.length-1].p1,c=(0,eJ.Wn)(u.x-d[0].p0.x),p=(0,eJ.Wn)(u.y-d[0].p0.y);h=null!=h?h:c>p?oj.ROW:oj.COLUMN,Number.isFinite(c)||(h=oj.COLUMN),Number.isFinite(p)||(h=oj.ROW);let g=i*(h===oj.ROW?c:p),f=0,m=!0,v=[],y=[],b,x,_=!0;for(let e=0,i=o.curves.length;e<i;e++){let n=o.curves[e],a=n.getLength(h),d=(g-f)/a;if(d<0)break;if(f+=a,s){let s=l.curves[i-e-1],a=n,o=s;if(n.originP1===n.originP2){b=n,x=s;continue}if(b&&b.originP1===b.originP2&&(a=b,o=x),n.defined)_||(v.push(a),y.push(o),oa(t,v,y,r),v.length=0,y.length=0,_=!_);else{let e,i;let{originP1:l,originP2:h}=n;l&&!1!==l.defined?(e=a,i=o):l&&!1!==h.defined&&(e=n,i=s),_?(_=!_,v.push(e||n),y.push(i||s)):e&&(_=!_,v.push(e||n),y.push(i||s),oa(t,v,y,r),v.length=0,y.length=0)}b=n}else{let s=null,a=null;m!==n.defined?(m?(oo(t,v,y,r),v.length=0,y.length=0):(s=n,a=l.curves[i-e-1]),m=!m):m&&(s=n,a=l.curves[i-e-1]),s&&a&&(d<1&&(s=s.p2&&s.p3?iS(s,d)[0]:ik(s,d)[0],a=a.p2&&a.p3?iS(a,1-d)[1]:ik(a,1-d)[1]),s.defined=m,a.defined=m,v.push(s),y.push(a)),s=null,a=null}}s?oa(t,v,y,r):oo(t,v,y,r)}(t.camera?t:t.nativeContext,e,l,{offsetX:h,offsetY:d,offsetZ:u,direction:M,drawConnect:g,mode:_,zeroX:A,zeroY:w}),this.beforeRenderStep(c,t,h,d,!!r,!1,i,!1,o,p,f,null,{attribute:a}),t.setShadowBlendStyle&&t.setShadowBlendStyle(c,a,o);let{x:P=0,x:O=0}=a;if(!1!==i&&(f?f(t,a,o):r&&(t.setCommonStyle(c,g?S:a,P-h,O-d,g?T:o),t.fill())),this.afterRenderStep(c,t,h,d,!!r,!1,i,!1,o,p,f,null,{attribute:a}),!1!==n){if(m)m(t,a,o);else{let{stroke:i=o&&o[1]&&o[1].stroke}=a;(0,ev.Z)(i)&&(i[0]||i[2])&&!1===i[1]&&(t.beginPath(),or(t.camera?t:t.nativeContext,i[0]?e.top:e.bottom,l,M===oj.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:u,drawConnect:g,mode:_,zeroX:A,zeroY:w})),t.setStrokeStyle(c,g?S:a,P-h,O-d,g?T:o),t.stroke()}}return!1}};op=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),ou(0,ez(eH)),ou(0,eZ(a$)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],op);let og=class extends op{constructor(){super(...arguments),this.numberType=n9}drawShape(t,e,i,r,n,s,a){if(t.incremental&&n.multiGraphicOptions){var o,l,h;let{startAtIdx:s,length:d}=n.multiGraphicOptions,{segments:u=[]}=t.attribute;if(s>u.length)return;let c=rQ(t).area,{fill:p=c.fill,fillOpacity:g=c.fillOpacity,opacity:f=c.opacity,visible:m=c.visible}=t.attribute,v=(o=f,l=g,p&&o*l>0),y=!!p;if(!!t.valid&&!!m&&!!y){if(v||a)for(let n=s;n<s+d;n++)this.drawIncreaseSegment(t,e,u[n-1],u[n],t.attribute.segments[n],[c,t.attribute],i,r)}}else super.drawShape(t,e,i,r,n,s,a)}drawIncreaseSegment(t,e,i,r,n,s,a,o){r&&(e.beginPath(),function(t,e,i,r){let{offsetX:n=0,offsetY:s=0}=r||{},{points:a}=i,o=[],l=0;for(let t=0;t<a.length;t++)!1===a[t].defined&&(l+1!==t&&o.slice(l,t),l=t);o.push(a),o.forEach((i,r)=>{var a,o,l,h;let d=e&&0===r?e.points[e.points.length-1]:i[0];t.moveTo(d.x+n,d.y+s),i.forEach(e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+s):t.moveTo(e.x+n,e.y+s)});for(let e=i.length-1;e>=0;e--){let r=i[e];t.lineTo(null!==(a=r.x1)&&void 0!==a?a:r.x,null!==(o=r.y1)&&void 0!==o?o:r.y)}t.lineTo(null!==(l=d.x1)&&void 0!==l?l:d.x,null!==(h=d.y1)&&void 0!==h?h:d.y),t.closePath()})}(e.camera?e:e.nativeContext,i,r,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,s),e.setCommonStyle(t,n,a,o,s),e.fill())}};og=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],og);var of,om,ov,oy,ob,ox,o_,oA,ow,oS,oT,ok,oB,oC,oE,oM,oP,oO,oR,oI,oL,oD,oj,oN,oF,oG,oz,oZ,oH,oU,oV,oW,o$,oY,oX,oK,oq=function(t,e){return function(i,r){e(i,r,t)}},oJ=function(t,e,i,r){return new(i||(i=Promise))(function(n,s){function a(t){try{l(r.next(t))}catch(t){s(t)}}function o(t){try{l(r.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?n(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(a,o)}l((r=r.apply(t,e||[])).next())})};(u=oK||(oK={}))[u.NORMAL=0]="NORMAL",u[u.STOP=1]="STOP";let oQ=class extends aI{constructor(t,e,i,r){super(t,r),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=r,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=oK.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new e$([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return oJ(this,void 0,void 0,function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);let i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;let{context:r,viewBox:n}=e;r&&(r.inuse=!0,r.clearMatrix(),r.setTransformForCurrent(!0),r.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,r,e),r.translate(n.x1,n.y1,!0),r.save(),t.renderTreeRoots.sort((t,e)=>{var i,r;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:i4.zIndex)-(null!==(r=e.attribute.zIndex)&&void 0!==r?r:i4.zIndex)}).forEach(t=>{this.renderGroup(t,e)}),this.hooks.completeDraw.tap("top-draw",()=>{r.restore(),r.restore(),r.draw(),r.inuse=!1,this.rendering=!1}))})}_increaseRender(t,e){return oJ(this,void 0,void 0,function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)})}_renderIncrementalGroup(t,e){return oJ(this,void 0,void 0,function*(){this.count=t.count,yield new Promise(i=>{this.renderItem(t,e,{drawingCb:()=>oJ(this,void 0,void 0,function*(){if(2!==t.count)yield ax(t,i4.zIndex,(i,r)=>{if(this.status===oK.STOP)return!0;if(i.isContainer||r<this.currentIdx)return!1;let n=this.currFrameStartAt+t.incremental;return r<n&&(this.currentIdx=r+1,this.renderItem(i,e)),r===n-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())}),i(!1);else{let r=t.getChildAt(0);if(r.incremental&&r.attribute.segments)for(r.incrementalAt||(r.incrementalAt=0);r.incrementalAt<r.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:r.incrementalAt,length:r.incremental},this.renderItem(r,e),r.incrementalAt+=r.incremental,yield this.waitToNextFrame();else this.renderItem(r,e);i(!1)}})})}),this.hooks.completeDraw.call()})}waitToNextFrame(){return oJ(this,void 0,void 0,function*(){return new Promise(t=>{this.global.getRequestAnimationFrame()(()=>{t(!1)})})})}checkForDraw(t){return oJ(this,void 0,void 0,function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e})}forceStop(){return oJ(this,void 0,void 0,function*(){this.rendering&&(this.status=oK.STOP,yield new Promise(t=>{this.hooks.completeDraw.tap("stopCb",()=>{this.status=oK.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter(t=>"stopCb"!==t.name),t(!1)})}))})}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return oJ(this,void 0,void 0,function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise(i=>{this.renderItem(t,e,{drawingCb:()=>oJ(this,void 0,void 0,function*(){yield ax(t,i4.zIndex,t=>oJ(this,void 0,void 0,function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})),i(!1)})})}))})}};oQ=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),oq(0,ay(sR)),oq(1,ez(os)),oq(2,ez(og)),oq(3,ez(eH)),oq(3,eZ(a_)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object,Object,Object])],oQ);var o0=new eM(t=>{t(a3).toSelf().inSingletonScope(),t(ol).toSelf().inSingletonScope(),t(sW).to(aI),t(sC).to(oQ),t(sI).to(a9).inSingletonScope(),t(sR).toService(sI),eV(t,aX),t(a6).toSelf().inSingletonScope(),eV(t,a2),eV(t,sR),t(aT).toSelf().inSingletonScope(),t(a_).toService(aT),eV(t,a_)});function o1(){var t;o1.__loaded||(o1.__loaded=!0,rR.load(sB),rR.load(aa),rR.load(sX),rR.load(s8),rR.load(au),(t=rR).load(ac),t.load(ap),t.load(av),function(t){t.load(o0)}(rR))}o1.__loaded=!1,o1();let o2=rR.get(eX);ru.global=o2;let o5=rR.get(s_);ru.graphicUtil=o5;let o3=rR.get(sx);ru.transformUtil=o3;let o4=rR.get(sp);ru.graphicService=o4;let o6=rR.get(sA);function o8(t,e){return ex(t).reduce((t,i)=>{let r=(0,ek.Z)(i)?e.getGrammarById(i):i;return r&&t.push(r),t},[])}ru.layerService=o6;function o7(t,e){var i,r;if((0,eB.Z)(t))return[];if(r6(i=t)||!(null==i?void 0:i.signal)){;if(!r6(r=t)&&(null==r?void 0:r.callback))return o8(t.dependency,e)}else{let i=t.signal;if((0,ek.Z)(i))return ex(e.getGrammarById(i));if("signal"===(null==i?void 0:i.grammarType))return[i]}return[]}function o9(t){return r6(t)||(null==t?void 0:t.signal)||!!(null==t?void 0:t.callback)}function lt(t,e,i,r){if((0,eB.Z)(t))return t;if(r6(t))return r?t.call(null,i,r,e):t.call(null,i,e);if(t.signal){let i=t.signal;return(0,ek.Z)(i)?null==e?void 0:e[i]:i.output()}return t.callback?r?t.callback.call(null,i,r,e):t.callback.call(null,i,e):t}function le(t,e){return li(t)?t.output():e[t]}let li=t=>t&&!(0,eB.Z)(t.grammarType),lr=t=>r6(t)?t:e=>e[t],ln=t=>(0,ek.Z)(t)&&n_.parseColorString(t)?t:null,ls=(t,e)=>li(t)?t.output():t&&(0,ep.Z)(t)?r6(t.callback)?i=>t.callback(i,e):r6(t.value)?t.value(e):t:t,la=(t,e)=>t?(0,ep.Z)(t)?Object.keys(t).reduce((i,r)=>{let n=t[r];return i[r]=ls(n,e),i},{}):t.map(t=>ls(t,e)):t;(c=tj||(tj={})).enter="enter",c.update="update",c.exit="exit",c.group="group",c.connectNulls="connectNulls",(p=tN||(tN={})).enter="enter",p.update="update",p.exit="exit",p.unChange="unChange",(g=tF||(tF={})).arc="arc",g.arc3d="arc3d",g.area="area",g.image="image",g.line="line",g.path="path",g.rect="rect",g.rect3d="rect3d",g.rule="rule",g.shape="shape",g.symbol="symbol",g.text="text",g.richtext="richtext",g.polygon="polygon",g.pyramid3d="pyramid3d",g.circle="circle",g.cell="cell",g.interval="interval",g.group="group",g.glyph="glyph",g.component="component",g.largeRects="largeRects",g.largeSymbols="largeSymbols",(f=tG||(tG={})).axis="axis",f.grid="grid",f.legend="legend",f.slider="slider",f.label="label",f.datazoom="datazoom",f.player="player",f.title="title",f.scrollbar="scrollbar",(m=tz||(tz={}))[m.player=1]="player",m[m.rollUp=2]="rollUp",m[m.drillDown=3]="drillDown",m[m.slider=4]="slider",m[m.datazoom=5]="datazoom",m[m.legend=6]="legend",m[m.scrollbar=7]="scrollbar",m[m.brush=8]="brush",m[m.normal=9]="normal",(v=tZ||(tZ={})).lineAxis="lineAxis",v.circleAxis="circleAxis",(y=tH||(tH={})).lineAxisGrid="lineAxisGrid",y.circleAxisGrid="circleAxisGrid",(b=tU||(tU={})).discreteLegend="discreteLegend",b.colorLegend="colorLegend",b.sizeLegend="sizeLegend",(x=tV||(tV={})).lineCrosshair="lineCrosshair",x.rectCrosshair="rectCrosshair",x.sectorCrosshair="sectorCrosshair",x.circleCrosshair="circleCrosshair",x.polygonCrosshair="polygonCrosshair",x.ringCrosshair="ringCrosshair",(_=tW||(tW={})).symbolLabel="symbolLabel",_.rectLabel="rectLabel",_.lineLabel="lineLabel",_.dataLabel="dataLabel",(A=t$||(t$={})).continuousPlayer="continuousPlayer",A.discretePlayer="discretePlayer",(w=tY||(tY={})).before="before",w.layouting="layouting",w.reevaluate="reevaluate",w.after="after",(S=tX||(tX={})).BEFORE_EVALUATE_DATA="beforeEvaluateData",S.AFTER_EVALUATE_DATA="afterEvaluateData",S.BEFORE_EVALUATE_SCALE="beforeEvaluateScale",S.AFTER_EVALUATE_SCALE="afterEvaluateScale",S.BEFORE_PARSE_VIEW="beforeParseView",S.AFTER_PARSE_VIEW="afterParseView",S.BEFORE_TRANSFORM="beforeTransform",S.AFTER_TRANSFORM="afterTransform",S.BEFORE_CREATE_VRENDER_STAGE="beforeCreateVRenderStage",S.AFTER_CREATE_VRENDER_STAGE="afterCreateVRenderStage",S.BEFORE_CREATE_VRENDER_LAYER="beforeCreateVRenderLayer",S.AFTER_CREATE_VRENDER_LAYER="afterCreateVRenderLayer",S.BEFORE_STAGE_RESIZE="beforeStageResize",S.AFTER_STAGE_RESIZE="afterStageResize",S.BEFORE_VRENDER_DRAW="beforeVRenderDraw",S.AFTER_VRENDER_DRAW="afterVRenderDraw",S.BEFORE_MARK_JOIN="beforeMarkJoin",S.AFTER_MARK_JOIN="afterMarkJoin",S.BEFORE_MARK_UPDATE="beforeMarkUpdate",S.AFTER_MARK_UPDATE="afterMarkUpdate",S.BEFORE_MARK_STATE="beforeMarkState",S.AFTER_MARK_STATE="afterMarkState",S.BEFORE_MARK_ENCODE="beforeMarkEncode",S.AFTER_MARK_ENCODE="afterMarkEncode",S.BEFORE_DO_LAYOUT="beforeDoLayout",S.AFTER_DO_LAYOUT="afterDoLayout",S.BEFORE_MARK_LAYOUT_END="beforeMarkLayoutEnd",S.AFTER_MARK_LAYOUT_END="afterMarkLayoutEnd",S.BEFORE_DO_RENDER="beforeDoRender",S.AFTER_DO_RENDER="afterDoRender",S.BEFORE_MARK_RENDER_END="beforeMarkRenderEnd",S.AFTER_MARK_RENDER_END="afterMarkRenderEnd",S.BEFORE_CREATE_VRENDER_MARK="beforeCreateVRenderMark",S.AFTER_CREATE_VRENDER_MARK="afterCreateVRenderMark",S.BEFORE_ADD_VRENDER_MARK="beforeAddVRenderMark",S.AFTER_ADD_VRENDER_MARK="afterAddVRenderMark",S.AFTER_VRENDER_NEXT_RENDER="afterVRenderNextRender",S.BEFORE_ELEMENT_UPDATE_DATA="beforeElementUpdateData",S.AFTER_ELEMENT_UPDATE_DATA="afterElementUpdateData",S.BEFORE_ELEMENT_STATE="beforeElementState",S.AFTER_ELEMENT_STATE="afterElementState",S.BEFORE_ELEMENT_ENCODE="beforeElementEncode",S.AFTER_ELEMENT_ENCODE="afterElementEncode",S.ANIMATION_START="animationStart",S.ANIMATION_END="animationEnd",S.ELEMENT_ANIMATION_START="elementAnimationStart",S.ELEMENT_ANIMATION_END="elementAnimationEnd",S.ALL_ANIMATION_START="allAnimationStart",S.ALL_ANIMATION_END="allAnimationEnd",(T=tK||(tK={})).signal="signal",T.data="data",T.scale="scale",T.coordinate="coordinate",T.mark="mark",(k=tq||(tq={})).active="active",k.selected="selected",k.highlight="highlight",k.blur="blur";let lo=-1;class ll extends ec(){constructor(t){super(),this.spec={},this.references=new Map,this.targets=[],this.transforms=[],this.view=t,this.uid=++lo}parse(t){return this.id(t.id),this.name(t.name),this.depend(t.dependency),this}depend(t){var e;if(null===(e=this.spec)||void 0===e?void 0:e.dependency){let t=ex(this.spec.dependency).map(t=>(0,ek.Z)(t)?this.view.getGrammarById(t):t);this.detach(t)}this.spec.dependency=t;let i=ex(t).map(t=>(0,ek.Z)(t)?this.view.getGrammarById(t):t);return this.attach(i),this.commit(),this}addEventListener(t,e,i){let r=e;return i&&!1===i.trap||((r=e).raw=e),i&&i.target&&(r.target=i.target),this.on(t,r),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}emit(t,...e){var i,r;return null===(r=null===(i=this.view)||void 0===i?void 0:i.emit)||void 0===r||r.call(i,t,...e),super.emit(t,...e)}emitGrammarEvent(t,...e){return super.emit(t,...e)}evaluateTransform(t,e,i){if(!t||!t.length)return e;let r=e,n=0,s=t.length;for(;n<s;){let e=t[n];this.emit(tX.BEFORE_TRANSFORM,e.type),r=e.transform(e.isRawOptions?e.options:la(e.options,i),r,i,this.view),n++,this.emit(tX.AFTER_TRANSFORM,e.type)}return r}set(t){return!1}id(t){return arguments.length?(this.view.grammars.unrecord(this),this._id=t,this.view.grammars.record(this),this):this._id}name(t){return arguments.length?(this._name=t,this):this._name}attach(t,e=1){return ex(t).filter(t=>!(0,eB.Z)(t)).forEach(i=>{var r;(0,eB.Z)(t)||(i.targets.includes(this)||i.targets.push(this),this.references.set(i,(null!==(r=this.references.get(i))&&void 0!==r?r:0)+e))}),this}detach(t,e=1){return ex(t).filter(t=>!(0,eB.Z)(t)).forEach(t=>{let i=this.references.get(t)-e;i>0?this.references.set(t,i-1):(this.references.delete(t),t.targets.includes(this)&&(t.targets=t.targets.filter(t=>t!==this)))}),this}detachAll(){this.references.forEach((t,e)=>{this.detach(e,t)})}link(t){this.grammarSource=t}run(){var t;let e=null===(t=this.grammarSource)||void 0===t?void 0:t.output(),i=this.parameters();return this.evaluate(e,i)}commit(){this.view.commit(this)}parameters(){let t={};return this.references.forEach((e,i)=>{eb(i.id())&&(t[i.id()]=i.output())}),t}getSpec(){return this.spec}reuse(t){return this}clear(){this.spec=null,this.view=null}release(){this.clear()}setFunctionSpec(t,e){return(0,eB.Z)(this.spec[e])||this.detach(o7(this.spec[e],this.view)),this.spec[e]=t,this.attach(o7(t,this.view)),this.commit(),this}}class lh{constructor(t,e,i,r){this.channelEncoder={},this.marks=t,e&&this.registerChannelEncoder(e),i&&this.registerDefaultEncoder(i),this.progressiveChannels&&this.registerProgressiveChannels(r)}getMarks(){return this.marks}registerChannelEncoder(t,e){return(0,ek.Z)(t)?this.channelEncoder[t]=e:Object.assign(this.channelEncoder,t),this}registerFunctionEncoder(t){return this.functionEncoder=t,this}registerDefaultEncoder(t){return this.defaultEncoder=t,this}registerProgressiveChannels(t){return this.progressiveChannels=ex(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}class ld{static registerPlotMarks(t,e){ld._plotMarks[t]=e}static createPlotMark(t,e){return ld._plotMarks[t]?new ld._plotMarks[t](e):null}static registerMark(t,e){ld._marks[t]=e}static createMark(t,e,i){return ld._marks[t]?new ld._marks[t](e,t,i):null}static hasMark(t){return!!ld._marks[t]}static registerComponent(t,e){ld._components[t]=e}static createComponent(t,e,i,r){let n=ld._components[t];return n?new n(e,i,r):null}static hasComponent(t){return!!ld._components[t]}static registerGraphicComponent(t,e){ld._graphicComponents[t]=e}static createGraphicComponent(t,e,i){let r=ld._graphicComponents[t];return r?r(e,i):null}static registerTransform(t,e,i){ld._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return ld._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(ld._transforms).forEach(t=>{ld._transforms[t]&&!ld._transforms[t].isBuiltIn&&(ld._transforms[t]=null)})}static registerGrammar(t,e,i){ld._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var r;let n=null===(r=ld._grammars[t])||void 0===r?void 0:r.grammarClass;return n?new n(e,i):null}static getGrammars(){return this._grammars}static getGlyph(t){return ld._glyphs[t]}static createInteraction(t,e,i){let r=ld._interactions[t];return r?new r(e,i):null}static hasInteraction(t){return!!ld._interactions[t]}}ld._plotMarks={},ld._marks={},ld._components={},ld._graphicComponents={},ld._transforms={},ld._grammars={},ld._glyphs={},ld._animations={},ld._interactions={},ld._graphics={},ld.registerGlyph=(t,e,i,r,n)=>(ld._glyphs[t]=new lh(e,i,r,n),ld._glyphs[t]),ld.registerAnimationType=(t,e)=>{ld._animations[t]=e},ld.getAnimationType=t=>ld._animations[t],ld.registerInteraction=(t,e)=>{ld._interactions[t]=e},ld.registerGraphic=(t,e)=>{ld._graphics[t]=e},ld.getGraphicType=t=>ld._graphics[t],ld.createGraphic=(t,e)=>{let i=ld._graphics[t];return i?i(e):null};let lu=(t,e,i)=>{var r,n;if("callback"===t&&r6(e))return{references:[],value:{callback:e,dependency:[]}};if(!(0,eB.Z)(e.data)){let t=i.getDataById(e.data);return{references:[t],value:t}}if(!(0,eB.Z)(e.customized)){let t=i.getCustomizedById(e.customized);return{references:[t],value:t}}if(!(0,eB.Z)(e.scale)){let t=i.getScaleById(e.scale);return{references:[t],value:t}}if((n=e)&&(n.signal||n.callback)){let t=o7(e,i);return{references:t,value:e.callback?{value:e.callback,dependency:t}:null!==(r=null==t?void 0:t[0])&&void 0!==r?r:e}}return{value:e}},lc=(t,e,i)=>{if((0,eB.Z)(e))return{value:e};if((0,ev.Z)(e)){let r=e.map(e=>lu(t,e,i));return{references:r.reduce((t,e)=>(e.references&&t.concat(e.references),t),[]),value:r.map(t=>t.value)}}return lu(t,e,i)},lp=(t,e)=>{let i=ld.getTransform(t.type);if(!i)return;let r={},n=[];return Object.keys(t).forEach(i=>{var s;if("type"===i)return;let a=t[i];if("dependency"===i)return void((null==a?void 0:a.length)&&(n=n.concat(o8(a,e))));let o=lc(i,a,e);o&&((null===(s=o.references)||void 0===s?void 0:s.length)&&(n=n.concat(o.references)),r[i]=o.value)}),{markPhase:i.markPhase,transform:i.transform,canProgressive:i.canProgressive,type:i.type,options:r,references:n}},lg=(t,e)=>{if(null==t?void 0:t.length){let i=[],r=[];return t.forEach(t=>{var n;let s=lp(t,e);s&&((null===(n=s.references)||void 0===n?void 0:n.length)&&(r=r.concat(s.references)),i.push(s))}),{transforms:i,refs:r}}return null};var lf=i("833693"),lm=i("315528"),lv=i("256706");(B=tJ||(tJ={})).DSV="dsv",B.TREE="tree",B.GEO="geo",B.BYTE="bytejson",B.HEX="hex",B.GRAPH="graph",B.TABLE="table",B.GEO_GRATICULE="geo-graticule";var ly=t=>(0,r3.Z)(t,"Date");function lb(t,e,i){let r;if(!eb(t)||"object"!=typeof t||e&&e(t))return t;let n=(0,ev.Z)(t),s=t.length;r=n?Array(s):"object"==typeof t?{}:r4(t)||(0,iy.Z)(t)||(0,ek.Z)(t)?t:ly(t)?new Date(+t):void 0;let a=n?void 0:Object.keys(Object(t)),o=-1;if(r)for(;++o<(a||t).length;){let n=a?a[o]:o,s=t[n];i&&i.includes(n.toString())?r[n]=s:r[n]=lb(s,e,i)}return r}let lx={delimiter:","};var l_=t=>"object"==typeof t&&null!==t,lA=function(t){if(!l_(t)||!(0,r3.Z)(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function lw(t,e,i=!1,r=!1){if(e&&t!==e&&eb(e)&&"object"==typeof e){let n=Object(e),s=[];for(let t in n)s.push(t);let{length:a}=s,o=-1;for(;a--;){let a=s[++o];!eb(n[a])||"object"!=typeof n[a]||r&&(0,ev.Z)(t[a])?lS(t,a,n[a]):function(t,e,i,r=!1,n=!1){let s=t[i],a=e[i],o=e[i],l=!0;if((0,ev.Z)(a)){if(r)o=[];else if((0,ev.Z)(s))o=s;else if(ey(s)){o=Array(s.length);let t=-1,e=s.length;for(;++t<e;)o[t]=s[t]}}else lA(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&lw(o,a,r,n),lS(t,i,o)}(t,e,a,i,r)}}}function lS(t,e,i){(void 0===i||function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i))&&(void 0!==i||e in t)||(t[e]=i)}function lT(t,...e){let i=-1,r=e.length;for(;++i<r;)lw(t,e[i],!0);return t}let lk=0;function lB(t="dataset"){return lk>1e8&&(lk=0),t+"_"+lk++}let lC=(t,e)=>{var i,r;if(!(null==e?void 0:e.fields)||0===t.length)return t;let n=e.fields,s=t[0],a={},o=[];for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e)){let l;let h=n[e];if(!h.type){let r=s;e in s||(r=null!==(i=t.find(t=>e in t))&&void 0!==i?i:s),h.type="number"==typeof r[e]?"linear":"ordinal"}if("number"==typeof h.sortIndex&&(l={key:e,type:h.type,index:h.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===h.sortReverse},o.push(l)),(null===(r=h.domain)||void 0===r?void 0:r.length)>0){if("ordinal"===h.type){h._domainCache={},a[e]=h;let t={};h.domain.forEach((e,i)=>{t[e]=i,h._domainCache[e]=i}),l&&(l.sortIndex=t,l.sortIndexCount=h.domain.length)}else h.domain.length>=2&&(a[e]=h)}}return Object.keys(a).length>0&&(t=t.filter(t=>{for(let e in a){let i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0})),o.sort((t,e)=>t.index-e.index),t.sort((t,e)=>(function(t,e,i){for(let r=0;r<i.length;r++){let n=i[r],s=0;if("ordinal"===n.type?(void 0===n.sortIndex[e[n.key]]&&(n.sortIndex[e[n.key]]=n.sortIndexCount++),void 0===n.sortIndex[t[n.key]]&&(n.sortIndex[t[n.key]]=n.sortIndexCount++),s=n.sortIndex[t[n.key]]-n.sortIndex[e[n.key]]):"linear"===n.type&&(s=t[n.key]-e[n.key]),n.sortReverse&&(s=-s),0!==s)return s}return 0})(t,e,o)),t},lE="_data-view-diff-rank";class lM{constructor(t,e){let i;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new(ec()),this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(t={pushHistory:!0,emitMessage:!0})=>(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach(e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),this.isLastTransform(e)&&this.diffLastData()}),this.isRunning=!1,!1!==t.emitMessage&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:lB("dataview"),this.name=i,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==e?void 0:e.fields)}parse(t,e,i=!1){var r;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);let n=this.cloneParseData(t,e);if(null==e?void 0:e.type){let t=(null!==(r=this.dataSet.getParser(e.type))&&void 0!==r?r:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;let e=this.transformsArr.findIndex(e=>e.type===t.type);e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){let e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort((t,e)=>{var i,r;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(r=e.level)&&void 0!==r?r:0)})}executeTransform(t,e={pushHistory:!0,emitMessage:!0}){let{pushHistory:i,emitMessage:r}=e,n=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(n),this.latestData=n,!1!==r&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData||!this.latestData.forEach||!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;let e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach(t=>{t[lE]=e,this._diffMap.set(this._diffKeys.reduce((e,i)=>e+t[i],""),t)}),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach(i=>{i[lE]=e,t=this._diffKeys.reduce((t,e)=>t+i[e],""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)}),this._diffMap.forEach((t,i)=>{t[lE]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))})}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof lM||!0!==(null==e?void 0:e.clone)||(i=!0),i?lb(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){let i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?lT({},this._fields,t):t;let i=this.transformsArr.find(t=>"fields"===t.type);!(0,eB.Z)(this._fields)&&(0,eB.Z)(i)?(this.dataSet.registerTransform("fields",lC),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}class lP{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new(ec()),i=(null==t?void 0:t.name)?t.name:lB("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:eC.Y.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let r=this._callMap.get(i);r||(r=()=>{t.some(t=>t.isRunning)||i()}),t.forEach(t=>{t.target.addListener(e,r)}),this._callMap.set(i,r)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){let r=this._callMap.get(i);r&&t.forEach(t=>{t.target.removeListener(e,r)}),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach(t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()}),t.forEach(t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)})}multipleDataViewUpdateInRawData(t){t.forEach(t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()}),t.forEach(t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)})}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}let lO={csv:(t,e={},i)=>(i.type=tJ.DSV,(0,lm.ue)(t)),dsv:(t,e={},i)=>{i.type=tJ.DSV;let{delimiter:r}=function(t,...e){return function(t,...e){t||(t={});let i=-1,r=e.length;for(;++i<r;)!function(t,e){if((0,ep.Z)(e)&&t!==e)for(let i in e)!function t(e,i,r){let n=i[r];if(void 0===n)e[r]=null;else if((0,ep.Z)(n))for(let i in(0,ep.Z)(e[r])||(e[r]={}),n)t(e[r],n,i);else e[r]=n}(t,e,i)}(t,e[i]);return t}(lb(t),...e)}(lx,e);if(!(0,ek.Z)(r))throw TypeError("Invalid delimiter: must be a string!");return(0,lf.Z)(r).parse(t)},tsv:(t,e={},i)=>(i.type=tJ.DSV,(0,lv.tJ)(t)),json:(t,e={},i)=>{if(!(0,ek.Z)(t))return ex(t);try{return ex(JSON.parse(t))}catch(t){return[]}}},lR=(t,e)=>{if(!e||!lO[e.type])return ex(t);let i="dsv"===e.type?{delimiter:e.delimiter}:{};return lO[e.type](t,i,new lM(new lP))};class lI extends ll{constructor(t,e,i){super(t),this.grammarType="data",this.spec={},this._dataIDKey=`VGRAMMAR_DATA_ID_KEY_${this.uid}`,this._loadTasks=[],this._postFilters=[],this.ingest=t=>{let e=function(t,e){if((0,eB.Z)(t))return t;if(r6(t))return t.call(null,e);if(t.signal){let i=t.signal;return(0,ek.Z)(i)?null==e?void 0:e[i]:i.output()}return t.callback?t.callback.call(null,e):t}(t.format,this.parameters());return this._input=lR(t.values,e),this._input},this.load=t=>{if(t.values)return this.ingest(t)},this.relay=t=>t[0],this._loadTasks=[],(0,eB.Z)(e)||this.values(e,i)}parse(t){return super.parse(t),this._isLoaded=!1,this.source(t.source,t.format,!1),this.url(t.url,t.format,!1),this.values(t.values,t.format,!1),this.transform(t.transform),this.parseLoad(t),this.commit(),this}parseDataSource(t){let e=[],i=[],r=t.format?o7(t.format,this.view)[0]:null;if(r&&e.push(r),t.values){let r=o7(t.values,this.view)[0];r&&e.push(r),i.push({type:"ingest",transform:this.ingest,isRawOptions:!0,options:{values:t.values,format:t.format}})}else if(t.url){let n=o7(t.url,this.view)[0];n&&e.push(n),i.push({type:"load",transform:this.load,options:{url:null!=n?n:t.url,format:null!=r?r:t.format}})}else if(t.source){let r=[];ex(t.source).forEach(t=>{let i=li(t)?t:this.view.getDataById(t);i&&(e.push(i),r.push(i))}),r.length&&(i.push({type:"relay",transform:this.relay,options:r}),this.grammarSource=r[0])}return{transforms:i,refs:e}}evaluate(t,e){this.view.emit(tX.BEFORE_EVALUATE_DATA);let i=this._isLoaded?this.transforms:this._loadTasks.concat(this.transforms);this.grammarSource&&(this._input=t);let r=this.evaluateTransform(i,this._input,e),n=this._evaluateFilter(r,e);return this.setValues(n),this._isLoaded=!0,this.view.emit(tX.AFTER_EVALUATE_DATA),this}output(){return this._values}getDataIDKey(){return this._dataIDKey}values(t,e,i=!0){let r=Object.assign({},this.spec,{values:t,format:e});return(0,eB.Z)(t)||(r.url=void 0,r.source=void 0),i?this.parseLoad(r):this}url(t,e,i=!0){let r=Object.assign({},this.spec,{url:t,format:e});return(0,eB.Z)(t)||(r.values=void 0,r.source=void 0),i?this.parseLoad(r):this}source(t,e,i=!0){let r=Object.assign({},this.spec,{source:t,format:e});return(0,eB.Z)(t)||(r.values=void 0,r.url=void 0),i?this.parseLoad(r):this}parseLoad(t){this.detach(this.parseDataSource(this.spec).refs),this.spec=t;let e=this.parseDataSource(this.spec);return this.attach(e.refs),this._loadTasks=e.transforms,this._isLoaded=!1,this.commit(),this}setValues(t){this._values=ex(t).map((t,e)=>{let i=t===Object(t)?t:{data:t};return i[this._dataIDKey]=e,i})}field(t){return this._values.map(e=>e[t])}transform(t){let e=lg(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]),this.spec.transform=t;let i=lg(this.spec.transform,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.commit(),this}getValue(){return this._values}getInput(){return this._input}addDataFilter(t){return this._postFilters=this._postFilters.concat(ex(t)),this._postFilters.sort((t,e)=>{var i,r;return(null!==(i=t.rank)&&void 0!==i?i:0)-(null!==(r=e.rank)&&void 0!==r?r:0)}),this}removeDataFilter(t){let e=ex(t);return this._postFilters=this._postFilters.filter(t=>!e.includes(t)),this}_evaluateFilter(t,e){return this._postFilters.reduce((t,i)=>i.filter(t,e),t)}reuse(t){return t.grammarType!==this.grammarType||(this._isLoaded=!1,this._values=t.output()),this}clear(){super.clear(),this._input=null,this._values=null}}let lL="window",lD="view",lj={trap:!1},lN="width",lF="height",lG="viewWidth",lz="viewHeight",lZ="padding",lH="viewBox",lU="autoFit";function lV(t,e,i,r){let n,s;let a=t[e];for(;e>i&&(n=t[s=Math.floor((e-1)/2)],a&&n&&0>r(a,n));)t[e]=n,e=s;return t[e]=a}function lW(t,e,i,r){let n=e,s=null!=i?i:t.length,a=t[e],o,l=2*e+1;for(;l<s;)(o=l+1)<s&&r(t[l],t[o])>=0&&(l=o),t[e]=t[l],l=2*(e=l)+1;return t[e]=a,lV(t,e,n,r)}class l${constructor(t){this.compare=t,this.nodes=[]}size(){return this.nodes.length}last(){return this.nodes[0]}validate(){for(let t=this.nodes.length-1;t>0;t-=1){let e=Math.floor((t-1)/2);if(this.compare(this.nodes[e],this.nodes[t])>0)return!1}return!0}push(t){if(this.nodes.includes(t)){let e=this.nodes.indexOf(t);return lV(this.nodes,e,0,this.compare),lW(this.nodes,e,null,this.compare)}return this.nodes.push(t),lV(this.nodes,this.nodes.length-1,0,this.compare)}remove(t){if(this.nodes.includes(t)){let e=this.nodes.indexOf(t);this.nodes=this.nodes.slice(0,e).concat(this.nodes.slice(e+1)),lV(this.nodes,e,0,this.compare),lW(this.nodes,e,null,this.compare)}}pop(){let t;let e=this.nodes.pop();return this.nodes.length?(t=this.nodes[0],this.nodes[0]=e,lW(this.nodes,0,null,this.compare)):t=e,t}clear(){this.nodes=[]}}let lY=(t,e,i)=>(t.fields=e||[],t.fname=i,t);var lX=(t,e,i)=>{let r=(0,ek.Z)(e)?e.split("."):e;for(let e=0;e<r.length;e++)t=t?t[r[e]]:void 0;return void 0===t?i:t};let lK=t=>e=>lX(e,t),lq=t=>{eC.Y.getInstance().error(t)},lJ=t=>{let e=[],i=t.length,r,n,s,a=null,o=0,l="";t+="";let h=()=>{e.push(l+t.substring(r,n)),l="",r=n+1};for(r=0,n=0;n<i;n+=1)if("\\"===(s=t[n]))l+=t.substring(r,n),l+=t.substring(++n,++n),r=n;else if(s===a)h(),a=null,o=-1;else{if(a)continue;r===o&&'"'===s||r===o&&"'"===s?(r=n+1,a=s):"."!==s||o?"["===s?(n>r&&h(),o=r=n+1):"]"===s&&(o||lq("Access path missing open bracket: "+t),o>0&&h(),o=0,r=n+1):n>r?h():r=n+1}return o&&lq("Access path missing closing bracket: "+t),a&&lq("Access path missing closing quote: "+t),n>r&&(n+=1,h()),e},lQ=(t,e,i={})=>{if(r6(t))return t;let r=lJ(t),n=1===r.length?r[0]:t;return lY((i&&i.get||lK)(r),[n],e||n)},l0=(t,e,i={})=>{if((0,ev.Z)(t)){let r=t.map(t=>lQ(t,e,i));return t=>r.map(e=>e(t))}return lQ(t,e,i)};l0("id");let l1=lY(function(t){return t},[],"identity");lY(function(){return 0},[],"zero"),lY(function(){return 1},[],"one"),lY(function(){return!0},[],"true"),lY(function(){return!1},[],"false"),lY(function(){return{}},[],"emptyObject");class l2{constructor(t){this.list=[],this.ids={},this.idFunc=t||l1}add(t){let e=this.idFunc(t);return this.ids[e]||(this.ids[e]=1,this.list.push(t)),this}remove(t){let e=this.idFunc(t);return this.ids[e]&&(this.ids[e]=0,this.list=this.list.filter(e=>e!==t)),this}forEach(t,e){e?this.list.slice().reverse().forEach(t):this.list.forEach(t)}filter(t){return this.list.filter(t)}get length(){return this.list.length}getElementByIndex(t){return this.list[t]}}class l5{constructor(){this.grammars=[],this.logger=eC.Y.getInstance(),this._curRank=0,this._committed=new l2(t=>t.uid),this._heap=new l$((t,e)=>(null==t?void 0:t.qrank)-(null==e?void 0:e.qrank)),this._beforeRunner=null,this._afterRunner=null,this._updateCounter=0,this._finishFirstRender=!1}add(t){if(t)return this._setRankOfGrammar(t),this.commit(t),!this.grammars.includes(t)&&(this.grammars.push(t),!0)}remove(t){t&&(this._committed.remove(t),this._heap.remove(t),this.grammars=this.grammars.filter(e=>e!==t))}_setRankOfGrammar(t){t&&(t.rank=++this._curRank)}_reRank(t){let e=[t];for(;e.length;){let i=e.pop();this._setRankOfGrammar(i);let r=i.targets;r&&r.forEach(i=>{e.push(i),i===t&&this.logger.error("Cycle detected in dataflow graph.")})}}_enqueue(t){t&&(t.qrank=t.rank,this._heap.push(t))}_logGrammarRunInfo(t){if(this.logger.canLogError()){let e=[{key:"id",value:t.id()},{key:"name",value:t.name()}].reduce((t,e,i)=>(0,eB.Z)(e.value)?t:`${t}${i?" , ":""}${e.key}: ${e.value}`,"");this.logger.debug("Run Operator: ",t,e)}}hasCommitted(){return!!this._committed.length}commit(t){return this._committed.add(t),this}_beforeEvaluate(){this.grammars.forEach(t=>{t.targets.some(e=>(null==e?void 0:e.rank)<(null==t?void 0:t.rank))&&this._reRank(t)}),this._committed.forEach(t=>this._enqueue(t)),this._committed=new l2(t=>t.uid)}_enqueueTargets(t){t.targets&&t.targets.length&&this._finishFirstRender&&t.targets.forEach(t=>this._enqueue(t))}evaluate(){if(this._beforeRunner&&this._beforeRunner(this),!this._committed.length)return this.logger.info("Dataflow invoked, but nothing to do."),!1;this._updateCounter+=1;let t,e,i=0;for(this.logger.canLogInfo()&&(e=Date.now(),this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)),this._beforeEvaluate();this._heap.size()>0;)(t=this._heap.pop())&&(t.rank===t.qrank?(t.run(),this._logGrammarRunInfo(t),this._enqueueTargets(t),i+=1):this._enqueue(t));return this.logger.canLogInfo()&&(e=Date.now()-e,this.logger.info(`> ${i} grammars updated; ${e} ms`)),this._afterRunner&&this._afterRunner(this),this._finishFirstRender=!0,!0}runBefore(t){this._beforeRunner=t}runAfter(t){this._afterRunner=t}release(){this._heap&&(this._heap.clear(),this._heap=null),this.logger=null,this._committed=null}}let l3=(t,e,i,r,n)=>{let s=t=>{if(n||!t||r&&!r(t)||i.call(null,t),t.markType===tF.group){let i=t[e];i&&i.forEach(t=>{s(t)})}n&&t&&(!r||r(t))&&i.call(null,t)};s(t)},l4="__vgrammar_scene_item__",l6=[tF.line,tF.area],l8=[tF.arc3d,tF.rect3d,tF.pyramid3d],l7=[{}],l9=["key"],ht="VGRAMMAR_IMMEDIATE_ANIMATION",he="quintInOut",hi={stopWhenStateChange:!1,immediatelyApply:!0};var hr=t=>void 0===t;class hn extends r7{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,r,n,s,a,o,l,h,d,u,c,p,g){throw Error("Method not implemented.")}}class hs extends hn{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw Error("getPredictedEvents is not supported!")}clone(){var t,e,i;let r=new hs(this.manager);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice(),r.type=this.type,r}}class ha extends hn{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;let r=new ha(this.manager);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice(),r.type=this.type,r}}ha.DOM_DELTA_PIXEL=0,ha.DOM_DELTA_LINE=1,ha.DOM_DELTA_PAGE=2;let ho="object"==typeof performance&&performance.now?performance:Date;function hl(t){return"mouse"===t||"pen"===t}class hh{constructor(t,e){this.dispatch=new(ec()),this.cursorTarget=null,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof hs))return void eC.Y.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(hl(i.pointerType)){let t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,r;if(!(t instanceof hs))return void eC.Y.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let n=this.createPointerEvent(t,t.type,e),s=hl(n.pointerType),a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.overTargets);if(a.overTargets&&o&&o!==this.rootTarget&&o!==n.target){let e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,o||void 0);if(this.dispatchEvent(i,"pointerout"),s&&this.dispatchEvent(i,"mouseout"),!n.composedPath().includes(o)){let e=this.createPointerEvent(t,"pointerleave",o||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!n.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(o!==n.target){let e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(n,e);this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover");let r=null==o?void 0:o.parent;for(;r&&r!==this.rootTarget.parent&&r!==n.target;)r=r.parent;if(!r||r===this.rootTarget.parent){let t=this.clonePointerEvent(n,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==o&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&this.dispatchEvent(n,"touchmove"),s&&(this.dispatchEvent(n,"mousemove"),this.cursorTarget=n.target,this.cursor=(null===(r=null===(i=n.target)||void 0===i?void 0:i.attribute)||void 0===r?void 0:r.cursor)||this.rootTarget.getCursor()),a.overTargets=n.composedPath(),this.freeEvent(n)},this.onPointerOver=(t,e)=>{var i,r;if(!(t instanceof hs))return void eC.Y.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let n=this.trackingData(t.pointerId),s=this.createPointerEvent(t,t.type,e),a=hl(s.pointerType);this.dispatchEvent(s,"pointerover"),a&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursorTarget=s.target,this.cursor=(null===(r=null===(i=s.target)||void 0===i?void 0:i.attribute)||void 0===r?void 0:r.cursor)||this.rootTarget.getCursor());let o=this.clonePointerEvent(s,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),a&&this.notifyTarget(o,"mouseenter"),o.target=o.target.parent;n.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(o)},this.onPointerOut=(t,e)=>{if(!(t instanceof hs))return void eC.Y.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let i=this.trackingData(t.pointerId);if(i.overTargets){let e=hl(t.pointerType),r=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",r||void 0);this.dispatchEvent(n),e&&this.dispatchEvent(n,"mouseout");let s=this.createPointerEvent(t,"pointerleave",r||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(n),this.freeEvent(s)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof hs))return void eC.Y.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let r=ho.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(hl(n.pointerType)){let t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}let s=this.trackingData(t.pointerId),a=this.findMountedTarget(s.pressTargetsByButton[t.button]),o=a;if(a&&!n.composedPath().includes(a)){let e=a;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(hl(n.pointerType)){let t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete s.pressTargetsByButton[t.button],o=e}if(o){let e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],s.clicksByButton[t.button]||(s.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:r});let a=s.clicksByButton[t.button];a.target===e.target&&r-a.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++a.clickCount:a.clickCount=1,a.target=e.target,a.timeStamp=r,e.detail=a.clickCount,hl(e.pointerType)?(this.dispatchEvent(e,"click"),2===a.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===a.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof hs))return void eC.Y.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let i=this.trackingData(t.pointerId),r=this.findMountedTarget(i.pressTargetsByButton[t.button]),n=this.createPointerEvent(t,t.type,e);if(r){let e=r;for(;e;)n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):hl(n.pointerType)&&this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(n)},this.onWheel=(t,e)=>{if(!(t instanceof ha))return void eC.Y.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");let i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((t,e)=>t.priority-e.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,r,n,s,a,o;let l;if(!this.rootTarget)return;let h=this.mappingTable[t.type],d=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[d])&&(null===(r=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[d])||void 0===r?void 0:r.stage)&&(null===(s=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[d])||void 0===s?void 0:s.stage.renderCount)===(null===(a=this._prePointTargetCache)||void 0===a?void 0:a.stageRenderCount)?l=this._prePointTargetCache[d]:(l=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[d]:l,stageRenderCount:null!==(o=null==l?void 0:l.stage.renderCount)&&void 0!==o?o:-1})),h)for(let e=0,i=h.length;e<i;e++)h[e].fn(t,l);else eC.Y.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;let i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let r=0,n=i.length-1;r<n;r++)if(t.currentTarget=i[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let r=i.length-2;r>=0;r--)if(t.currentTarget=i[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){let e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){e=null!=e?e:t.type;let i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){var r,n;let s=this.allocateEvent(hs);return this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t,s.target=i||this.pickTarget(null!==(r=s.viewX)&&void 0!==r?r:s.global.x,null!==(n=s.viewY)&&void 0!==n?n:s.global.y,s),"string"==typeof e&&(s.type=e),s}createWheelEvent(t,e){var i,r;let n=this.allocateEvent(ha);return this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=e||this.pickTarget(null!==(i=n.viewX)&&void 0!==i?i:n.global.x,null!==(r=n.viewY)&&void 0!==r?r:n.global.y,n),n}clonePointerEvent(t,e){let i=this.allocateEvent(hs);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof hs&&e instanceof hs&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof hn&&e instanceof hn&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach(i=>{e[i].x=t[i].x,e[i].y=t[i].y}))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=ho.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);let i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventManager!");let i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){let i=t.currentTarget._events[e];if(i){if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let r=0,n=i.length;r<n&&!t.propagationImmediatelyStopped;r++)i[r].once&&t.currentTarget.removeEventListener(e,i[r].fn,{once:!0}),i[r].fn.call(i[r].context,t)}this.emitDelegation(t,e)}emitDelegation(t,e){let i=t.currentTarget._events["*"];if(i){if("fn"in i)i.fn.call(i.context,t,e);else for(let r=0,n=i.length;r<n&&!t.propagationImmediatelyStopped;r++)i[r].fn.call(i[r].context,t,e)}}pickTarget(t,e,i){let r;let n=this.rootTarget.pick(t,e);return r=n&&n.graphic?n.graphic:n&&n.group?n.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=n.params),r}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}let hd={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class hu{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;let e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(!t.cancelable&&"cancelable"in t||t.preventDefault());for(let t=0,i=e.length;t<i;t++){let i=e[t],r=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(r)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType||this.isEventOutsideOfTargetElement(t))return;let e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){let i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;let e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,r=i.length;t<r;t++){let r=this.bootstrapEvent(this.rootPointerEvent,i[t]);r.type+=e,this.manager.mapEvent(r)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;let e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){let i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)},this.onWheel=t=>{let e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};let{targetElement:e,resolution:i,rootNode:r,global:n,autoPreventDefault:s=!1,clickInterval:a,supportsTouchEvents:o=n.supportsTouchEvents,supportsPointerEvents:l=n.supportsPointerEvents}=t;this.manager=new hh(r,{clickInterval:a}),this.globalObj=n,this.supportsPointerEvents=l,this.supportsTouchEvents=o,this.supportsMouseEvents=n.supportsMouseEvents,this.applyStyles=n.applyStyles,this.autoPreventDefault=s,this.eventsAdded=!1,this.rootPointerEvent=new hs,this.rootWheelEvent=new ha,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");let{applyStyles:i,domElement:r}=this;if(this.currentCursor===t)return;this.currentCursor=t;let n=this.cursorStyles[t];n?"string"==typeof n&&i?r.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&i&&Object.assign(r.style,n):i&&(0,ek.Z)(t)&&!r1(this.cursorStyles,t)&&(r.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;let{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;let{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e;let i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;let{clientX:r,clientY:n}=t,s=this.domElement.getBoundingClientRect();return{x:r-s.left,y:n-s.top}}normalizeToPointerData(t){let e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,r=t.changedTouches.length;i<r;i++){let r=t.changedTouches[i];hr(r.button)&&(r.button=0),hr(r.buttons)&&(r.buttons=1),hr(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),hr(r.width)&&(r.width=r.radiusX||1),hr(r.height)&&(r.height=r.radiusY||1),hr(r.tiltX)&&(r.tiltX=0),hr(r.tiltY)&&(r.tiltY=0),hr(r.pointerType)&&(r.pointerType="touch"),hr(r.pointerId)&&(r.pointerId=r.identifier||0),hr(r.pressure)&&(r.pressure=r.force||.5),hr(r.twist)&&(r.twist=0),hr(r.tangentialPressure)&&(r.tangentialPressure=0),hr(r.layerX)&&(r.layerX=r.offsetX=r.clientX),hr(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent)||(hr(t.isPrimary)&&(t.isPrimary=!0),hr(t.width)&&(t.width=1),hr(t.height)&&(t.height=1),hr(t.tiltX)&&(t.tiltX=0),hr(t.tiltY)&&(t.tiltY=0),hr(t.pointerType)&&(t.pointerType="mouse"),hr(t.pointerId)&&(t.pointerId=1),hr(t.pressure)&&(t.pressure=.5),hr(t.twist)&&(t.twist=0),hr(t.tangentialPressure)&&(t.tangentialPressure=0),t.isNormalized=!0),e.push(t);return e}normalizeWheelEvent(t){let e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;let{x:i,y:r}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=r,e.global.x=i,e.global.y=r,e.offset.x=i,e.offset.y=r;let{x:n,y:s}=this.mapToViewportPoint(e);return e.viewport.x=n,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);let{x:i,y:r}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=r,t.global.x=i,t.global.y=r,t.offset.x=i,t.offset.y=r;let{x:n,y:s}=this.mapToViewportPoint(t);return t.viewport.x=n,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=hd[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=ho.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){let e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),r=i.width(),n=i.height();return!(e.x<r&&e.y<n&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}class hc{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=eE.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,ru.graphicService.hooks.onAttributeUpdate.tap(this.key,e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}),ru.graphicService.hooks.onSetStage.tap(this.key,e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})}deactivate(t){ru.graphicService.hooks.onAttributeUpdate.taps=ru.graphicService.hooks.onAttributeUpdate.taps.filter(t=>t.name!==this.key),ru.graphicService.hooks.onSetStage.taps=ru.graphicService.hooks.onSetStage.taps.filter(t=>t.name!==this.key)}}class hp{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=eE.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;let r=this.pluginService.stage;if(this.option3d||(this.option3d=r.option3d),this.option3d&&this.mousedown){if(this.pageX&&this.pageY){let n=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+n/100,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+s/100,r.set3dOptions(this.option3d),r.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}}activate(t){this.pluginService=t;let e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){let e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class hg{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=eE.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,ru.graphicService.hooks.onAddIncremental.tap(this.key,(e,i,r)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))}),ru.graphicService.hooks.onClearIncremental.tap(this.key,(e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))})}deactivate(t){ru.graphicService.hooks.onAddIncremental.taps=ru.graphicService.hooks.onAddIncremental.taps.filter(t=>t.name!==this.key),ru.graphicService.hooks.onClearIncremental.taps=ru.graphicService.hooks.onClearIncremental.taps.filter(t=>t.name!==this.key)}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,ru.global.getRequestAnimationFrame()(()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1}))}_doRenderInThisFrame(){let t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach(e=>{let i=e.layer;if(!i||!e.layer.subLayers)return;let r=e.layer.subLayers.get(e._uid);r&&r.drawContribution&&r.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:r.layer.getNativeHandler().getContext()},this.nextUserParams))}),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}class hf{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=eE.GenAutoIncrementId(),this.key=this.name+this._uid,this.lastDomContainerSet=new Set,this.currentDomContainerSet=new Set}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}),ru.graphicService.hooks.onRemove.tap(this.key,t=>{this.removeDom(t)}),ru.graphicService.hooks.onRelease.tap(this.key,t=>{this.removeDom(t)})}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter(t=>t.name!==this.key),ru.graphicService.hooks.onRemove.unTap(this.key),ru.graphicService.hooks.onRelease.unTap(this.key),this.release()}drawHTML(t){"browser"===ru.global.env&&(t.renderTreeRoots.sort((t,e)=>{var i,r;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:i4.zIndex)-(null!==(r=e.attribute.zIndex)&&void 0!==r?r:i4.zIndex)}).forEach(t=>{this.renderGroupHTML(t)}),this.lastDomContainerSet.forEach(t=>{this.currentDomContainerSet.has(t)||t.parentElement&&t.parentElement.removeChild(t)}),this.lastDomContainerSet=new Set(this.currentDomContainerSet),this.currentDomContainerSet.clear())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren(t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)})}removeDom(t){t.bindDom&&t.bindDom.size&&(t.bindDom.forEach(t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)}),t.bindDom.clear())}renderGraphicHTML(t){let e,i;let{html:r}=t.attribute;if(!r)return void(t.bindDom&&t.bindDom.size&&(t.bindDom.forEach(t=>{t.dom&&t.dom.parentElement.removeChild(t.dom)}),t.bindDom.clear()));let n=t.stage;if(!n)return;let{dom:s,container:a,width:o,height:l,style:h,anchorType:d="boundsLeftTop",pointerEvents:u}=r;t.bindDom||(t.bindDom=new Map);let c=t.bindDom.get(s);if(!c||a&&a!==c.container){let r;t.bindDom.forEach(({wrapGroup:t})=>{ru.global.removeDom(t)}),"string"==typeof s?(r=(new DOMParser).parseFromString(s,"text/html").firstChild).lastChild&&(r=r.lastChild.firstChild):r=s;let d=a||(!0===n.params.enableHtmlAttribute?null:n.params.enableHtmlAttribute);i=d?"string"==typeof d?ru.global.getElementById(d):d:t.stage.window.getContainer(),(e=ru.global.createDom({tagName:"div",width:o,height:l,style:h,parent:i}))&&(e.appendChild(r),t.bindDom.set(s,{dom:r,container:a,wrapGroup:e}))}else i=(e=c.wrapGroup).parentNode;e.style.pointerEvents=u||"none",e.style.position||(e.style.position="absolute",i.style.position="relative");let p=0,g=0,f=t.globalAABBBounds;if("position"===d||f.empty()){let e=t.globalTransMatrix;p=e.e,g=e.f}else p=f.x1,g=f.y1;let m=ru.global.getElementTopLeft(i,!1),v=n.window.getTopLeft(!1),y=p+v.left-m.left,b=g+v.top-m.top;e.style.left=`${y}px`,e.style.top=`${b}px`,this.currentDomContainerSet.add(e)}release(){"browser"===ru.global.env&&(this.removeAllDom(this.pluginService.stage.defaultLayer),this.lastDomContainerSet.clear(),this.currentDomContainerSet.clear())}removeAllDom(t){this.removeDom(t),t.forEachChildren(e=>{e.isContainer&&this.removeAllDom(t)})}}let hm=new il;class hv{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=eE.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()}),ru.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(t,e,i,r)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(hm.setValue(r.x1,r.y1,r.x2,r.y2),e.dirty(hm,t.parent&&t.parent.globalTransMatrix)))}),ru.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(t,e,i,r,n)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!n||e.dirty(r.globalAABBBounds))}),ru.graphicService.hooks.onRemove.tap(this.key,t=>{let e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)})}deactivate(t){ru.graphicService.hooks.beforeUpdateAABBBounds.taps=ru.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(t=>t.name!==this.key),ru.graphicService.hooks.afterUpdateAABBBounds.taps=ru.graphicService.hooks.afterUpdateAABBBounds.taps.filter(t=>t.name!==this.key),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter(t=>t.name!==this.key),ru.graphicService.hooks.onRemove.taps=ru.graphicService.hooks.onRemove.taps.filter(t=>t.name!==this.key)}}let hy=new il;class hb{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=eE.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new il}pauseLayout(t){this.pause=t}tryLayoutChildren(t){t.firstChild&&this.tryLayout(t.firstChild)}tryLayout(t,e=!0){if(this.pause)return;let i=t.parent;if(!(e||i&&t.needUpdateLayout()))return;let r=rQ(i).group,{display:n=r.display}=i.attribute;if("flex"!==n)return;let{flexDirection:s=r.flexDirection,flexWrap:a=r.flexWrap,alignItems:o=r.alignItems,clip:l=r.clip}=i.attribute,{alignContent:h=null!=o?o:r.alignContent}=i.attribute,{width:d,height:u,justifyContent:c=r.justifyContent}=i.attribute,p=i.getChildren();if(null==d||null==u){let t=0,e=0,i=0;if(p.forEach(r=>{let n=this.getAABBBounds(r);n.empty()||("column"===s||"column-reverse"===s?(e+=n.height(),t=Math.max(t,n.width())):(t+=n.width(),e=Math.max(e,n.height())),i+=n.x1,i+=n.y1,i+=n.x2,i+=n.y2)}),!isFinite(i))return;d=t,u=e}i.attribute.width=d,i.attribute.height=u,this.tempBounds.copy(i._AABBBounds);let g={main:{len:d,field:"x"},cross:{len:u,field:"y"}},f=g.main,m=g.cross;"column"!==s&&"column-reverse"!==s||(f.len=u,m.len=d,f.field="y",m.field="x"),"row-reverse"!==s&&"column-reverse"!==s||("flex-start"===c?c="flex-end":"flex-end"===c?c="flex-start":p.reverse());let v=0,y=0,b=[];p.forEach(t=>{let e=this.getAABBBounds(t);if(e.empty())return;let i="x"===f.field?e.width():e.height(),r="x"===m.field?e.width():e.height();b.push({mainLen:i,crossLen:r}),v+=i,y=Math.max(y,r)});let x=[];if(v>f.len&&"wrap"===a){let t=0,e=0;b.forEach(({mainLen:i,crossLen:r},n)=>{t+i>f.len?0===t?(x.push({idx:n,mainLen:t+i,crossLen:r}),t=0,e=0):(x.push({idx:n-1,mainLen:t,crossLen:r}),t=i,e=r):(t+=i,e=Math.max(e,r))}),x.push({idx:b.length-1,mainLen:t,crossLen:e})}else x.push({idx:b.length-1,mainLen:v,crossLen:y});let _=0;if(x.forEach(t=>{this.layoutMain(i,p,c,f,b,_,t),_=t.idx+1}),y=x.reduce((t,e)=>t+e.crossLen,0),1===x.length){let t={"flex-start":0,"flex-end":m.len,center:m.len/2};this.layoutCross(p,o,m,t,b,x[0],0)}else if("flex-start"===h){_=0;let t=0;x.forEach((e,i)=>{let r={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"flex-start",m,r,b,x[i],_),_=e.idx+1,t+=e.crossLen})}else if("center"===h){_=0;let t=Math.max(0,(m.len-y)/2);x.forEach((e,i)=>{let r={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"center",m,r,b,x[i],_),_=e.idx+1,t+=e.crossLen})}else if("space-around"===h){_=0;let t=Math.max(0,(m.len-y)/x.length/2),e=t;x.forEach((i,r)=>{let n={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",m,n,b,x[r],_),_=i.idx+1,e+=i.crossLen+2*t})}else if("space-between"===h){_=0;let t=Math.max(0,(m.len-y)/(2*x.length-2)),e=0;x.forEach((i,r)=>{let n={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",m,n,b,x[r],_),_=i.idx+1,e+=i.crossLen+2*t})}p.forEach((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()}),i.addUpdateLayoutTag();let A=this.getAABBBounds(i);l||this.tempBounds.equals(A)||this.tryLayout(i,!1)}getAABBBounds(t){this.skipBoundsTrigger=!0;let e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}updateChildPos(t,e,i){return t+(null!=e?e:0)-i}layoutMain(t,e,i,r,n,s,a){if("flex-start"===i){let t=0;for(let i=s;i<=a.idx;i++){let s=t+function(t,e){return 0}(e[i],r.field),a=this.getAABBBounds(e[i]);a.empty()||(e[i].attribute[r.field]=this.updateChildPos(s,e[i].attribute[r.field],a[`${r.field}1`])),t+=n[i].mainLen}}else if("flex-end"===i){let t=r.len;for(let i=s;i<=a.idx;i++){let s=(t-=n[i].mainLen)+function(t,e){return 0}(e[i],r.field),a=this.getAABBBounds(e[i]);a.empty()||(e[i].attribute[r.field]=this.updateChildPos(s,e[i].attribute[r.field],a[`${r.field}1`]))}}else if("space-around"===i){if(a.mainLen>=r.len){let t=0;for(let i=s;i<=a.idx;i++){let s=t+function(t,e){return 0}(e[i],r.field),a=this.getAABBBounds(e[i]);a.empty()||(e[i].attribute[r.field]=this.updateChildPos(s,e[i].attribute[r.field],a[`${r.field}1`])),t+=n[i].mainLen}}else{let t=a.idx-s+1,i=(r.len-a.mainLen)/t/2,o=i;for(let t=s;t<=a.idx;t++){let s=o+function(t,e){return 0}(e[t],r.field),a=this.getAABBBounds(e[t]);a.empty()||(e[t].attribute[r.field]=this.updateChildPos(s,e[t].attribute[r.field],a[`${r.field}1`])),o+=n[t].mainLen+2*i}}}else if("space-between"===i){if(a.mainLen>=r.len){let t=0;for(let i=s;i<=a.idx;i++){let s=t+function(t,e){return 0}(e[i],r.field),a=this.getAABBBounds(e[i]);a.empty()||(e[i].attribute[r.field]=this.updateChildPos(s,e[i].attribute[r.field],a[`${r.field}1`])),t+=n[i].mainLen}}else{let t=a.idx-s+1,i=(r.len-a.mainLen)/(2*t-2),o=0;for(let t=s;t<=a.idx;t++){let s=o+function(t,e){return 0}(e[t],r.field),a=this.getAABBBounds(e[t]);a.empty()||(e[t].attribute[r.field]=this.updateChildPos(s,e[t].attribute[r.field],a[`${r.field}1`])),o+=n[t].mainLen+2*i}}}else if("center"===i){let t=(r.len-a.mainLen)/2;for(let i=s;i<=a.idx;i++){let s=t+function(t,e){return 0}(e[i],r.field),a=this.getAABBBounds(e[i]);a.empty()||(e[i].attribute[r.field]=this.updateChildPos(s,e[i].attribute[r.field],a[`${r.field}1`])),t+=n[i].mainLen}}}layoutCross(t,e,i,r,n,s,a){var o;for(let l=a;l<=s.idx;l++){let s=t[l],{alignSelf:a}=s.attribute;a&&"auto"!==a||(a=e);let h=this.getAABBBounds(s),d=null!==(o=r[a])&&void 0!==o?o:r["flex-start"];"flex-end"===a?h.empty()||(s.attribute[i.field]=this.updateChildPos(d-n[l].crossLen+function(t,e){return 0}(s,i.field),s.attribute[i.field],h[`${i.field}1`])):"center"===a?h.empty()||(s.attribute[i.field]=this.updateChildPos(d-n[l].crossLen/2+function(t,e){return 0}(s,i.field),s.attribute[i.field],h[`${i.field}1`])):h.empty()||(s.attribute[i.field]=this.updateChildPos(d+function(t,e){return 0}(s,i.field),s.attribute[i.field],h[`${i.field}1`]))}}activate(t){this.pluginService=t,ru.graphicService.hooks.onAttributeUpdate.tap(this.key,t=>{t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===this.pluginService.stage&&this.tryLayout(t,!1)}),ru.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(t,e,i,r)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&hy.copy(r)}),ru.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(t,e,i,r,n)=>{e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&(hy.equals(i)||this.tryLayout(t,!1))}),ru.graphicService.hooks.onSetStage.tap(this.key,t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t,!1)})}deactivate(t){ru.graphicService.hooks.onAttributeUpdate.taps=ru.graphicService.hooks.onAttributeUpdate.taps.filter(t=>t.name!==this.key),ru.graphicService.hooks.beforeUpdateAABBBounds.taps=ru.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(t=>t.name!==this.key),ru.graphicService.hooks.afterUpdateAABBBounds.taps=ru.graphicService.hooks.afterUpdateAABBBounds.taps.filter(t=>t.name!==this.key),ru.graphicService.hooks.onSetStage.taps=ru.graphicService.hooks.onSetStage.taps.filter(t=>t.name!==this.key)}}function hx(t,e){return 0}class h_{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return h_.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class hA{static Avaliable(){return!0}avaliable(){return hA.Avaliable()}tick(t,e){this.timerId=setTimeout(()=>{e(this)},t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class hw{static Avaliable(){return!!ru.global.getRequestAnimationFrame()}avaliable(){return hw.Avaliable()}tick(t,e){ru.global.getRequestAnimationFrame()(()=>{this.released||e(this)})}release(){this.released=!0}getTime(){return Date.now()}}(C=tQ||(tQ={}))[C.INITIAL=0]="INITIAL",C[C.RUNNING=1]="RUNNING",C[C.PAUSE=2]="PAUSE";let hS=new class t{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{let{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{let e=this.tickerHandler.getTime(),i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===tQ.RUNNING&&(this.tickCounts++,this.timelines.forEach(t=>{t.tick(i)}))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=tQ.INITIAL,ru.global.hooks.onSetEnv.tap("default-ticker",()=>{this.initHandler()}),ru.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter(e=>e!==t)}initHandler(){if(this._mode)return null;let t=[{mode:"raf",cons:hw},{mode:"timeout",cons:hA},{mode:"manual",cons:h_}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new hw;break;case"timeout":t=new hA;break;case"manual":t=new h_;break;default:eC.Y.getInstance().warn("非法的计时器模式"),t=new hw}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,t=>{this.handleTick(t,{once:!0})})}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,t=>{this.handleTick(t,{once:!0})})}pause(){return this.status!==tQ.INITIAL&&(this.status=tQ.PAUSE,!0)}resume(){return this.status!==tQ.INITIAL&&(this.status=tQ.RUNNING,!0)}ifCanStop(){return!!this.autoStop&&(!this.timelines.length||0===this.timelines.reduce((t,e)=>t+e.animateCount,0))||!1}start(t=!1){return this.status!==tQ.RUNNING&&!!this.tickerHandler&&(!!t||this.status!==tQ.PAUSE&&!!this.timelines.length&&0!==this.timelines.reduce((t,e)=>t+e.animateCount,0))&&(this.status=tQ.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0)}stop(){this.status=tQ.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}};hS.addTimeline(ni),hS.setFPS(60);class hT{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=nw.Get(e,oz.Color1),this.ambient=i;let r=(0,eJ._b)(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/r,t[1]/r,t[2]/r]}computeColor(t,e){let i;let r=this.formatedDir,n=(0,eJ.VV)((0,eJ.Fp)((t[0]*r[0]+t[1]*r[1]+t[2]*r[2])*(1-this.ambient/2),0)+this.ambient,1);i=(0,ek.Z)(e)?nw.Get(e,oz.Color1):e;let s=this.colorRgb;return`rgb(${s[0]*i[0]*n}, ${s[1]*i[1]*n}, ${s[2]*i[2]*n})`}}function hk(t,e,i){let r=e[0],n=e[1],s=e[2],a=e[3],o=e[4],l=e[5],h=e[6],d=e[7],u=e[8],c=e[9],p=e[10],g=e[11],f=e[12],m=e[13],v=e[14],y=e[15],b=i[0],x=i[1],_=i[2],A=i[3];return t[0]=b*r+x*o+_*u+A*f,t[1]=b*n+x*l+_*c+A*m,t[2]=b*s+x*h+_*p+A*v,t[3]=b*a+x*d+_*g+A*y,b=i[4],x=i[5],_=i[6],A=i[7],t[4]=b*r+x*o+_*u+A*f,t[5]=b*n+x*l+_*c+A*m,t[6]=b*s+x*h+_*p+A*v,t[7]=b*a+x*d+_*g+A*y,b=i[8],x=i[9],_=i[10],A=i[11],t[8]=b*r+x*o+_*u+A*f,t[9]=b*n+x*l+_*c+A*m,t[10]=b*s+x*h+_*p+A*v,t[11]=b*a+x*d+_*g+A*y,b=i[12],x=i[13],_=i[14],A=i[15],t[12]=b*r+x*o+_*u+A*f,t[13]=b*n+x*l+_*c+A*m,t[14]=b*s+x*h+_*p+A*v,t[15]=b*a+x*d+_*g+A*y,t}function hB(t,e,i){let r=e[0],n=e[1],s=e[2],a=i[3]*r+i[7]*n+i[11]*s+i[15];return a=a||1,t[0]=(i[0]*r+i[4]*n+i[8]*s+i[12])/a,t[1]=(i[1]*r+i[5]*n+i[9]*s+i[13])/a,t[2]=(i[2]*r+i[6]*n+i[10]*s+i[14])/a,t}class hC{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=s1.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=s1.allocate());let{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,r){let n,s,a,o,l,h,d,u,c,p;let g=e[0],f=e[1],m=e[2],v=r[0],y=r[1],b=r[2],x=i[0],_=i[1],A=i[2];Math.abs(g-x)<eJ.Ho&&Math.abs(f-_)<eJ.Ho&&Math.abs(m-A)<eJ.Ho?sQ.identity(t):(p=1/Math.hypot(d=g-x,u=f-_,c=m-A),d*=p,u*=p,c*=p,(p=Math.hypot(n=y*c-b*u,s=b*d-v*c,a=v*u-y*d))?(n*=p=1/p,s*=p,a*=p):(n=0,s=0,a=0),(p=Math.hypot(o=u*a-c*s,l=c*n-d*a,h=d*s-u*n))?(o*=p=1/p,l*=p,h*=p):(o=0,l=0,h=0),t[0]=n,t[1]=o,t[2]=d,t[3]=0,t[4]=s,t[5]=l,t[6]=u,t[7]=0,t[8]=a,t[9]=h,t[10]=c,t[11]=0,t[12]=-(n*g+s*f+a*m),t[13]=-(o*g+l*f+h*m),t[14]=-(d*g+u*f+c*m),t[15]=1,t)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=s1.allocate()),this._vp=hk(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=s1.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=s1.allocate());let{left:t,top:e,right:i,bottom:r}=this._params;return function(t,e,i,r,n,s,a){let o=1/(e-i),l=1/(r-n),h=1/(0- -2e6);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*o,t[13]=(n+r)*l,t[14]=(a+s)*h,t[15]=1}(this._projectionMatrixCached,t,i,r,e,0,-2e6),this._vp||(this._vp=s1.allocate()),this._vp=hk(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){let{fieldRatio:t=.8,fieldDepth:e,left:i,right:r}=this._params;return(null!=e?e:r-i)*t}getProjectionScale(t){let e=this.getField();return e/(e+t)}view(t,e,i){let r=[0,0,0];return hB(r,[t,e,i],this._viewMatrixCached),r}vp(t,e,i){let r=[0,0,0],{pos:n}=this._params.viewParams;hB(r,[t,e,i],this._viewMatrixCached),t=r[0],e=r[1],i=r[2];let s=this.getProjectionScale(i);return{x:t*s+n[0],y:e*s+n[1]}}}function hE(){if(null==l)try{(l=globalThis===window)&&(l=!!document.createElement)}catch(t){l=!1}}function hM(){hE();let t=ru.global&&ru.global.env;return t?"browser"===t:l}class hP extends hf{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=eE.GenAutoIncrementId(),this.key=this.name+this._uid}removeDom(t){t.bindDom&&t.bindDom.size&&(t.bindDom.forEach(t=>{t.root&&t.root.unmount()}),t.bindDom.clear())}renderGraphicHTML(t){let e,i;let{react:r}=t.attribute;if(!r)return void(t.bindDom&&t.bindDom.size&&(t.bindDom.forEach(t=>{t.root&&t.root.unmount()}),t.bindDom.clear()));let n=t.stage;if(!n)return;let s=n.params.ReactDOM,{element:a,container:o,width:l,height:h,style:d,anchorType:u="boundsLeftTop",pointerEvents:c}=r;if(!(a&&s&&s.createRoot))return;t.bindDom||(t.bindDom=new Map);let p=t.bindDom.get(a);if(!p||o&&o!==p.container){t.bindDom.forEach(({wrapGroup:t})=>{ru.global.removeDom(t)});if(i=o?"string"==typeof o?ru.global.getElementById(o):o:t.stage.window.getContainer(),e=ru.global.createDom({tagName:"div",width:l,height:h,style:d,parent:i})){let i=s.createRoot(e);i.render(a),t.bindDom.set(a,{dom:a,container:o,wrapGroup:e,root:i})}}else i=(e=p.wrapGroup).parentNode;e.style.pointerEvents=c||"none",e.style.position||(e.style.position="absolute",i.style.position="relative");let g=0,f=0,m=t.globalAABBBounds;if("position"===u||m.empty()){let e=t.globalTransMatrix;g=e.e,f=e.f}else g=m.x1,f=m.y1;let v=ru.global.getElementTopLeft(i,!1),y=n.window.getTopLeft(!1),b=g+y.left-v.left,x=f+y.top-v.top;e.style.left=`${b}px`,e.style.top=`${x}px`}}let hO={BACKGROUND:"white"};class hR extends sv{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){let e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){let e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:hO.BACKGROUND}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(t={}){var e;super({}),this._onVisibleChange=t=>{if(!(this._skipRender<0)){if(t){if(this.dirtyBounds){let t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1}},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach(e=>e(t)),this._afterNextRenderCbs=null},this.params=t,this.theme=new rq,this.hooks={beforeRender:new e$(["stage"]),afterRender:new e$(["stage"])},this.global=ru.global,!this.global.env&&hM()&&this.global.setEnv("browser"),this.window=rR.get(rN),this.renderService=rR.get(s$),this.pluginService=rR.get(al),this.layerService=rR.get(sA),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:hO.BACKGROUND,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||hS,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new ne,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&(0,ek.Z)(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(){this._skipRender=-1}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new hu(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-Infinity:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(t=!1){t&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){let{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:r=0,beta:n=0,camera:s,fieldRatio:a=1,fieldDepth:o}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:r,beta:n,camera:s,fieldRatio:a,fieldDepth:o})}set3dOptions(t){var e,i,r,n,s,a;this.option3d=t;let{light:o,center:l,camera:h,alpha:d,beta:u,fieldRatio:c,fieldDepth:p}=this.get3dOptions(t),{dir:g=[1,1,-1],color:f="white",ambient:m}=o,v=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),y=(null!==(r=l.y)&&void 0!==r?r:this.height/2)+(null!==(n=l.dy)&&void 0!==n?n:0),b=[v,y,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(a=l.dz)&&void 0!==a?a:0)],x=0,_=0,A=0;h||(x=Math.sin(d)+v,_=Math.sin(u)+y,A=Math.cos(d)*Math.cos(u)*1),this.light=new hT(g,f,m);let w={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:c,fieldDepth:p,viewParams:{pos:[x,_,A],center:b,up:[0,1,0]}};this.camera?this.camera.params=w:this.camera=new hC(w),t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new hp))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new hc))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new hg))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new io;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new hv,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new hb))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new hf))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableReactAttribute(t){this.reactAttribute||(this.reactAttribute=t,this.pluginService.register(new hP))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach(t=>{this.pluginService.unRegister(t)}))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){let t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw Error("暂不支持")}createLayer(t,e){let i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){let e=this.children;e.sort(t),this.removeAllChild(),e.forEach(t=>{this.appendChild(t)})}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){this.ticker.start(),this.timeline.resume();let i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach(t=>{this.nextFrameRenderLayerSet.add(t)}),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()(()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1}))}_doRenderInThisFrame(){this.timeline.resume(),this.ticker.start();let t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){let i=[];for(let e=0;e<t.length;e++){let r=t[e];"virtual"===r.layerMode&&(r=r.getNativeHandler().mainHandler.layer),i.includes(r)||i.push(r)}i.forEach(t=>{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))}),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e))}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren(i=>{i.resize(t,e)}),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e,i=!0){this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren(i=>{i.resizeView(t,e)}),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render()}setViewBox(t,e,i,r,n){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+r),!1===n&&(s=!1)),this.forEachChildren(t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())}),s&&this.render()}setDpr(t,e=!0){this.forEachChildren(e=>{e.setDpr(t)}),e&&this.render()}setOrigin(t,e){throw Error("暂不支持")}export(t){throw Error("暂不支持")}pick(t,e){this.pickerService||(this.pickerService=rR.get(sK));let i=this.pickerService.pick(this.children,new ib(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw Error("暂不支持")}setToFrame(t){throw Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach(t=>{t.release()}),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release()}setStage(t){}dirty(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}getLayer(t){return this.children.filter(e=>e.name===t)[0]}renderTo(t){this.forEachChildren((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})})}renderToNewWindow(t=!0,e){let i=rR.get(rN),r=e?-e.x1:0,n=e?-e.y1:0,s=e?e.x2:this.viewWidth,a=e?e.y2:this.viewHeight,o=e?e.width():this.viewWidth,l=e?e.height():this.viewHeight;return i.create({viewBox:{x1:r,y1:n,x2:s,y2:a},width:o,height:l,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(i),i}toCanvas(t=!0,e){let i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}}class hI{constructor(t){this.onPointerDown=t=>{let e=t.target,i=this.rootNode,r=e===i;if(e&&!r){let s,a=!1;function n(t){if(a||(t.type="dragstart",null==e||e.dispatchEvent(t),a=!0),t.type="drag",null==e||e.dispatchEvent(t),!r){e.pickable=!1;let r=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.pickable=!0,s!==r&&(s&&(t.type="dragleave",t.target=s,s.dispatchEvent(t)),r&&(t.type="dragenter",t.target=r,r.dispatchEvent(t)),(s=r)&&(t.type="dragover",t.target=s,s.dispatchEvent(t)))}}null==i||i.addEventListener("pointermove",n);let o=function(){a&&(s&&(t.type="drop",t.target=s,s.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),a=!1),null==i||i.removeEventListener("pointermove",n)};e.addEventListener("pointerup",o,{once:!0}),e.addEventListener("pointerupoutside",o,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}}let hL=(t,e)=>{let i=e.x-t.x,r=e.y-t.y;return Math.abs(i)>Math.abs(r)?i>0?"right":"left":r>0?"down":"up"},hD=(t,e)=>{let i=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return Math.sqrt(i*i+r*r)},hj=t=>{let e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,r=0,n=0;for(;n<e;)i+=t[n].x,r+=t[n].y,n++;return{x:Math.round(i/e),y:Math.round(r/e)}};class hN extends ec(){constructor(t,e={}){var i,r,n,s,a,o,l,h,d,u;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.reset(),this.startTime=ho.now();let{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){let{x:r,y:n}=e[t],s={x:r,y:n};i[t]=s}if(1!==i.length)this.startDistance=hD(i[0],i[1]),this.center=hj([i[0],i[1]]);else{let t=e[0];this.pressTimeout=setTimeout(()=>{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none"},this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();let{startPoints:e,cachedEvents:i}=this;if(!e.length)return;let r=t.clone(),{x:n,y:s,pointerId:a}=r;for(let t=0,e=i.length;t<e;t++)if(a===i[t].pointerId){i[t]=r;break}let o={x:n,y:s},l=i.map(t=>({x:t.x,y:t.y})),h=ho.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=o,1===e.length){let t=e[0],i=n-t.x,a=s-t.y,h=this.direction||hL(t,o);this.direction=h;let d=this.getEventType(o);return r.direction=h,r.deltaX=i,r.deltaY=a,r.points=l,this.triggerStartEvent(d,r),void this.triggerEvent(d,r)}let{startDistance:d}=this,u=hD(l[0],l[1]);r.scale=u/d,r.center=this.center,r.points=l,this.triggerStartEvent("pinch",r),this.triggerEvent("pinch",r)},this.onEnd=t=>{let e=t.clone(),{cachedEvents:i,startPoints:r}=this,n=i.map(t=>({x:t.x,y:t.y}));if(e.points=n,this.triggerEndEvent(e),1===i.length){let i=ho.now(),n=this.lastMoveTime;if(i-n<100){let t=n-(this.prevMoveTime||this.startTime);if(t>0){let i=this.prevMovePoint||r[0],n=this.lastMovePoint||r[0],s=hD(i,n),a=s/t;a>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=a,e.direction=hL(i,n),this.triggerEvent("swipe",e))}}i-this.lastTapTime<this.config.tap.interval&&t.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=i,this.lastTapTarget=t.target,1===this.tapCount?this.triggerEvent("tap",e):2===this.tapCount&&(this.triggerEvent("doubletap",e),this.tapCount=0)}for(let t=0,n=i.length;t<n;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),r.splice(t,1);break}this.reset(),i.length>0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(r=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==r?r:251,threshold:null!==(s=null===(n=null==e?void 0:e.press)||void 0===n?void 0:n.threshold)&&void 0!==s?s:9},swipe:{threshold:null!==(o=null===(a=null==e?void 0:e.swipe)||void 0===a?void 0:a.threshold)&&void 0!==o?o:10,velocity:null!==(h=null===(l=null==e?void 0:e.swipe)||void 0===l?void 0:l.velocity)&&void 0!==h?h:.3},tap:{interval:null!==(u=null===(d=null==e?void 0:e.tap)||void 0===d?void 0:d.interval)&&void 0!==u?u:300}},this.initEvents()}initEvents(){let{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){let{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){let e;let{eventType:i,startTime:r,startPoints:n}=this;return i?i:(e=ho.now()-r>this.config.press.time&&hD(n[0],t)<this.config.press.threshold?"press":"pan",this.eventType=e,e)}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){let{emitThrottles:i}=this,r={type:t,ev:e};for(let e=0,n=i.length;e<n;e++)if(i[e].type===t)return void i.splice(e,1,r);i.push(r)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);let{throttleTimer:i,emitThrottles:r}=this;i||(this.throttleTimer=ru.global.getRequestAnimationFrame()(()=>{for(let t=0,e=r.length;t<e;t++){let{type:e,ev:i}=r[t];this.emitEvent(e,i)}this.throttleTimer=0,this.emitThrottles.length=0}))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){let e=this.processEvent;Object.keys(e).forEach(i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]})}emitEvent(t,e){let i=this.element._events["*"];if(i){if("fn"in i)i.fn.call(i.context,e,t);else for(let r=0,n=i.length;r<n&&!e.propagationImmediatelyStopped;r++)i[r].fn.call(i[r].context,e,t)}this.emit(t,e)}}class hF{constructor(t){this.handleAfterNextRender=()=>{this._stage&&!this._viewOptions.disableDirtyBounds&&this._stage.enableDirtyBounds(),this._view.emit(tX.AFTER_VRENDER_DRAW),this._view.emit(tX.AFTER_VRENDER_NEXT_RENDER)},this._view=t}initialize(t,e,i,r){return this._width=t,this._height=e,this._viewOptions=i,this._eventConfig=r,this.initStage(),this}stage(){var t;return null!==(t=this._stage)&&void 0!==t?t:null}gestureController(){var t;return null!==(t=this._gestureController)&&void 0!==t?t:null}canvas(){return this._stage?this._stage.window.getNativeHandler().nativeCanvas:null}context(){return this._stage?this._stage.window.getContext().nativeContext:null}combineIncrementalLayers(){return this._stage&&(function(t){var e,i,r,n;return e=this,i=void 0,r=void 0,n=function*(){let e=[],i=t.getChildren();yield new Promise(t=>{ru.global.getRequestAnimationFrame()(()=>{t(null)})}),i.forEach(t=>{t.subLayers.size&&t.subLayers.forEach(t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise(e=>{t.drawContribution.hooks.completeDraw.tap("outWait",()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter(t=>"outWait"!==t.name),e(null)})}))})}),yield Promise.all(e)},new(r||(r=Promise))(function(t,s){function a(t){try{l(n.next(t))}catch(t){s(t)}}function o(t){try{l(n.throw(t))}catch(t){s(t)}}function l(e){var i;e.done?t(e.value):((i=e.value)instanceof r?i:new r(function(t){t(i)})).then(a,o)}l((n=n.apply(e,i||[])).next())})})(this._stage).then(()=>{this._stage&&this._stage.defaultLayer.combineSubLayer()}),this}background(t){if(this._stage)return this._stage.background=t,this}setDpr(t,e){var i,r;return null===(r=null===(i=this._stage)||void 0===i?void 0:i.setDpr)||void 0===r||r.call(i,t),e&&this.renderNextFrame(),this}shouldResize(t,e){return t!==this._width||e!==this._height}resize(t,e){return this._view.emit(tX.BEFORE_STAGE_RESIZE),this.shouldResize(t,e)&&(this._width=t,this._height=e,this._stage&&this._stage.resize(t,e)),this._view.emit(tX.AFTER_STAGE_RESIZE),this}setViewBox(t,e=!0){return this._stage&&(!t||this._viewBox&&t.x1===this._viewBox.x1&&t.x2===this._viewBox.x2&&t.y1===this._viewBox.y1&&t.y2===this._viewBox.y2||(this._viewBox=t,this._stage.setViewBox(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1,e))),this}render(t=!1){return this._view.emit(tX.BEFORE_VRENDER_DRAW),this.initStage(),this._stage.disableDirtyBounds(),this._stage.afterNextRender(this.handleAfterNextRender),t&&(this._stage.render(),this._view.emit(tX.AFTER_VRENDER_DRAW)),this}renderNextFrame(){return this.initStage(),this._stage.renderNextFrame(),this}toCanvas(){return this._stage?this._stage.toCanvas():null}preventRender(t){this._stage&&this._stage.preventRender(t)}release(){var t;this._view.traverseMarkTree(t=>{t.release()}),this._dragController&&this._dragController.release(),this._gestureController&&this._gestureController.release(),this._stage!==(null===(t=this._viewOptions)||void 0===t?void 0:t.stage)&&this._stage.release(),this._stage=null,this._layer=null,this._dragController=null,this._gestureController=null}createStage(){var t,e,i,r,n;this._view.emit(tX.BEFORE_CREATE_VRENDER_STAGE);let s=this._viewOptions,a=null!==(t=s.stage)&&void 0!==t?t:new hR({width:this._width,height:this._height,renderStyle:s.renderStyle,viewBox:s.viewBox,dpr:s.dpr,canvas:s.renderCanvas,canvasControled:s.canvasControled,container:s.container,title:s.rendererTitle,beforeRender:s.beforeRender,afterRender:s.afterRender,disableDirtyBounds:!0,autoRender:!0,pluginList:s.pluginList,enableHtmlAttribute:s.enableHtmlAttribute,optimize:s.optimize,ticker:s.ticker,supportsTouchEvents:s.supportsTouchEvents,supportsPointerEvents:s.supportsPointerEvents});(null===(e=s.options3d)||void 0===e?void 0:e.enable)&&a.set3dOptions(s.options3d),a.enableIncrementalAutoRender(),this._viewBox=s.viewBox,this._view.emit(tX.AFTER_CREATE_VRENDER_STAGE),this._view.emit(tX.BEFORE_CREATE_VRENDER_LAYER);let o=null!==(i=s.layer)&&void 0!==i?i:a.defaultLayer;if(this._view.emit(tX.AFTER_CREATE_VRENDER_LAYER),(null===(r=this._eventConfig)||void 0===r?void 0:r.drag)&&(this._dragController=new hI(a)),null===(n=this._eventConfig)||void 0===n?void 0:n.gesture){let t=(0,ep.Z)(this._eventConfig.gesture)?this._eventConfig.gesture:{};this._gestureController=new hN(a,t)}return{stage:a,layer:o}}initStage(){if(!this._stage){let{stage:t,layer:e}=this.createStage();this._stage=t,this._layer=e;let i=this._view.background();this.background(i)}}}function hG(t){return(0,eB.Z)(t.offsetX)?(0,eB.Z)(t.x)?t.changedTouches&&t.changedTouches.length?function(t){return{canvasX:t.changedTouches[0].x,canvasY:t.changedTouches[0].y}}(t):{canvasX:0,canvasY:0}:function(t){return{canvasX:t.x,canvasY:t.y}}(t):function(t){return{canvasX:t.offsetX,canvasY:t.offsetY}}(t)}function hz(t,e,i=!0){return(0,eg.Z)(e.canvasX)&&Object.defineProperty(t,"canvasX",{value:e.canvasX,writable:!0}),(0,eg.Z)(e.canvasY)&&Object.defineProperty(t,"canvasY",{value:e.canvasY,writable:!0}),i&&(0,eg.Z)(e.clientX)&&Object.defineProperty(t,"clientX",{value:e.clientX,writable:!0}),i&&(0,eg.Z)(e.clientY)&&Object.defineProperty(t,"clientY",{value:e.clientY,writable:!0}),[e.canvasX,e.canvasY]}function hZ(t,e,i,r,n){return n===lL&&!function(t){["touches","changedTouches","targetTouches"].forEach(e=>{t[e]&&t[e].length&&Array.from(t[e]).forEach(t=>{hz(t,hG(t),!1)})});let e=hG(t);hz(t,e)}(e.changedTouches?e.changedTouches[0]:e),e.element=i,e}class hH extends ll{constructor(){super(...arguments),this.grammarType="signal",this.spec={value:null,update:null}}parse(t){return super.parse(t),this.value(t.value),this.update(t.update),this.commit(),this}evaluate(t,e){return this._signal=this.spec.update?lt(this.spec.update,e,this._signal):this.spec.value,this.spec.value=this._signal,this}output(){return this._signal}getValue(){return this.output()}set(t){if((0,ev.Z)(t)&&(0,ev.Z)(this.value)&&t.length===this.value.length){for(let e=0;e<t.length;e++)if(this.value[e]!==t[e])return this._signal=t,this.spec.value=t,!0;return!1}return this._signal!==t&&(this._signal=t,this.spec.value=t,!0)}update(t){return(0,eB.Z)(t)||this.value(void 0),this.setFunctionSpec(t,"update")}value(t){return(0,eB.Z)(t)||this.update(void 0),this.spec.value=t,this.commit(),this}reuse(t){return t.grammarType!==this.grammarType||(this._signal=t.output()),this}clear(){super.clear(),this._signal=null}}let hU=-1,hV=[lN,lF,lZ,lG,lz,lH,lU],hW=(t,e,i)=>{var r,n,s,a,o;return[{id:lN,value:null!==(r=t[lN])&&void 0!==r?r:0},{id:lF,value:null!==(n=t[lF])&&void 0!==n?n:0},{id:lZ,value:h$(null!==(a=null!==(s=t[lZ])&&void 0!==s?s:e[lZ])&&void 0!==a?a:null==i?void 0:i.padding)},{id:lG,update:{callback:(t,e)=>{let i=h$(e[lZ]);return e[lN]-i.left-i.right},dependency:[lN,lZ]}},{id:lz,update:{callback:(t,e)=>{let i=h$(e[lZ]);return e[lF]-i.top-i.bottom},dependency:[lF,lZ]}},{id:lH,update:{callback:(t,e)=>{let i=h$(e[lZ]);return(t||new io).setValue(i.left,i.top,i.left+e[lG],i.top+e[lz])},dependency:[lG,lz,lZ]}},{id:lU,value:null!==(o=t[lU])&&void 0!==o?o:e[lU]}]},h$=t=>{var e,i,r,n;return(0,iy.Z)(t)?{top:t,bottom:t,left:t,right:t}:{top:null!==(e=null==t?void 0:t.top)&&void 0!==e?e:0,bottom:null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0,left:null!==(r=null==t?void 0:t.left)&&void 0!==r?r:0,right:null!==(n=null==t?void 0:t.right)&&void 0!==n?n:0}},hY=t=>{var e;let i=(t,e)=>{var r,n;t.group=e;let s=null!==(r=t.id)&&void 0!==r?r:"VGRAMMAR_MARK_"+ ++hU;t.id=s,(null!==(n=t.marks)&&void 0!==n?n:[]).forEach(t=>i(t,s))};return(null!==(e=t.marks)&&void 0!==e?e:[]).forEach(t=>i(t,"root")),t},hX=t=>{var e,i,r,n,s;let{reuse:a=!0,morph:o=!0,morphAll:l=!1,animation:h={},enableExitAnimation:d=!0}=null!=t?t:{};return{reuse:a,morph:o,morphAll:l,animation:{easing:null!==(e=h.easing)&&void 0!==e?e:he,delay:null!==(i=h.delay)&&void 0!==i?i:0,duration:null!==(r=h.duration)&&void 0!==r?r:1e3,oneByOne:null!==(n=h.oneByOne)&&void 0!==n&&n,splitPath:null!==(s=h.splitPath)&&void 0!==s?s:null},enableExitAnimation:d}};var hK=function(t,e,i){let r=!0,n=!0;if("function"!=typeof t)throw TypeError("Expected a function");return(0,ep.Z)(i)&&(r="leading"in i?!!i.leading:r,n="trailing"in i?!!i.trailing:n),em(t,e,{leading:r,trailing:n,maxWait:e})};let hq=t=>!!tF[t];function hJ(t,e,i={}){var r;let n=ld.getGraphicType(e)?ld.createGraphic(e,i):ld.createGraphicComponent(e,i,{skipDefault:null===(r=null==t?void 0:t.spec)||void 0===r?void 0:r.skipTheme});return!n&&eC.Y.getInstance().error(`create ${e} graphic failed!`),n}let hQ=t=>{t&&(t[l4]=null,t.release(),t.parent&&t.parent.removeChild(t))},h0=t=>(0,eB.Z)(t.markId)?e=>e&&e.mark.id()===t.markId:(0,eB.Z)(t.markName)?e=>e&&e.mark.name()===t.markName:(0,eB.Z)(t.type)?e=>e&&e.mark.markType===t.type:()=>!0,h1=(t,e)=>e&&e.debounce?em(t,e.debounce):e&&e.throttle?hK(t,e.throttle):t,h2=(t,e=lD)=>{let i={},r=t.split(":");if(2===r.length){let[t,n]=r;"#"===t[0]?(i.markId=t.slice(1),i.source=e):"@"===t[0]?(i.markName=t.slice(1),i.source=e):hq(t)?(i.markType=t,i.source=e):i.source=t===lL?lL:e,i.type=n}else 1===r.length&&(i.type=t,i.source=e);return i};function h5(t,e){switch(e){case"line":return t.some(t=>["x","y","defined"].includes(t));case"area":return t.some(t=>["x","y","x1","y1","defined"].includes(t));case"largeRects":return t.some(t=>["x","y","width","y1"].includes(t));case"largeSymbols":return t.some(t=>["x","y"].includes(t))}return!1}let h3=["fillOpacity"],h4=(t,e,i)=>{var r;return"fillOpacity"===e?(t.fillOpacity=null!==(r=i.fillOpacity)&&void 0!==r?r:1,["fillOpacity"]):[]},h6={rect3d:[{channels:["x","y","z","x1","y1","width","height","length"],transform:(t,e,i)=>{var r,n,s,a,o,l,h,d,u,c,p,g;(0,eg.Z)(e.width)||!(0,eg.Z)(e.x1)&&(0,eg.Z)(i.width)?(t.x=Math.min(null!==(r=i.x)&&void 0!==r?r:0,null!==(n=i.x1)&&void 0!==n?n:1/0),t.width=i.width):(0,eg.Z)(e.x1)||!(0,eg.Z)(e.width)&&(0,eg.Z)(i.x1)?(t.x=Math.min(i.x,i.x1),t.width=Math.abs(i.x1-i.x)):(t.x=Math.min(null!==(s=i.x)&&void 0!==s?s:0,null!==(a=i.x1)&&void 0!==a?a:1/0),t.width=i.width),(0,eg.Z)(e.height)||!(0,eg.Z)(e.y1)&&(0,eg.Z)(i.height)?(t.y=Math.min(null!==(o=i.y)&&void 0!==o?o:0,null!==(l=i.y1)&&void 0!==l?l:1/0),t.height=i.height):(0,eg.Z)(e.y1)||!(0,eg.Z)(e.height)&&(0,eg.Z)(i.y1)?(t.y=Math.min(i.y,i.y1),t.height=Math.abs(i.y1-i.y)):(t.y=Math.min(null!==(h=i.y)&&void 0!==h?h:0,null!==(d=i.y1)&&void 0!==d?d:1/0),t.height=i.height),(0,eg.Z)(e.length)||!(0,eg.Z)(e.z1)&&(0,eg.Z)(i.length)?(t.z=Math.min(null!==(u=i.z)&&void 0!==u?u:0,null!==(c=i.z1)&&void 0!==c?c:1/0),t.length=i.length):(0,eg.Z)(e.z1)||!(0,eg.Z)(e.length)&&(0,eg.Z)(i.z1)?(t.z=Math.min(i.z,i.z1),t.length=Math.abs(i.z1-i.z)):(t.z=Math.min(null!==(p=i.z)&&void 0!==p?p:0,null!==(g=i.z1)&&void 0!==g?g:1/0),t.length=i.length)},storedAttrs:"sizeAttrs"}],[tF.text]:[{channels:["text","limit","autoLimit","maxLineWidth","textType"],transform:(t,e,i)=>{var r,n;let s=null!==(r=i.limit)&&void 0!==r?r:1/0,a=Math.min(s,null!==(n=i.autoLimit)&&void 0!==n?n:1/0),o=lA(i.text)&&!(0,eB.Z)(i.text.text),l=o?i.text.text:i.text;Array.isArray(l),t.maxLineWidth=a===1/0?i.maxLineWidth:a,(o||i.textType)&&("rich"===i.text.type||"rich"===i.textType)?t.textConfig=l:t.text=l},storedAttrs:"limitAttrs"}],[tF.rule]:[{channels:["x","y","x1","y1"],transform:(t,e,i)=>{let r=function(t){let{x:e,y:i,x1:r,y1:n}=t;return(0,eg.Z)(e)&&(0,eg.Z)(i)&&(0,eg.Z)(r)&&(0,eg.Z)(n)?[{x:e,y:i},{x:r,y:n}]:[]}(i);t.points=r,t.x=0,t.y=0},storedAttrs:"pointAttrs"}],[tF.symbol]:[{channels:["shape","symbolType"],transform:(t,e,i)=>{var r;t.symbolType=null!==(r=e.shape)&&void 0!==r?r:e.symbolType}},{channels:["image","fill","background"],transform:(t,e,i)=>{e.image?(t.background=e.image,t.fill=!1):i.image?(t.background=i.image,t.fill=!1):(t.fill=i.fill,t.background=i.background)},storedAttrs:"imageAttrs"}]},h8=(t,e,i,r)=>{let n={},s=e?Object.keys(e):[],a=(0,ek.Z)(t)?h6[t]:t;if(a&&a.length){let t=[];s.forEach(s=>{let o=!1;a.forEach((a,l)=>{if(a.channels.includes(s)){if(!t[l]){if(a.storedAttrs){let t=function(t,e,i,r,n,s){let a=n.getGraphicAttribute(t,!1,s);if(a)return e.forEach(t=>{t in r&&(a[t]=r[t])}),a;let o={};return e.forEach(t=>{o[t]=r[t]}),i[t]=o,o}(a.storedAttrs,a.channels,n,e,i,r);a.transform(n,e,t)}else a.transform(n,e,null)}t[l]=!0,o=!0}}),o||(h3.includes(s)?h4(n,s,e):n[s]=e[s])})}else s.forEach(t=>{h3.includes(t)?h4(n,t,e):n[t]=e[t]});return n};function h7(t){return Object.prototype.toString.call(t)}function h9(t){return Object.keys(t)}var dt=t=>({}).toString.call(t).replace(/^\[object /,"").replace(/]$/,"");let de=Object.prototype;var di=function(t){let e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||de)};let dr=Object.prototype.hasOwnProperty;var dn=function(t){if((0,eB.Z)(t))return!0;if(ey(t))return!t.length;let e=dt(t);if("Map"===e||"Set"===e)return!t.size;if(di(t))return!Object.keys(t).length;for(let e in t)if(dr.call(t,e))return!1;return!0};let ds=(t,e,i,r=!0)=>{if(e===i)return!0;if((0,eB.Z)(e)||(0,eB.Z)(i))return(0,eB.Z)(e)&&(0,eB.Z)(i);if(!l_(e)&&!l_(i))return e===i;let n=(0,ev.Z)(e)?e:e[t],s=(0,ev.Z)(i)?i:i[t];return n===s||!1!==r&&((0,ev.Z)(s)?!(!(0,ev.Z)(n)||s.length!==n.length||!s.every((t,e)=>t===n[e])):!!(0,ep.Z)(s)&&!(!(0,ep.Z)(n)||Object.keys(s).length!==Object.keys(n).length||!Object.keys(s).every(t=>ds(t,s,n))))};function da(t){return!!(null==t?void 0:t.scale)}function dl(t){return!!(null==t?void 0:t.field)}function dh(t,e){if(!t)return[];let i=[];return t.scale&&(i=li(t.scale)?[t.scale]:ex(e.getScaleById(t.scale))),i.concat(o7(t,e))}function dd(t,e,i,r,n){i&&(o9(i)?e.forEach(e=>{let n=lt(i,r,e.datum,t);Object.assign(e.nextAttrs,n)}):Object.keys(i).forEach(s=>{var a,o;let l=i[s],h=n&&!function(t,e){if(["x","y","dx","dy"].includes(e))return!0;switch(t){case tF.arc:return["innerRadius","outerRadius","startAngle","endAngle"].includes(e);case tF.group:case tF.rect:case tF.image:return["width","height","y1"].includes(e);case tF.path:case tF.shape:return["path","customPath"].includes(e);case tF.line:return"defined"===e;case tF.area:return["x1","y1","defined"].includes(e);case tF.rule:return["x1","y1"].includes(e);case tF.symbol:return"size"===e;case tF.polygon:return"points"===e;case tF.text:return"text"===e}return!1}(t.mark.markType,s)?[e[0]]:e;if(da(l)){let t=le(l.scale,r),e=null!==(a=null==l?void 0:l.offset)&&void 0!==a?a:0,i=!(0,eB.Z)(l.band)&&t.bandwidth?t.bandwidth()*l.band:null,n=(0,ek.Z)(null==l?void 0:l.field),d=n?l0(l.field):null,u=n?null:(0,eB.Z)(null==l?void 0:l.value)?0:null===(o=t.scale)||void 0===o?void 0:o.call(t,l.value);h.forEach(r=>{var a;n&&(u=null===(a=t.scale)||void 0===a?void 0:a.call(t,d(r.datum))),r.nextAttrs[s]=(0,iy.Z)(u)||(0,iy.Z)(i)?u+e+i:u})}else if(dl(l)){let t=l0(l.field);h.forEach(e=>{e.nextAttrs[s]=t(e.datum)})}else h.forEach(e=>{e.nextAttrs[s]=lt(l,r,e.datum,t)})}))}function du(t,e,i,r){if(!t)return null;if(o9(t))return lt(t,r,e,i);let n={};return Object.keys(t).forEach(s=>{var a,o,l;let h=t[s];if(da(h)){let t=le(h.scale,r),i=null!==(a=null==h?void 0:h.offset)&&void 0!==a?a:0,d=!(0,eB.Z)(h.band)&&t.bandwidth?t.bandwidth()*h.band:null,u=(0,ek.Z)(null==h?void 0:h.field),c=u?l0(h.field):null,p=u?null===(o=t.scale)||void 0===o?void 0:o.call(t,c(e)):(0,eB.Z)(null==h?void 0:h.value)?0:null===(l=t.scale)||void 0===l?void 0:l.call(t,h.value);n[s]=(0,iy.Z)(p)||(0,iy.Z)(d)?p+i+d:p}else if(dl(h)){let t=l0(h.field);n[s]=t(e)}else n[s]=lt(h,r,e,i)}),n}let dc=(t,e)=>{var i,r;if(t===e)return!0;let n=null!==(i=t&&t.length)&&void 0!==i?i:0;return n===(null!==(r=e&&e.length)&&void 0!==r?r:0)&&0!==n&&t.every((t,i)=>!t&&!e[i]||t&&e[i]&&t.color===e[i].color&&t.offset===e[i].offset)},dp=(t,e)=>{if(t===e)return!0;if(typeof t!=typeof e||(0,ek.Z)(t)||t.gradient!==e.gradient)return!1;let i=Object.keys(t),r=Object.keys(e);return i.length===r.length&&i.every(i=>"stops"===i?dc(t[i],e[i]):t[i]===e[i])},dg=(t,e)=>t.length===e.length&&t.join("-")===e.join("-"),df=(t,e,i)=>!(!(0,eB.Z)(t)||!(0,eB.Z)(e))||!(0,eB.Z)(t)&&!(0,eB.Z)(e)&&("lineDash"===i?dg(t,e):"stroke"===i||"fill"===i?dp(t,e):t===e),dm=["stroke","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","lineWidth","miterLimit"],dv=["fill","fillOpacity","background","texture","texturePadding","textureSize","textureColor"].concat(dm);function dy(t,e,i){var r;if(!t||t.length<=1)return null;let n="area"===(null===(r=null==i?void 0:i.mark)||void 0===r?void 0:r.markType)?dv:dm,s=[],a=null;return t.forEach((t,e)=>{a&&n.every(e=>df(a[e],t[e],e))||(s.length&&(s[s.length-1].endIndex=e),a=t,s.push({attrs:a,startIndex:e}))}),s.length>=2?s.map(t=>{let i=db(t.attrs);return i.points=e.slice(t.startIndex,(0,eB.Z)(t.endIndex)?e.length:t.endIndex),i}):null}function db(t){let e={};return t&&Object.keys(t).forEach(i=>{"x"!==i&&"y"!==i&&"x1"!==i&&"y1"!==i&&"defined"!==i&&"size"!==i&&"width"!==i&&"height"!==i&&"context"!==i&&(e[i]=t[i])}),e}class dx{constructor(t){this.data=null,this.states=[],this.diffState=tN.enter,this.isReserved=!1,this.runtimeStatesEncoder=null,this.items=[],this.getStateAttrs=(t,e)=>{var i,r,n;let s=!(0,eB.Z)(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),a=s?this.runtimeStatesEncoder[t]:null===(r=this.mark.getSpec().encode)||void 0===r?void 0:r[t];if(!a)return{};if(r6(a))return a(this.getDatum(),this,t,e);if(!s&&(null===(n=this.graphicItem.states)||void 0===n?void 0:n[t]))return this.graphicItem.states[t];let o=this.items.map(t=>Object.assign({},t,{nextAttrs:{}}));dd(this,o,a,this.mark.parameters());let l=this.transformElementItems(o,this.mark.markType);return this.graphicItem.states?this.graphicItem.states[t]||(this.graphicItem.states[t]=l):this.graphicItem.states={[t]:l},l},this.mark=t}initGraphicItem(t={}){if(this.graphicItem)return;let e=this.mark.getAttributeTransforms();this.graphicItem=this.mark.addGraphicItem(e?h8(e,t,this):t,this.groupKey),this.graphicItem&&(this.graphicItem[l4]=this,e&&(this.graphicItem.onBeforeAttributeUpdate=t=>this.mark?h8(e,t,this):t),this.clearGraphicAttributes(),this.mark.needAnimate()&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(t),this.setFinalGraphicAttributes(t)))}updateGraphicItem(){if(!this.graphicItem)return;this.diffState===tN.exit?this.graphicItem.releaseStatus="willRelease":this.graphicItem.releaseStatus=void 0;let t=this.mark.animate.getAnimationConfigs("state");0!==t.length&&(this.graphicItem.stateAnimateConfig=t[0].originConfig)}getGraphicItem(){return this.graphicItem}removeGraphicItem(){var t,e;this.graphicItem&&(null===(e=null===(t=this.graphicItem.animates)||void 0===t?void 0:t.forEach)||void 0===e||e.call(t,t=>t.stop())),this.graphicItem&&(hQ(this.graphicItem),this.graphicItem[l4]=null,this.graphicItem=null)}resetGraphicItem(){this.graphicItem&&(this.graphicItem=null)}getBounds(){var t;return null===(t=this.graphicItem)||void 0===t?void 0:t.AABBBounds}getStates(){return this.states}updateData(t,e,i){var r;this.mark.emit(tX.BEFORE_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.data=e;let n=lr(i);return this.items=e.map(t=>({datum:t,key:n(t),view:this.mark.view,nextAttrs:{}})),this.groupKey=t,this.key=this.mark.isCollectionMark()?t:null===(r=this.items)||void 0===r?void 0:r[0].key,this.mark.emit(tX.AFTER_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.items}state(t,e){var i;let r=this.mark.isCollectionMark(),n=this.states,s=ex(lt(t,e,this.getDatum(),this)),a=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;a&&s.length&&s.sort(a);let o=s.length!==n.length||s.some((t,e)=>t!==n[e]);this.states=s,!r&&o&&this.diffState===tN.unChange&&(this.diffState=tN.update)}encodeGraphic(t){this.coordinateTransformEncode(this.items);let e=this.transformElementItems(this.items,this.mark.markType);t&&(this.mark.isCollectionMark()&&delete t.defined,Object.assign(e,t)),this.graphicItem?(this.graphicItem.clearStates(),this.graphicItem.states={},this.graphicItem.stateProxy=null,this.applyGraphicAttributes(e)):this.initGraphicItem(e),(this.diffState===tN.enter||this.diffState===tN.update)&&this.states.length&&this.useStates(this.states),this.mark.markType===tF.shape&&(this.graphicItem.datum=this.items[0].datum),this.items.forEach(t=>{t.nextAttrs={}}),this._setCustomizedShape()}_setCustomizedShape(){var t;if(!this.graphicItem)return;let e=null===(t=this.mark.getSpec())||void 0===t?void 0:t.setCustomizedShape;e&&(this.graphicItem.pathProxy=t=>e(this.data,t,new iK))}encodeItems(t,e,i=!1,r){let n=this.mark.isCollectionMark(),s=e[tj.update],a=e[tj.enter],o=e[tj.exit],l=this.mark.isLargeMode()||n&&!this.mark.getSpec().enableSegments;this.diffState===tN.enter?(a&&dd(this,t,a,r,l),s&&dd(this,t,s,r,l)):this.diffState===tN.update?((n&&a||i)&&dd(this,t,a,r,l),s&&dd(this,t,s,r,l)):this.diffState===tN.exit&&o&&(i&&dd(this,t,a,r,l),dd(this,t,o,r,l))}coordinateTransformEncode(t){if(!this.mark.coord||"arc"===this.mark.markType||!0===this.mark.disableCoordinateTransform)return;let e=this.mark.coord.output();t.forEach(t=>{let i=t.nextAttrs,r=e.convert(i);Object.assign(i,r)})}clearStates(t){let e=r4(t)?t:0!==this.mark.animate.getAnimationConfigs("state").length;this.states=[],this.graphicItem&&this.graphicItem.clearStates(e),this.runtimeStatesEncoder&&(this.runtimeStatesEncoder={})}_updateRuntimeStates(t,e){this.runtimeStatesEncoder||(this.runtimeStatesEncoder={}),this.runtimeStatesEncoder[t]=e}hasState(t){return this.states&&t&&this.states.includes(t)}addState(t,e){var i;if(!this.graphicItem)return!1;if(e&&(0,ek.Z)(t)&&!function t(e,i,r){if(e===i)return!0;if(typeof e!=typeof i||null==e||null==i)return!1;if(Number.isNaN(e)&&Number.isNaN(i))return!0;if(h7(e)!==h7(i))return!1;if(r6(e))return!!(null==r?void 0:r.skipFunction);if("object"!=typeof e)return!1;if((0,ev.Z)(e)){if(e.length!==i.length)return!1;for(let n=e.length-1;n>=0;n--)if(!t(e[n],i[n],r))return!1;return!0}if(!lA(e))return!1;let n=h9(e),s=h9(i);if(n.length!==s.length)return!1;n.sort(),s.sort();for(let t=n.length-1;t>=0;t--)if(n[t]!=s[t])return!1;for(let s=n.length-1;s>=0;s--){let a=n[s];if(!t(e[a],i[a],r))return!1}return!0}(e,null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t])){let i=this.states.slice();return i.includes(t)?this.graphicItem.clearStates():i.push(t),this._updateRuntimeStates(t,e),this.useStates(i),!0}let r=this.mark.getSpec().encode,n=ex(t).reduce((t,e)=>(e&&!t.includes(e)&&(null==r?void 0:r[e])&&t.push(e),t),this.states.slice());return n.length!==this.states.length&&(this.useStates(n),!0)}removeState(t){if(!this.graphicItem)return!1;let e=ex(t);if(!e.length)return!1;let i=this.states.filter(t=>!e.includes(t));return i.length!==this.states.length&&(this.runtimeStatesEncoder&&e.forEach(t=>{this.runtimeStatesEncoder[t]=null}),this.useStates(i),!0)}useStates(t,e){var i;if(!this.graphicItem)return!1;this.mark.emit(tX.BEFORE_ELEMENT_STATE,{states:t},this);let r=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;r&&t.sort(r),this.states=t;let n=r4(e)?e:0!==this.mark.animate.getAnimationConfigs("state").length;return this.graphicItem.stateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,n),this.mark.emit(tX.AFTER_ELEMENT_STATE,{states:t},this),!0}diffAttributes(t){let e={},i=this.getFinalGraphicAttributes();for(let r in t)ds(r,i,t)&&r1(i,r)||(e[r]=t[r]);return e}transformElementItems(t,e,i){var r,n,s,a,o,l,h,d,u,c,p;let g=t[0];if(!g.nextAttrs||0===Object.keys(g.nextAttrs).length)return{};let f=g.nextAttrs;if(l=e,[tF.line,tF.area,tF.largeRects,tF.largeSymbols].includes(l)&&t&&t.length&&(0,eB.Z)(null===(r=g.nextAttrs)||void 0===r?void 0:r.points)&&(!0===i||h5(Object.keys(g.nextAttrs),this.mark.markType))){let i=this.mark.getSpec(),r=this.getGraphicAttribute("points",!1),l=this.getGraphicAttribute("segments",!1),g=i.enableSegments,m=null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[tj.connectNulls],v=t.map(t=>t.nextAttrs),y=this.mark.isProgressive();if(f=db(f),e===tF.line||e===tF.area){;let i=(h=t,d=!0,u=r,c=e===tF.area,h&&h.length&&(1!==h.length||d)?h.some(t=>h5(Object.keys(t.nextAttrs),"line"))?h.map((t,e)=>{var i;let r=t.nextAttrs,{x:n,y:s,x1:a,y1:o,defined:l}=null!==(i=null==u?void 0:u[e])&&void 0!==i?i:{};return(0,eB.Z)(r.x)&&(r.x=n),(0,eB.Z)(r.y)&&(r.y=s),(0,eB.Z)(r.defined)&&!1===l&&(r.defined=!1),r.context=t.key,c&&((0,eB.Z)(r.x1)&&(r.x1=a),(0,eB.Z)(r.y1)&&(r.y1=o)),r}):null!=u?u:[]:[]);if(y)f.segments=(null!==(o=null===(a=null===(s=this.graphicItem)||void 0===s?void 0:s.attribute)||void 0===a?void 0:a.segments)&&void 0!==o?o:[]).concat([{points:i}]);else if(m){if(f.segments=function(t,e,i){if(!t||t.length<=1)return null;let r=!!i&&i.mark.getSpec().enableSegments,n,s,a=[],o=null;if(t.forEach((t,i)=>{(o=e[i])&&!1!==o.defined?(n||(s={items:[],points:[]},a.push(s)),s.points.push(o),s.items.push(t),!1===n&&(s.isConnect=!0,s={items:[],points:[]},a.push(s)),n=!0):n=!1}),(a=a.filter(t=>t.points.length>0)).length>=2){let t=[];return a.forEach(e=>{if(e.isConnect)return void t.push({points:e.points,isConnect:!0});if(r){let r=dy(e.items,e.points,i);if(r)return void r.forEach(e=>{t.push(e)})}let n=db(e.items[0]);n.points=e.points,t.push(n)}),t}return r?dy(t,e,i):null}(v,i,this),f.segments&&f.segments.some(t=>t.isConnect)){let t=du(m,this.getDatum(),this,this.mark.parameters());t&&f.segments.forEach(e=>{e.isConnect&&Object.assign(e,t)})}f.points=i}else if(g){;let t=i&&0!==i.length?i:(p=l)?p.reduce((t,e)=>t.concat(e.points),[]):null,e=dy(v,t,this);e?(f.segments=e,f.points=null):(f.segments=null,f.points=t)}else f.points=i,f.segments=null}else e===tF.largeRects?f.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];let r=new Float32Array(4*t.length);return t.forEach((t,e)=>{var n,s,a,o;let l=t.nextAttrs,h=null!==(n=l.x)&&void 0!==n?n:i[4*e],d=null!==(s=l.y)&&void 0!==s?s:i[4*e+1],u=null!==(a=l.width)&&void 0!==a?a:i[4*e+2],c=null!==(o=l.y1)&&void 0!==o?o:i[4*e+3];r[4*e]=h,r[4*e+1]=d,r[4*e+2]=u,r[4*e+3]=c-d}),r}(t,!0,r):e===tF.largeSymbols&&(f.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];let r=new Float32Array(2*t.length);return t.forEach((t,e)=>{var n,s;let a=t.nextAttrs,o=null!==(n=a.x)&&void 0!==n?n:i[2*e],l=null!==(s=a.y)&&void 0!==s?s:i[2*e+1];r[2*e]=o,r[2*e+1]=l}),r}(t,!0,r))}return f}applyGraphicAttributes(t){var e,i;if(!dn(t)){if(this.mark.needAnimate()){let r=this.diffAttributes(t),n=null!==(e=this.getPrevGraphicAttributes())&&void 0!==e?e:{},s=null!==(i=this.getFinalGraphicAttributes())&&void 0!==i?i:{};Object.keys(r).forEach(t=>{n[t]=this.getGraphicAttribute(t),s[t]=r[t]}),this.setNextGraphicAttributes(r),this.setPrevGraphicAttributes(n),this.setFinalGraphicAttributes(s);let a=Object.assign({},this.mark.animate.getElementAnimators(this).reduce((t,e)=>Object.assign(t,e.getEndAttributes()),{}),s);this.graphicItem.setAttributes(a)}else this.graphicItem.setAttributes(t)}}getGraphicAttribute(t,e=!1){var i;if(!this.graphicItem)return;if(e){let e;let i=this.getPrevGraphicAttributes();if(!(0,eB.Z)(e=lX(i,t)))return e}let r=this.mark.getAttributeTransforms(),n=[t];if(r&&r.length){let e=r.find(e=>e.storedAttrs&&e.channels.includes(t));e&&(n=[e.storedAttrs,t])}return lX(null===(i=this.graphicItem)||void 0===i?void 0:i.attribute,n)}setGraphicAttribute(t,e,i=!0){if(!this.graphicItem)return;let r=this.getFinalGraphicAttributes(),n=this.getPrevGraphicAttributes();i&&r&&(r[t]=e),n&&!r1(n,t)&&(n[t]=this.graphicItem.attribute[t]),this.graphicItem.setAttribute(t,e)}setGraphicAttributes(t,e=!0){if(!this.graphicItem)return;let i=this.getFinalGraphicAttributes(),r=this.getPrevGraphicAttributes();Object.keys(t).forEach(n=>{i&&e&&(i[n]=t[n]),r&&!r1(r,n)&&(r[n]=this.graphicItem.attribute[n])}),this.graphicItem.setAttributes(t)}getFinalGraphicAttributes(){return this.graphicItem.finalAttrs}setFinalGraphicAttributes(t){this.graphicItem.finalAttrs=t}getPrevGraphicAttributes(){return this.graphicItem.prevAttrs}setPrevGraphicAttributes(t){this.graphicItem.prevAttrs=t}getNextGraphicAttributes(){return this.graphicItem.nextAttrs}setNextGraphicAttributes(t){this.graphicItem.nextAttrs=t}clearChangedGraphicAttributes(){this.graphicItem&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null))}clearGraphicAttributes(){this.graphicItem&&(this.graphicItem.prevAttrs&&this.setPrevGraphicAttributes(null),this.graphicItem.nextAttrs&&this.setNextGraphicAttributes(null),this.graphicItem.finalAttrs&&this.setFinalGraphicAttributes(null))}remove(){this.graphicItem&&(hQ(this.graphicItem),this.graphicItem=null)}release(){this.removeGraphicItem(),this.mark=null,this.data=null,this.items=null}getItemAttribute(t){var e,i;if(null===(e=this.items)||void 0===e?void 0:e.length)return this.mark.isCollectionMark()?(0,eB.Z)(t)?this.items.map(t=>t.nextAttrs):this.items.map(e=>{var i;return null===(i=e.nextAttrs)||void 0===i?void 0:i[t]}):(0,eB.Z)(t)?this.items[0].nextAttrs:null===(i=this.items[0].nextAttrs)||void 0===i?void 0:i[t]}setItemAttributes(t){var e;(null===(e=this.items)||void 0===e?void 0:e.length)&&(this.mark.isCollectionMark()?(0,ev.Z)(t)&&this.items.forEach((e,i)=>{Object.assign(e.nextAttrs,t[i])}):Object.assign(this.items[0].nextAttrs,t))}getItem(){var t,e;return this.mark.isCollectionMark()?null!==(t=this.items)&&void 0!==t?t:[]:null===(e=this.items)||void 0===e?void 0:e[0]}getDatum(){var t,e;return this.mark.isCollectionMark()?null!==(t=this.data)&&void 0!==t?t:[]:null===(e=this.data)||void 0===e?void 0:e[0]}}class d_ extends dx{constructor(t){super(t),this.getStateAttrs=(t,e)=>{var i,r,n;let s=!(0,eB.Z)(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),a=s?this.runtimeStatesEncoder[t]:null===(r=this.mark.getSpec().encode)||void 0===r?void 0:r[t],o={};if(!a)return o;if(r6(a))return o.attributes=a(this.getDatum(),this,t,e),o;if(!s&&(null===(n=this.graphicItem.glyphStates)||void 0===n?void 0:n[t]))return this.graphicItem.glyphStates[t];if(a){let e=[Object.assign({},this.items[0],{nextAttrs:{}})];return dd(this,e,a,this.mark.parameters()),this.coordinateTransformEncode(e),o.attributes=e[0].nextAttrs,this.graphicItem.glyphStates?this.graphicItem.glyphStates[t]||(this.graphicItem.glyphStates[t]=o):this.graphicItem.glyphStates={[t]:o},o}return o},this.glyphMeta=this.mark.getGlyphMeta()}getGlyphGraphicItems(){return this.glyphGraphicItems}initGraphicItem(t={}){if(this.graphicItem)return;this.graphicItem=this.mark.addGraphicItem(t,this.groupKey),this.graphicItem[l4]=this,this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1);let e=this.glyphMeta.getMarks();this.glyphGraphicItems={},this.graphicItem.getSubGraphic().forEach(t=>{let i=e[t.name];this.glyphGraphicItems[t.name]=t,t.onBeforeAttributeUpdate=e=>this.mark?h8(i,e,this,t.name):e}),this.clearGraphicAttributes()}useStates(t,e){if(!this.graphicItem)return!1;this.mark.emit(tX.BEFORE_ELEMENT_STATE,{states:t},this),this.states=t.slice();let i=r4(e)?e:0!==this.mark.animate.getAnimationConfigs("state").length;return this.graphicItem.glyphStateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,i),this.mark.emit(tX.AFTER_ELEMENT_STATE,{states:t},this),!0}encodeGraphic(){this.coordinateTransformEncode(this.items);let t=this.transformElementItems(this.items,this.mark.markType);this.graphicItem||this.initGraphicItem(),this.diffState===tN.enter?(this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!0),this.applyGraphicAttributes(t),this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1)):this.applyGraphicAttributes(t),(this.diffState===tN.enter||this.diffState===tN.update)&&this.states.length&&(Object.values(this.glyphGraphicItems).forEach(t=>{t.states={}}),this.useStates(this.states)),this.items.map(t=>{t.nextAttrs={}})}encodeCustom(t){var e;let i={},r=this.glyphMeta.getChannelEncoder(),n=this.glyphMeta.getFunctionEncoder();if(n&&(i=n.call(null,Object.assign({},null===(e=this.graphicItem)||void 0===e?void 0:e.attribute,t),this.getDatum(),this,this.mark.getGlyphConfig())),r){let e;Object.keys(r).forEach(n=>{var s;if(!(0,eB.Z)(t[n])){e||(e=Object.assign({},null===(s=this.graphicItem)||void 0===s?void 0:s.attribute,t));let a=r[n].call(null,n,t[n],e,this.getDatum(),this,this.mark.getGlyphConfig());Object.keys(null!=a?a:{}).forEach(t=>{var e;i[t]=Object.assign(null!==(e=i[t])&&void 0!==e?e:{},a[t])})}})}return i}encodeDefault(){let t={};return this.diffState===tN.enter&&this.glyphMeta.getDefaultEncoder()&&Object.assign(t,this.glyphMeta.getDefaultEncoder().call(null,this.getDatum(),this,this.mark.getGlyphConfig())),t}_onGlyphAttributeUpdate(t=!1){return e=>{if(!this.mark)return e;let i=this.glyphMeta.getMarks(),r=h8(this.mark.getAttributeTransforms(),e,this),n=t?this.encodeDefault():null,s=this.encodeCustom(e);return Object.keys(i).forEach(r=>{var a,o,l;let h=i[r],d=this.glyphGraphicItems[r],u=Object.assign({},null==s?void 0:s[r]);if(t){let t=null==n?void 0:n[r];Object.keys(null!=t?t:{}).forEach(e=>{r1(this.items[0].nextAttrs,e)||r1(u,e)||(u[e]=t[e])})}let c=Object.assign({},(a=h,o=e,(null!==(l=h6[a])&&void 0!==l?l:[]).reduce((t,e)=>(e.channels.forEach(e=>{r1(o,e)&&(t[e]=o[e])}),t),{})),u),p=this._generateGlyphItems(h,this.items,c);this.coordinateTransformEncode(p);let g=this.transformElementItems(p,h);this.applyGlyphGraphicAttributes(g,r,d),h===tF.shape&&(d.datum=p[0].datum)}),r}}_generateGlyphItems(t,e,i){let r=e.map(t=>Object.assign({},t,{nextAttrs:i}));return l6.includes(t)&&this.mark.getSpec().enableSegments&&r.forEach((t,r)=>{t.nextAttrs=Object.assign({},e[r].nextAttrs,i)}),r}getGraphicAttribute(t,e=!1,i){if(!this.graphicItem)return;let r=this.getPrevGraphicAttributes(i);return e&&r1(r,t)?r[t]:(i?this.glyphGraphicItems[i]:this.graphicItem).attribute[t]}setGraphicAttribute(t,e,i=!0,r){if(!this.graphicItem)return;let n=r?this.glyphGraphicItems[r]:this.graphicItem,s=this.getFinalGraphicAttributes(r),a=this.getPrevGraphicAttributes(r);i&&(s[t]=e),r1(a,t)||(a[t]=n.attribute[t]),n.setAttribute(t,e)}setGraphicAttributes(t,e=!0,i){if(!this.graphicItem)return;let r=i?this.glyphGraphicItems[i]:this.graphicItem,n=this.getFinalGraphicAttributes(i),s=this.getPrevGraphicAttributes(i);Object.keys(t).forEach(i=>{e&&(n[i]=t[i]),r1(s,i)||(s[i]=r.attribute[i])}),r.setAttributes(t)}diffAttributes(t,e){let i={},r=this.getFinalGraphicAttributes(e);for(let e in t)ds(e,r,t)||(i[e]=t[e]);return i}applyGlyphGraphicAttributes(t,e,i){var r,n;if(this.mark.needAnimate()){let s=this.diffAttributes(t,e),a=null!==(r=this.getPrevGraphicAttributes(e))&&void 0!==r?r:{},o=null!==(n=this.getFinalGraphicAttributes(e))&&void 0!==n?n:{};Object.keys(s).forEach(t=>{a[t]=i.attribute[t],o[t]=s[t]}),this.setNextGraphicAttributes(s,e),this.setPrevGraphicAttributes(a,e),this.setFinalGraphicAttributes(o,e),i.setAttributes(s)}else i.setAttributes(t)}getFinalGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).finalAttrs}setFinalGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).finalAttrs=t}getPrevGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).prevAttrs}setPrevGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).prevAttrs=t}getNextGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).nextAttrs}setNextGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).nextAttrs=t}clearChangedGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach(t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t)})}clearGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),this.setFinalGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach(t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t),this.setFinalGraphicAttributes(null,t)})}remove(){this.glyphGraphicItems=null,super.remove()}release(){this.glyphGraphicItems&&(Object.values(this.glyphGraphicItems).forEach(t=>{t[l4]=null}),this.glyphGraphicItems=null),super.release()}}let dA=t=>t.markType===tF.glyph?new d_(t):new dx(t);function dw(t,e,i){let r=new Map;if(!t||0===t.length)return{keys:[],data:r};if(!e)return r.set("key",i?t.slice().sort(i):t.slice()),{keys:l9,data:r};let n=lr(e);if(1===t.length){let e=n(t[0]);return r.set(e,[t[0]]),{keys:[e],data:r}}let s=new Set;return t.forEach(t=>{var e;let i=n(t),a=null!==(e=r.get(i))&&void 0!==e?e:[];a.push(t),r.set(i,a),s.add(i)}),i&&s.forEach(t=>{r.get(t).sort(i)}),{keys:Array.from(s),data:r}}class dS{constructor(t,e,i){this.prevData=(null==t?void 0:t.length)?dw(t,null!=e?e:null,i):null}setCurrentData(t){this.currentData=t}getCurrentData(){return this.currentData}doDiff(){if(this.callback){if(this.currentData&&this.prevData){let t=new Map(this.prevData.data);this.currentData.keys.forEach(e=>{this.callback(e,this.currentData.data.get(e),t.get(e)),t.delete(e)}),this.prevData.keys.forEach(e=>{t.has(e)&&this.callback(e,null,t.get(e))})}else this.currentData?this.currentData.keys.forEach(t=>{this.callback(t,this.currentData.data.get(t),null)}):this.prevData&&this.prevData.keys.forEach(t=>{this.callback(t,null,this.prevData.data.get(t))})}}setCallback(t){this.callback=t}updateToCurrent(){this.prevData=this.currentData,this.currentData=null}reset(){this.prevData=null}}class dT extends nr{constructor(t,e,i,r,n){super(t,e,i,r,n)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,r,n,s,a,o;this.fromNumber=(0,iy.Z)(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=(0,iy.Z)(null===(r=this.to)||void 0===r?void 0:r.text)?null===(n=this.to)||void 0===n?void 0:n.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(o=null===(a=this.params)||void 0===a?void 0:a.fixed)&&void 0!==o?o:Math.max((0,eJ.i4)(this.fromNumber),(0,eJ.i4)(this.toNumber)))}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}(E=t0||(t0={}))[E.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",E[E.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",E[E.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",E[E.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",E[E.STROKE=4]="STROKE";class dk extends nr{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach(t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target})}getEndProps(){let t={};return this.customAnimates.forEach(e=>{Object.assign(t,e.getEndProps())}),t}onBind(){this.initAnimates(),this.customAnimates.forEach(t=>{t.onBind()})}onEnd(){this.customAnimates.forEach(t=>{t.onEnd()})}onStart(){this.customAnimates.forEach(t=>{t.onStart()})}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach(r=>{let n=r.easing;e=("string"==typeof n?nt[n]:n)(e),r.onUpdate(t,e,i)}),this.updating=!1)}}let dB=(t,e)=>{if(!t)return null;if(t.from){let i=t.from,r=Object.keys(i);r.forEach(t=>{(0,eB.Z)(i[t])&&delete i[t]});let n=h5(r,e.mark.markType)&&!eb(i.segments);if(n){let r=e.items.map(t=>Object.assign({},t,{nextAttrs:Object.assign({},i)}));t.from=e.transformElementItems(r,e.mark.markType,n)}}if(t.to){let i=t.to,r=Object.keys(i);r.forEach(t=>{(0,eB.Z)(i[t])&&delete i[t]});let n=h5(r,e.mark.markType)&&!eb(i.segments);if(n){let r=e.items.map(t=>Object.assign({},t,{nextAttrs:Object.assign({},i)}));t.to=e.transformElementItems(r,e.mark.markType,n)}}return t},dC=(t,e,i,r,n)=>r6(i)?i(t.getDatum(),t,n):i;class dE extends nr{constructor(t,e,i,r,n){super(t,e,i,r,n),this._interpolator=null==n?void 0:n.interpolator,this._element=null==n?void 0:n.element}onBind(){var t,e;this.from=null!==(t=this.from)&&void 0!==t?t:{},this.to=null!==(e=this.to)&&void 0!==e?e:{}}getEndProps(){return this.to}onUpdate(t,e,i){this._interpolator&&this._element&&this._interpolator.call(this,e,this.from,this.to,i,this._element.getDatum(),this._element,this.params.parameters)}}class dM extends nr{getEndProps(){return this.to}onBind(){var t,e;this.from=null!==(t=this.from)&&void 0!==t?t:{},this.to=null!==(e=this.to)&&void 0!==e?e:{}}onStart(){var t;let e=null!==(t=this.target.constructor.NOWORK_ANIMATE_ATTR)&&void 0!==t?t:nN,i=Object.keys(e).filter(t=>0!==e[t]);this.subAnimate.animate.preventAttrs(i);let r=Object.assign({},this.from),n=Object.assign({},this.to),s=[];Object.keys(n).forEach(t=>{i.includes(t)?(r[t]=n[t],this.from[t]=n[t]):(0,eB.Z)(r[t])?r[t]=this.target.getComputedAttribute(t):s.push(t)}),this.target.animates.forEach(t=>{t!==this.subAnimate.animate&&t.preventAttrs(s)}),this.target.setAttributes(r,!1,{type:oR.ANIMATE_UPDATE,animationState:{ratio:0,end:!1}}),this._fromAttribute=r,this._toAttribute=n}onEnd(){if(this._toAttribute){let t={};Object.keys(this._toAttribute).forEach(e=>{this.subAnimate.animate.validAttr(e)&&(t[e]=this._toAttribute[e])}),this.target.setAttributes(t,!1,{type:oR.ANIMATE_END})}}update(t,e,i){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1;let r=this.step.getLastProps();Object.keys(r).forEach(t=>{this.subAnimate.animate.validAttr(t)&&(i[t]=r[t])}),this.onUpdate(t,e,i),t&&this.onEnd()}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this._toAttribute,this._fromAttribute)}}ns.mode|=oL.SET_ATTR_IMMEDIATELY;let dP=0,dO=t=>!(0,eB.Z)(t)&&t.prototype instanceof nr;class dR{constructor(t,e,i){this.id=dP++,this.isAnimating=!1,this.runnings=[],this.element=t,this.animationOptions=i,this.unit=e}callback(t){return this.callbackFunction=t,this}animate(t,e){return this.isAnimating=!0,this.animateElement(t,e),0===this.runnings.length&&this.animationEnd(),this}stop(t="end",e=!0){return this.runnings.forEach(e=>e.stop(t)),this.animationEnd(e),this}pause(){return this.runnings.forEach(t=>t.pause()),this}resume(){return this.runnings.forEach(t=>t.resume()),this}startAt(t){return this.runnings.forEach(e=>{let i=this.unit.initialDelay;e.startAt(i+t)}),this}getTotalAnimationTime(){var t;let e=this.unit.initialDelay+this.unit.loopDuration*this.unit.loopCount;return null!==(t=this.unit.totalTime)&&void 0!==t?t:e}getEndAttributes(){return this.runnings.reduce((t,e)=>Object.assign(t,e.getEndProps()),{})}animationEnd(t=!0){var e;this.isAnimating=!1,this.runnings=null,t&&(null===(e=this.callbackFunction)||void 0===e||e.call(null))}animateElement(t,e){let i=this.element.getGraphicItem();if(!i)return;let r=i.animate();this.runnings.push(r),r.startAt(this.unit.initialDelay),r.wait(this.unit.loopDelay),this.unit.timeSlices.forEach(i=>{this.animateTimeSlice(r,i,t,e)}),r.wait(this.unit.loopDelayAfter),r.loop(this.unit.loopCount-1),(0,eg.Z)(this.unit.totalTime)&&setTimeout(()=>{r&&r.stop("end")},this.unit.totalTime),r.onEnd(()=>{this.runnings=this.runnings.filter(t=>t!==r),0===this.runnings.length&&this.animationEnd()})}animateTimeSlice(t,e,i,r){let n=e.delay,s=e.delayAfter,a=e.duration,o=e.effects;if(n>0&&t.wait(n),o.length<0)t.wait(a);else{let e=o.map((t,e)=>{var n;let s=null!==(n=t.type?function(t,e,i,r){let n=r6(e.options)?e.options.call(null,t.getDatum(),t,r):e.options;return e.type&&ld.getAnimationType(e.type)?dB(ld.getAnimationType(e.type)(t,n,i),t):null}(this.element,t,i,r):t.channel?function(t,e,i,r){let n=e.channel,s=null;return(0,ev.Z)(n)?s=n.reduce((e,i)=>(e.from[i]=t.getGraphicAttribute(i,!0),e.to[i]=t.getGraphicAttribute(i,!1),e),{from:{},to:{}}):(0,ep.Z)(n)&&(s=Object.keys(n).reduce((e,i)=>{var s,a;let o=!(0,eB.Z)(null===(s=n[i])||void 0===s?void 0:s.from),l=!(0,eB.Z)(null===(a=n[i])||void 0===a?void 0:a.to);return(o||l)&&(e.from[i]=o?dC(t,0,n[i].from,0,r):void 0,e.to[i]=l?dC(t,0,n[i].to,0,r):t.getGraphicAttribute(i,!1)),e},{from:{},to:{}})),dB(s,t)}(this.element,t,0,r):void 0)&&void 0!==n?n:{},o=s.custom||(null==t?void 0:t.custom),l=(null==s?void 0:s.customParameters)||(null==t?void 0:t.customParameters);s.from&&Object.keys(s.from).length&&this.unit&&this.animationOptions.timeline.controlOptions.immediatelyApply&&"component"!==this.element.mark.markType&&this.element.getGraphicItem().setAttributes(s.from);let h=dO(o);return(0,eB.Z)(o)||dO(o)?h?new o(s.from,s.to,a,t.easing,l):s.to?new dM(s.from,s.to,a,t.easing):void 0:new dE(s.from,s.to,a,t.easing,{interpolator:o,element:this.element,parameters:l})}).filter(t=>!(0,eB.Z)(t));1===e.length?t.play(e[0]):e.length>1&&t.play(new dk(a,e))}s>0&&t.wait(s)}}function dI(t){let e=[];return Object.keys(t).forEach(i=>{e=e.concat(dL(i,t[i]))}),e}function dL(t,e,i=0){let r=[],n=i;return ex(e).forEach(e=>{var i;let s=function(t){var e,i,r,n,s,a,o,l,h,d,u,c;if((0,eB.Z)(t.timeSlices))return{startTime:null!==(e=t.startTime)&&void 0!==e?e:0,totalTime:t.totalTime,oneByOne:null!==(i=t.oneByOne)&&void 0!==i&&i,loop:null!==(r=t.loop)&&void 0!==r&&r,controlOptions:lT({},hi,null!==(n=t.controlOptions)&&void 0!==n?n:{}),timeSlices:[{duration:null!==(s=t.duration)&&void 0!==s?s:1e3,delay:null!==(a=t.delay)&&void 0!==a?a:0,delayAfter:null!==(o=t.delayAfter)&&void 0!==o?o:0,effects:[{type:t.type,channel:t.channel,custom:t.custom,easing:null!==(l=t.easing)&&void 0!==l?l:he,customParameters:t.customParameters,options:t.options}]}]};let p=ex(t.timeSlices).filter(t=>t.effects&&ex(t.effects).filter(t=>t.channel||t.type).length);if(p.length)return{startTime:null!==(h=t.startTime)&&void 0!==h?h:0,totalTime:t.totalTime,oneByOne:null!==(d=t.oneByOne)&&void 0!==d&&d,loop:null!==(u=t.loop)&&void 0!==u&&u,controlOptions:lT({},hi,null!==(c=t.controlOptions)&&void 0!==c?c:{}),timeSlices:p.map(t=>{var e,i;return{duration:t.duration,delay:null!==(e=t.delay)&&void 0!==e?e:0,delayAfter:null!==(i=t.delayAfter)&&void 0!==i?i:0,effects:ex(t.effects).filter(t=>t.channel||t.type).map(t=>{var e;return{type:t.type,channel:t.channel,custom:t.custom,easing:null!==(e=t.easing)&&void 0!==e?e:he,customParameters:t.customParameters,options:t.options}})}}),partitioner:t.partitioner,sort:t.sort}}(e);s&&(r.push({state:t,id:null!==(i=s.id)&&void 0!==i?i:`${t}-${n}`,timeline:s,originConfig:e}),n+=1)}),r}function dD(t,e,i){return r6(t)?t.call(null,e.getDatum(),e,i):t}class dj{constructor(t){this.parallelArrangers=[this],this.totalTime=0,this.startTime=0,this.endTime=0,this.animators=t.filter(t=>!(0,eB.Z)(t)),this.totalTime=this.animators.reduce((t,e)=>Math.max(t,e.getTotalAnimationTime()),0)}parallel(t){let e=Array.from(new Set(this.parallelArrangers.concat(t.parallelArrangers)));return e.forEach(t=>{t.parallelArrangers=e}),this.arrangeTime(),this}after(t){return this.afterArranger=t,this.arrangeTime(),this}arrangeTime(){let t=this.parallelArrangers.reduce((t,e)=>Math.max(t,e.totalTime),this.totalTime),e=this.parallelArrangers.reduce((t,e)=>{var i,r;return Math.max(t,null!==(r=null===(i=e.afterArranger)||void 0===i?void 0:i.endTime)&&void 0!==r?r:0)},0);this.parallelArrangers.forEach(i=>{i.startTime=e,i.endTime=e+t,i.animators.forEach(t=>{t.startAt(e)})})}}class dN{constructor(t,e){this.state=null,this.immediateConfigs=[],this.isEnabled=!0,this.disabledStates=[],this.animators=new Map,this.elementRecorder=new WeakMap,this.timelineCount={},this.mark=t,this.configs=dI(null!=e?e:{})}getAnimationConfigs(t){var e;return this.isEnabled?(null!==(e=this.configs)&&void 0!==e?e:[]).filter(e=>e.state===t):[]}updateConfig(t){this.configs=dI(null!=t?t:{})}updateState(t){this.state=t}animate(){if(!this.isEnabled||!this.configs||!this.configs.length)return;let t=this.mark.getAllElements(),e=this.mark.parameters();return t.forEach(t=>{var e;t.isReserved&&t.diffState!==tN.exit&&(t.isReserved=!1);let i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.prevState;this.configs.some(e=>i!==t.diffState&&e.state===i&&e.timeline.controlOptions.stopWhenStateChange)&&this.clearElementAnimation(t,!1)}),this.configs.forEach(i=>{this.animateByTimeline(i,t,e)}),this.mark.cleanExitElements(),this}runAnimationByState(t){if(!this.isEnabled)return;let e=this.configs.filter(e=>e.state===t),i=this.mark.getAllElements(),r=this.mark.parameters();return new dj(e.reduce((t,e)=>t.concat(this.animateByTimeline(e,i,r,!0)),[]))}stopAnimationByState(t){let e=this.animators.get(t);return e&&e.forEach(t=>t.stop()),this}pauseAnimationByState(t){let e=this.animators.get(t);return e&&e.forEach(t=>t.pause()),this}resumeAnimationByState(t){let e=this.animators.get(t);return e&&e.forEach(t=>t.resume()),this}run(t){if(!this.isEnabled)return;let e=dL(ht,t,this.immediateConfigs.length);this.immediateConfigs=this.immediateConfigs.concat(e);let i=this.mark.getAllElements(),r=this.mark.parameters();return new dj(e.reduce((t,e)=>t.concat(this.animateByTimeline(e,i,r,!0)),[]))}stop(){return this.animators.forEach(t=>{t.forEach(t=>t.stop())}),this}pause(){return this.animators.forEach(t=>t.forEach(t=>t.pause())),this}resume(){return this.animators.forEach(t=>t.forEach(t=>t.resume())),this}reverse(){return this}restart(){return this}record(){return this}recordEnd(){return this}isAnimating(){let t=!1;return this.animators.forEach(e=>{t=t||e.some(t=>t.isAnimating)}),t}isElementAnimating(t){var e;let i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.count;return(0,eB.Z)(i)||Object.values(i).every(t=>0===t)}getAnimatorCount(){let t=0;return this.animators.forEach(e=>t+=e.length),t}getAllAnimators(){let t=[];return this.animators.forEach(e=>{t.push(...e)}),t}getElementAnimators(t,e){var i;let r=ex(t),n=[];return e?n=null!==(i=this.animators.get(e))&&void 0!==i?i:[]:this.animators.forEach(t=>{n=n.concat(t)}),n.filter(t=>r.includes(t.element))}enable(){return this.isEnabled=!0,this}disable(){return this.isEnabled=!1,this.stop(),this.animators.clear(),this}enableAnimationState(t){let e=ex(t);return this.disabledStates=this.disabledStates.filter(t=>!e.includes(t)),this}disableAnimationState(t){let e=ex(t);return this.disabledStates=this.disabledStates.concat(e),this}release(){this.stop(),this.animators.clear(),this.configs=null,this.animators=null,this.elementRecorder=null,this.timelineCount=null}animateByTimeline(t,e,i,r=!1){var n;let s=[],a=e.filter(e=>{let n=!(e.isReserved&&e.diffState===tN.exit),s=this.getAnimationState(e),a=!this.disabledStates.includes(s),o=r||s===t.state,l=!t.timeline.partitioner||t.timeline.partitioner(e.getDatum(),e,i);return n&&a&&o&&l});if(a.length){(0,eB.Z)(this.timelineCount[t.id])&&(this.timelineCount[t.id]=0),t.timeline.sort&&a.sort((e,r)=>t.timeline.sort(e.getDatum(),r.getDatum(),e,r,i));let e={width:this.mark.view.width(),height:this.mark.view.height(),group:null!==(n=this.mark.group)&&void 0!==n?n:null,mark:this.mark,view:this.mark.view,elementCount:a.length,elementIndex:0};a.forEach((r,n)=>{e.elementIndex=n;let o=Object.assign({VGRAMMAR_ANIMATION_PARAMETERS:e},i),l=this.getAnimationUnit(t.timeline,r,n,a.length,o);s.push(this.animateElement(t,l,r,e,o))})}return s}animateElement(t,e,i,r,n){var s,a;let o=new dR(i,e,t);if(o.animate(r,n),!o.isAnimating)return;i.diffState===tN.exit&&(i.isReserved=!0);let l=0===this.timelineCount[t.id];this.timelineCount[t.id]+=1;let h=null!==(s=this.elementRecorder.get(i))&&void 0!==s?s:{prevState:t.state,count:{}};h.prevState=t.state,h.count[t.state]=(null!==(a=h.count[t.state])&&void 0!==a?a:0)+1,this.elementRecorder.set(i,h);let d=this.animators.get(t.state);d?d.push(o):this.animators.set(t.state,[o]),o.callback(()=>{this.handleAnimatorEnd(o)});let u={mark:this.mark,animationState:t.state,animationConfig:t.originConfig};return l&&this.mark.emit(tX.ANIMATION_START,u),this.mark.emit(tX.ELEMENT_ANIMATION_START,u,i),o}getAnimationState(t){let e=lt(this.state,this.mark.parameters(),t.getDatum(),t);return null!=e?e:t.diffState}getAnimationUnit(t,e,i,r,n){let s=[],a=dD(t.startTime,e,n),o=dD(t.totalTime,e,n),l=dD(t.oneByOne,e,n),h=dD(t.loop,e,n),d=0;t.timeSlices.forEach(t=>{var i;let a=dD(t.delay,e,n),l=dD(t.delayAfter,e,n),h=null!==(i=dD(t.duration,e,n))&&void 0!==i?i:o/r,u=ex(t.effects).map(t=>Object.assign({},t,{customParameters:dD(t.customParameters,e,n)}));s.push({effects:u,duration:h,delay:a,delayAfter:l}),d+=a+h+l});let u=(0,iy.Z)(l)?l:!0===l?d:0;return{initialDelay:a,loopCount:(0,iy.Z)(h)?h:!0===h?1/0:1,loopDelay:u*i,loopDelayAfter:u*(r-i-1),loopAnimateDuration:d,loopDuration:d+u*(r-1),totalTime:o,timeSlices:s}}clearElementAnimation(t,e=!0){this.animators.forEach(i=>{i.forEach(i=>{i.element===t&&(i.animationOptions.state===tN.exit?i.stop("start",!1):i.stop("end",!1),this.handleAnimatorEnd(i,e))})}),this.elementRecorder.delete(t)}clearAllElements(){let t=this.mark.getAllElements();t&&t.forEach((e,i)=>{this.clearElement(e,i===t.length-1)})}clearElement(t,e=!0){this.clearElementAnimation(t),t.getGraphicItem()&&(t.clearGraphicAttributes(),t.diffState===tN.exit&&(t.isReserved=!1),e&&this.mark.cleanExitElements())}handleAnimatorEnd(t,e=!0){let i=t.element,r=t.animationOptions,n=r.state,s=n===ht,a=this.elementRecorder.get(i).count;a[n]-=1,this.animators.set(n,this.animators.get(n).filter(e=>e!==t)),0===this.animators.get(n).length&&this.animators.delete(n),this.timelineCount[r.id]-=1;let o=0===this.timelineCount[r.id],l=s?this.immediateConfigs.find(t=>t.id===r.id).originConfig:this.configs.find(t=>t.id===r.id).originConfig;o&&(delete this.timelineCount[r.id],s&&(this.immediateConfigs=this.immediateConfigs.filter(t=>t.id!==r.id))),e&&(0===Object.keys(this.timelineCount).length?this.clearAllElements():n===tN.exit&&0===a[tN.exit]&&this.clearElement(i));let h={mark:this.mark,animationState:n,animationConfig:l};o&&this.mark.emit(tX.ANIMATION_END,h),this.mark.emit(tX.ELEMENT_ANIMATION_END,h,i)}}class dF extends ll{constructor(t,e,i){super(t),this.grammarType="mark",this.elements=[],this.elementMap=new Map,this.isUpdated=!0,this._isReentered=!1,this.animate=new dN(this,{}),this.differ=new dS([]),this.markType=e,this.spec.type=e,this.spec.encode={update:{}},this.spec.group=i,i&&(this.group=i,this.attach(i),i.appendChild(this))}parse(t){var e,i,r;if(super.parse(t),this.spec.group){let t=(0,ek.Z)(this.spec.group)?this.view.getMarkById(this.spec.group):this.spec.group;this.detach(t)}let n=(0,ek.Z)(t.group)?this.view.getMarkById(t.group):t.group;return this.attach(n),this.join(null===(e=t.from)||void 0===e?void 0:e.data,t.key,t.sort,t.groupBy,t.groupSort),this.coordinate(t.coordinate),this.state(t.state,this.spec.stateSort),Object.keys(null!==(i=this.spec.encode)&&void 0!==i?i:{}).forEach(t=>{this.encodeState(t,{},!0)}),Object.keys(null!==(r=t.encode)&&void 0!==r?r:{}).forEach(e=>{this.encodeState(e,t.encode[e])}),this.animation(t.animation),this.animationState(t.animationState),this.morph(t.morph,t.morphKey,t.morphElementKey),this.layout(t.layout),this.configure(t),this.transform(t.transform),this.parseAddition(t),this.spec=t,this.markType=t.type,this.commit(),this}parameters(){var t;return null!==(t=this._finalParameters)&&void 0!==t?t:super.parameters()}parseAddition(t){return this}reuse(t){return t.grammarType!==this.grammarType?this:(this.markType=t.markType,this.coord=t.coord,this.elementMap=t.elementMap,this.elements=t.elements,this.elementMap.forEach(t=>t.mark=this),this.differ=t.differ,this.animate=t.animate,this.animate.mark=this,this._context=t._context,this.graphicItem=t.graphicItem,this.graphicIndex=t.graphicIndex,this.graphicParent=t.graphicParent,this.needClear=t.needClear,this.isUpdated=t.isUpdated,this)}needLayout(){return!(0,eB.Z)(this.spec.layout)}handleLayoutEnd(){}handleRenderEnd(){this.needClear&&(this.cleanExitElements(),this.elementMap.forEach(t=>{t.diffState===tN.exit?t.clearGraphicAttributes():t.clearChangedGraphicAttributes()}),this.differ.updateToCurrent(),this.needClear=!1)}evaluateMainTasks(t,e){var i;if(this.needSkipBeforeLayout()&&this.view.getLayoutState()===tY.before)return this;let r=null===(i=this.view.renderer)||void 0===i?void 0:i.stage();this.init(r,e);let n=this.evaluateTransform(this._getTransformsBeforeJoin(),null!=t?t:l7,e),s=(null==n?void 0:n.progressive)?t:n;return this.evaluateGroup(s),this.renderContext=this.parseRenderContext(s,e),this.renderContext.progressive?(this.differ.reset(),this.elementMap.clear(),this.evaluateProgressive()):((null==n?void 0:n.progressive)&&(this.renderContext.parameters=e,this.renderContext.beforeTransformProgressive=n.progressive,s=n.progressive.output()),this.emit(tX.BEFORE_MARK_JOIN),this.evaluateJoin(s),this.emit(tX.AFTER_MARK_JOIN),this.emit(tX.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,e),this.emit(tX.AFTER_MARK_STATE),this.emit(tX.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),e),this.emit(tX.AFTER_MARK_ENCODE)),this.emit(tX.BEFORE_MARK_UPDATE),this.update(this.spec),this.emit(tX.AFTER_MARK_UPDATE),this}evaluateGroup(t){if(this.markType===tF.group)return;let e=dw(null!=t?t:l7,this.spec.groupBy,this.spec.groupSort),i=e.keys;this._groupKeys=i,this._groupEncodeResult=null,this.differ.setCurrentData(e)}_getTransformsAfterEncodeItems(){return this.transforms&&this.transforms.filter(t=>"afterEncodeItems"===t.markPhase)}_getTransformsAfterEncode(){return this.transforms&&this.transforms.filter(t=>(0,eB.Z)(t.markPhase)||"afterEncode"===t.markPhase)}_getTransformsBeforeJoin(){return this.transforms?this.transforms.filter(t=>"beforeJoin"===t.markPhase):[]}evaluate(t,e){var i;return this.evaluateMainTasks(t,e),(null===(i=this.renderContext)||void 0===i?void 0:i.progressive)||this.evaluateTransform(this._getTransformsAfterEncode(),this.elements,e),this}output(){return this}join(t,e,i,r,n){return this.grammarSource&&(this.detach(this.grammarSource),this.grammarSource=null),this.spec.from=null,(0,eB.Z)(t)||((0,ek.Z)(t)?this.grammarSource=this.view.getDataById(t):this.grammarSource=t,this.spec.from={data:t},this.attach(this.grammarSource)),this.spec.key=e,this.spec.sort=i,this.spec.groupBy=r,this.spec.groupSort=n,this.commit(),this}coordinate(t){return(0,ek.Z)(t)?this.coord=this.view.getCoordinateById(t):this.coord=t,this.attach(this.coord),this.commit(),this}state(t,e){return this.spec.stateSort=e,this.setFunctionSpec(t,"state")}encode(t,e,i){return this.encodeState(tN.update,t,e,i)}encodeState(t,e,i,r){if(t===tN.enter&&(this._isReentered=!0),this.spec.encode[t]){let n=this.spec.encode[t];if(o9(n))this.detach(dh(n,this.view));else{let s=(0,ek.Z)(e);s&&r||!s&&i?(Object.keys(n).forEach(t=>{this.detach(dh(n[t],this.view))}),this.spec.encode[t]={}):s?this.detach(dh(n[e],this.view)):Object.keys(e).forEach(t=>{this.detach(dh(n[t],this.view))})}}return e&&(this.spec.encode[t]||(this.spec.encode[t]={}),(0,ek.Z)(e)?(this.spec.encode[t][e]=i,this.attach(dh(i,this.view))):o9(e)?(this.spec.encode[t]=e,this.attach(dh(e,this.view))):e&&(Object.assign(this.spec.encode[t],e),Object.values(e).forEach(t=>{this.attach(dh(t,this.view))}))),this.commit(),this}_getEncoders(){var t;return null!==(t=this.spec.encode)&&void 0!==t?t:{}}animation(t){return this.spec.animation=t,this}animationState(t){return this.setFunctionSpec(t,"animationState")}layout(t){return this.spec.layout=t,this.commit(),this}morph(t,e,i){return this.spec.morph=t,this.spec.morphKey=e,this.spec.morphElementKey=i,this}transform(t){let e=lg(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]);let i=lg(t,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.spec.transform=t,this.commit(),this}configure(t){let e=["clip","clipPath","zIndex","interactive","context","setCustomizedShape","large","largeThreshold","progressiveStep","progressiveThreshold","support3d","morph","morphKey","morphElementKey","attributeTransforms","skipTheme","enableSegments","stateSort"];return null===t?e.forEach(t=>{(0,eB.Z)(this.spec[t])||(this.spec[t]=void 0)}):e.forEach(e=>{(0,eB.Z)(t[e])||(this.spec[e]=t[e])}),this}context(t){return this.spec.context=t,this._context=t,this}isCollectionMark(){return l6.includes(this.markType)}needAnimate(){var t;return!(null===(t=this.renderContext)||void 0===t?void 0:t.progressive)&&!(0,eB.Z)(this.spec.animation)}getAllElements(){let t=this.elements.slice();return this.elementMap.forEach(e=>{e.diffState!==tN.exit||t.includes(e)||t.push(e)}),this.spec.sort&&t.sort((t,e)=>this.spec.sort(t.getDatum(),e.getDatum())),t}getScales(){let t={};return this.references.forEach((e,i)=>{i.grammarType===tK.scale&&(t[i.id()]=i.output())}),t}getScalesByChannel(){let t=this.spec.encode;if(!t)return{};let e={},i=this.parameters();return Object.keys(t).forEach(r=>{let n=t[r];n&&!o9(n)&&Object.keys(n).forEach(t=>{da(n[t])&&(e[t]=le(n[t].scale,i))})}),e}getFieldsByChannel(){let t=this.spec.encode;if(!t)return{};let e={};return Object.keys(t).forEach(i=>{let r=t[i];o9(r)||Object.keys(r).forEach(t=>{dl(r[t])&&(e[t]=r[t].field)})}),e}init(t,e){var i,r,n,s;if(this._delegateEvent||(this._delegateEvent=(t,e)=>{var i;let r=null===(i=t.target)||void 0===i?void 0:i[l4];if((null==r?void 0:r.mark)===this){let i=hZ(this.view,t,r,e,lD);this.emitGrammarEvent(e,i,r)}},this.initEvent()),this.animate||(this.animate=new dN(this,this.spec.animation),this.needAnimate()&&this.animate.updateState(this.spec.animationState)),!this.group){let t=le(this.spec.group,e);this.group=t,t&&t.appendChild(this)}let a=this.group?this.group.getGroupGraphicItem():t.defaultLayer,o=null!==(n=null===(r=null===(i=this.group)||void 0===i?void 0:i.children)||void 0===r?void 0:r.indexOf(this))&&void 0!==n?n:0;if(this.markType!==tF.group){if(!this.graphicItem){let t=hJ(this,tF.group,{pickable:!1,zIndex:null!==(s=this.spec.zIndex)&&void 0!==s?s:0});(this.spec.support3d||l8.includes(this.markType))&&t.setMode("3d"),t.name=`${this.id()||this.markType}`,this.graphicItem=t}this.graphicParent=this.graphicItem,a&&(this.graphicIndex!==o||this.graphicItem.parent!==a)&&a.insertIntoKeepIdx(this.graphicItem,o)}else this.graphicParent=a;this.graphicIndex=o}update(t){this._context=this.spec.context,this.isUpdated=!0,this.renderContext.progressive||(t.animation&&this.animate.updateConfig(t.animation),this.animate.updateState(t.animationState)),this.markType!==tF.group?((0,eB.Z)(t.zIndex)||this.graphicItem.setAttribute("zIndex",t.zIndex),(0,eB.Z)(t.clip)||this.graphicItem.setAttribute("clip",t.clip),(0,eB.Z)(t.clipPath)||this.graphicItem.setAttribute("path",(0,ev.Z)(t.clipPath)?t.clipPath:t.clipPath(this.elements)),this.elementMap.forEach(t=>{t.updateGraphicItem()})):this.elementMap.forEach(t=>{t.updateGraphicItem()})}evaluateJoin(t){var e,i,r,n;this.needClear=!0;let s=lr(null!==(r=null!==(e=this.spec.key)&&void 0!==e?e:null===(i=this.grammarSource)||void 0===i?void 0:i.getDataIDKey())&&void 0!==r?r:()=>"key"),a=lr(null!==(n=this.spec.groupBy)&&void 0!==n?n:()=>"key"),o=this.spec.sort,l=this.isCollectionMark(),h=new Set(this.elements.filter(t=>t.diffState===tN.enter)),d=[];this.differ.setCallback((t,e,i)=>{let r;if((0,eB.Z)(e))(r=this.elementMap.get(t))&&(r.diffState=tN.exit);else if((0,eB.Z)(i)){(r=this.elementMap.has(t)?this.elementMap.get(t):dA(this)).diffState===tN.exit&&(r.diffState=tN.enter,this.animate.getElementAnimators(r,tN.exit).forEach(t=>t.stop("start"))),r.diffState=tN.enter;let i=l?t:a(e[0]);r.updateData(i,e,s,this.view),this.elementMap.set(t,r),d.push(r)}else if(r=this.elementMap.get(t)){r.diffState=tN.update;let i=l?t:a(e[0]);r.updateData(i,e,s,this.view),d.push(r)}h.delete(r)});let u=null!=t?t:l7;l||this.differ.setCurrentData(dw(u,t=>`${a(t)}-${s(t)}`,void 0)),this.differ.doDiff(),h.forEach(t=>{this.elementMap.delete(l?t.groupKey:`${t.groupKey}-${t.key}`),t.remove(),t.release()}),this.elements=d,o&&this.elements.length>=2&&this.elements.sort((t,e)=>o(t.getDatum(),e.getDatum()))}evaluateState(t,e,i){e&&t.forEach(t=>{t.state(e,i)})}evaluateGroupEncode(t,e,i){if(!this._groupKeys||!e)return;let r={};return this._groupKeys.forEach(n=>{let s=t.find(t=>t.groupKey===n);s&&(r[n]=du(e,s.items&&s.items[0]&&s.items[0].datum,s,i))}),this._groupEncodeResult=r,r}getChannelsFromConfig(t){let e=this.spec;return(0,eB.Z)(e.interactive)?null:{pickable:e.interactive}}evaluateEncode(t,e,i,r){let n=this.getChannelsFromConfig();if(e){this.emit(tX.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);let s=r?null:this.evaluateGroupEncode(t,e[tj.group],i);t.forEach(t=>{this.markType===tF.glyph&&this._groupEncodeResult?t.items.forEach(e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,this._groupEncodeResult[t.groupKey])}):(null==s?void 0:s[t.groupKey])&&!this.isCollectionMark()?t.items.forEach(e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,s[t.groupKey])}):n&&t.items.forEach(t=>{t.nextAttrs=Object.assign(t.nextAttrs,n)}),t.encodeItems(t.items,e,this._isReentered,i)}),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach(t=>{t.encodeGraphic(this.isCollectionMark()?null==s?void 0:s[t.groupKey]:null)}),this.emit(tX.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach(t=>{t.initGraphicItem(n)})}addGraphicItem(t,e,i){var r;let n=null!=i?i:hJ(this,this.markType,t);if(n){if(null===(r=this.renderContext)||void 0===r?void 0:r.progressive){let t;if(this._groupKeys){let i=this._groupKeys.indexOf(e);i>=0&&(t=this.graphicParent.getChildAt(i))}else t=this.graphicParent.at(0);this.isCollectionMark()?(n.incremental=1,t.appendChild(n)):t.incrementalAppendChild(n)}else this.graphicParent.appendChild(n);return n}}parseRenderContext(t,e){let i=this.markType!==tF.group&&this.spec.progressiveStep>0&&this.spec.progressiveThreshold>0&&this.spec.progressiveStep<this.spec.progressiveThreshold,r=this.spec.large&&this.spec.largeThreshold>0&&t.length>=this.spec.largeThreshold;if(i){let i=this.differ.getCurrentData();return i&&i.keys&&i.keys.some(t=>i.data.get(t).length>this.spec.progressiveThreshold)?{large:r,parameters:e,progressive:{data:t,step:this.spec.progressiveStep,currentIndex:0,totalStep:i.keys.reduce((t,e)=>Math.max(Math.ceil(i.data.get(e).length/this.spec.progressiveStep),t),1),groupedData:i.data}}:{large:r}}return{large:r}}isProgressive(){return this.renderContext&&(!!this.renderContext.progressive||!!this.renderContext.beforeTransformProgressive)}isDoingProgressive(){return this.renderContext&&(this.renderContext.progressive&&this.renderContext.progressive.currentIndex<this.renderContext.progressive.totalStep||this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.unfinished())}clearProgressive(){this.renderContext&&this.renderContext.progressive&&(this.elements=[],this.graphicParent.children.forEach(t=>{t.incrementalClearChild()}),this.graphicParent.removeAllChild()),this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.release(),this.renderContext=null}restartProgressive(){this.renderContext&&this.renderContext.progressive&&(this.renderContext.progressive.currentIndex=0)}evaluateJoinProgressive(){var t,e,i;let r=this.renderContext.progressive.currentIndex,n=lr(null!==(i=null!==(t=this.spec.key)&&void 0!==t?t:null===(e=this.grammarSource)||void 0===e?void 0:e.getDataIDKey())&&void 0!==i?i:()=>"key"),s=[];if(this.isCollectionMark())return this._groupKeys.forEach((t,e)=>{let i=this.renderContext.progressive.groupedData.get(t),a=this.renderContext.progressive.step,o=i.slice(r*a,(r+1)*a);if(0===r){let e=dA(this);e.diffState=tN.enter,e.updateData(t,o,n,this.view),s.push(e)}else{let i=this.elements[e];i.updateData(t,o,n,this.view),s.push(i)}}),s;let a={};return this._groupKeys.forEach(t=>{let e=this.renderContext.progressive.groupedData.get(t),i=this.renderContext.progressive.step,o=e.slice(r*i,(r+1)*i),l=[];o.forEach(e=>{let i=dA(this);i.diffState=tN.enter,i.updateData(t,[e],n,this.view),l.push(i),s.push(i)}),a[t]=l}),{groupElements:a,elements:s}}evaluateEncodeProgressive(t,e,i){let r=this.renderContext.progressive.currentIndex;if(0===r){if(this.evaluateEncode(t,e,i),0===r&&this._groupEncodeResult&&!this.isCollectionMark()&&this.markType!==tF.glyph){let e=t[0],i=e.getGraphicItem(),r=null==i?void 0:i.parent;r&&this._groupEncodeResult[e.groupKey]&&r.setTheme({common:this._groupEncodeResult[e.groupKey]})}}else this.evaluateEncode(t,e,i,!0)}evaluateProgressive(){var t,e,i;if(null===(t=this.renderContext)||void 0===t?void 0:t.beforeTransformProgressive){this.renderContext.beforeTransformProgressive.progressiveRun();let t=this.renderContext.beforeTransformProgressive.output();return this.emit(tX.BEFORE_MARK_JOIN),this.evaluateJoin(t),this.emit(tX.AFTER_MARK_JOIN),this.emit(tX.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,this.renderContext.parameters),this.emit(tX.AFTER_MARK_STATE),this.emit(tX.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),this.renderContext.parameters),void this.emit(tX.AFTER_MARK_ENCODE)}if(!(null===(e=this.renderContext)||void 0===e?void 0:e.progressive))return;let r=this.renderContext.parameters;this.emit(tX.BEFORE_MARK_JOIN);let n=this.evaluateJoinProgressive(),s=Array.isArray(n)?n:n.elements;if(this.emit(tX.AFTER_MARK_JOIN),0===this.renderContext.progressive.currentIndex?(this.graphicParent.removeAllChild(),this._groupKeys.forEach(t=>{let e=hJ(this,tF.group,{pickable:!1,zIndex:this.spec.zIndex});e.incremental=this.renderContext.progressive.step,this.graphicParent.appendChild(e)}),this.elements=s):this.elements=this.elements.concat(s),this.emit(tX.BEFORE_MARK_STATE),this.evaluateState(s,this.spec.state,r),this.emit(tX.AFTER_MARK_STATE),this.emit(tX.BEFORE_MARK_ENCODE),Array.isArray(n))this.evaluateEncodeProgressive(s,this._getEncoders(),r);else{let t=n.groupElements;Object.keys(t).forEach(e=>{this.evaluateEncodeProgressive(t[e],this._getEncoders(),r)})}this.emit(tX.AFTER_MARK_ENCODE);let a=null===(i=this._getTransformsAfterEncode())||void 0===i?void 0:i.filter(t=>!0===t.canProgressive);(null==a?void 0:a.length)&&this.evaluateTransform(a,this.elements,r),this.renderContext.progressive.currentIndex+=1}isLargeMode(){return this.renderContext&&this.renderContext.large}cleanExitElements(){this.elementMap.forEach((t,e)=>{t.diffState!==tN.exit||t.isReserved||(this.elementMap.delete(e),t.remove(),t.release())})}getGroupGraphicItem(){if(this.elements&&this.elements[0]&&this.elements[0].getGraphicItem)return this.elements[0].getGraphicItem()}getBounds(){var t;return this.graphicItem?this.graphicItem.AABBBounds:null===(t=this.getGroupGraphicItem())||void 0===t?void 0:t.AABBBounds}getMorphConfig(){var t;return{morph:null!==(t=this.spec.morph)&&void 0!==t&&t,morphKey:this.spec.morphKey,morphElementKey:this.spec.morphElementKey}}getAttributeTransforms(){var t;return null!==(t=this.spec.attributeTransforms)&&void 0!==t?t:h6[this.markType]}getContext(){return this._context}needSkipBeforeLayout(){var t,e;if(!0===(null===(t=this.spec.layout)||void 0===t?void 0:t.skipBeforeLayouted))return!0;let i=this.group;for(;i;){if(!0===(null===(e=i.getSpec().layout)||void 0===e?void 0:e.skipBeforeLayouted))return!0;i=i.group}return!1}initEvent(){if(this._delegateEvent){let t=this.view.renderer.stage();t&&t.on("*",this._delegateEvent)}}releaseEvent(){if(this._delegateEvent){let t=this.view.renderer.stage();t&&t.off("*",this._delegateEvent)}}clear(){var t;this.releaseEvent(),this.transforms=null,this.elementMap=null,this.elements=null,this.graphicItem=null,this.animate=null,null===(t=this.group)||void 0===t||t.removeChild(this),this.group=null,super.clear()}prepareRelease(){this.animate.stop(),this.elementMap.forEach(t=>t.diffState=tN.exit),this._finalParameters=this.parameters()}release(){this.releaseEvent(),this.elements.forEach(t=>t.release()),this.elementMap.clear(),this._finalParameters=null,this.animate&&this.animate.release(),this.graphicItem&&hQ(this.graphicItem),this.detachAll(),super.release()}}class dG extends dF{constructor(t,e){super(t,tF.group,e),this.children=[]}parseRenderContext(){return{large:!1}}appendChild(t){return this.children.push(t),this}removeChild(t){return this.children=this.children.filter(e=>e!==t),this}includesChild(t,e=!0){return!!this.children.includes(t)||!!e&&this.children.some(e=>e.markType===tF.group&&e.includesChild(t,!0))}updateLayoutChildren(){return this.children.length&&(this.layoutChildren||(this.layoutChildren=[]),this.layoutChildren=this.children.filter(t=>t.needLayout())),this}getAttributeTransforms(){return h6.rect}evaluateJoin(t){if(!this.elements.length){let t=dA(this);t.updateData("key",l7,()=>"",this.view),this.elements=[t],this.elementMap.set("key",t)}}getChannelsFromConfig(t){let e=this.spec,i={};return(0,eB.Z)(e.clip)||(i.clip=e.clip),(0,eB.Z)(e.zIndex)||(i.zIndex=e.zIndex),(0,eB.Z)(e.clipPath)||(i.path=r6(e.clipPath)?e.clipPath([t]):e.clipPath),(0,eB.Z)(e.interactive)||(i.pickable=e.interactive),i}evaluateGroupEncode(t,e,i){var r;let n=this.elements[0],s={},a=[Object.assign({},null===(r=n.items)||void 0===r?void 0:r[0],{nextAttrs:s})];return dd(n,a,e,i),this._groupEncodeResult=s,s}evaluateEncode(t,e,i,r){let n=this.getChannelsFromConfig();if(e){this.emit(tX.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);let s=r?null:this.evaluateGroupEncode(t,e[tj.group],i);t.forEach(t=>{t.items.forEach(t=>{t.nextAttrs=Object.assign(t.nextAttrs,n,s)}),t.encodeItems(t.items,e,this._isReentered,i)}),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach(t=>{t.encodeGraphic()}),this.emit(tX.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach(t=>{t.initGraphicItem(n)})}addGraphicItem(t,e,i){let r=null!=i?i:hJ(this,this.markType,t);if(r)return this.emit(tX.BEFORE_ADD_VRENDER_MARK,{graphicItem:r}),r.name=`${this.id()||this.markType}`,this.graphicParent.insertIntoKeepIdx(r,this.graphicIndex),this.emit(tX.AFTER_ADD_VRENDER_MARK,{graphicItem:r}),r}}function dz(t,e){if((0,eg.Z)(t))return t;let i=t.trim();if("auto"===i)return 0;if(i.endsWith("%")){let t=parseFloat(i.substring(0,i.length-1));return(0,eg.Z)(t)?t*e:0}return 0}function dZ(t,e){return Math.min(t<0?t+e:t-1,e)}function dH(t,e,i){let r=dZ(t,i),n=dZ(e,i);if((0,eg.Z)(t)||(0,eg.Z)(e)?(0,eg.Z)(t)?(0,eg.Z)(e)||(r=dZ(Math.max(0,n-1),i)):n=dZ(r+1,i):(r=1,n=2),r>n){let t=n;n=r,r=t}return{start:r,end:n}}let dU=(t,e,i,r)=>{let n=function(t,e,i){var r,n,s,a;let o=null!==(r=t.gridTemplateRows)&&void 0!==r?r:[i],l=null!==(n=t.gridTemplateColumns)&&void 0!==n?n:[e],h=null!==(s=t.gridRowGap)&&void 0!==s?s:0,d=null!==(a=t.gridColumnGap)&&void 0!==a?a:0,u=o.map(t=>dz(t,i)),c=l.map(t=>dz(t,e)),p=Math.max(0,u.reduce((t,e)=>t-e,i)-u.length*h)/o.filter(t=>"auto"===t).length,g=Math.max(0,c.reduce((t,e)=>t-e,e)-c.length*d)/l.filter(t=>"auto"===t).length,f=0,m=u.map((t,e)=>{let i="auto"===o[e]?p:t,r=f;return f+=i+h,r});m.push(f);let v=0,y=c.map((t,e)=>{let i="auto"===l[e]?g:t,r=v;return v+=i+d,r});return y.push(v),{rows:m,columns:y,rowGap:h,columnGap:d}}(t.getSpec().layout,i.width(),i.height());e&&e.forEach(t=>{let e=t.getSpec().layout;t.layoutBounds=function(t,e,i,r,n){let s=t.rows.length,a=t.columns.length,{start:o,end:l}=dH(e,i,s),{start:h,end:d}=dH(r,n,a),u=t.columns[o],c=t.columns[l]-(d===a?0:t.columnGap),p=t.rows[h],g=t.rows[d]-(l===s?0:t.rowGap);return(new io).set(u,p,c,g)}(n,e.gridRowStart,e.gridRowEnd,e.gridColumnStart,e.gridColumnEnd),t.commit()})},dV=(t,e)=>(0,eB.Z)(t)?e:(0,ek.Z)(t)?e*parseFloat(t)/100:t,dW={[tG.axis]:0,[tG.legend]:1,[tG.slider]:2,[tG.player]:3,[tG.datazoom]:4},d$=t=>{var e,i,r;return null!==(i=null===(e=t.getSpec().layout)||void 0===e?void 0:e.order)&&void 0!==i?i:"component"===t.markType&&null!==(r=dW[t.componentType])&&void 0!==r?r:1/0},dY=(t,e,i,r)=>{let n=i.clone(),s=t.getSpec().layout,a=dV(s.maxChildWidth,n.width()),o=dV(s.maxChildHeight,n.width()),l=0,h=0,d=0,u=0;e.forEach(t=>{let e=t.getSpec().layout,s=h$(e.padding),c=r.parseMarkBounds?r.parseMarkBounds(t.getBounds(),t):t.getBounds();if("top"===e.position||"bottom"===e.position){let t=Math.min(c.height()+s.top+s.bottom,o);"top"===e.position?n.y1+=t:n.y2-=t,c.x1<i.x1&&(l=Math.max(l,i.x1-c.x1)),c.x2>i.x2&&(h=Math.max(h,c.x2-i.x2))}if("left"===e.position||"right"===e.position){let t=Math.min(c.width()+s.left+s.right,a);"left"===e.position?n.x1+=t:n.x2-=t,c.y1<i.y1&&(d=Math.max(d,i.y1-c.y1)),c.y2>i.y2&&(u=Math.max(u,c.y2-i.y2))}"outside"===e.position&&(n.x1+=Math.max(i.x1-c.x1,0)+s.left,n.x2-=Math.max(c.x2-i.x2,0)+s.right,n.y1+=Math.max(i.y1-c.y1,0)+s.top,n.y2-=Math.max(c.y2-i.y2)+s.bottom)}),l>n.x1-i.x1&&l<i.width()&&(n.x1=i.x1+l),h>i.x2-n.x2&&h<i.width()&&(n.x2=i.x2-h),d>n.y1-i.y1&&d<i.height()&&(n.y1=i.y1+d),u>i.y2-n.y2&&u<i.height()&&(n.y2=i.y2-u);let c=n.y1,p=n.y2,g=n.x1,f=n.x2,m=e.slice().sort((t,e)=>d$(t)-d$(e));for(let t=0,e=m.length;t<e;t++){let e=m[t],s=e.getSpec().layout,l=h$(s.padding),h=r.parseMarkBounds?r.parseMarkBounds(e.getBounds(),e):e.getBounds();if("top"===s.position||"bottom"===s.position){let t=Math.min(h.height()+l.top+l.bottom,o);if("top"===s.position?(e.layoutBounds=(new io).set(n.x1,c-t,n.x2,c),c-=t):(e.layoutBounds=(new io).set(n.x1,p,n.x2,p+t),p+=t),e.relativePosition={top:e.layoutBounds.y1-n.y1,bottom:e.layoutBounds.y1-n.y2},s.align){let t=h.width()+l.left+l.right;t<n.width()&&("center"===s.align?(e.layoutBounds.x1=(n.x1+n.x2)/2-t/2,e.layoutBounds.x2=e.layoutBounds.x1+t,e.relativePosition.left=e.relativePosition.right=(n.width()-t)/2):"right"===s.align?(e.layoutBounds.x1=n.x2-t,e.layoutBounds.x2=n.x2,e.relativePosition.right=0,e.relativePosition.left=n.width()-t):"left"===s.align&&(e.layoutBounds.x1=n.x1,e.layoutBounds.x2=n.x1+t,e.relativePosition.left=0,e.relativePosition.right=n.width()-t))}}else if("left"===s.position||"right"===s.position){let t=Math.min(h.width()+l.left+l.right,a);if("left"===s.position?(e.layoutBounds=(new io).set(g-t,n.y1,g,n.y2),g-=t):(e.layoutBounds=(new io).set(f,n.y1,f+t,n.y2),f+=t),e.relativePosition={left:e.layoutBounds.x1-n.x1,right:e.layoutBounds.x1-n.x2},s.align){let i=h.height()+l.top+l.bottom;t<n.width()&&("middle"===s.align?(e.layoutBounds.y1=(n.y1+n.y2)/2-i/2,e.layoutBounds.y2=e.layoutBounds.y1+i,e.relativePosition.top=e.relativePosition.bottom=(n.height()-i)/2):"bottom"===s.align?(e.layoutBounds.y1=n.y2-i,e.layoutBounds.y2=n.y2,e.relativePosition.top=n.height()-i,e.relativePosition.bottom=0):"top"===s.align&&(e.layoutBounds.y1=n.y1,e.layoutBounds.y2=n.y1+i,e.relativePosition.bottom=n.height()-i,e.relativePosition.top=0))}}else"outside"===s.position?(g-=Math.max(i.x1-h.x1,0)+l.left,f-=Math.max(h.x2-i.x2,0)+l.right,c-=Math.max(i.y1-h.y1,0)+l.top,p+=Math.max(h.y2-i.y2)+l.bottom):e.layoutBounds=n}return n},dX=(t,e,i)=>{null==t||t.forEach(t=>{var r;if(t.markType!==tF.group)return;let n=t.layoutChildren,s=t.getSpec().layout,a=null!==(r=t.layoutBounds)&&void 0!==r?r:t.getBounds();if(a){if(r6(s))s.call(null,t,n,a,e);else if(r6(s.callback))s.callback.call(null,t,n,a,e);else if("relative"===s.display){if(s.updateViewSignals){let r=i.getViewBox();r&&a.intersect(r);let s=dY(t,n,a,e),o=s.width(),l=s.height(),h={top:s.y1,right:i.width()-s.x2,left:s.x1,bottom:i.height()-s.y2};i.updateSignal(lG,o),i.updateSignal(lz,l),i.updateSignal(lZ,h)}else dY(t,n,a,e)}else"grid"===s.display&&dU(t,n,a,e);dX(n,e,i)}})};class dK extends dF{constructor(t,e,i){super(t,tF.glyph,i),this.glyphType=e,this.glyphMeta=ld.getGlyph(e)}configureGlyph(t){return this.spec.glyphConfig=t,this.commit(),this}getGlyphMeta(){return this.glyphMeta}getGlyphConfig(){return this.spec.glyphConfig}addGraphicItem(t,e){let i=function(t,e,i={}){if(!ld.getGraphicType(tF.glyph))return;let r=ld.createGraphic(tF.glyph,i),n=e.getMarks(),s=Object.keys(n).map(t=>{if(ld.getGraphicType(n[t])){let e=ld.createGraphic(n[t]);if(e)return e.name=t,e}});return r.setSubGraphic(s),r}(0,this.glyphMeta,t);return super.addGraphicItem(t,e,i)}}function dq(t,e,i=1e-10,r=1e-10){let n=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(r,n)}function dJ(t,e,i,r){return t>e&&!dq(t,e,i,r)}function dQ(t,e,i,r){return t<e&&!dq(t,e,i,r)}function d0(t,e,i,r,n,s){let a=(e-t)*n+t,o=(i-e)*n+e,l=(r-i)*n+i,h=(o-a)*n+a,d=(l-o)*n+o,u=(d-h)*n+h;s[0]=t,s[1]=a,s[2]=h,s[3]=u,s[4]=u,s[5]=d,s[6]=l,s[7]=r}function d1(t,e){let i=t||e,r=i.length,n=i[r-2],s=i[r-1],a=[];for(let t=0;t<e.length;t+=2)a[t]=n,a[t+1]=s;return a}function d2(t){let e=0,i=0,r=0,n=t.length;for(let s=0,a=n-2;s<n;a=s,s+=2){let n=t[a],o=t[a+1],l=t[s],h=t[s+1],d=n*h-l*o;e+=d,i+=(n+l)*d,r+=(o+h)*d}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,r/e/3,e]}let d5=(t,e,i,r,n)=>{dq(e,r)&&dq(i,n)||t.push(e,i,r,n,r,n)};function d3(t){let e,i,r,n;let s=t.commandList,a=[],o,l=0,h=0,d=0,u=0,c=(t,e)=>{o&&o.length>2&&a.push(o),o=[t,e]};for(let t=0,a=s.length;t<a;t++){let a=s[t],p=0===t;switch(p&&(d=l=a[1],u=h=a[2],[ic.L,ic.C,ic.Q].includes(a[0])&&(o=[d,u])),a[0]){case ic.M:l=d=a[1],h=u=a[2],c(d,u);break;case ic.L:e=a[1],i=a[2],d5(o,l,h,e,i),l=e,h=i;break;case ic.C:o.push(a[1],a[2],a[3],a[4],l=a[5],h=a[6]);break;case ic.Q:e=a[1],i=a[2],r=a[3],n=a[4],o.push(l+2/3*(e-l),h+2/3*(i-h),r+2/3*(e-r),n+2/3*(i-n),r,n),l=r,h=n;break;case ic.A:{let t=a[1],r=a[2],n=a[3],s=a[4],g=a[5],f=!!a[6];e=Math.cos(s)*n+t,i=Math.sin(s)*n+r,p?c(d=e,u=i):d5(o,l,h,e,i),l=Math.cos(g)*n+t,h=Math.sin(g)*n+r;let m=(f?-1:1)*Math.PI/2;for(let e=s;f?e>g:e<g;e+=m){let i=f?Math.max(e+m,g):Math.min(e+m,g);ig(o,e,i,t,r,n,n)}break}case ic.E:{let t=a[1],r=a[2],n=a[3],s=a[4],g=a[5],f=a[6],m=a[7]+f,v=!!a[8],y=!dq(g,0),b=Math.cos(g),x=Math.sin(g),_=Math.cos(f)*n,A=Math.sin(f)*s;y?(e=_*b-A*x+t,i=_*x+A*b+r):(e=_+t,i=A+r),p?c(d=e,u=i):d5(o,l,h,e,i),_=Math.cos(m)*n,A=Math.sin(m)*s,y?(l=_*b-A*x+t,h=_*x+A*b+r):(l=_+t,h=A+r);let w=(v?-1:1)*Math.PI/2;for(let e=f;v?e>m:e<m;e+=w){let i=v?Math.max(e+w,m):Math.min(e+w,m);if(ig(o,e,i,t,r,n,s),y){let e=o.length;for(let i=e-6;i<=e-1;i+=2)_=o[i],A=o[i+1],o[i]=(_-t)*b-(A-r)*x+t,o[i+1]=(_-t)*x+(A-r)*b+r}}break}case ic.R:d=l=a[1],u=h=a[2],e=d+a[3],i=u+a[4],c(e,u),d5(o,e,u,e,i),d5(o,e,i,d,i),d5(o,d,i,d,u),d5(o,d,u,e,u);break;case ic.AT:{let t=a[1],e=a[2],i=a[3],r=a[4],n=a[5],s=ix.distancePP({x:l,y:h},{x:t,y:e}),c=ix.distancePP({x:i,y:r},{x:t,y:e}),p=n/Math.sin(((l-t)*(i-t)+(h-e)*(r-e))/(s*c)/2),g=(l+i-2*t)/2,f=(h+r-2*e)/2,m=ix.distancePP({x:g,y:f},{x:0,y:0}),v=t+p*g/m,y=i+p*f/m,b=Math.sqrt(p*p-n*n);d=t+b*(l-t)/s,u=e+b*(h-e)/s,d5(o,l,h,d,u),l=t+b*(i-t)/c,h=e+b*(r-e)/c;let x=e5({x:v,y:y},{x:d,y:u}),_=e5({x:v,y:y},{x:l,y:h});ig(o,x,_,v,y,n,n);break}case ic.Z:o&&d5(o,l,h,d,u),l=d,h=u}}return o&&o.length>2&&a.push(o),a}function d4(t,e){for(let i=0;i<t.length;i++){let r=t[i];for(let t=0;t<r.length;t+=2){let i=r[t],n=r[t+1],s={x:i,y:n};e.transformPoint({x:i,y:n},s),r[t]=s.x,r[t+1]=s.y}}}let d6=t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=(0,eB.Z)(t.width)?t.x1-t.x:t.width,i=(0,eB.Z)(t.height)?t.y1-t.y:t.height,r=0,n=0;return e<0?(r=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:r,y:n,width:e,height:i}};function d8(t,e,i){let r,n;let s=t/e;t>=e?(n=Math.ceil(Math.sqrt(i*s)),0===(r=Math.floor(i/n))&&(r=1,n=i)):(r=Math.ceil(Math.sqrt(i/s)),0===(n=Math.floor(i/r))&&(n=1,r=i));let a=[];for(let t=0;t<r;t++)a.push(n);let o=i-r*n;if(o>0)for(let t=0;t<o;t+=n)t+n<o?a.push(n):a.push(o-t);return a}let d7=(t,e)=>{let{width:i,height:r}=d6(t.attribute),n=d8(i,r,e),s=[],a=r/n.length;for(let t=0,e=n.length;t<e;t++){let e=n[t],r=i/e;for(let i=0;i<e;i++)s.push({x:0+i*r,y:0+t*a,width:r,height:a})}return s},d9=(t,e)=>{let i=t.getParsedAngle(),r=i.startAngle,n=i.endAngle,s=t.getComputedAttribute("innerRadius"),a=t.getComputedAttribute("outerRadius"),o=Math.abs(r-n),l=Math.abs(a-s),h=d8(o*(s+a)/2,l,e),d=[],u=l/h.length,c=a>=s?1:-1,p=n>=r?1:-1;for(let t=0,e=h.length;t<e;t++){let e=h[t],i=o/e;for(let n=0;n<e;n++)d.push({innerRadius:a-u*t*c,outerRadius:a-u*(t+1)*c,startAngle:r+i*n*p,endAngle:r+i*(n+1)*p})}return d},ut=(t,e)=>{let i=t.getComputedAttribute("startAngle"),r=t.getComputedAttribute("endAngle"),n=t.getComputedAttribute("radius"),s=Math.abs(i-r),a=d8(s*n,n,e),o=[],l=s/a[0],h=n/a.length,d=r>=i?1:-1;for(let t=0,e=a.length;t<e;t++)for(let e=0,r=a[t];e<r;e++)o.push({innerRadius:h*t,outerRadius:h*(t+1),startAngle:i+l*e*d,endAngle:i+l*(e+1)*d});return o},ue=(t,e)=>{let i=t.filter(t=>!1!==t.defined&&(0,iy.Z)(t.x)&&(0,iy.Z)(t.y));if(0===i.length)return[];if(1===i.length)return Array(e).fill(0).map(t=>i[0]);let r=[];if(e<=i.length){let t=i.length/e,n=0,s=0;for(;n<e;)r.push(i[Math.floor(s)]),s+=t,n++;return r}let n=e-i.length,s=1/(n/(i.length-1)+1),a=0;for(let e=0,i=t.length;e<i;e++)if(r.push(t[e]),e<i-1){let i=s,o=t[e].x,l=t[e].y,h=t[e+1].x,d=t[e+1].y;for(;i<1&&a<n;)r.push({x:o+(h-o)*i,y:l+(d-l)*i}),i+=s,a+=1}return r},ui=(t,e)=>{var i,r;let n=t.attribute,s=n.points,a=n.segments;s||(s=a.reduce((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])},[]));let o=s.filter(t=>!1!==t.defined&&(0,iy.Z)(t.x)&&(0,iy.Z)(t.y));if(!o.length)return[];let l=[];o.forEach(t=>{l.push({x:t.x,y:t.y})});for(let t=o.length-1;t>=0;t--){let e=o[t];l.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y})}let h=[];return uo(s,e,h),h},ur=(t,e)=>{let i=t.attribute,r=i.points;return r?ue(r,e):i.segments?ue(i.segments.reduce((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])},[]),e):[]},un=t=>t.map(t=>({x:t.x,y:t.y})),us=(t,e,i)=>{let r=t.length,n=[];for(let o=0;o<r;o++){var s,a;let l=t[o],h=o===r-1?t[0]:t[o+1],d=function(t,e,i,r){if(!e7(t,e,i,r))return!1;let n=[0,0],s=[0,0],a=[0,0];if(e8(n,e,t),e8(s,r,i),(0,eJ.Bw)(n,s))return!0;e8(a,i,t);let o=(0,eJ.ir)(a,s)/(0,eJ.ir)(n,s);return o>=0&&o<=1&&[t[0]+n[0]*o,t[1]+n[1]*o]}([e.x,e.y],[i.x,i.y],[l.x,l.y],[h.x,h.y]);d&&"boolean"!=typeof d&&n.push({dot:(s=[d[0]-e.x,d[1]-e.x],a=[i.x-e.x,i.y-e.x],s[0]*a[1]-s[1]*a[0]),point:{x:d[0],y:d[1]},edgeIndex:o})}if(n.length<2)return[un(t),un(t)];n.sort((t,e)=>t.dot-e.dot);let o=n[0],l=n[n.length-1];o.edgeIndex>l.edgeIndex&&([o,l]=[l,o]);let h=o.point,d=l.point,u=[{x:h.x,y:h.y}];for(let e=o.edgeIndex+1;e<=l.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:d.x,y:d.y});let c=[{x:d.x,y:d.y}];for(let e=l.edgeIndex+1,i=o.edgeIndex+r;e<=i;e++){let i=t[e%r];c.push({x:i.x,y:i.y})}return c.push({x:h.x,y:h.y}),[u,c]},ua=t=>{let e=new io;t.forEach(t=>{e.add(t.x,t.y)});let i=e.width(),r=e.height();if(i>=r){let r=e.x1+i/2;return us(t,{x:r,y:e.y1},{x:r,y:e.y2})}let n=e.y1+r/2;return us(t,{x:e.x1,y:n},{x:e.x2,y:n})},uo=(t,e,i)=>{if(1===e)i.push({points:t});else{let r=Math.floor(e/2),n=ua(t);uo(n[0],r,i),uo(n[1],e-r,i)}},ul=(t,e)=>{let i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:un(i)}];let r=[];return uo(i,e,r),r},uh=(t,e)=>{let i=d3(t.getParsedPathShape());if(!i.length||e<0)return[];let r=i.length;if(i.length>=e){let t=[],n=Math.floor(i.length/e);for(let s=0;s<e;s++){let a=i.slice(s*n,s===e-1?r:(s+1)*n);t.push({path:function(t){let e=new iK;for(let i=0;i<t.length;i++){let r=t[i];if(r.length>2){e.moveTo(r[0],r[1]);for(let t=2;t<r.length;t+=6)e.bezierCurveTo(r[t],r[t+1],r[t+2],r[t+3],r[t+4],r[t+5])}}return e}(a)})}return t}let n=[],s=Math.floor(e/r),a=e;for(let t=0;t<r;t++){let e=[];for(let r=2,n=i[t].length;r<n;r+=2)e.push({x:i[0][r],y:i[0][r+1]});uo(e,t===r-1?a:s,n),a-=s}return n},ud=(t,e,i)=>{t.forEach(t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){let r=nT(t.from,t.to,i,!1);r&&(e[t.key]=r)}})},uu=(t,e,i)=>{let r=[],n=[];e.clear();for(let s=0;s<t.length;s++){let a=t[s],o=a.from,l=a.to,h=a.rotation*i,d=a.fromCp,u=a.toCp,c=Math.sin(h),p=Math.cos(h);n[0]=d[0]+(u[0]-d[0])*i,n[1]=d[1]+(u[1]-d[1])*i;for(let t=0;t<o.length;t+=2){let e=o[t],s=o[t+1],a=e*(1-i)+l[t]*i,h=s*(1-i)+l[t+1]*i;r[t]=a*p-h*c+n[0],r[t+1]=a*c+h*p+n[1]}let g=r[0],f=r[1];e.moveTo(g,f);for(let t=2;t<o.length;t+=6){let i=r[t],n=r[t+1],s=r[t+2],a=r[t+3],o=r[t+4],l=r[t+5];g===i&&f===n&&s===o&&a===l?e.lineTo(o,l):e.bezierCurveTo(i,n,s,a,o,l),g=o,f=l}}},uc=(t,e,i)=>{let r=t?d3(t):[],n=d3(e);i&&r&&(i.fromTransform&&d4(r,i.fromTransform.clone().getInverse()),d4(r,i.toTransfrom));let[s,a]=function(t,e){let i,r;let n=[],s=[];for(let a=0;a<Math.max(t.length,e.length);a++){let o,l;let h=t[a],d=e[a];h?d?([o,l]=function(t,e){let i=t.length,r=e.length;if(i===r)return[t,e];let n=[],s=[],a=i<r?t:e,o=Math.min(i,r),l=Math.abs(r-i)/6,h=Math.ceil(l/((o-2)/6)),d=[a[0],a[1]],u=l;for(let t=2;t<o;t+=6){let e=a[t-2],i=a[t-1],r=a[t],o=a[t+1],l=a[t+2],c=a[t+3],p=a[t+4],g=a[t+5];if(u<=0){d.push(r,o,l,c,p,g);continue}let f=Math.min(u,h)+1;for(let t=1;t<=f;t++){let a=t/f;d0(e,r,l,p,a,n),d0(i,o,c,g,a,s),e=n[3],i=s[3],d.push(n[1],s[1],n[2],s[2],e,i),r=n[5],o=s[5],l=n[6],c=s[6]}u-=f-1}return a===t?[d,e]:[t,d]}(h,d),i=o,r=l):(l=d1(r,h),o=h):(o=d1(i,d),l=d),n.push(o),s.push(l)}return[n,s]}(r,n);return t?function(t,e,i,r){let n;let s=[];for(let a=0;a<t.length;a++){let o=t[a],l=e[a],h=d2(o),d=d2(l);null==n&&(n=h[2]<0!=d[2]<0);let u=[],c=[],p=0,g=1/0,f=[],m=o.length;n&&(o=function(t){let e=[],i=t.length;for(let r=0;r<i;r+=2)e[r]=t[i-r-2],e[r+1]=t[i-r-1];return e}(o));let v=6*function(t,e,i,r){let n=(t.length-2)/6,s=1/0,a=0,o=t.length,l=o-2;for(let h=0;h<n;h++){let n=6*h,d=0;for(let s=0;s<o;s+=2){let a=0===s?n:(n+s-2)%l+2,o=t[a]-i[0],h=t[a+1]-i[1],u=e[s]-r[0]-o,c=e[s+1]-r[1]-h;d+=u*u+c*c}d<s&&(s=d,a=h)}return a}(o,l,h,d),y=m-2;for(let t=0;t<y;t+=2){let e=(v+t)%y+2;u[t+2]=o[e]-h[0],u[t+3]=o[e+1]-h[1]}u[0]=o[v]-h[0],u[1]=o[v+1]-h[1],!0;{let t=r/i;for(let e=-r/2;e<=r/2;e+=t){let t=Math.sin(e),i=Math.cos(e),r=0;for(let e=0;e<o.length;e+=2){let n=u[e],s=u[e+1],a=l[e]-d[0],o=l[e+1]-d[1],h=a*i-o*t,c=a*t+o*i;f[e]=h,f[e+1]=c;let p=h-n,g=c-s;r+=p*p+g*g}if(r<g){g=r,p=e;for(let t=0;t<f.length;t++)c[t]=f[t]}}}s.push({from:u,to:c,fromCp:h,toCp:d,rotation:-p})}return s}(s,a,10,Math.PI):a.map((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0}))},up=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],ug=(t,e)=>{if(!t||!e)return null;let i=[],r=!1;return Object.keys(t).forEach(n=>{if(!up.includes(n))return;let s=e[n];(0,eB.Z)(s)||(0,eB.Z)(t[n])||s===t[n]||("fill"===n||"stroke"===n?i.push({from:"string"==typeof t[n]?nw.Get(t[n],oz.Color255):t[n],to:"string"==typeof s?nw.Get(s,oz.Color255):s,key:n}):i.push({from:t[n],to:s,key:n}),r=!0)}),r?i:null};class uf extends nr{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){let r=this.target,n="function"==typeof r.pathProxy?r.pathProxy(r.attribute):r.pathProxy;uu(this.morphingData,n,e),this.otherAttrs&&this.otherAttrs.length&&ud(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}let um=(t,e,i,r)=>{var n,s,a;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let o=null==t?void 0:t.globalTransMatrix;r&&o&&(o=r.clone().multiply(o.a,o.b,o.c,o.d,o.e,o.f));let l=uc(null===(n=null==t?void 0:t.toCustomPath)||void 0===n?void 0:n.call(t),e.toCustomPath(),{fromTransform:o,toTransfrom:e.globalTransMatrix}),h=ug(null==t?void 0:t.attribute,e.attribute),d=e.animate(i);return(null==i?void 0:i.delay)&&d.wait(i.delay),d.play(new uf({morphingData:l,otherAttrs:h},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:nh.duration,null!==(a=null==i?void 0:i.easing)&&void 0!==a?a:nh.easing)),d},uv=(t,e,i)=>{var r;let n=e.filter(t=>t&&t.toCustomPath&&t.valid);n.length||__DEV__&&console.error(n," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");let s=("clone"===(null==i?void 0:i.splitPath)?u_:null!==(r=null==i?void 0:i.splitPath)&&void 0!==r?r:uA)(t,n.length,!1),a=null==i?void 0:i.onEnd,o=n.length,l=()=>{0==--o&&a&&a()};n.forEach((e,r)=>{var a;let o=s[r],h=(null!==(a=null==i?void 0:i.delay)&&void 0!==a?a:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(r,n.length,o,e):0);um(o,e,Object.assign({},i,{onEnd:l,delay:h}),t.globalTransMatrix)})};class uy extends nr{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren(t=>{t.createPathProxy()}),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren(t=>{t.pathProxy=null})}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren((t,i)=>{var r;uu(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(r=this.otherAttrs)||void 0===r?void 0:r[i])&&this.otherAttrs[i].length&&ud(this.otherAttrs[i],t.attribute,e)}),t&&(this.clearPathProxy(),this.morphingData=null)}}let ub=t=>{let e={};return Object.keys(t).forEach(i=>{nK(i)||(e[i]=t[i])}),e},ux=(t,e,i)=>{let r=ub(t.attribute),n=t.attachShadow();if(e.length)n.setTheme({[e[0].type]:r}),e.forEach(t=>{n.appendChild(t)});else{let s=t.AABBBounds,a=s.width(),o=s.height();n.setTheme({rect:r}),Array(i).fill(0).forEach(t=>{let i=ru.graphicService.creator.rect({x:0,y:0,width:a,height:o});n.appendChild(i),e.push(i)})}},u_=(t,e,i)=>{let r=[],n=i?null:ub(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){let t={path:(new iK).fromCustomPath2D(s)};r.push(ru.graphicService.creator.path(i?t:Object.assign({},n,t)))}return i&&ux(t,r,e),r},uA=(t,e,i)=>{let r=[],n=i?null:ub(t.attribute);if("rect"===t.type)d7(t,e).forEach(t=>{r.push(ru.graphicService.creator.rect(i?t:Object.assign({},n,t)))});else if("arc"===t.type)d9(t,e).forEach(t=>{r.push(ru.graphicService.creator.arc(i?t:Object.assign({},n,t)))});else if("circle"===t.type)ut(t,e).forEach(t=>{r.push(ru.graphicService.creator.arc(i?t:Object.assign({},n,t)))});else if("line"===t.type){let s=ur(t,e),a={size:10,symbolType:"circle"};s.forEach(t=>{r.push(ru.graphicService.creator.symbol(i?Object.assign({},t,a):Object.assign({},n,t,a)))})}else"polygon"===t.type?ul(t,e).forEach(t=>{r.push(ru.graphicService.creator.polygon(i?t:Object.assign({},n,t)))}):"area"===t.type?ui(t,e).forEach(t=>{r.push(ru.graphicService.creator.polygon(i?t:Object.assign({},n,t)))}):"path"===t.type&&uh(t,e).forEach(t=>{"path"in t?r.push(ru.graphicService.creator.path(i?t:Object.assign({},n,t))):r.push(ru.graphicService.creator.polygon(i?t:Object.assign({},n,t)))});return i&&ux(t,r,e),r},uw=(t,e,i)=>{var r,n,s;let a=t.filter(t=>t.toCustomPath&&t.valid);a.length||__DEV__&&console.error(t," is not validate"),e.valid&&e.toCustomPath||__DEV__&&console.error(e," is not validate");let o=("clone"===(null==i?void 0:i.splitPath)?u_:null!==(r=null==i?void 0:i.splitPath)&&void 0!==r?r:uA)(e,a.length,!0),l=e.attribute;e.setAttribute("visible",!1);let h=a.map((t,e)=>uc(t.toCustomPath(),o[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:o[e].globalTransMatrix})),d=a.map((t,e)=>ug(t.attribute,l));if(null==i?void 0:i.individualDelay){let r=i.onEnd,n=a.length,s=()=>{0==--n&&(e.setAttributes({visible:!0,ratio:null},!1,{type:oR.ANIMATE_END}),e.detachShadow(),r&&r())};o.forEach((e,r)=>{var n,o,l;let u=(null!==(n=i.delay)&&void 0!==n?n:0)+i.individualDelay(r,a.length,t[r],e),c=e.animate(Object.assign({},i,{onEnd:s}));c.wait(u),c.play(new uf({morphingData:h[r],saveOnEnd:!0,otherAttrs:d[r]},null!==(o=i.duration)&&void 0!==o?o:nh.duration,null!==(l=i.easing)&&void 0!==l?l:nh.easing))})}else{let t=null==i?void 0:i.onEnd,r=i?Object.assign({},i):{};r.onEnd=()=>{e.setAttribute("visible",!0,!1,{type:oR.ANIMATE_END}),e.detachShadow(),t&&t()};let a=e.animate(r);(null==i?void 0:i.delay)&&a.wait(i.delay),a.play(new uy({morphingData:h,otherAttrs:d},null!==(n=null==i?void 0:i.duration)&&void 0!==n?n:nh.duration,null!==(s=null==i?void 0:i.easing)&&void 0!==s?s:nh.easing))}},uS=Symbol.for("key");class uT{diffGrammar(t,e){return function(t,e,i){let r={enter:[],exit:[],update:[]},n=new dS(t,i);return n.setCallback((t,e,i)=>{(0,eB.Z)(e)?r.exit.push({prev:i[0]}):(0,eB.Z)(i)?r.enter.push({next:e[0]}):r.update.push({next:e[0],prev:i[0]})}),n.setCurrentData(dw(e,i)),n.doDiff(),r}(t,e,t=>{var e;return null!==(e=t.id())&&void 0!==e?e:Symbol()})}diffMark(t,e,i){let r={enter:[],exit:[],update:[]},n=[],s=[];t.forEach(t=>{t.markType!==tF.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?n.push(t):r.exit.push({prev:[t]})}),e.forEach(t=>{t.markType!==tF.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?s.push(t):r.enter.push({next:[t]})});let a=this.diffUpdateByGroup(n,s,t=>t.getMorphConfig().morphKey,t=>t.getMorphConfig().morphKey);n=a.prev,s=a.next,r.update=r.update.concat(a.update);let o=this.diffUpdateByGroup(n,s,t=>t.id(),t=>t.id());n=o.prev,s=o.next,r.update=r.update.concat(o.update);let l=dw(n,t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)}),h=dw(s,t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)});return Object.keys(h).forEach(t=>{let e=l.data.get(t),i=h.data.get(t);if(e&&i){for(let t=0;t<Math.max(e.length,i.length);t+=1){let n=e[t],s=i[t];n&&s?r.update.push({prev:[n],next:[s]}):n?r.exit.push({prev:[n]}):s&&r.enter.push({next:[s]})}n=n.filter(t=>!e.includes(t)),s=s.filter(t=>!i.includes(t))}}),n.forEach(t=>r.exit.push({prev:[t]})),s.forEach(t=>r.enter.push({next:[t]})),r}_appendMorphKeyToElements(t){let e=t.getMorphConfig();if(!(0,eB.Z)(e.morphElementKey)){let i=lr(e.morphElementKey);t.elements&&t.elements.forEach(t=>{t.morphKey=i(t.getDatum())})}}morph(t,e,i){let r=t.reduce((t,e)=>(this._appendMorphKeyToElements(e),t.concat(e.elements)),[]),n=function(t,e,i){let r={enter:[],exit:[],update:[]},n=new dS(t,i);return n.setCallback((t,e,i)=>{(0,eB.Z)(e)?r.exit.push({prev:i}):(0,eB.Z)(i)?r.enter.push({next:e}):r.update.push({next:e,prev:i})}),n.setCurrentData(dw(e,i)),n.doDiff(),r}(r,e.reduce((t,e)=>(this._appendMorphKeyToElements(e),t.concat(e.elements)),[]),t=>{var e;return null!==(e=t.morphKey)&&void 0!==e?e:t.key});t.forEach(t=>{var e,i;return null===(i=null===(e=t.animate)||void 0===e?void 0:e.disable)||void 0===i?void 0:i.call(e)}),e.forEach(t=>{var e,i;return null===(i=null===(e=t.animate)||void 0===e?void 0:e.disable)||void 0===i?void 0:i.call(e)});let s=t.concat(e).reduce((t,e)=>(Object.assign(t,e.parameters()),t),{}),a=0,o=()=>{0==(a-=1)&&e.forEach(t=>{var e,i;null===(i=null===(e=t.animate)||void 0===e?void 0:e.enable)||void 0===i||i.call(e)})};n.enter.forEach(t=>{t.next.forEach(t=>{this.doMorph([],[t],i,o,s)}),a+=1}),n.update.forEach(t=>{let e=Math.min(t.prev.length,t.next.length),r=this.divideElements(t.prev,e),n=this.divideElements(t.next,e);for(let t=0;t<e;t++)this.doMorph(r[t],n[t],i,o,s),a+=1})}diffUpdateByGroup(t,e,i,r){let n=dw(t,t=>{var e;return null!==(e=i(t))&&void 0!==e?e:uS}),s=dw(e,t=>{var e;return null!==(e=r(t))&&void 0!==e?e:uS}),a=t,o=e,l=[];return s.keys.forEach(t=>{if(t!==uS){let e=n.data.get(t),i=s.data.get(t);e&&i&&(l.push({prev:e,next:i}),a=a.filter(t=>!e.includes(t)),o=o.filter(t=>!i.includes(t)))}}),{prev:a,next:o,update:l}}doMorph(t,e,i,r,n){var s,a;let o={prev:t.map(t=>t.getDatum()),next:e.map(t=>t.getDatum())},l={prev:t.slice(),next:e.slice()},h=i.animation.easing,d=lt(i.animation.delay,n,o,l),u=lt(i.animation.duration,n,o,l),c=lt(i.animation.oneByOne,n,o,l),p=lt(i.animation.splitPath,n,o,l),g=(0,eg.Z)(c)&&c>0?t=>(0,iy.Z)(c)?t*c:!0===c?t*u:0:void 0;1!==t.length&&0!==t.length||1!==e.length?1===t.length&&e.length>1?uv(t[0].getGraphicItem(),e.map(t=>t.getGraphicItem()),{delay:d,duration:u,easing:h,onEnd:r,individualDelay:g,splitPath:p}):t.length>1&&1===e.length&&uw(t.map(t=>t.getGraphicItem()),e[0].getGraphicItem(),{delay:d,duration:u,easing:h,onEnd:r,individualDelay:g,splitPath:p}):um(null===(a=null===(s=t[0])||void 0===s?void 0:s.getGraphicItem)||void 0===a?void 0:a.call(s),e[0].getGraphicItem(),{delay:d,duration:u,easing:h,onEnd:r})}divideElements(t,e){let i=Math.floor(t.length/e);return Array(e).fill(0).map((r,n)=>t.slice(i*n,n===e-1?t.length:i*(n+1)))}}class uk{constructor(t,e){this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}},this._size=0,this._mapKey=(0,ek.Z)(t)?e=>e[t]:t,this._warning=e}record(t){var e,i;let r=t.grammarType,n=this._mapKey(t);return this._grammarMap[r]?(this._grammars[r].push(t),(0,eB.Z)(n)||(this._grammarMap[r][n]?null===(e=this._warning)||void 0===e||e.call(this,n,t):this._grammarMap[r][n]=t)):(this._grammars.customized.push(t),(0,eB.Z)(n)||(this._grammarMap.customized[n]?null===(i=this._warning)||void 0===i||i.call(this,n,t):this._grammarMap.customized[n]=t)),this._size+=1,this}unrecord(t){let e=t.grammarType,i=this._mapKey(t);return this._grammarMap[e]?(this._grammars[e]=this._grammars[e].filter(e=>e!==t),(0,eB.Z)(i)||this._grammarMap[e][i]!==t||delete this._grammarMap[e][i]):(this._grammars.customized=this._grammars.customized.filter(e=>e!==t),(0,eB.Z)(i)||this._grammarMap.customized[i]!==t||delete this._grammarMap.customized[i]),this._size-=1,this}size(){return this._size}getSignal(t){var e;return null!==(e=this._grammarMap.signal[t])&&void 0!==e?e:null}getData(t){var e;return null!==(e=this._grammarMap.data[t])&&void 0!==e?e:null}getScale(t){var e;return null!==(e=this._grammarMap.scale[t])&&void 0!==e?e:null}getCoordinate(t){var e;return null!==(e=this._grammarMap.coordinate[t])&&void 0!==e?e:null}getMark(t){var e;return null!==(e=this._grammarMap.mark[t])&&void 0!==e?e:null}getCustomized(t){var e;return null!==(e=this._grammarMap.customized[t])&&void 0!==e?e:null}getGrammar(t){return this._grammarMap.data[t]?this._grammarMap.data[t]:this._grammarMap.signal[t]?this._grammarMap.signal[t]:this._grammarMap.scale[t]?this._grammarMap.scale[t]:this._grammarMap.coordinate[t]?this._grammarMap.coordinate[t]:this._grammarMap.mark[t]?this._grammarMap.mark[t]:this._grammarMap.customized[t]?this._grammarMap.customized[t]:null}getAllSignals(){return this._grammars.signal}getAllData(){return this._grammars.data}getAllScales(){return this._grammars.scale}getAllCoordinates(){return this._grammars.coordinate}getAllMarks(){return this._grammars.mark}getAllCustomized(){return this._grammars.customized}traverse(t){var e;Object.values(null!==(e=this._grammars)&&void 0!==e?e:{}).forEach(e=>(null!=e?e:[]).forEach(e=>{t.call(null,e)}))}find(t){let e=null;return this.traverse(i=>!0===t.call(null,i)&&(e=i,!0)),e}filter(t){let e=[];return this.traverse(i=>{!0===t.call(null,i)&&e.push(i)}),e}clear(){this._size=0,this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}}}release(){this._size=0,this._grammars=null,this._grammarMap=null}}class uB extends uk{constructor(){super(...arguments),this._markNodes=[]}record(t){if(super.record(t),"mark"===t.grammarType){let e={mark:t,parent:null,children:[]};this._markNodes.forEach(i=>{let r=i.mark;r.markType===tF.group&&r.includesChild(t,!1)?(i.children.push(e),e.parent=i):t.markType===tF.group&&t.includesChild(r,!1)&&(e.children.push(i),i.parent=e)}),this._markNodes.push(e)}return this}unrecord(t){if(super.unrecord(t),"mark"===t.grammarType){let e=this._markNodes.find(e=>e.mark===t);this._markNodes.forEach(i=>{let r=i.mark;r.markType===tF.group&&r.includesChild(t,!1)?(i.children=i.children.filter(t=>t!==e),e.parent=null):t.markType===tF.group&&t.includesChild(r,!1)&&(e.children=e.children.filter(t=>t!==i),i.parent=null)}),this._markNodes=this._markNodes.filter(t=>t!==e)}return this}getAllMarkNodes(){return this._markNodes}clear(){super.clear(),this._markNodes=[]}release(){super.release(),this._markNodes=null}}class uC{constructor(t){this._animations=[],this._additionalAnimateMarks=[],this.isEnabled=!0,this._onAnimationStart=t=>{this._additionalAnimateMarks=this._additionalAnimateMarks.filter(t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()}),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(tX.ALL_ANIMATION_START,{}),this._animations=this._animations.concat({config:t.animationConfig,mark:t.mark})},this._onAnimationEnd=t=>{this._additionalAnimateMarks=this._additionalAnimateMarks.filter(t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()}),this._animations=this._animations.filter(e=>e.config!==t.animationConfig||e.mark!==t.mark),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(tX.ALL_ANIMATION_END,{})},this._view=t,this._view.addEventListener(tX.ANIMATION_START,this._onAnimationStart),this._view.addEventListener(tX.ANIMATION_END,this._onAnimationEnd)}stop(){return this._view.traverseMarkTree(t=>{var e,i;t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))}),this._additionalAnimateMarks.forEach(t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))}),this._additionalAnimateMarks=[],this}pause(){return this._view.traverseMarkTree(t=>{var e,i;t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))}),this._additionalAnimateMarks.forEach(t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))}),this}resume(){return this._view.traverseMarkTree(t=>{var e,i;t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))}),this._additionalAnimateMarks.forEach(t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))}),this}enable(){return this.isEnabled=!0,this._view.traverseMarkTree(t=>{var e,i;t.animate&&(null===(i=(e=t.animate).enable)||void 0===i||i.call(e))}),this}disable(){return this.isEnabled=!1,this._view.traverseMarkTree(t=>{var e,i;t.animate&&(null===(i=(e=t.animate).disable)||void 0===i||i.call(e))}),this._additionalAnimateMarks.forEach(t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))}),this._additionalAnimateMarks=[],this}enableAnimationState(t){return this._view.traverseMarkTree(e=>{var i,r;e.animate&&(null===(r=(i=e.animate).enableAnimationState)||void 0===r||r.call(i,t))}),this}disableAnimationState(t){return this._view.traverseMarkTree(e=>{var i,r;e.animate&&(null===(r=(i=e.animate).disableAnimationState)||void 0===r||r.call(i,t))}),this}isAnimating(){return 0!==this._animations.length||this._additionalAnimateMarks.some(t=>{var e;return(null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating())||!1})}animate(){return this.isEnabled&&this._view.traverseMarkTree(t=>{t.isUpdated&&t.animate&&t.animate.animate(),t.cleanExitElements(),t.isUpdated=!1},null,!0),this}animateAddition(t){let e=t.animate.animate();return e&&e.isAnimating()&&this._additionalAnimateMarks.push(t),this}release(){this._additionalAnimateMarks=[],this._animations=[],this._view.removeEventListener(tX.ALL_ANIMATION_START,this._onAnimationStart),this._view.removeEventListener(tX.ALL_ANIMATION_END,this._onAnimationEnd),this._view=null}}class uE extends dF{addGraphicItem(t,e){let i=t&&t.limitAttrs,r=hJ(this,i&&("rich"===i.textType||i.text&&"rich"===i.text.type)?tF.richtext:tF.text,t);return super.addGraphicItem(t,e,r)}release(){super.release()}}uE.markType=tF.text;let uM={axis:{label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#89909d",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],start:{x:0,y:0},end:{x:100,y:0},x:0,y:0},circleAxis:{title:{space:4,padding:[0,0,0,0],textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1},text:"theta"},label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#6F6F6F",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],startAngle:0,endAngle:2*Math.PI,radius:100,innerRadius:0,center:{x:0,y:0},x:0,y:0},grid:{style:{stroke:"#f1f2f5"}},circleGrid:{style:{stroke:"#f1f2f5"}},discreteLegend:{layout:"vertical",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:10,spaceRow:10,shape:{space:4,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",stroke:"#D8D8D8",fillOpacity:.5}}},label:{space:4,style:{fontSize:12,fill:"black",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",fillOpacity:.5}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"},state:{selectedHover:{fillOpacity:.7,fill:"gray"},unSelectedHover:{fillOpacity:.2,fill:"gray"}}},focus:!1,focusIconStyle:{size:10,fill:"#333",cursor:"pointer"},visible:!0,padding:{top:2,bottom:2,left:2,right:2}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!1,items:[{index:0,id:"",label:"",shape:{fill:"#6690F2",stroke:"#6690F2",symbolType:"circle"}}]},colorLegend:{title:{visible:!1,text:""},colors:[],layout:"horizontal",railWidth:200,railHeight:8,railStyle:{cornerRadius:5}},sizeLegend:{title:{visible:!1,text:""},trackStyle:{fill:"#ccc"},layout:"horizontal",align:"bottom",railWidth:200,railHeight:6,min:0,max:1,value:[0,1]},lineCrosshair:{start:{x:0,y:0},end:{x:0,y:0}},rectCrosshair:{start:{x:0,y:0},end:{x:0,y:0},rectStyle:{width:10,height:10}},sectorCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:Math.PI/6},circleCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI},polygonCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI,sides:6},slider:{layout:"horizontal",railWidth:200,railHeight:10,railStyle:{cornerRadius:5},range:{draggableTrack:!0},startText:{visible:!0,text:"",space:8},endText:{visible:!0,text:"",space:8},min:0,max:1,value:[0,1]},dataLabel:{size:{width:400,height:400},dataLabels:[]},pointLabel:{data:[{text:"",fill:"#606773",data:{}}],overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},lineLabel:{type:"line",data:[{text:"",data:{}}],position:"start",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},areaLabel:{type:"area",data:[{text:"",data:{}}],position:"end",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},rectLabel:{type:"rect",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},symbolLabel:{type:"symbol",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{avoidBaseMark:!0,size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},arcLabel:{type:"arc",data:[{text:"",fill:"#606773",data:{}}],width:800,height:600,position:"outside",zIndex:302},lineDataLabel:{type:"line-data",data:[{text:""}],position:"top",overlap:{avoidBaseMark:!1,clampForce:!1},smartInvert:!1},datazoom:{orient:"bottom",showDetail:"auto",brushSelect:!0,start:0,end:1,position:{x:0,y:0},size:{width:500,height:40},previewData:[]},continuousPlayer:{},discretePlayer:{},tooltip:{},title:{textStyle:{fill:"#21252c"},subtextStyle:{fill:"#606773"}},scrollbar:{width:12,height:12,padding:[2,2],railStyle:{fill:"rgba(0, 0, 0, .1)"}}},uP={symbol:{shape:"circle",size:8},text:{fontSize:14,fill:"#000000"}},uO=Object.assign({},uM);uO.axis=Object.assign({},uO.axis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),uO.circleAxis=Object.assign({},uO.circleAxis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),uO.grid=Object.assign({},uO.grid,{style:{stroke:"#404349"}}),uO.circleGrid=Object.assign({},uO.circleGrid,{style:{stroke:"#404349"}}),uO.rectLabel=Object.assign({},uO.rectLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),uO.lineLabel=Object.assign({},uO.lineLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),uO.symbolLabel=Object.assign({},uO.symbolLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),uO.title=Object.assign({},uO.title,{textStyle:{fill:"#fdfdfd"},subtextStyle:{fill:"#888c93"}});class uR{static registerTheme(t,e){t&&uR._themes.set(t,e)}static unregisterTheme(t){uR._themes.delete(t)}static getTheme(t){return uR._themes.get(t)}static getDefaultTheme(){return uR.getTheme("default")}}uR._themes=new Map,uR.registerTheme("default",{name:"default",padding:5,palette:{default:["#6690F2","#70D6A3","#B4E6E2","#63B5FC","#FF8F62","#FFDC83","#BCC5FD","#A29BFE","#63C4C7","#F68484"]},marks:uP,components:uM}),uR.registerTheme("dark",{name:"dark",padding:5,background:"#202226",palette:{default:["#5383F4","#7BCF8E","#FF9D2C","#FFDB26","#7568D9","#80D8FB","#1857A3","#CAB0E8","#FF8867","#B9E493","#2CB4A8","#B9E4E3"]},marks:uP,components:uO});class uI extends dF{constructor(t,e,i,r){super(t,tF.component,i),this._componentDatum={key:0},this.componentType=e,this.spec.type="component",this.spec.componentType=e,this.mode=r,this._updateComponentEncoders()}configureComponent(t){return this.spec.componentConfig=t,this.commit(),this}addGraphicItem(t,e,i){let r=null!=i?i:ld.createGraphicComponent(this.componentType,t,{mode:this.mode,skipDefault:this.spec.skipTheme});return this.emit(tX.BEFORE_ADD_VRENDER_MARK,{graphicItem:r}),this.graphicParent.appendChild(r),this.emit(tX.AFTER_ADD_VRENDER_MARK,{graphicItem:r}),r}join(t){return super.join(t,"key")}encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(),this}parseRenderContext(){return{large:!1}}_prepareRejoin(){this._componentDatum.key+=1}evaluateJoin(t){return this.spec.key="key",t?(t.key=this._componentDatum.key,this._componentDatum=t):this._componentDatum={key:this._componentDatum.key},super.evaluateJoin([this._componentDatum])}_updateComponentEncoders(){this._encoders=this.spec.encode}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}}class uL extends ec(){static useRegisters(t){t.forEach(t=>{t()})}constructor(t={},e={}){super(),this._observer=null,this._onResize=em((...t)=>{let e=this._getContainerSize();e&&this.resize(e.width,e.height)},100),this.delegateEvent=(t,e)=>{var i;let r=null===(i=t.target)||void 0===i?void 0:i[l4],n=hZ(this,t,r,e,lD);this.emit(e,n,r)},this.handleProgressiveFrame=()=>{this._progressiveMarks.length&&this._progressiveMarks.forEach(t=>{t.isDoingProgressive()&&t.evaluateProgressive()}),this.doPreProgressive()},this._config=e,this._options=Object.assign({mode:"browser"},t),this.initialize()}getGrammarById(t){return this.grammars.getGrammar(t)}getSignalById(t){return this.grammars.getSignal(t)}getDataById(t){return this.grammars.getData(t)}getScaleById(t){return this.grammars.getScale(t)}getCoordinateById(t){return this.grammars.getCoordinate(t)}getMarkById(t){return this.grammars.getMark(t)}getCustomizedById(t){return this.grammars.getCustomized(t)}getGrammarsByName(t){return this.grammars.filter(e=>e.name()===t)}getGrammarsByType(t){return this.grammars.filter(e=>e.grammarType===t)}getMarksByType(t){return this.grammars.getAllMarks().filter(e=>e.markType===t)}getMarksByName(t){return this.grammars.getAllMarks().filter(e=>e.name()===t)}getMarksBySelector(t){if(!t)return null;let e=ex(t),i=[];return e.forEach(t=>{if(li(t))return void i.push(t);if("#"===t[0]){let e=this.getMarkById(t.slice(1));return void(e&&i.push(e))}let e="@"===t[0]?this.getMarksByName(t.slice(1)):hq(t)?this.getMarksByType(t):null;e&&e.length&&e.forEach(t=>{i.push(t)})}),i}updateSignal(t,e){(0,ek.Z)(t)&&(t=this.getSignalById(t)),t.set(e),this.commit(t)}signal(t,e){let i=new hH(this);return arguments.length>=1&&i.value(t),arguments.length>=2&&i.update(e),this.grammars.record(i),this._dataflow.add(i),i}data(t){let e=new lI(this,t);return this.grammars.record(e),this._dataflow.add(e),e}scale(t){let e=ld.createGrammar("scale",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}coordinate(t){let e=ld.createGrammar("coordinate",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}mark(t,e,i){let r;let n=(0,ek.Z)(e)?this.getMarkById(e):e;switch(t){case tF.group:r=new dG(this,n);break;case tF.glyph:r=new dK(this,null==i?void 0:i.glyphType,n);break;case tF.component:r=ld.hasComponent(null==i?void 0:i.componentType)?ld.createComponent(null==i?void 0:i.componentType,this,n,null==i?void 0:i.mode):new uI(this,null==i?void 0:i.componentType,n,null==i?void 0:i.mode);break;case tF.text:r=new uE(this,t,n);break;default:r=ld.hasMark(t)?ld.createMark(t,this,n):new dF(this,t,n)}return this.grammars.record(r),this._dataflow.add(r),r}group(t){return this.mark(tF.group,t)}glyph(t,e){return this.mark(tF.glyph,e,{glyphType:t})}component(t,e,i="2d"){return this.mark(tF.component,e,{componentType:t,mode:i})}axis(t,e="2d"){return this.mark(tF.component,t,{componentType:tG.axis,mode:e})}grid(t,e="2d"){return this.mark(tF.component,t,{componentType:tG.grid,mode:e})}legend(t){return this.mark(tF.component,t,{componentType:tG.legend})}slider(t){return this.mark(tF.component,t,{componentType:tG.slider})}label(t){return this.mark(tF.component,t,{componentType:tG.label})}datazoom(t){return this.mark(tF.component,t,{componentType:tG.datazoom})}player(t){return this.mark(tF.component,t,{componentType:tG.player})}title(t){return this.mark(tF.component,t,{componentType:tG.title})}scrollbar(t){return this.mark(tF.component,t,{componentType:tG.scrollbar})}customized(t,e){let i=ld.createGrammar(t,this,null==e?void 0:e.type);if(i)return i.parse(e),this.grammars.record(i),this._dataflow.add(i),i}addGrammar(t){return this.grammars.find(e=>e.uid===t.uid)||(this.grammars.record(t),this._dataflow.add(t),t.parse(t.getSpec()),this._needBuildLayoutTree=!0),this}removeGrammar(t){let e=(0,ek.Z)(t)?this.getGrammarById(t):t;return e&&this.grammars.find(t=>t.uid===e.uid)&&("mark"===e.grammarType&&e.prepareRelease(),this._cachedGrammars.record(e),this._dataflow.remove(e),this.grammars.unrecord(e),this._needBuildLayoutTree=!0),this}removeAllGrammars(){return this.grammars.traverse(t=>{"signal"===t.grammarType&&hV.includes(t.id())||"mark"===t.grammarType&&"root"===t.id()||this.removeGrammar(t)}),this}removeAllGraphicItems(){return this.traverseMarkTree(t=>{t.graphicItem&&(hQ(t.graphicItem),t.elementMap.forEach(t=>{t.resetGraphicItem()}),t.graphicItem=null)}),this}parseSpec(t){var e,i,r,n,s,a;if(this.emit(tX.BEFORE_PARSE_VIEW),this._spec=t,hY(t),t.theme?this.theme(t.theme):this.theme(uR.getDefaultTheme()),t.width&&this.width(t.width),t.height&&this.height(t.height),this.padding(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this._options.padding)&&void 0!==i?i:this._theme.padding),!this.width()||!this.height()){let t=this._getContainerSize();t&&(this.updateSignal(lN,t.width),this.updateSignal(lF,t.height))}(null===(r=t.signals)||void 0===r?void 0:r.length)&&t.signals.forEach(t=>{this.signal().parse(t)}),(null===(n=t.data)||void 0===n?void 0:n.length)&&t.data.forEach(t=>{this.data(null).parse(t)}),(null===(s=t.coordinates)||void 0===s?void 0:s.length)&&t.coordinates.forEach(t=>{var e;null===(e=this.coordinate(t.type))||void 0===e||e.parse(t)}),(null===(a=t.scales)||void 0===a?void 0:a.length)&&t.scales.forEach(t=>{var e;null===(e=this.scale(t.type))||void 0===e||e.parse(t)});let o=ld.getGrammars();return Object.keys(o).forEach(e=>{let{specKey:i}=o[e];t[i]&&t[i].length&&t[i].forEach(t=>{this.customized(e,t)})}),t.marks&&t.marks.length&&t.marks.forEach(t=>{this.parseMarkSpec(t)}),t.events&&t.events.length&&t.events.forEach(t=>{this.event(t)}),t.interactions&&t.interactions.length&&t.interactions.forEach(t=>{this.interaction(t.type,t)}),!1===t.animation?this.animate.disable():this.animate.enable(),this.emit(tX.AFTER_PARSE_VIEW),this._needBuildLayoutTree=!0,this._layoutState=tY.before,this}updateSpec(t){return this.removeAllInteractions(),this.removeAllGrammars(),this.parseSpec(t)}parseBuiltIn(){hW(this._options,this._config,this.getCurrentTheme()).forEach(t=>{let e=this.signal().parse(t);t.value&&e.set(t.value)}),this.parseMarkSpec({id:"root",type:"group",encode:{enter:{x:0,y:0},update:{width:{signal:"width"},height:{signal:"height"}}}}),this.rootMark=this.getMarkById("root")}parseMarkSpec(t){var e;let i=t.type===tF.glyph?{glyphType:t.glyphType}:t.type===tF.component?{componentType:t.componentType,mode:t.mode}:null;this.mark(t.type,t.group,i).parse(t),null===(e=t.marks)||void 0===e||e.forEach(t=>{this.parseMarkSpec(t)})}theme(t){var e,i,r,n,s,a;(0,ek.Z)(t)?this._theme=null!==(e=uR.getTheme(t))&&void 0!==e?e:uR.getDefaultTheme():this._theme=t;let{background:o,padding:l}=null!==(i=this._spec)&&void 0!==i?i:{};return this._theme?(this.background(null!==(r=null!=o?o:this._options.background)&&void 0!==r?r:this._theme.background),this.padding(null!==(n=null!=l?l:this._options.padding)&&void 0!==n?n:this._theme.padding),null===(a=null===(s=this.renderer.stage())||void 0===s?void 0:s.setTheme)||void 0===a||a.call(s,Object.assign({},this._theme.marks))):(this.background(null!=o?o:this._options.background),this.padding(null!=l?l:this._options.padding)),this}getCurrentTheme(){return this._theme}setCurrentTheme(t,e=!0){return this.theme(t),this.grammars.getAllMarks().forEach(t=>{t.commit()}),e?(this.evaluate(),this.renderer.render(!0)):this._dataflow.evaluate(),this}background(t){return arguments.length?(this._background=t,this.renderer.background(t),t):this._background}width(t){let e=this.getSignalById(lN);return arguments.length?(this._options.width=t,this.updateSignal(e,t),t):e.output()}height(t){let e=this.getSignalById(lF);return arguments.length?(this._options.height=t,this.updateSignal(e,t),t):e.output()}viewWidth(t){let e=this.getSignalById(lG);if(arguments.length){let e=this.padding();return this.width(t+e.left+e.right),t}return e.output()}viewHeight(t){let e=this.getSignalById(lz);if(arguments.length){let e=this.padding();return this.height(t+e.top+e.bottom),t}return e.output()}padding(t){let e=this.getSignalById(lZ);if(arguments.length){let i=h$(t);return this.updateSignal(e,i),i}return h$(e.output())}autoFit(t){let e=this.getSignalById(lU);return arguments.length?(this.updateSignal(e,t),t):e.output()}getViewBox(){let t=this.getSignalById(lH);return null==t?void 0:t.output()}updateLayoutTag(){return this._layoutState=tY.before,this}getLayoutState(){return this._layoutState}buildLayoutTree(){let t={},e=[];this.traverseMarkTree(i=>{t[i.id()]=!0,i.group&&t[i.group.id()]||e.push(i),i.markType===tF.group&&i.updateLayoutChildren()},t=>t.needLayout()),this._layoutMarks=e}doLayout(){var t;let e=this._options.doLayout||dX;e&&(null===(t=this._layoutMarks)||void 0===t?void 0:t.length)&&(this.emit(tX.BEFORE_DO_LAYOUT),e(this._layoutMarks,this._options,this),this.emit(tX.AFTER_DO_LAYOUT))}handleLayoutEnd(){this.emit(tX.BEFORE_MARK_LAYOUT_END),this._layoutMarks.forEach(t=>{l3(t,"layoutChildren",t=>{t.handleLayoutEnd()},e=>e!==t)}),this.emit(tX.AFTER_MARK_LAYOUT_END)}handleRenderEnd(){this.emit(tX.BEFORE_MARK_RENDER_END),l3(this.rootMark,"children",t=>{t.handleRenderEnd()}),this.emit(tX.AFTER_MARK_RENDER_END)}commit(t){return this._dataflow.commit(t),this}run(t){return this.evaluate(t),this}doRender(t){this.emit(tX.BEFORE_DO_RENDER),this.renderer&&(this._progressiveMarks||this.animate.animate(),this.renderer.render(t),this.handleRenderEnd()),this.emit(tX.AFTER_DO_RENDER)}evaluate(t){var e,i;let r=hX(t),n=this._cachedGrammars.size()>0;n&&(this.reuseCachedGrammars(r),this.detachCachedGrammar());let s=this._resizeRenderer(),a=this._dataflow.hasCommitted();return(n||a||this._layoutState||s)&&(this.clearProgressive(),this._dataflow.evaluate(),this._needBuildLayoutTree&&(this.buildLayoutTree(),this._needBuildLayoutTree=!1),this._layoutState&&(this._layoutState=tY.layouting,this.doLayout(),this._dataflow.hasCommitted()&&(this._layoutState=tY.reevaluate,this._dataflow.evaluate()),this._layoutState=tY.after,(null===(e=this._layoutMarks)||void 0===e?void 0:e.length)&&this.handleLayoutEnd()),this._layoutState=null,this.findProgressiveMarks(),this._resizeRenderer(),null===(i=this._willMorphMarks)||void 0===i||i.forEach(t=>{this._morph.morph(t.prev,t.next,r)}),this._willMorphMarks=null,this.releaseCachedGrammars(r),this.doRender(!0),this.doPreProgressive()),this}reuseCachedGrammars(t){if(this._willMorphMarks||(this._willMorphMarks=[]),t.reuse){let t=t=>{t.next.reuse(t.prev),t.prev.detachAll(),t.prev.clear(),this._cachedGrammars.unrecord(t.prev)};this._morph.diffGrammar(this._cachedGrammars.getAllSignals(),this.grammars.getAllSignals().filter(t=>!hV.includes(t.id()))).update.forEach(t),this._morph.diffGrammar(this._cachedGrammars.getAllData(),this.grammars.getAllData()).update.forEach(t),this._morph.diffGrammar(this._cachedGrammars.getAllScales(),this.grammars.getAllScales()).update.forEach(t),this._morph.diffGrammar(this._cachedGrammars.getAllCoordinates(),this.grammars.getAllCoordinates()).update.forEach(t)}this._morph.diffMark(this._cachedGrammars.getAllMarks(),this.grammars.getAllMarks().filter(t=>"root"!==t.id()),t).update.forEach(e=>{let i=1===e.prev.length&&1===e.next.length&&e.prev[0].markType===e.next[0].markType,r=e.prev.every(t=>t.getMorphConfig().morph)&&e.next.every(t=>t.getMorphConfig().morph);i&&t.reuse?(e.next[0].reuse(e.prev[0]),e.prev[0].detachAll(),e.prev[0].clear(),this._cachedGrammars.unrecord(e.prev[0])):(t.morph&&r||t.morphAll)&&this._willMorphMarks.push({prev:e.prev,next:e.next})})}detachCachedGrammar(){this._cachedGrammars.traverse(t=>{var e,i;t.detachAll(),"mark"===t.grammarType&&(null===(i=null===(e=t.group)||void 0===e?void 0:e.removeChild)||void 0===i||i.call(e,t))})}releaseCachedGrammars(t){this._cachedGrammars.traverse(t=>{"mark"!==t.grammarType&&t.release()});let e=this._cachedGrammars.getAllMarkNodes();e.forEach(e=>{e.mark.animate.stop(),t.enableExitAnimation&&this.animate.animateAddition(e.mark)});let i=t=>{if(t.mark.view&&0===t.mark.animate.getAnimatorCount()&&(!t.children||0===t.children.length)){t.mark.release();let e=t.parent;e&&(t.parent.children=t.parent.children.filter(e=>e!==t),t.parent=null,i(e))}};e.forEach(t=>{let e=t.mark;0===e.animate.getAnimatorCount()?i(t):e.addEventListener("animationEnd",()=>{0===e.animate.getAnimatorCount()&&i(t)})}),this._cachedGrammars.clear()}runAfter(t){return this._dataflow.runAfter(()=>{t.call(null,this)}),this}runBefore(t){return this._dataflow.runBefore(()=>{t.call(null,this)}),this}getImageBuffer(){var t,e;if("node"!==this._options.mode)return void this.logger.error(TypeError("getImageBuffer() now only support node environment."));let i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t);return i?(i.render(),i.window.getImageBuffer()):(this.logger.error(ReferenceError("render is not defined")),null)}traverseMarkTree(t,e,i){return l3(this.rootMark,"children",t,e,i),this}_bindResizeEvent(){var t,e,i,r,n,s;if(this.autoFit()){let a=null===(n=null===(r=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===r?void 0:r.getContainer)||void 0===n?void 0:n.call(r);if(a){let t=window.ResizeObserver;this._observer=new t(this._onResize),null===(s=this._observer)||void 0===s||s.observe(a)}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this.autoFit()&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}_getContainerSize(){var t,e,i,r,n,s,a,o,l,h,d;let u=null===(n=null===(r=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===r?void 0:r.getContainer)||void 0===n?void 0:n.call(r);if(u){let{width:t,height:e}=function(t,e=0,i=0){let r;if(!t)return{width:e,height:i};try{r=null==window?void 0:window.getComputedStyle}catch(t){r=()=>({})}let n=r(t);if(/^(\d*\.?\d+)(px)$/.exec(n.width)){let r=parseFloat(n.width)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)||t.clientWidth-1,s=parseFloat(n.height)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)||t.clientHeight-1;return{width:r<=0?e:r,height:s<=0?i:s}}return{width:e,height:i}}(u);return{width:null!==(o=null!==(a=null===(s=this._spec)||void 0===s?void 0:s.width)&&void 0!==a?a:this._options.width)&&void 0!==o?o:t,height:null!==(d=null!==(h=null===(l=this._spec)||void 0===l?void 0:l.height)&&void 0!==h?h:this._options.height)&&void 0!==d?d:e}}return null}resize(t,e,i=!0){let r=!1;return t!==this.width()&&(r=!0,this.updateSignal(lN,t)),e!==this.height()&&(r=!0,this.updateSignal(lF,e)),r&&(i?this.evaluate():this._dataflow.evaluate()),this}_resizeRenderer(){let t=this.width(),e=this.height();return!!this.renderer.shouldResize(t,e)&&(this.renderer.resize(t,e),this.emit("resize",{},{width:t,height:e}),!0)}bindEvents(t){if(this._eventConfig.disable)return;let{type:e,filter:i,callback:r,throttle:n,debounce:s,consume:a,target:o,dependency:l}=t,h=h2(e);if(!h)return;let{source:d,type:u}=h,c=h0(h),p=(Array.isArray(o)&&o.length?o.map(t=>({signal:this.getSignalById(t.target),callback:t.callback})):[{signal:(0,ek.Z)(o)?this.getSignalById(o):null,callback:r}]).filter(t=>t.signal||t.callback),g=o8(l,this),f=h1((t,e)=>{let r=d===lD&&function(t,e){let i=t.defaults,r=i.prevent,n=i.allow;return!1!==r&&!0!==n&&(!0===r||!1===n||(r?r[e]:!!n&&!n[e]))}(this._eventConfig,u)||a&&(void 0===t.cancelable||t.cancelable);d===lL&&(t=hZ(this,t,e,u,lL));let n=!1;if((!i||i(t))&&(!c||c(e))&&p.length){let e=g.reduce((t,e)=>(t[e.id()]=e.output(),t),{});p.forEach(i=>{i.callback&&i.signal?i.signal.set(i.callback(t,e))&&(this.commit(i.signal),n=!0):i.callback?i.callback(t,e):(this.commit(i.signal),n=!0)})}r&&t.preventDefault(),a&&t.stopPropagation(),n&&this.run()},{throttle:n,debounce:s});if(d===lD){if(function(t,e,i){let r=null==t?void 0:t[e];return!(!1===r||(0,ep.Z)(r)&&!r[i])}(this._eventConfig,lD,u))return this.addEventListener(u,f,lj),()=>{this.removeEventListener(u,f)}}else if(d===lL)return o2.addEventListener(u,f),this._eventListeners.push({type:u,source:o2,handler:f}),()=>{o2.removeEventListener(u,f);let t=this._eventListeners.findIndex(t=>t.type===u&&t.source===o2&&t.handler===f);t>=0&&this._eventListeners.splice(t,1)}}event(t){if("between"in t){let e;let[i,r]=t.between,n=`${i.type}-${t.type}-${r.type}`;this.bindEvents(Object.assign({},i,{callback:()=>{if(this._eventCache||(this._eventCache={}),!this._eventCache[n]){let e=this.bindEvents(t);this._eventCache[n]=e}e||(e=this.bindEvents(Object.assign({},r,{callback:()=>{this._eventCache[n]&&(this._eventCache[n](),this._eventCache[n]=null)}})))}}))}else"merge"in t?t.merge.forEach(e=>{let i=Object.assign({},t);(0,ek.Z)(e)?i.type=e:(0,ep.Z)(e)&&Object.assign(i,e),i.debounce=50,this.bindEvents(i)}):this.bindEvents(t)}interaction(t,e){let i=ld.createInteraction(t,this,e);return i&&(i.bind(),this._boundInteractions||(this._boundInteractions=[]),this._boundInteractions.push(i)),i}removeInteraction(t,e){if(this._boundInteractions){let i=this._boundInteractions.filter(i=>{var r;return(0,eB.Z)(e)?(0,ek.Z)(t)?i.type===t:t?i===t:void 0:(null===(r=i.options)||void 0===r?void 0:r.id)===e});i.length&&i.forEach(t=>{t.unbind()})}return this}removeAllInteractions(){return this._boundInteractions&&(this._boundInteractions.forEach(t=>{t.unbind()}),this._boundInteractions=null),this}initEvent(){let t=this.renderer.stage();t&&t.on("*",this.delegateEvent)}releaseStageEvent(){let t=this.renderer.stage();t&&t.off("*",this.delegateEvent)}addEventListener(t,e,i){let r=e;return i&&!1===i.trap||((r=e).raw=e),i&&i.target&&(r.target=i.target),this.on(t,r),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}initializeRenderer(){let t=this._options.width,e=this._options.height;this.renderer=new hF(this),this.renderer.initialize(t,e,this._options,this._eventConfig).background(this._background)}initialize(){var t,e;this.grammars=new uk(t=>t.id(),(t,e)=>this.logger.warn(`Grammar id '${t}' has been occupied`,e)),this._cachedGrammars=new uB(t=>t.id()),this._options.logger&&eC.Y.setInstance(this._options.logger),this.logger=eC.Y.getInstance(null!==(t=this._options.logLevel)&&void 0!==t?t:0),this._dataflow=new l5,this.animate=new uC(this),this._morph=new uT,this._options.hooks&&(Object.keys(this._options.hooks).forEach(t=>{this.on(t,this._options.hooks[t])}),this.hooks=this._options.hooks),this.container=null,this.renderer=null,this._eventListeners=[],this._eventConfig=function(t){let e=Object.assign({defaults:{}},t),i=(t,e)=>{e.forEach(e=>{(0,ev.Z)(t[e])&&(t[e]=t[e].reduce((t,e)=>(t[e]=!0,t),{}))})};return i(e.defaults,["prevent","allow"]),i(e,[lD,lL]),e}(this._options.eventConfig),this._theme=this._options.disableTheme?null:uR.getDefaultTheme(),this.parseBuiltIn(),(e=this._options).mode&&o2.setEnv(e.mode,e.modeParams||{}),this.initializeRenderer(),this._eventConfig.disable||this.initEvent(),this._bindResizeEvent(),this._needBuildLayoutTree=!0,this._layoutState=tY.before,this.theme(this._theme)}pauseProgressive(){return!1}resumeProgressive(){return!1}restartProgressive(){return!1}findProgressiveMarks(){let t=[];return this.traverseMarkTree(e=>{t.push(e)},t=>t.markType!==tF.group&&t.isProgressive()),t.length?(this._progressiveMarks=t,this.renderer&&this.renderer.combineIncrementalLayers(),t):(this._progressiveMarks=null,null)}doPreProgressive(){if(this._progressiveMarks&&this._progressiveMarks.some(t=>t.isDoingProgressive())){let t=o2.getRequestAnimationFrame();this._progressiveRafId=t(this.handleProgressiveFrame)}}clearProgressive(){this._progressiveRafId&&o2.getCancelAnimationFrame()(this._progressiveRafId),this._progressiveMarks&&this._progressiveMarks.length&&(this._progressiveMarks.forEach(t=>{t.clearProgressive()}),this._progressiveMarks=null)}release(){var t,e,i;this.removeAllInteractions(),this.releaseStageEvent(),this._unBindResizeEvent(),this.clearProgressive(),ld.unregisterRuntimeTransforms(),this.animate.stop(),this.grammars.release(),this._cachedGrammars.release(),this._dataflow.release(),this._dataflow=null,null===(e=null===(t=this.renderer)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this.renderer=null,this._boundInteractions=null,this.removeAllListeners(),null===(i=this._eventListeners)||void 0===i||i.forEach(t=>{t.source.removeEventListener(t.type,t.handler)}),this._eventListeners=null}}(M=t1||(t1={})).Identity="identity",M.Linear="linear",M.Log="log",M.Pow="pow",M.Sqrt="sqrt",M.Symlog="symlog",M.Time="time",M.Quantile="quantile",M.Quantize="quantize",M.Threshold="threshold",M.Ordinal="ordinal",M.Point="point",M.Band="band";let uD={};function uj(t){switch(t){case t1.Linear:case t1.Log:case t1.Pow:case t1.Sqrt:case t1.Symlog:case t1.Time:return!0;default:return!1}}function uN(t){switch(t){case t1.Ordinal:case t1.Point:case t1.Band:return!0;default:return!1}}Object.values(t1).forEach(t=>{uD[t]=!0});function uF(t){return Number(t)}function uG(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function uz(t,e,i=0,r){for((0,eB.Z)(r)&&(r=t.length);i<r;){let n=i+r>>>1;uG(t[n],e)>0?r=n:i=n+1}return i}function uZ(t){return t}let uH=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t),uU=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),uV=t=>t<0?-t*t:t*t,uW=t=>-Math.log(-t),u$=t=>-Math.exp(-t),uY=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,uX=t=>10===t?uY:t===Math.E?Math.exp:e=>Math.pow(t,e),uK=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),uq=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),uJ=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function uQ(t,e){if(t=Number(t),e=Number(e)-t)return i=>(i-t)/e;let i=Number.isNaN(e)?NaN:.5;return()=>i}function u0(t,e,i){let r,n;let s=t[0],a=t[1],o=e[0],l=e[1];return a<s?(r=uQ(a,s),n=i(l,o)):(r=uQ(s,a),n=i(o,l)),t=>n(r(t))}function u1(t,e,i){let r;return r=1===t?t+2*i:t-e+2*i,t?r>0?r:1:0}function u2(t,e){let i=(t[1]-t[0])/(e[1]-e[0]),r=t[0]-i*e[0];return[r,i+r]}function u5(t,e,i){let r=Math.min(t.length,e.length)-1,n=Array(r),s=Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)n[a]=uQ(t[a],t[a+1]),s[a]=i(e[a],e[a+1]);return function(e){let i=uz(t,e,1,r)-1;return s[i](n[i](e))}}let u3=(t,e)=>{let i=t.slice(),r=0,n=i.length-1,s=i[r],a=i[n];return a<s&&([r,n]=[n,r],[s,a]=[a,s]),i[r]=e.floor(s),i[n]=e.ceil(a),i},u4=(t,e=!1)=>{let i=Math.floor(Math.log10(t)),r=t/Math.pow(10,i);return(e?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10)*Math.pow(10,i)},u6=(t,e)=>{let i,r;return e[0]<e[1]?(i=e[0],r=e[1]):(i=e[1],r=e[0]),Math.min(Math.max(t,i),r)};class u8{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:eb(this._rangeFactorStart)&&eb(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=u2(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every(t=>t>=0&&t<=1)&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):eb(this._rangeFactorStart)&&eb(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return(0,eB.Z)(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0===t&&((0,eB.Z)(this._rangeFactorEnd)||1===this._rangeFactorEnd)?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1)),this)}rangeFactorEnd(t,e){var i;return(0,eB.Z)(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0===t&&((0,eB.Z)(this._rangeFactorStart)||0===this._rangeFactorStart)?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);let{distortion:e=2,radiusRatio:i=.1,radius:r}=this._fishEyeOptions,n=this.range(),s=n[0],a=n[n.length-1],o=Math.min(s,a),l=Math.max(s,a),h=nd(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,l),d=(0,eB.Z)(r)?(l-o)*i:r,u=Math.exp(e);u=u/(u-1)*d;let c=e/d;this._fishEyeTransform=t=>{let e=Math.abs(t-h);return e>=d?t:e<=1e-6?h:h+(t-h)*(u*(1-Math.exp(-e*c))/e*.75+.25)}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}let u7=Symbol("implicit");class u9 extends u8{specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=t1.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=u7}clone(){let t=(new u9).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){return eb(this._rangeFactorStart)&&eb(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){let e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let r=this._index.get(e);if(!r){if(this._unknown!==u7)return this._unknown;r=this._domain.push(t),this._index.set(e,r)}let n=this._ordinalRange[(r-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(n):n}invert(t){let e=0;for(;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}domain(t){if(!t)return this._domain.slice();for(let e of(this._domain=[],this._index=new Map,t)){let t=`${e}`;this._index.has(t)||this._index.set(t,this._domain.push(e))}return this}range(t){if(!t)return this._ordinalRange.slice();let e=Array.from(t);return this._ordinalRange=e,this}index(t){var e;return this._index&&null!==(e=this._index.get(`${t}`))&&void 0!==e?e:-1}}function ct(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}function ce(t,e,i,r){let n=[],s=t;for(;s<=e;)n.push(s),s+=i;return r&&n.reverse(),n}function ci(t,e,i,r){let n,s;if(e=Math.floor(+e),t=Math.floor(+t),!(i=Math.floor(+i)))return[];if(t===e)return[t];if(n=e<t){let i=t;t=e,e=i}let a=ct(1,e-t+1)(i);if(s=Math.floor((e-t+1)/a),!r)for(;Math.ceil((e-t+1)/s)>i&&a>1;)a-=1,s=Math.floor((e-t)/a);return ce(t,e,s,n)}class cr extends u9{constructor(t){super(),this.type=t1.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t,e){if(t)return this;this._wholeRange=null;let i=this._calculateWholeRange(this._range,e),r=super.domain().length,n=i[1]<i[0],s=i[Number(n)-0],a=i[1-Number(n)],o=u1(r,this._paddingInner,this._paddingOuter);return this._step=(a-s)/Math.max(1,o||1),this._round&&(this._step=Math.floor(this._step)),s+=(a-s-this._step*(r-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(s=Math.round(s),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:n,start:n?s+this._step*(r-1):s,count:r},this.generateFishEyeTransform(),this}scale(t){if(!this._bandRangeState)return;let e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let r=this._index.get(e);if(!r){if(this._unknown!==u7)return this._unknown;r=this._domain.push(t),this._index.set(e,r)}let{count:n,start:s,reverse:a}=this._bandRangeState,o=s+(r-1)%n*(a?-1:1)*this._step;return this._fishEyeTransform?this._fishEyeTransform(o):o}_calculateWholeRange(t,e){var i,r,n,s,a,o,l,h,d;if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){;let e,o,l;if(eb(this._rangeFactorStart)&&eb(this._rangeFactorEnd)&&2===t.length){let i=u2(t,[this._rangeFactorStart,this._rangeFactorEnd]);e=Math.abs(i[1]-i[0])}else e=Math.abs(t[1]-t[0]);let h=(i=super.domain().length,r=e,n=this._paddingInner,s=this._paddingOuter,a=this._round,o=r/Math.max(1,u1(i,n,s)||1),a&&(o=Math.floor(o)),l=o*(1-n),a&&(l=Math.round(l)),l);h<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):h>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=h,this._isFixed=!1)}if(this.isBandwidthFixed()){;let i=(o=super.domain().length,l=this._bandwidth,h=this._paddingInner,d=this._paddingOuter,1===h&&(h=0),u1(o,h,d)*(l/(1-h))*Math.sign(t[1]-t[0])),r=Math.min((t[1]-t[0])/i,1);if(eb(this._rangeFactorStart)&&eb(this._rangeFactorEnd)){if(i>0){let e=t[0]-i*this._rangeFactorStart;this._wholeRange=[e,e+i]}else{let e=t[1]+i*(1-this._rangeFactorEnd);this._wholeRange=[e-i,e]}let n=this._rangeFactorStart+r<=1,s=this._rangeFactorEnd-r>=0;"rangeFactorStart"===e&&n?this._rangeFactorEnd=this._rangeFactorStart+r:"rangeFactorEnd"===e&&s?this._rangeFactorStart=this._rangeFactorEnd-r:t[0]<=t[1]?n?this._rangeFactorEnd=this._rangeFactorStart+r:s?this._rangeFactorStart=this._rangeFactorEnd-r:(this._rangeFactorStart=0,this._rangeFactorEnd=r):s?this._rangeFactorStart=this._rangeFactorEnd-r:n?this._rangeFactorEnd=this._rangeFactorStart+r:(this._rangeFactorStart=1-r,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=r,this._wholeRange=[t[0],t[0]+i];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){let t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){let e=this._domain;if(eb(this._rangeFactorStart)&&eb(this._rangeFactorEnd)&&e.length){let i=this._getInvertIndex(t[0]),r=this._getInvertIndex(t[1]);return e.slice(Math.min(i,r),Math.max(i,r)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[uF(t[0]),uF(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[uF(t[0]),uF(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){let e=this.calculateVisibleDomain(this._range);return -1===t?e:ci(0,e.length-1,t,!1).map(t=>e[t])}tickData(t=10){return this.ticks(t).map((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])}))}forceTicks(t=10){let e=this.calculateVisibleDomain(this._range);return ci(0,e.length-1,t,!0).filter(t=>t<e.length).map(t=>e[t])}stepTicks(t){let e=this.calculateVisibleDomain(this._range);return(function(t,e,i){let r;if(i=ct(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+i)),r=e<t){let i=t;t=e,e=i}return ce(t,e,i,r)})(0,e.length-1,t).map(t=>e[t])}_getInvertIndex(t){let e=0,i=this.step()/2,r=this.bandwidth()/2,n=this._domain.length,s=this.range(),a=s[0]>s[s.length-1];for(e=0;e<n;e++){let s=this.scale(this._domain[e])+r;if(0===e&&(!a&&!dJ(t,s+i)||a&&!dQ(t,s-i))||e===n-1||!dQ(t,s-i)&&!dJ(t,s+i))break}return e>=0&&e<=n-1?e:n-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}step(){return this._step}round(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}align(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}rangeFactorStart(t,e){return(0,eB.Z)(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return(0,eB.Z)(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&(0,iy.Z)(this._userBandwidth)}clone(){var t,e,i;return new cr(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(i=this._maxBandwidth)&&void 0!==i?i:"auto")}}function cn(t,e,i){eb(e)||(e=t,t=0),eb(i)||(i=1);let r=-1,n=0|Math.max(0,Math.ceil((e-t)/i)),s=Array(n);for(;++r<n;)s[r]=t+r*i;return s}let cs=t=>{let e=null,i=null;return(...r)=>(e&&r.every((t,i)=>t===e[i])||(e=r,i=t(...r)),i)},ca=Math.sqrt(50),co=Math.sqrt(10),cl=Math.sqrt(2),ch=[1,2,5,10],cd=(t,e,i)=>{let r=1,n=t,s=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&a<1?r=cf(a).step:(i||a>1)&&(n=Math.floor(t)-s*r),r>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*r)),cn(0,e).map(t=>n+t*r)):t>0?cc(0,-(e-1)/r,r):cc((e-1)/r,0,r)},cu=cs((t,e,i,r)=>{let n,s,a,o,l=-1;if(i=+i,(t=+t)==(e=+e)||Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((n=e<t)&&(s=t,t=e,e=s),!isFinite(o=cm(t,e,i).step))return[];if(o>0){let i=Math.round(t/o),r=Math.round(e/o);for(i*o<t&&++i,r*o>e&&--r,a=Array(s=r-i+1);++l<s;)a[l]=(i+l)*o}else if(o<0&&(null==r?void 0:r.noDecimals)){o=1;let i=Math.ceil(t),r=Math.floor(e);if(!(i<=r))return[];for(a=Array(s=r-i+1);++l<s;)a[l]=i+l}else{let i=Math.round(t*(o=-o)),r=Math.round(e*o);for(i/o<t&&++i,r/o>e&&--r,a=Array(s=r-i+1);++l<s;)a[l]=(i+l)/o}return n&&a.reverse(),a}),cc=(t,e,i)=>{let r,n,s=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*i<t&&++a,(o-1)*i>e&&--o,n=Array(r=o-a+1);++s<r;)n[s]=(a+s)*i}else{let a=Math.floor(t*(i=-i)),o=Math.ceil(e*i);for((a+1)/i<t&&++a,(o-1)/i>e&&--o,n=Array(r=o-a+1);++s<r;)n[s]=(a+s)/i}return n},cp=(t,e,i)=>{let r;let n=t[0],s=t[t.length-1],a=e-t.length;if(s<=0){let e=[];for(r=a;r>=1;r--)e.push(n-r*i);return e.concat(t)}if(n>=0){for(r=1;r<=a;r++)t.push(s+r*i);return t}let o=[],l=[];for(r=1;r<=a;r++)r%2==0?o=[n-Math.floor(r/2)*i].concat(o):l.push(s+Math.ceil(r/2)*i);return o.concat(t).concat(l)},cg=cs((t,e,i,r)=>{let n,s,a;if(i=+i,(t=+t)==(e=+e)||Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return cd(t,i,null==r?void 0:r.noDecimals);(n=e<t)&&(a=t,t=e,e=a);let o=cm(t,e,i),l=o.step;if(!isFinite(l))return[];if(l>0){let r=1,{power:n,gap:a}=o,h=10===a?2*10**n:1*10**n;for(;r<=5&&(s=cc(t,e,l)).length>i+1&&i>2;)l+=h,r+=1;i>2&&s.length<i-1&&(s=cp(s,i,l))}else(null==r?void 0:r.noDecimals)&&l<0&&(l=1),s=cc(t,e,l);return n&&s.reverse(),s}),cf=t=>{let e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e,r=1;return i>=ca?r=10:i>=co?r=5:i>=cl&&(r=2),e>=0?{step:r*10**e,gap:r,power:e}:{step:-(10**-e)/r,gap:r,power:e}};function cm(t,e,i){return cf((e-t)/Math.max(0,i))}function cv(t,e,i){let r;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(r=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(r))return[];let n=Array(i);for(let e=0;e<i;e++)n[e]=t+e*r;return n}function cy(t,e,i){let r,n,s=-1;if(i=+i,(n=(e=+e)<(t=+t))&&(r=t,t=e,e=r),!isFinite(i)||e-t<=i)return[t];let a=Math.floor((e-t)/i+1),o=Array(a);for(;++s<a;)o[s]=t+s*i;return n&&o.reverse(),o}function cb(t,e=10){let i,r,n=0,s=t.length-1,a=t[n],o=t[s],l=10;for(o<a&&(r=a,a=o,o=r,r=n,n=s,s=r);l-- >0;){if((r=cm(a,o,e).step)===i)return t[n]=a,t[s]=o,t;if(r>0)a=Math.floor(a/r)*r,o=Math.ceil(o/r)*r;else{if(!(r<0))break;a=Math.ceil(a*r)/r,o=Math.floor(o*r)/r}i=r}}function cx(t,e){let i=(0,iy.Z)(e.forceMin),r=(0,iy.Z)(e.forceMax),n=null,s=[],a=null,o=i&&r?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:r?t=>t<=e.forceMax:null;return i?s[0]=e.forceMin:(0,iy.Z)(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(s[0]=e.min),r?s[1]=e.forceMax:(0,iy.Z)(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(s[1]=e.max),(0,iy.Z)(s[0])&&(0,iy.Z)(s[1])?((a=t.slice())[0]=s[0],a[a.length-1]=s[1]):n=(0,iy.Z)(s[0])||(0,iy.Z)(s[1])?(0,iy.Z)(s[0])?"max":"min":"all",{niceType:n,niceDomain:a,niceMinMax:s,domainValidator:o}}let c_=(t,e,i)=>1>Math.abs(e-t)?+i.toFixed(1):Math.round(+i),cA=cs((t,e,i,r,n,s,a)=>{let o=t,l=e,h=l<o;h&&([o,l]=[l,o]);let d,u,c=n(o),p=n(l),g=[];if(!(r%1)&&p-c<i){if(c=Math.floor(c),p=Math.ceil(p),o>0){for(;c<=p;++c)for(d=1;d<r;++d)if(!((u=c<0?d/s(-c):d*s(c))<o)){if(u>l)break;g.push(u)}}else for(;c<=p;++c)for(d=r-1;d>=1;--d)if(!((u=c>0?d/s(-c):d*s(c))<o)){if(u>l)break;g.push(u)}2*g.length<i&&(g=cg(o,l,i))}else g=cg(c,p,Math.min(p-c,i)).map(s);return g=g.filter(t=>0!==t),(null==a?void 0:a.noDecimals)&&(g=Array.from(new Set(g.map(t=>Math.floor(t))))),h?g.reverse():g}),cw=cs((t,e,i,r,n,s)=>{let a=[],o={},l=n(t),h=n(e),d=[];if(Number.isInteger(r))d=cg(l,h,i);else{let t=(h-l)/(i-1);for(let e=0;e<i;e++)d.push(l+e*t)}return d.forEach(i=>{let n=s(i),l=Number.isInteger(r)?c_(t,e,n):c_(t,e,u4(n)),h=c_(t,e,u6(l,[t,e]));o[h]||isNaN(h)||!(d.length>1)||(o[h]=1,a.push(h))}),a}),cS=cs((t,e,i,r,n)=>cv(r(t),r(e),i).map(t=>u4(n(t))));function cT(t){let e="",i="",r="",n="#"===t[0]?1:0;for(let s=n;s<t.length;s++)"#"!==t[s]&&(s<n+2?e+=t[s]:s<n+4?i+=t[s]:s<n+6&&(r+=t[s]));return[parseInt(e,16),parseInt(i,16),parseInt(r,16)]}function ck(t,e,i){return Number(0x1000000+(t<<16)+(e<<8)+i).toString(16).slice(1)}function cB(t,e){let i=t.r,r=e.r,n=t.g,s=e.g,a=t.b,o=e.b,l=t.opacity,h=e.opacity;return t=>new nA(Math.round(i*(1-t)+r*t),Math.round(n*(1-t)+s*t),Math.round(a*(1-t)+o*t),l*(1-t)+h*t)}function cC(t,e){return i=>t*(1-i)+e*i}function cE(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}cs((t,e,i,r,n)=>cy(r(t),r(e),i).map(t=>u4(n(t))));RegExp(/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g.source,"g");let{interpolateRgb:cM}=eh;function cP(t,e){let i;let r=typeof e;if((0,eB.Z)(e)||"boolean"===r)return()=>e;if("number"===r)return cC(t,e);if("string"===r){if(i=n_.parseColorString(e)){let e=cM(n_.parseColorString(t),i);return t=>e(t).formatRgb()}return cC(Number(t),Number(e))}return e instanceof nA?cM(t,e):e instanceof n_?cM(t.color,e.color):e instanceof Date?function(t,e){let i=t.valueOf(),r=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+r*t),n)}(t,e):cC(Number(t),Number(e))}class cO extends u8{constructor(t=uZ,e=uZ){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=uZ,this._piecewise=u0,this._interpolate=cP}calculateVisibleDomain(t){var e;return eb(this._rangeFactorStart)&&eb(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(Number.isNaN(t=Number(t))||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));let i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),cC)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;let r=Array.from(t,uF);return this._domain=r,this.rescale(e)}range(t,e){if(!t)return this._range.slice();let i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){let i=Array.from(t);return this._range=i,this._interpolate=cE,this.rescale(e)}rescale(t){var e;if(t)return this;let i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,r=i.length,n=this._range.length,s=Math.min(r,n);if(r&&r<n&&this._forceAlign){let t=n-r+1,e=i[r-1],a=r>=2?(e-i[r-2])/t:0;for(let n=1;n<=t;n++)i[r-2+n]=e-a*(t-n);s=n}return this._autoClamp&&(this._clamp=ct(i[0],i[s-1])),this._piecewise=s>2?u5:u0,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:uZ),this.rescale(i)):this._clamp!==uZ}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){let e=this.ticks(t);return(null!=e?e:[]).map((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])}))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return(0,eB.Z)(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return(0,eB.Z)(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}class cR extends cO{constructor(){super(...arguments),this.type=t1.Linear}clone(){return(new cR).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){let i=this.calculateVisibleDomain(this._range);return cu(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(r6(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(eb(this._rangeFactorStart)&&eb(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);let r=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,s=r[0],a=r[r.length-1],o=cg(n[0],n[n.length-1],t,e);if(!o.length)return o;if(this._domainValidator)o=o.filter(this._domainValidator);else if((o[0]!==s||o[o.length-1]!==a)&&this._niceType){let t=r.slice();if("all"===this._niceType?(t[0]=o[0],t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&o[0]!==s?(t[0]=o[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&o[o.length-1]!==a&&(t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){let e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);o=o.filter(t=>t>=e&&t<=i)}}return o}forceTicks(t=10){let e=this.calculateVisibleDomain(this._range);return cv(e[0],e[e.length-1],t)}stepTicks(t){let e=this.calculateVisibleDomain(this._range);return cy(e[0],e[e.length-1],t)}nice(t=10,e){var i,r;let n=this._domain,s=[];if(e){let t=cx(n,e);if(s=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){let e=cb(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=s[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(r=s[0])&&void 0!==r?r:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";let e=this._domain[this._domain.length-1],i=cb(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";let e=this._domain[0],i=cb(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}function cI(t,e,i=!0){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){let r=Object.getOwnPropertyNames(e);for(let n=0;n<r.length;n++){let s=r[n];"constructor"!==s&&(i?null!=e[s]:null==t[s])&&(t[s]=e[s])}}else!function(t,e,i){let r=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);let e=[];for(let i in t)t.hasOwnProperty(i)&&e.push(i);return e}(e);for(let n=0;n<r.length;n++){let s=r[n];(i?null!=e[s]:null==t[s])&&(t[s]=e[s])};}(t,e,i)}class cL{nice(t=10,e){var i,r,n,s;let a=this._domain,o=[],l=null;if(e){let t=cx(a,e);if(o=t.niceMinMax,this._domainValidator=t.domainValidator,l=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else l="all";if(l){let t=u3(a.slice(),null!==(r=null===(i=this.getNiceConfig)||void 0===i?void 0:i.call(this))&&void 0!==r?r:{floor:t=>Math.floor(t),ceil:t=>Math.ceil(t)});return"min"===l?t[t.length-1]=null!==(n=o[1])&&void 0!==n?n:t[t.length-1]:"max"===l&&(t[0]=null!==(s=o[0])&&void 0!==s?s:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){let t=this._domain[this._domain.length-1];this.nice();let e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){let t=this._domain[0];this.nice();let e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function cD(t){return e=>-t(-e)}function cj(t=Number.EPSILON){return e=>Math.max(e,t)}class cN extends cO{constructor(){super(uK(10),uX(10)),this.type=t1.Log,this._limit=cj(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new cN).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){var e,i,r;if(t)return this;super.rescale();let n=uK(this._base),s=uX(this._base);return(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain)[0]<0?(this._logs=(i=n,t=>-i(-t)),this._pows=(r=s,t=>-r(-t)),this._limit=function(t=Number.EPSILON){return e=>Math.min(e,-t)}(),this.transformer=uW,this.untransformer=u$):(this._logs=n,this._pows=s,this._limit=cj(),this.transformer=this._logs,this.untransformer=s),this}scale(t){var e;if(Number.isNaN(t=Number(t))||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));let i=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(i):i}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return uZ}d3Ticks(t=10,e){let i=this.domain(),r=this._limit(i[0]);return cA(r,this._limit(i[i.length-1]),t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){let e=this.calculateVisibleDomain(this._range);return cw(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){let e=this.calculateVisibleDomain(this._range);return cS(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){let e=this.calculateVisibleDomain(this._range);return cS(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}getNiceConfig(){return{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))}}}cI(cN,cL);class cF extends cr{constructor(t){super(!1),this.type=t1.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}}class cG extends cR{constructor(){super(),this.type=t1.Pow,this._exponent=1}clone(){return(new cG).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).exponent(this._exponent)}rescale(t){return t||(1===this._exponent?(this.transformer=uZ,this.untransformer=uZ):.5===this._exponent?(this.transformer=uU,this.untransformer=uV):(this.transformer=uH(this._exponent),this.untransformer=uH(1/this._exponent)),super.rescale()),this}exponent(t,e){return arguments.length?(this._exponent=t,this.rescale(e)):this._exponent}}function cz(t,e,i=uF){let r=t.length;if(!r)return;if(e<=0||r<2)return i(t[0],0,t);if(e>=1)return i(t[r-1],r-1,t);let n=(r-1)*e,s=Math.floor(n),a=i(t[s],s,t);return a+(i(t[s+1],s+1,t)-a)*(n-s)}class cZ{constructor(){this.type=t1.Quantile,this._range=[],this._domain=[],this._thresholds=[]}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}rescale(t){if(t)return this;let e=0,i=Math.max(1,this._range.length);for(this._thresholds=Array(i-1);++e<i;)this._thresholds[e-1]=cz(this._domain,e/i);return this}scale(t){return(0,eg.Z)(t)?this._range[uz(this._thresholds,t)]:this._unknown}invertExtent(t){let e=this._range.indexOf(t);return e<0?[NaN,NaN]:[e>0?this._thresholds[e-1]:this._domain[0],e<this._thresholds.length?this._thresholds[e]:this._domain[this._domain.length-1]]}quantiles(){return this._thresholds.slice()}domain(t,e){if(!t)return this._domain.slice();for(let e of(this._domain=[],t))(0,eB.Z)(e)||Number.isNaN(+e)||this._domain.push(+e);return this._domain.sort(uG),this.rescale(e)}range(t,e){if(!t)return this._range.slice();let i=Array.from(t);return eS(this._range,i)?this:(this._range=i,this.rescale(e))}clone(){return(new cZ).domain(this._domain,!0).range(this._range).unknown(this._unknown)}}class cH{constructor(){this.type=t1.Quantile,this._range=[0,1],this._domain=[.5],this.x0=0,this.x1=1,this.n=1}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}rescale(t){if(t)return this;let e=-1;for(this._domain=Array(this.n);++e<this.n;)this._domain[e]=((e+1)*this.x1-(e-this.n)*this.x0)/(this.n+1);return this}scale(t){return(0,eg.Z)(t)?this._range[uz(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){let e=this._range.indexOf(t);return e<0?[NaN,NaN]:e<1?[this.x0,this._domain[0]]:e>=this.n?[this._domain[this.n-1],this.x1]:[this._domain[e-1],this._domain[e]]}thresholds(){return this._domain.slice()}domain(t,e){if(!t)return[this.x0,this.x1];let i=Array.from(t);return this.x0=+i[0],this.x1=+i[1],this.rescale(e)}range(t,e){if(!t)return this._range.slice();let i=Array.from(t);return eS(this._range,i)?this:(this.n=i.length-1,this._range=i,this.rescale(e))}clone(){return(new cH).domain([this.x0,this.x1],!0).range(this._range).unknown(this._unknown)}ticks(t=10){let e=this.domain();return cg(e[0],e[e.length-1],t)}forceTicks(t=10){let e=this.domain();return cv(e[0],e[e.length-1],t)}stepTicks(t){let e=this.domain();return cy(e[0],e[e.length-1],t)}nice(t=10){let e=cb(this.domain(),t);return e?this.domain(e):this}niceMin(t=10){let e=this._domain[this._domain.length-1],i=cb(this.domain(),t);return i&&(i[i.length-1]=e,this.domain(i)),this}niceMax(t=10){let e=this._domain[0],i=cb(this.domain(),t);return i&&(i[0]=e,this.domain(i)),this}}class cU extends cR{constructor(){super(uU,uV),this.type=t1.Sqrt}clone(){return(new cU).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}class cV extends cR{constructor(){super(uq(1),uJ(1)),this.type=t1.Symlog,this._const=1}clone(){return(new cV).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=uq(t),this.untransformer=uJ(t),this.rescale(e)):this._const}d3Ticks(t=10,e){let i=this.domain(),r=i[0];return cA(r,i[i.length-1],t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){let e=this.calculateVisibleDomain(this._range);return cw(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){let e=this.calculateVisibleDomain(this._range);return cS(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){let e=this.calculateVisibleDomain(this._range);return cS(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}cI(cV,cL);class cW{constructor(){this.type=t1.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!(0,eB.Z)(t)&&(0,eg.Z)(+t)?this._range[uz(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){let e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}domain(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}range(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}clone(){return(new cW).domain(this._domain).range(this._range).unknown(this._unknown)}}var c$=i("824100"),cY=i("11959"),cX=i("156597");let cK=Math.sqrt(50),cq=Math.sqrt(10),cJ=Math.sqrt(2);function cQ(t,e,i){let r=Math.abs(e-t)/Math.max(0,i),n=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),s=r/n;return s>=cK?n*=10:s>=cq?n*=5:s>=cJ&&(n*=2),e<t?-n:n}let c0=[["second",1,cX.sh],["second",5,5*cX.sh],["second",10,10*cX.sh],["second",30,30*cX.sh],["minute",1,cX.EB],["minute",5,5*cX.EB],["minute",10,10*cX.EB],["minute",30,30*cX.EB],["hour",1,cX.kr],["hour",3,3*cX.kr],["hour",6,6*cX.kr],["hour",12,12*cX.kr],["day",1,cX.x4],["day",2,2*cX.x4],["day",7,7*cX.x4],["month",1,cX.vc],["month",3,3*cX.vc],["month",6,6*cX.vc],["year",1,365*cX.x4]];function c1(t){return+(0,c$.Z)(t)}function c2(t,e,i,r){let n=(+e-+t)/i,s=uz(c0.map(t=>t[2]),n);if(s===c0.length){let n=Math.max(cQ(+t/cX.oP,+e/cX.oP,i),1),s=t=>(t[(0,cY.xL)(r)](Math.floor(t[(0,cY.sx)(r)]()/n)*n),t[(0,cY.vh)(r)](0,1),t[(0,cY.En)(r)](0,0,0,0),t),a=(t,e)=>(t[(0,cY.xL)(r)](t[(0,cY.sx)(r)]()+e*n),t);return{floor:s,offset:a,ceil:(0,cX.OU)(s,a)}}if(0===s){let r=Math.max(cQ(+t,+e,i),1),n=t=>(t.setTime(Math.floor(+t/r)*r),t),s=(t,e)=>(t.setTime(+t+e*r),t);return{floor:n,offset:s,ceil:(0,cX.OU)(n,s)}}let[a,o]=c0[n/c0[s-1][2]<c0[s][2]/n?s-1:s],l=(0,cX.Rd)(a,r);return(0,cX.fQ)(o,l)}class c5 extends cO{constructor(t=!1){super(),this.type=t1.Time,this._domain=t?[Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]:[+new Date(2e3,0,1),+new Date(2e3,0,2)],this._isUtc=t}invert(t){return new Date(super.invert(t))}domain(t,e){if(!t)return this._domain.map(c$.Z);let i=Array.from(t,c1);return this._domain=i,this.rescale(e)}ticks(t){let e=this.domain(),i=e[0],r=e[e.length-1],n=r<i;n&&([i,r]=[r,i]);let s=t;((0,iy.Z)(t)||(0,eB.Z)(t))&&(s=c2(i,r,(0,eB.Z)(t)?10:t,this._isUtc));let a=[],o=+(i=s.ceil(i)),l=0;for(;o<=+r&&l<100;)a.push(new Date(o)),o=+s.offset(new Date(o),1),l++;return n?a.reverse():a}tickFormat(t,e){return(0,cY.bt)(null==e?(0,cY.Hr)(this._domain[0],this._isUtc):e,this._isUtc)}clone(){return new c5(this._isUtc).domain(this.domain(),!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}nice(t){let e=this.domain(),i=t;return((0,iy.Z)(t)||(0,eB.Z)(t))&&(i=c2(e[0],e[e.length-1],(0,eB.Z)(t)?10:t,this._isUtc)),i&&this.domain(u3(e,i)),this}utc(){return this._isUtc}}let c3=Symbol("implicit");class c4{constructor(){this.type=t1.Identity}specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}clone(){return(new c4).unknown(this._unknown).domain(this._domain).specified(this._specified)}scale(t){let e=`${t}`,i=this._getSpecifiedValue(e);return void 0!==i?i:this._unknown!==c3&&this._domain&&!this._domain.includes(t)?this._unknown:t}invert(t){return t}domain(t){return t?(this._domain=t,this):this._domain?this._domain.slice():void 0}range(t){return t?this:this._domain?this._domain.slice():void 0}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}}function c6(t){switch(t){case"band":return new cr;case"linear":break;case"log":return new cN;case"ordinal":return new u9;case"point":return new cF;case"pow":return new cG;case"quantile":return new cZ;case"quantize":return new cH;case"sqrt":return new cU;case"symlog":return new cV;case"threshold":return new cW;case"time":return new c5;case"utc":return new c5(!0);case"identity":return new c4}return new cR}function c8(t){return!(0,eB.Z)(null==t?void 0:t.data)}function c7(t,e){var i;if((0,ek.Z)(t.data)){let i=e.getGrammarById(t.data);return i?[i]:[]}return"data"===(null===(i=t.data)||void 0===i?void 0:i.grammarType)?[t.data]:[]}function c9(t){return!(0,eB.Z)(null==t?void 0:t.datas)}function pt(t){return!(0,eB.Z)(null==t?void 0:t.coordinate)}function pe(t,e){let i=[];return(i=(i=(i=(i=(i=(i=i.concat(o7(t.nice,e))).concat(o7(t.niceMin,e))).concat(o7(t.niceMax,e))).concat(o7(t.min,e))).concat(o7(t.max,e))).concat(o7(t.zero,e))).concat(o7(t.roundRange,e))}function pi(t,e){let i=[];return(i=(i=(i=(i=i.concat(o7(t.round,e))).concat(o7(t.padding,e))).concat(o7(t.paddingInner,e))).concat(o7(t.paddingOuter,e))).concat(o7(t.align,e))}function pr(t,e){return c8(t)?c7(t,e):c9(t)?function(t,e){if(t&&t.datas&&t.datas.length){let i=[];return t.datas.forEach(t=>{let r=c7(t,e);r.length&&i.push(r[0])}),i}return[]}(t,e):pt(t)?function(t,e){var i;if((0,ek.Z)(t.coordinate)){let i=e.getCoordinateById(t.coordinate);return i?[i]:[]}return"coordinate"===(null===(i=t.coordinate)||void 0===i?void 0:i.grammarType)?[t.coordinate]:[]}(t,e):o7(t,e)}function pn(t,e,i){var r,n,s,a,o,l,h,d,u,c,p,g;if((0,eB.Z)(e))return[];let f=o7(e.unknown,i);switch(t){case"linear":case"sqrt":return f.concat(pe(e,i));case"ordinal":;return f.concat((r=0,n=0,[]));case"band":;return f.concat(pi(s=e,a=i).concat(o7(s.paddingInner,a)));case"point":return f.concat(pi(e,i));case"pow":;return f.concat(pe(o=e,l=i).concat(o7(o.exponent,l)));case"log":case"time":case"utc":;let m;return f.concat((h=e,d=i,(m=(m=(m=(m=(m=[]).concat(o7(h.nice,d))).concat(o7(h.min,d))).concat(o7(h.max,d))).concat(o7(h.zero,d))).concat(o7(h.roundRange,d))));case"symlog":;return f.concat(pe(u=e,c=i).concat(o7(u.constant,c)));case"quantize":;let v;return f.concat((p=e,g=i,(v=(v=(v=(v=(v=(v=[]).concat(o7(p.nice,g))).concat(o7(p.niceMin,g))).concat(o7(p.niceMax,g))).concat(o7(p.min,g))).concat(o7(p.max,g))).concat(o7(p.zero,g))))}return f}function ps(t,e,i){let r=lt(t.nice,i,e);!0===r?e.nice():(0,eg.Z)(r)&&e.nice(r)}function pa(t,e,i){let r=lt(t.niceMax,i,e);!0===r?e.niceMax():(0,eg.Z)(r)&&e.niceMax(r);let n=lt(t.niceMin,i,e);!0===n?e.niceMin():(0,eg.Z)(n)&&e.niceMin(n)}function po(t,e,i){let r=lt(t.min,i,e),n=lt(t.max,i,e),s=lt(t.zero,i,e),a=(0,eg.Z)(r),o=(0,eg.Z)(n),l=e.domain();if(2===l.length&&(a||o||s)){let t=Math.min(l[0],l[l.length-1]),i=Math.max(l[0],l[l.length-1]);s&&t>0?t=0:a&&(t=Math.min(t,r)),s&&i<0?i=0:o&&(i=Math.max(i,n)),e.domain([t,i],!0)}}function pl(t,e,i){var r;lt(t.roundRange,i,e)&&e.rangeRound(e.range(),!0);let{interpolate:n,clamp:s}=null!==(r=lt(t.config,i,e))&&void 0!==r?r:{};n&&e.interpolate(n,!0),(0,eB.Z)(s)||(r6(s)?e.clamp(!0,s,!0):e.clamp(s,void 0,!0));let a=lt(t.tickCount,i,e);a&&e.tickData(a)}function ph(t,e,i){ps(t,e,i),pa(t,e,i),po(t,e,i),pl(t,e,i)}function pd(t,e,i){t.round&&e.round(lt(t.round,i,e),!0),t.padding&&e.padding(lt(t.padding,i,e),!0),t.paddingInner&&e.paddingInner(lt(t.paddingInner,i,e),!0),t.paddingOuter&&e.paddingOuter(lt(t.paddingOuter,i,e),!0),t.align&&e.align(lt(t.align,i,e),!0)}function pu(t,e){let i=t.field,r=le(t.data,e),n=[];if((0,ev.Z)(i))i.forEach(t=>{let e=l0(t);r&&r.forEach(t=>{n.push(e(t))})});else{let t=l0(i);r&&r.forEach(e=>{n.push(t(e))})}return n}function pc(t,e){let i=[];return t.datas.forEach(t=>{i=i.concat(pu(t,e))}),i}function pp(t,e,i,r){return i&&t.sort(i),uj(e.type)?(r&&t.filter(t=>(0,iy.Z)(t)),[ew(t),eA(t)]):t}class pg extends ll{constructor(t,e){super(t),this.grammarType="scale",this.spec.type=e,this.scale=c6(e)}parse(t){return super.parse(t),this.domain(t.domain),this.range(t.range),this.configure(t),this.commit(),this}evaluate(t,e){return this.view.emit(tX.BEFORE_EVALUATE_SCALE),this.spec.type||(this.spec.type="linear"),this.scale&&this.scale.type===this.spec.type||(this.scale=c6(this.spec.type)),function(t,e,i){var r,n,s,a,o,l;if(c8(t.domain)?e.domain(pp(pu(t.domain,i),e,t.domain.sort,!0),!0):c9(t.domain)?e.domain(pp(pc(t.domain,i),e,t.domain.sort,!0),!0):e.domain(lt(t.domain,i,e),!0),"identity"!==t.type){if(c8(t.range))e.range(pp(pu(t.range,i),e),!0);else if(c9(t.range))e.range(pp(pc(t.range,i),e),!0);else if(pt(t.range)){let r=le(t.range.coordinate,i);!function(t){switch(t){case t1.Quantile:case t1.Quantize:case t1.Threshold:return!0;default:return!1}}(e.type)&&r&&e.range(r.getRangeByDimension(t.range.dimension,t.range.isSubshaft,t.range.reversed))}else e.range(lt(t.range,i,e),!0)}switch((0,eB.Z)(t.unknown)||e.unknown(lt(t.unknown,i,e)),t.type){case"linear":ph(t,e,i),e.rescale();break;case"band":pd(t,e,i),e.rescale();break;case"point":pd(t,e,i),e.rescale();break;case"pow":(function(t,e,i){ph(t,e,i);let r=lt(t.exponent,i,e);r>0&&e.exponent(r)})(t,e,i),e.rescale();break;case"log":(function(t,e,i){ps(t,e,i),po(t,e,i);let r=lt(t.base,i,e);r>0&&e.base(r),pl(t,e,i)})(t,e,i),e.rescale();break;case"sqrt":ph(t,e,i),e.rescale();break;case"symlog":(function(t,e,i){ph(t,e,i);let r=lt(t.constant,i,e);(0,eg.Z)(r)&&e.constant(r)})(t,e,i),e.rescale();break;case"time":case"utc":;ps(r=t,n=e,s=i),po(r,n,s),pl(r,n,s),e.rescale();break;case"quantize":;ps(a=t,o=e,l=i),pa(a,o,l),po(a,o,l),e.rescale();break;case"quantile":e.rescale()}}(this.spec,this.scale,e),this.scale&&function(t){switch(t){case t1.Linear:case t1.Log:case t1.Pow:case t1.Sqrt:case t1.Symlog:case t1.Time:case t1.Band:case t1.Point:return!0;default:return!1}}(this.scale.type)&&(this._rangeFactor?this.scale.rangeFactor(this._rangeFactor):this.scale.rangeFactor()&&this.scale.rangeFactor(null,!1,!0),this._fishEyeOptions?this.scale.fishEye(this._fishEyeOptions):this.scale.fishEye()&&this.scale.fishEye(null,!1,!0)),this.view.emit(tX.BEFORE_EVALUATE_SCALE),this}output(){return this.scale}getScaleType(){return this.spec.type}getScale(){return this.scale}ticks(t){var e,i,r;return null!==(r=null===(i=null===(e=this.scale)||void 0===e?void 0:e.tickData)||void 0===i?void 0:i.call(e,t))&&void 0!==r?r:[]}domain(t){return(0,eB.Z)(this.spec.domain)||this.detach(pr(this.spec.domain,this.view)),this.spec.domain=t,this.attach(pr(t,this.view)),this.commit(),this}range(t){return(0,eB.Z)(this.spec.range)||this.detach(pr(this.spec.range,this.view)),this.spec.range=t,this.attach(pr(t,this.view)),this.commit(),this}tickCount(t){return this.setFunctionSpec(t,"tickCount")}setRangeFactor(t){return this._rangeFactor=t,this}getRangeFactor(){return this._rangeFactor}setFishEye(t){return this._fishEyeOptions=t,this}getFishEye(){return this._fishEyeOptions}getCoordinateAxisPosition(){let t=this.spec.range,e=null==t?void 0:t.coordinate;if(!(0,eB.Z)(e)){let i=t.dimension,r=t.isSubshaft,n=t.reversed,s=this.parameters()[e];return null==s?void 0:s.getVisualPositionByDimension(i,r,n)}return null}getCoordinateAxisPoints(t){let e=this.spec.range,i=null==e?void 0:e.coordinate;if(!(0,eB.Z)(i)){let r=e.dimension,n=e.isSubshaft,s=e.reversed,a=this.parameters()[i];return null==a?void 0:a.getAxisPointsByDimension(r,n,s,t)}return null}getCoordinate(){let t=this.spec.range,e=null==t?void 0:t.coordinate;return(0,eB.Z)(e)?null:this.parameters()[e]}configure(t){return this.detach(pn(this.spec.type,t,this.view)),(0,eB.Z)(t)?this.spec={type:this.spec.type,domain:this.spec.domain,range:this.spec.range}:(Object.assign(this.spec,t),this.attach(pn(this.spec.type,t,this.view))),this.commit(),this}reuse(t){return t.grammarType!==this.grammarType||(this.scale=t.output()),this}clear(){super.clear(),this.scale=null}}class pf{constructor(){this.startPoint={x:0,y:0},this.endPoint={x:0,y:0},this.originPoint={x:0,y:0},this.width=0,this.height=0,this.transforms=[]}start(t,e){return(0,eB.Z)(t)?this.startPoint:(this.startPoint=this._parsePoint(t,e),this._updateSize(),this)}end(t,e){return(0,eB.Z)(t)?this.endPoint:(this.endPoint=this._parsePoint(t,e),this._updateSize(),this)}_parsePoint(t,e){let i={x:0,y:0};return(0,ev.Z)(t)?(i.x=t[0],i.y=t[1]):(0,iy.Z)(t)?(i.x=t,i.y=e):(i.x=t.x,i.y=t.y),i}_updateSize(){this.width=this.endPoint.x-this.startPoint.x,this.height=this.endPoint.y-this.startPoint.y}isTransposed(){return this.transforms&&this.transforms.filter(t=>"transpose"===t.type).length%2!=0}isMainDimension(t){let e="x"===t||"theta"===t||"0"===t;return this.isTransposed()&&(e=!e),e}applyTransforms(t){return this.transforms=t.slice(),this._invokeTransforms(),this}_invokeTransforms(){this.invertMatrix=null,this.convertMatrix=null,this.invertMatrix=new e3,this.invertMatrix.translate(this.originPoint.x,this.originPoint.y),this.transforms.forEach(t=>{switch(t.type){case"translate":this.invertMatrix.translate(t.offset.x,t.offset.y);break;case"rotate":this.invertMatrix.rotateByCenter(t.angle,this.originPoint.x,this.originPoint.y);break;case"scale":this.invertMatrix.scale(t.scale.x,t.scale.y);break;case"transpose":"polar"!==this.type&&this.invertMatrix.transpose()}}),this.invertMatrix,this.convertMatrix=this.invertMatrix.getInverse()}}class pm extends pf{constructor(){super(...arguments),this.type="cartesian"}convert(t){var e,i;if((0,eg.Z)(t.x1)||(0,eg.Z)(t.y1)){let r=this.convertPoint(t),n=this.convertPoint({x:null!==(e=t.x1)&&void 0!==e?e:t.x,y:null!==(i=t.y1)&&void 0!==i?i:t.y});return r.x1=n.x,r.y1=n.y,r}return this.convertPoint(t)}invert(t){var e,i;if((0,eg.Z)(t.x1)||(0,eg.Z)(t.y1)){let r=this.invertPoint(t),n=this.invertPoint({x:null!==(e=t.x1)&&void 0!==e?e:t.x,y:null!==(i=t.y1)&&void 0!==i?i:t.y});return r.x1=n.x,r.y1=n.y,r}return this.invertPoint(t)}getRangeByDimension(t,e,i){let r=this.start(),n=this.end(),s=this.isMainDimension(t)?[r.x,n.x]:[n.y,r.y];return i?[s[1],s[0]]:s}getVisualPositionByDimension(t,e,i){return this.isMainDimension(t)?e?"top":"bottom":e?"right":"left"}getAxisPointsByDimension(t,e,i,r){let n=this.start(),s=this.end();if(this.isMainDimension(t)){let t=(0,eB.Z)(r)?e?[{x:n.x,y:n.y},{x:s.x,y:n.y}]:[{x:n.x,y:s.y},{x:s.x,y:s.y}]:[{x:n.x,y:r},{x:s.x,y:r}];return i?[t[1],t[0]]:t}let a=(0,eB.Z)(r)?e?[{x:s.x,y:s.y},{x:s.x,y:n.y}]:[{x:n.x,y:s.y},{x:n.x,y:n.y}]:[{x:r,y:s.y},{x:r,y:n.y}];return i?[a[1],a[0]]:a}convertPoint(t){let e=(0,ev.Z)(t)?{x:t[0],y:t[1]}:t,i=Object.assign({},e);return this.convertMatrix.transformPoint(e,i),i}invertPoint(t){let e=Object.assign({},t);return this.invertMatrix.transformPoint(t,e),e}}class pv extends pf{constructor(){super(...arguments),this.type="polar",this._isUserOrigin=!1,this._isUserRadius=!1,this.startAngle=0,this.endAngle=2*Math.PI,this.innerRadius=0,this.outerRadius=0}_updateStartEndPoint(){let t=this.origin(),e=Math.min(this.startAngle,this.endAngle),i=Math.max(this.startAngle,this.endAngle),r=2*e/Math.PI,n=2*i/Math.PI,s=[e,i],a=Math.ceil(r);for(;a<=n;)s.push(a*Math.PI/2),a++;let o=s.length,l=[],h=[];for(a=0;a<o;a++){let e=e2(t,this.innerRadius,s[a]),i=e2(t,this.outerRadius,s[a]);l.push(e.x),l.push(i.x),h.push(e.y),h.push(i.y)}let d=ew(l),u=ew(h),c=eA(l),p=eA(h);this.startPoint={x:d,y:u},this.endPoint={x:c,y:p}}_updateSize(){super._updateSize(),this._isUserOrigin||(this.originPoint={x:this.width/2,y:this.height/2},this._invokeTransforms()),this._isUserRadius||(this.outerRadius=Math.min(Math.abs(this.startPoint.x-this.originPoint.x),Math.abs(this.endPoint.x-this.originPoint.x),Math.abs(this.startPoint.y-this.originPoint.y),Math.abs(this.endPoint.y-this.originPoint.y)))}angle(t,e){return(0,eB.Z)(t)?[this.startAngle,this.endAngle]:(Array.isArray(t)?(this.startAngle=t[0],this.endAngle=t[1]):(this.startAngle=t,this.endAngle=null!=e?e:t),this._updateStartEndPoint(),this)}radius(t,e){return(0,eB.Z)(t)?[this.innerRadius,this.outerRadius]:(this._isUserRadius=!0,Array.isArray(t)?(this.innerRadius=Math.min(t[0],t[1]),this.outerRadius=Math.max(t[1],t[1])):(this.innerRadius=Math.min(t,e),this.outerRadius=Math.max(t,e)),this._updateStartEndPoint(),this)}origin(t,e){return(0,eB.Z)(t)?this.originPoint:(this._isUserOrigin=!0,this.originPoint=this._parsePoint(t,e),this._updateStartEndPoint(),this._invokeTransforms(),this)}convert(t){var e,i,r,n;if((0,eg.Z)(t.r1)||(0,eg.Z)(t.theta1)){let r=this.convertPoint(t),n=this.convertPoint({r:null!==(e=t.r1)&&void 0!==e?e:t.r,theta:null!==(i=t.theta1)&&void 0!==i?i:t.theta});return r.x1=n.x,r.y1=n.y,r}if((0,eg.Z)(t.x1)||(0,eg.Z)(t.y1)){let e=this.convertPoint(t),i=this.convertPoint({x:null!==(r=t.x1)&&void 0!==r?r:t.x,y:null!==(n=t.y1)&&void 0!==n?n:t.y});return e.x1=i.x,e.y1=i.y,e}return this.convertPoint(t)}invert(t){var e,i;if((0,eg.Z)(t.x1)||(0,eg.Z)(t.y1)){let r=this.invertPoint(t),n=this.invertPoint({x:null!==(e=t.x1)&&void 0!==e?e:t.x,y:null!==(i=t.y1)&&void 0!==i?i:t.y});return r.r1=n.r,r.theta1=n.theta,r}return this.invertPoint(t)}getRangeByDimension(t,e,i){let r=this.isMainDimension(t)?[this.startAngle,this.endAngle]:[this.innerRadius,this.outerRadius];return i?[r[1],r[0]]:r}getVisualPositionByDimension(t,e,i){return this.isMainDimension(t)?e?"inside":"outside":e?"end":"start"}getAxisPointsByDimension(t,e,i,r){if(!this.isMainDimension(t)){let t=this.origin(),n=(0,eB.Z)(r)?e?[e2(t,this.innerRadius,this.endAngle),e2(t,this.outerRadius,this.endAngle)]:[e2(t,this.innerRadius,this.startAngle),e2(t,this.outerRadius,this.startAngle)]:[e2(t,this.innerRadius,r),e2(t,this.outerRadius,r)];return i?[n[1],n[0]]:n}return null}convertPoint(t){let e,i;let r=this.isTransposed();(0,eB.Z)(t.r)||(0,eB.Z)(t.theta)?(0,ev.Z)(t)?(e=r?t[0]:t[1],i=r?t[1]:t[0]):(e=r?t.y:t.x,i=r?t.x:t.y):(e=r?t.r:t.theta,i=r?t.theta:t.r);let n={x:Math.cos(e)*i,y:Math.sin(e)*i};!1===t.defined&&(n.defined=!1);let s=Object.assign({},n);return this.convertMatrix.transformPoint(n,s),s}invertPoint(t){let e=Object.assign({},t);this.invertMatrix.transformPoint(t,e);let i=e.x,r=e.y;if(dq(i,0)&&dq(r,0)){let t={r:0,theta:0};return!1===e.defined&&(t.defined=!1),t}let n=Math.atan(r/i);(n+=i>=0?2*Math.PI:Math.PI)>=2*Math.PI&&(n-=2*Math.PI),n=e1(n);let s=dq(r,0)?i/Math.cos(n):r/Math.sin(n),a=this.isTransposed()?{r:n,theta:s}:{r:s,theta:n};return!1===e.defined&&(a.defined=!1),a}}function py(t){switch(t){case"cartesian":default:return new pm;case"polar":return new pv}}class pb extends ll{constructor(t,e){super(t),this.grammarType="coordinate",this.spec={type:"cartesian"},this.spec.type=e,this.coordinate=py(e)}parse(t){return super.parse(t),this.start(t.start),this.end(t.end),this.origin(t.origin),this.translate(t.translate),this.rotate(t.rotate),this.scale(t.scale),this.transpose(t.transpose),this.commit(),this}evaluate(t,e){return this.coordinate&&this.coordinate.type===this.spec.type||(this.coordinate=py(this.spec.type)),function(t,e,i){var r,n,s,a,o,l,h;(0,eB.Z)(t.start)||e.start(null!==(r=lt(t.start,i))&&void 0!==r?r:[0,0]),(0,eB.Z)(t.end)||e.end(null!==(n=lt(t.end,i))&&void 0!==n?n:[0,0]),(0,eB.Z)(t.origin)||e.origin(null!==(s=lt(t.origin,i))&&void 0!==s?s:[0,0]);let d=[];if(!(0,eB.Z)(t.translate)){let e=lt(t.translate,i);d.push({type:"translate",offset:{x:null!==(a=null==e?void 0:e[0])&&void 0!==a?a:0,y:null!==(o=null==e?void 0:e[1])&&void 0!==o?o:0}})}if(!(0,eB.Z)(t.rotate)){let e=lt(t.rotate,i);d.push({type:"rotate",angle:null!=e?e:0})}if(!(0,eB.Z)(t.scale)){let e=lt(t.scale,i);d.push({type:"scale",scale:{x:null!==(l=null==e?void 0:e[0])&&void 0!==l?l:1,y:null!==(h=null==e?void 0:e[1])&&void 0!==h?h:1}})}!(0,eB.Z)(t.transpose)&<(t.transpose,i)&&d.push({type:"transpose"}),e.applyTransforms(d)}(this.spec,this.coordinate,e),this}output(){return this.coordinate}start(t){return this.setFunctionSpec(t,"start")}end(t){return this.setFunctionSpec(t,"end")}origin(t){return this.setFunctionSpec(t,"origin")}translate(t){return this.setFunctionSpec(t,"translate")}rotate(t){return this.setFunctionSpec(t,"rotate")}scale(t){return this.setFunctionSpec(t,"scale")}transpose(t){return this.setFunctionSpec(t,"transpose")}reuse(t){return t.grammarType!==this.grammarType||(this.coordinate=t.output()),this}clear(){super.clear(),this.coordinate=null}}function px(t){return t&&(t.type===t1.Band||t.type===t1.Point)}function p_(t){if(t)return t.type===t1.Band?t.bandwidth():t.type===t1.Point?t.step():void 0}function pA(t,e){let i=t.range();return(t.scale(e)-i[0])/(i[i.length-1]-i[0])}class pw extends dF{encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(t),this}_updateComponentEncoders(t){this._encoders||(this._encoders={});let e=this.spec.encode[t];if(e&&"update"===t){let i=this.parameters(),r=o9(e)?null:Object.keys(e).reduce((t,r)=>(da(e[r])&&(t[r]=le(e[r].scale,i)),t),{});this._encoders[t]={callback:(t,i,n)=>{let s=du(e,t,i,n);if((0,eB.Z)(s.size)){let t=r.x?p_(r.x):void 0,e=r.y?p_(r.y):void 0;(0,eB.Z)(t)&&(0,eB.Z)(e)?s.size=10:(0,eB.Z)(t)?s.size=e:(0,eB.Z)(e)&&(s.size=t),s.size=[t,e]}return(0,eB.Z)(s.shape)&&(s.shape="rect"),s}}}else this._encoders[t]=e}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}getAttributeTransforms(){return[{channels:["size","padding"],transform:(t,e,i)=>{if((0,iy.Z)(i.padding)&&i.padding>0)t.size=(0,ev.Z)(i.size)?i.size.map(t=>Math.max(t-i.padding,1)):Math.max(i.size-i.padding,1);else if((0,ev.Z)(i.padding)&&2===i.padding.length){let e=(0,ev.Z)(i.size)?i.size:[i.size,i.size];t.size=[Math.max(e[0]-i.padding[0],1),Math.max(e[1]-i.padding[1],1)]}else t.size=i.size},storedAttrs:"paddingAttrs"}].concat(h6.symbol)}release(){super.release(),this._encoders=null}}pw.markType=tF.cell;class pS extends dF{encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(t),this}_updateComponentEncoders(t){this._encoders||(this._encoders={});let e=this.spec.encode[t];if(e&&"update"===t){let i=this.parameters(),r=o9(e)?null:Object.keys(e).reduce((t,r)=>(da(e[r])&&(t[r]=le(e[r].scale,i)),t),{});this._encoders[t]={callback:(t,i,n)=>{var s,a,o;let l=du(e,t,i,n);if(this.disableCoordinateTransform=!1,r&&r.x&&r.x.type===t1.Band){if(!(0,eB.Z)(r.y)){let t=r.y.domain(),e=ew(t),i=eA(t);l.y1=r.y.scale(e>0?e:i<0?i:0)}let t=r.x.bandwidth();l.x=l.x+t/4,l.x1=l.x+t/2}else if(r&&r.y&&r.y.type===t1.Band){if(!(0,eB.Z)(r.x)){let t=r.x.domain(),e=ew(t),i=eA(t);l.x1=r.x.scale(e>0?e:i<0?i:0)}let t=r.y.bandwidth();l.y=l.y+t/4,l.y1=l.y+t/2}if(r){let t=(null!==(a=this.view.getScaleById(null===(s=e.x)||void 0===s?void 0:s.scale))&&void 0!==a?a:this.view.getScaleById(null===(o=e.y)||void 0===o?void 0:o.scale)).getCoordinate();if(t&&"polar"===t.type){this.disableCoordinateTransform=!0;let e=t.origin();l.cx=e.x,l.cy=e.y}}return l}}}else this._encoders[t]=e}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}getAttributeTransforms(){return this.coord&&"polar"===this.coord.output().type?[{channels:["x","y","x1","y1","cx","cy"],transform:(t,e,i)=>{t.x=i.cx,t.y=i.cy,this.coord.output().isTransposed()?(t.startAngle=i.y,t.endAngle=i.y1,t.innerRadius=i.x,t.outerRadius=i.x1):(t.startAngle=i.x,t.endAngle=i.x1,t.innerRadius=i.y,t.outerRadius=i.y1)},storedAttrs:"sizeAttrs"}]:h6.rect}addGraphicItem(t,e){let i=hJ(this,this.coord&&"polar"===this.coord.output().type?tF.arc:tF.rect,t);return super.addGraphicItem(t,e,i)}release(){super.release(),this._encoders=null}}pS.markType=tF.interval;var pT=i("510227");let pk=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class pB extends sv{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage(()=>{this.render(),this.bindEvents()})}setAttribute(t,e,i){lA(this.attribute[t])&&lA(e)&&!r6(this.attribute[t])&&!r6(e)?lT(this.attribute[t],e):this.attribute[t]=e,pk.includes(t)||this.render(),this.valid=this.isValid(),!this.updateShapeAndBoundsTagSetted()&&(i||this.needUpdateTag(t))?this.addUpdateShapeAndBoundsTag():this.addUpdateBoundTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){let i=Object.keys(t);this._mergeAttributes(t,i),i.every(t=>pk.includes(t))||this.render(),this.valid=this.isValid(),!this.updateShapeAndBoundsTagSetted()&&(e||this.needUpdateTags(i))?this.addUpdateShapeAndBoundsTag():this.addUpdateBoundTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){(0,eB.Z)(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){let r=e[i];!lA(this.attribute[r])||r6(this.attribute[r])||r6(t[r])?this.attribute[r]=t[r]:lT(this.attribute[r],t[r])}}bindEvents(){}_getNodeId(t){return`${this.id}-${this.name}-${t}`}_dispatchEvent(t,e){var i;let r=new r9(t,e);r.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(r)}}function pC(){pC.__loaded||(pC.__loaded=!0,as.RegisterGraphicCreator("group",sy))}pC.__loaded=!1;let pE=["segments","points","curveType",...nR];class pM extends nF{constructor(t={}){super(t),this.type="line",this.numberType=sn}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;let{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&!(t.length<=1)}_interpolate(t,e,i,r,n){"points"===t&&(n.points=nY(i,r,e))}doUpdateAABBBounds(){let t=rQ(this).line;this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updateLineAABBBounds(e,rQ(this).line,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=e,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw Error("暂不支持")}getDefaultAttribute(t){return rQ(this).line[t]}needUpdateTags(t){return super.needUpdateTags(t,pE)}needUpdateTag(t){return super.needUpdateTag(t,pE)}toCustomPath(){let t=this.attribute,e=new iK,i=t.segments,r=t=>{if(t&&t.length){let i=!0;t.forEach(t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)})}};return i&&i.length?i.forEach(t=>{r(t.points)}):t.points&&r(t.points),e}clone(){return new pM(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return pM.NOWORK_ANIMATE_ATTR}}function pP(t){return new pM(t)}pM.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},nN);let pO=!1,pR=new eM(t=>{pO||(pO=!0,t(on).toSelf().inSingletonScope(),t(os).toSelf().inSingletonScope(),t(sL).to(on).inSingletonScope(),t(sR).toService(sL))}),pI=hM(),pL=Symbol.for("MathPickerContribution"),pD=Symbol.for("MathArcPicker"),pj=Symbol.for("MathAreaPicker"),pN=Symbol.for("MathCirclePicker"),pF=Symbol.for("MathImagePicker"),pG=Symbol.for("MathLinePicker"),pz=Symbol.for("MathPathPicker"),pZ=Symbol.for("MathRectPicker"),pH=Symbol.for("MathSymbolPicker"),pU=Symbol.for("MathTextPicker"),pV=Symbol.for("MathPolygonPicker"),pW=Symbol.for("MathGlyphPicker"),p$=Symbol.for("CanvasArcPicker"),pY=Symbol.for("CanvasArc3dPicker"),pX=Symbol.for("CanvasAreaPicker"),pK=Symbol.for("CanvasCirclePicker"),pq=Symbol.for("CanvasImagePicker"),pJ=Symbol.for("CanvasLinePicker"),pQ=Symbol.for("CanvasPathPicker"),p0=Symbol.for("CanvasRectPicker"),p1=Symbol.for("CanvasRect3dPicker"),p2=Symbol.for("CanvasSymbolPicker"),p5=Symbol.for("CanvasTextPicker"),p3=Symbol.for("CanvasPolygonPicker"),p4=Symbol.for("CanvasPyramid3dPicker"),p6=Symbol.for("CanvasRichTextPicker"),p8=Symbol.for("CanvasGlyphPicker"),p7=Symbol.for("CanvasGroupPicker"),p9=Symbol.for("CanvasPickerContribution"),gt=class extends oe{};gt=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],gt);let ge=class extends gt{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=sn}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;r.highPerformanceSave();let n=rQ(t).line,{x:s,y:a,z:o,lastModelMatrix:l}=this.transform(t,n,r),h=e;if(r.camera){h=e.clone();let i=t.parent.globalTransMatrix;h.x=i.a*e.x+i.c*e.y+i.e,h.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=o;let d=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,t=>!!d||(d=t.isPointInPath(h.x,h.y)),(t,e,i)=>{if(d)return!0;let n=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return r.lineWidth=aM(r,n+s,r.dpr),d=t.isPointInStroke(h.x,h.y)}),this.canvasRenderer.z=0,r.modelMatrix!==l&&s1.free(r.modelMatrix),r.modelMatrix=l,r.highPerformanceRestore(),d}};ge=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(P=0,O=ez(sL),function(t,e){O(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ge);let gi=!1,gr=new eM((t,e,i,r)=>{gi||(gi=!0,t(pJ).to(ge).inSingletonScope(),t(p9).toService(pJ))}),gn=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=sn}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).line,{x:s=n.x,y:a=n.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,t=>!!o||(o=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(o)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=s+a,o=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),o}};gn=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(R=0,I=ez(sL),function(t,e){I(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],gn);let gs=!1,ga=new eM((t,e,i,r)=>{gs||(gs=!0,t(pG).to(gn).inSingletonScope(),t(pL).toService(pG))});function go(){go.__loaded||(go.__loaded=!0,as.RegisterGraphicCreator("line",pP),rR.load(pR),rR.load(pI?gr:ga))}go.__loaded=!1;let gl=["points","cornerRadius",...nR];class gh extends nF{constructor(t){super(t),this.type="polygon",this.numberType=sa}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){let t=rQ(this).polygon;this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updatePolygonAABBBounds(e,rQ(this).polygon,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=e,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw Error("暂不支持")}_interpolate(t,e,i,r,n){"points"===t&&(n.points=nY(i,r,e))}getDefaultAttribute(t){return rQ(this).polygon[t]}needUpdateTags(t){return super.needUpdateTags(t,gl)}needUpdateTag(t){return super.needUpdateTag(t,gl)}toCustomPath(){let t=this.attribute.points,e=new iK;return t.forEach((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)}),e.closePath(),e}clone(){return new gh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return gh.NOWORK_ANIMATE_ATTR}}function gd(t){return new gh(t)}gh.NOWORK_ANIMATE_ATTR=nN;function gu(t,e,i,r){t.moveTo(e[0].x+i,e[0].y+r);for(let n=1;n<e.length;n++)t.lineTo(e[n].x+i,e[n].y+r)}function gc(t,e){return Math.sqrt(t*t+e*e)}function gp(t,e,i,r,n){let s=e/i;return{x:t.x-r*s,y:t.y-n*s}}var gg=function(t,e){return function(i,r){e(i,r,t)}};let gf=class extends oe{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=sa,this.builtinContributions=[a4,oh],this.init(t)}drawShape(t,e,i,r,n,s,a,o){let l=rQ(t,null==s?void 0:s.theme).polygon,{points:h=l.points,cornerRadius:d=l.cornerRadius,x:u=l.x,y:c=l.y,closePath:p=l.closePath}=t.attribute,g=this.valid(t,l,a,o);if(!g)return;let{fVisible:f,sVisible:m,doFill:v,doStroke:y}=g;e.beginPath(),d<=0||(0,ev.Z)(d)&&d.every(t=>0===t)?gu(e.camera?e:e.nativeContext,h,i,r):function(t,e,i,r,n,s=!0){var a;if(e.length<3)return void gu(t,e,i,r);let o=0,l=e.length-1;s||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+r));for(let s=o;s<=l;s++){let o=e[0===s?l:(s-1)%e.length],h=e[s%e.length],d=e[(s+1)%e.length],u=h.x-o.x,c=h.y-o.y,p=h.x-d.x,g=h.y-d.y,f=Math.abs(Math.tan((Math.atan2(c,u)-Math.atan2(g,p))/2)),m=Array.isArray(n)?null!==(a=n[s%e.length])&&void 0!==a?a:0:n,v=m/f,y=gc(u,c),b=gc(p,g),x=Math.min(y,b);v>x&&(v=x,m=x*f);let _=gp(h,v,y,u,c),A=gp(h,v,b,p,g),w=2*h.x-_.x-A.x,S=2*h.y-_.y-A.y,T=gc(w,S),k=gp(h,gc(v,m),T,w,S),B=Math.atan2(_.y-k.y,_.x-k.x),C=Math.atan2(A.y-k.y,A.x-k.x),E=C-B;E<0&&(B=C,E=-E),E>Math.PI&&(E-=Math.PI),0===s?t.moveTo(_.x+i,_.y+r):t.lineTo(_.x+i,_.y+r),E&&t.arcTo(h.x+i,h.y+r,A.x+i,A.y+r,m),t.lineTo(A.x+i,A.y+r)}s||t.lineTo(e[l+1].x+i,e[l+1].y+r)}(e.camera?e:e.nativeContext,h,i,r,d,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,r,v,y,f,m,l,n,a,o),v&&(a?a(e,t.attribute,l):f&&(e.setCommonStyle(t,t.attribute,u-i,c-r,l),e.fill())),y&&(o?o(e,t.attribute,l):m&&(e.setStrokeStyle(t,t.attribute,u-i,c-r,l),e.stroke())),this.afterRenderStep(t,e,i,r,v,y,f,m,l,n,a,o)}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).polygon;this._draw(t,n,!1,i,r)}};gf=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),gg(0,ez(eH)),gg(0,eZ(aJ)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],gf);let gm=!1,gv=new eM(t=>{gm||(gm=!0,t(sj).to(gf).inSingletonScope(),t(sR).toService(sj),t(aJ).toService(a6),eV(t,aJ))}),gy=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=sa}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).polygon,{x:s=n.x,y:a=n.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,i,r)=>!!o||(o=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(o)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=aM(r,s+a,r.dpr),o=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),o}};gy=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(L=0,D=ez(sj),function(t,e){D(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],gy);let gb=!1,gx=new eM((t,e,i,r)=>{gb||(gb=!0,t(p3).to(gy).inSingletonScope(),t(p9).toService(p3))}),g_=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=sa}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).polygon,{x:s=n.x,y:a=n.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,i,r)=>!!o||(o=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(o)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=s+a,o=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),o}};g_=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(j=0,N=ez(sj),function(t,e){N(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],g_);let gA=!1,gw=new eM((t,e,i,r)=>{gA||(gA=!0,t(pV).to(g_).inSingletonScope(),t(pL).toService(pV))});function gS(){gS.__loaded||(gS.__loaded=!0,as.RegisterGraphicCreator("polygon",gd),rR.load(gv),rR.load(pI?gx:gw))}gS.__loaded=!1;class gT{bounds(t,e){if((0,iy.Z)(t)){let i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function gk(t,e,i,r,n){return n?t.arc(i,r,e,0,eJ.BZ,!1,n):t.arc(i,r,e,0,eJ.BZ),!1}var gB=new class t extends gT{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,r,n){return gk(t,e/2,i,r,n)}drawOffset(t,e,i,r,n,s){return gk(t,e/2+n,i,r,s)}drawToSvgPath(t,e,i,r){let n=t/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}},gC=new class t extends gT{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,r,n){var s,a,o,l,h;return s=t,a=e/6,o=i,l=r,h=n,s.moveTo(-3*a+o,-a+l,h),s.lineTo(-a+o,-a+l,h),s.lineTo(-a+o,-3*a+l,h),s.lineTo(a+o,-3*a+l,h),s.lineTo(a+o,-a+l,h),s.lineTo(3*a+o,-a+l,h),s.lineTo(3*a+o,a+l,h),s.lineTo(a+o,a+l,h),s.lineTo(a+o,3*a+l,h),s.lineTo(-a+o,3*a+l,h),s.lineTo(-a+o,a+l,h),s.lineTo(-3*a+o,a+l,h),s.closePath(),!0}drawOffset(t,e,i,r,n,s){var a,o,l,h,d,u;return a=t,o=e/6,l=i,h=r,d=n,u=s,a.moveTo(-3*o+l-d,-o+h-d,u),a.lineTo(-o+l-d,-o+h-d,u),a.lineTo(-o+l-d,-3*o+h-d,u),a.lineTo(o+l+d,-3*o+h-d,u),a.lineTo(o+l+d,-o+h-d,u),a.lineTo(3*o+l+d,-o+h-d,u),a.lineTo(3*o+l+d,o+h+d,u),a.lineTo(o+l+d,o+h+d,u),a.lineTo(o+l+d,3*o+h+d,u),a.lineTo(-o+l-d,3*o+h+d,u),a.lineTo(-o+l-d,o+h+d,u),a.lineTo(-3*o+l-d,o+h+d,u),a.closePath(),!0}};function gE(t,e,i,r,n){return t.moveTo(i,r-e,n),t.lineTo(e+i,r,n),t.lineTo(i,r+e,n),t.lineTo(i-e,r,n),t.closePath(),!0}var gM=new class t extends gT{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,r,n){return gE(t,e/2,i,r,n)}drawFitDir(t,e,i,r,n){return gE(t,e/2,i,r,n)}drawOffset(t,e,i,r,n,s){return gE(t,e/2+n,i,r,s)}};function gP(t,e,i,r){let n=2*e;return t.rect(i-e,r-e,n,n),!1}var gO=new class t extends gT{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,r){return gP(t,e/2,i,r)}drawOffset(t,e,i,r,n){return gP(t,e/2+n,i,r)}};class gR extends gT{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,r){var n,s,a,o;return n=t,s=e/2,a=i,o=r,n.moveTo(a+s,s+o),n.lineTo(a-s,s+o),n.lineTo(a,o-s),n.closePath(),!0}drawOffset(t,e,i,r,n){var s,a,o,l,h;return s=t,a=e/2,o=i,l=r,h=n,s.moveTo(o+a+2*h,a+l+h),s.lineTo(o-a-2*h,a+l+h),s.lineTo(o,l-a-2*h),s.closePath(),!0}}var gI=new gR,gL=new class t extends gR{constructor(){super(...arguments),this.type="triangle"}};let gD=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),gj=Math.sin(eJ.BZ/10)*gD,gN=-Math.cos(eJ.BZ/10)*gD;function gF(t,e,i,r){let n=gj*e,s=gN*e;t.moveTo(i,-e+r),t.lineTo(n+i,s+r);for(let a=1;a<5;++a){let o=eJ.BZ*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+r),t.lineTo(l*n-h*s+i,h*n+l*s+r)}return t.closePath(),!0}var gG=new class t extends gT{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,r){return gF(t,e/2,i,r)}drawOffset(t,e,i,r,n){return gF(t,e/2+n,i,r)}};let gz=(0,eJ._b)(3);function gZ(t,e,i,r){let n=e/gz,s=n/5;return t.moveTo(0+i,-e+r),t.lineTo(n/2+i,r),t.lineTo(s/2+i,r),t.lineTo(s/2+i,e+r),t.lineTo(-s/2+i,e+r),t.lineTo(-s/2+i,r),t.lineTo(-n/2+i,r),t.closePath(),!0}var gH=new class t extends gT{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,r){return gZ(t,e/2,i,r)}drawOffset(t,e,i,r,n){return gZ(t,e/2+n,i,r)}};function gU(t,e,i,r){let n=2*e;return t.moveTo(i,-e+r),t.lineTo(n/3/2+i,e+r),t.lineTo(-n/3/2+i,e+r),t.closePath(),!0}var gV=new class t extends gT{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,r){return gU(t,e/2,i,r)}drawOffset(t,e,i,r,n){return gU(t,e/2+n,i,r)}};function gW(t,e,i,r){return t.moveTo(-e+i,r),t.lineTo(i,e+r),!1}var g$=new class t extends gT{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,r){return gW(t,e/2,i,r)}drawOffset(t,e,i,r,n){return gW(t,e/2+n,i,r)}};let gY=(0,eJ._b)(3)/2,gX=1/(0,eJ._b)(12);function gK(t,e,i,r){let n=e/2,s=e*gX,a=e*gX+e,o=-n;return t.moveTo(n+i,s+r),t.lineTo(n+i,a+r),t.lineTo(o+i,a+r),t.lineTo(-.5*n-gY*s+i,gY*n+-.5*s+r),t.lineTo(-.5*n-gY*a+i,gY*n+-.5*a+r),t.lineTo(-.5*o-gY*a+i,gY*o+-.5*a+r),t.lineTo(-.5*n+gY*s+i,-.5*s-gY*n+r),t.lineTo(-.5*n+gY*a+i,-.5*a-gY*n+r),t.lineTo(-.5*o+gY*a+i,-.5*a-gY*o+r),t.closePath(),!1}var gq=new class t extends gT{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,r){return gK(t,e/2,i,r)}drawOffset(t,e,i,r,n){return gK(t,e/2+n,i,r)}},gJ=new class t extends gT{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,r){var n,s,a,o;return n=t,s=e/2,a=i,o=r,n.moveTo(-s+a,o),n.lineTo(s+a,s+o),n.lineTo(s+a,o-s),n.closePath(),!0}drawOffset(t,e,i,r,n){var s,a,o,l,h;return s=t,a=e/2,o=i,l=r,h=n,s.moveTo(-a+o-2*h,l),s.lineTo(a+o+h,a+l+2*h),s.lineTo(a+o+h,l-a-2*h),s.closePath(),!0}},gQ=new class t extends gT{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,r){var n,s,a,o;return n=t,s=e/2,a=i,o=r,n.moveTo(a-s,s+o),n.lineTo(s+a,o),n.lineTo(a-s,o-s),n.closePath(),!0}drawOffset(t,e,i,r,n){var s,a,o,l,h;return s=t,a=e/2,o=i,l=r,h=n,s.moveTo(o-a-h,a+l+2*h),s.lineTo(a+o+2*h,l),s.lineTo(o-a-h,l-a-2*h),s.closePath(),!0}},g0=new class t extends gT{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,r){var n,s,a,o;return n=t,s=e/2,a=i,o=r,n.moveTo(a-s,o-s),n.lineTo(a+s,o-s),n.lineTo(a,o+s),n.closePath(),!0}drawOffset(t,e,i,r,n){var s,a,o,l,h;return s=t,a=e/2,o=i,l=r,h=n,s.moveTo(o-a-2*h,l-a-h),s.lineTo(o+a+2*h,l-a-h),s.lineTo(o,l+a+2*h),s.closePath(),!0}};let g1=(0,eJ._b)(3);function g2(t,e,i,r){let n=e*g1;return t.moveTo(i,r+-n/3*2),t.lineTo(e+i,r+n),t.lineTo(i-e,r+n),t.closePath(),!0}var g5=new class t extends gR{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,r){return g2(t,e/2/g1,i,r)}drawOffset(t,e,i,r,n){return g2(t,e/2/g1+n,i,r)}};function g3(t,e,i,r){let n=2*e;return t.moveTo(e+i,r-n),t.lineTo(i-e,r),t.lineTo(e+i,n+r),!0}var g4=new class t extends gT{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,r){return g3(t,e/4,i,r)}drawOffset(t,e,i,r,n){return g3(t,e/4+n,i,r)}};function g6(t,e,i,r){let n=2*e;return t.moveTo(i-e,r-n),t.lineTo(i+e,r),t.lineTo(i-e,n+r),!0}var g8=new class t extends gT{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,r){return g6(t,e/4,i,r)}drawOffset(t,e,i,r,n){return g6(t,e/4+n,i,r)}};function g7(t,e,i,r){let n=2*e;return t.moveTo(i-n,r+e),t.lineTo(i,r-e),t.lineTo(i+n,r+e),!0}var g9=new class t extends gT{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,r){return g7(t,e/4,i,r)}drawOffset(t,e,i,r,n){return g7(t,e/4+n,i,r)}};function ft(t,e,i,r){let n=2*e;return t.moveTo(i-n,r-e),t.lineTo(i,r+e),t.lineTo(i+n,r-e),!0}var fe=new class t extends gT{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,r){return ft(t,e/4,i,r)}drawOffset(t,e,i,r,n){return ft(t,e/4+n,i,r)}};function fi(t,e,i,r,n){return t.moveTo(i,r-e),t.lineTo(i,r+e),!0}var fr=new class t extends gT{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,r,n){return fi(t,e/2,i,r,n)}drawOffset(t,e,i,r,n,s){return fi(t,e/2+n,i,r,s)}drawToSvgPath(t,e,i,r){let n=t/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function fn(t,e,i,r,n){return t.moveTo(i-e,r),t.lineTo(i+e,r),!0}var fs=new class t extends gT{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,r,n){return fn(t,e/2,i,r,n)}drawOffset(t,e,i,r,n,s){return fn(t,e/2+n,i,r,s)}drawToSvgPath(t,e,i,r){let n=t/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function fa(t,e,i,r,n){return t.moveTo(i-e,r-e),t.lineTo(i+e,r+e),t.moveTo(i+e,r-e),t.lineTo(i-e,r+e),!0}var fo=new class t extends gT{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,r,n){return fa(t,e/2,i,r,n)}drawOffset(t,e,i,r,n,s){return fa(t,e/2+n,i,r,s)}drawToSvgPath(t,e,i,r){let n=t/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function fl(t,e,i,r){return t.rect(i-e[0]/2,r-e[1]/2,e[0],e[1]),!1}function fh(t,e,i,r){let n=e/2;return t.rect(i-e/2,r-n/2,e,n),!1}var fd=new class t extends gT{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,r){return(0,iy.Z)(e)?fh(t,e,i,r):fl(t,e,i,r)}drawOffset(t,e,i,r,n){return(0,iy.Z)(e)?fh(t,e+2*n,i,r):fl(t,[e[0]+2*n,e[1]+2*n],i,r)}};let fu={};[gB,gC,gM,gO,g5,gL,gG,gH,gV,g$,gq,gJ,gQ,gI,g0,g4,g8,g9,fe,fd,fr,fs,fo].forEach(t=>{fu[t.type]=t});let fc={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},fp=new il;class fg{constructor(t,e,i=!1){this.pathStr="",this.type=t,(0,ev.Z)(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,r,n,s,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach(n=>{t.beginPath(),iv(n.path.commandList,t,i,r,e,e),a&&a(n.path,n.attribute)}),!1):(iv(this.path.commandList,t,i,r,e+n,e+n),!1)}draw(t,e,i,r,n,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach(n=>{t.beginPath(),iv(n.path.commandList,t,i,r,e,e),s&&s(n.path,n.attribute)}),!1):(iv(this.path.commandList,t,i,r,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach(({path:i})=>{fp.x1=i.bounds.x1*t,fp.y1=i.bounds.y1*t,fp.x2=i.bounds.x2*t,fp.y2=i.bounds.y2*t,e.union(fp)})}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}class ff{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function fm(t,e,i,r){let n=t.indexOf(e,i);if(-1===n)throw Error(r);return n+e.length-1}function fv(t,e,i,r=">"){let n=function(t,e,i=">"){let r,n="";for(let s=e;s<t.length;s++){let e=t[s];if(r)e===r&&(r="");else if('"'===e||"'"===e)r=e;else if(e===i[0]){if(!i[1]||t[s+1]===i[1])return{data:n,index:s}}else" "===e&&(e=" ");n+=e}}(t,e+1,r);if(!n)return;let s=n.data,a=n.index,o=s.search(/\s/),l=s,h=!0;-1!==o&&(l=s.substr(0,o).replace(/\s\s*$/,""),s=s.substr(o+1));let d=l;if(i){let t=l.indexOf(":");-1!==t&&(h=(l=l.substr(t+1))!==n.data.substr(t+1))}return{tagName:l,tagExp:s,closeIndex:a,attrExpPresent:h,rawTagName:d}}let fy=RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class fb{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){let r=e.tagname;"string"==typeof r&&(e.tagname=r),t.addChild(e)}buildAttributesMap(t,e,i){let r={};if(!t)return;let n=function(t,e){let i=[],r=e.exec(t);for(;r;){let n=[];n.startIndex=e.lastIndex-r[0].length;let s=r.length;for(let t=0;t<s;t++)n.push(r[t]);i.push(n),r=e.exec(t)}return i}(t,fy),s=n.length;for(let t=0;t<s;t++){let e=n[t][1],i=n[t][4];e&&(r[e]=void 0===i||(isNaN(i)?i:Number(i)))}return r}parseXml(t){t=t.replace(/\r\n?/g,"\n");let e=new ff("!xml"),i=e,r="",n="";for(let s=0;s<t.length;s++)if("<"===t[s]){if("/"===t[s+1]){let e=fm(t,">",s,"Closing Tag is not closed."),a=n.lastIndexOf(".");n=n.substring(0,a),(i=this.tagsNodeStack.pop())&&i.child&&r&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=r),r="",s=e}else if("?"===t[s+1])s=fv(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=fm(t,"--\x3e",s+4,"Comment is not closed.");else{let a=fv(t,s,!1),o=a.tagName,l=a.tagExp,h=a.attrExpPresent,d=a.closeIndex;if(o!==e.tagname&&(n+=n?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),n=n.substr(0,n.length-1),l=o):l=l.substr(0,l.length-1);let t=new ff(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{let t=new ff(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),i=t}r="",s=d}}else r+=t[s];return e.child}}class fx{constructor(t){this.options=Object.assign({},fx.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){var e,i;if(!this.valid)return!1;return e=new fb(this.options).parseXml(t),i=this.options,function t(e,i){let r={};for(let n=0;n<e.length;n++){let s=e[n],a=function(t){let e=Object.keys(t);for(let t=0;t<e.length;t++){let i=e[t];if(":@"!==i)return i}}(s),o="";if(o=void 0===i?a:i+"."+a,void 0!==a&&s[a]){let e=t(s[a],o);(function(t){Object.keys(t).length})(e),s[":@"]&&function(t,e,i){if(e){let i=Object.keys(e),r=i.length;for(let n=0;n<r;n++){let r=i[n];t[r]=e[r]}}}(e,s[":@"],o),void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(e)):r[a]=e}}return r}(e)}}fx.defaultOptions={};let f_=new il,fA=["symbolType","size",...nR];class fw extends nF{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=su}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{size:t}=this.attribute;return(0,ev.Z)(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){var t;let e=rQ(this).symbol,{symbolType:i=e.symbolType}=this.attribute,r=fu[i];if(r||(r=fw.userSymbolMap[i]))return this._parsedPath=r,r;if(!0===((t=i=fc[i]||i).startsWith("<svg")||t.startsWith("<?xml"))){let{svg:t}=(new fx).parse(i);if(!t)return null;let e=(0,ev.Z)(t.path)?t.path:[t.path];f_.clear();let r=[];e.forEach(t=>{let e=(new iK).fromString(t.d),i={};sm.forEach(e=>{t[e]&&(i[sf[e]]=t[e])}),r.push({path:e,attribute:i}),f_.union(e.bounds)});let n=f_.width(),s=f_.height(),a=1/(0,eJ.Fp)(n,s);return r.forEach(t=>t.path.transform(0,0,a,a)),this._parsedPath=new fg(i,r,!0),fw.userSymbolMap[i]=this._parsedPath,this._parsedPath}let n=(new iK).fromString(i),s=n.bounds.width(),a=n.bounds.height(),o=1/(0,eJ.Fp)(s,a);return n.transform(0,0,o,o),this._parsedPath=new fg(i,n),fw.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){let e=rQ(this).symbol;this._AABBBounds.clear();let i=this.attribute,r=ru.graphicService.updateSymbolAABBBounds(i,rQ(this).symbol,this._AABBBounds,t,this),{boundsPadding:n=e.boundsPadding}=i,s=nH(n);return s&&r.expand(s),this.clearUpdateBoundTag(),r}tryUpdateOBBBounds(){throw Error("暂不支持")}getDefaultAttribute(t){return rQ(this).symbol[t]}needUpdateTags(t){return super.needUpdateTags(t,fA)}needUpdateTag(t){return super.needUpdateTag(t,fA)}toCustomPath(){let t=this.getParsedPath(),e=this.attribute.size,i=(0,ev.Z)(e)?e:[e,e];return t.path?(new iK).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new iK).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new fw(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fw.NOWORK_ANIMATE_ATTR}}function fS(t){return new fw(t)}fw.userSymbolMap={},fw.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},nN);let fT=new class t{constructor(){this.time=oF.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,r,n,s,a,o,l,h,d,u){let c=t.getParsedPath();if(!c)return;let{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;let{size:v=l.size,opacity:y=l.opacity,x:b=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY}=t.attribute,w=!(!p||!p.stroke),S=!(!g||!g.stroke);if(f){let{distance:n=l.outerBorder.distance}=p,s=aM(e,n,e.dpr);if(e.beginPath(),!1===c.drawOffset(e,v,i,r,s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.outerBorder);else if(w){let n=l.outerBorder.opacity;l.outerBorder.opacity=y,e.setStrokeStyle(t,p,(b-i)/_,(x-r)/A,l.outerBorder),l.outerBorder.opacity=n,e.stroke()}}if(m){let{distance:n=l.innerBorder.distance}=g,s=aM(e,n,e.dpr);if(e.beginPath(),!1===c.drawOffset(e,v,i,r,-s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,g,l.innerBorder);else if(S){let n=l.innerBorder.opacity;l.innerBorder.opacity=y,e.setStrokeStyle(t,g,(b-i)/_,(x-r)/A,l.innerBorder),l.innerBorder.opacity=n,e.stroke()}}}};var fk=function(t,e){return function(i,r){e(i,r,t)}};let fB=class extends oe{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=su,this.builtinContributions=[fT,a4,oh],this.init(t)}drawShape(t,e,i,r,n,s,a,o){var l;let h=rQ(t,null==s?void 0:s.theme).symbol,{size:d=h.size,x:u=h.x,y:c=h.y,scaleX:p=h.scaleX,scaleY:g=h.scaleY}=t.attribute,f=this.valid(t,h,a,o);if(!f)return;let{fVisible:m,sVisible:v,doFill:y,doStroke:b}=f,x=t.getParsedPath();if(!x)return;let{keepDirIn3d:_=h.keepDirIn3d}=t.attribute,A=null!==(l=this.z)&&void 0!==l?l:0;if(e.beginPath(),_&&e.camera&&e.project){let n=e.project(i,r,A),s=e.camera;e.camera=null,!1===x.draw(e,(0,ev.Z)(d)?[d[0]*p,d[1]*g]:d*p,n.x,n.y,void 0,(n,s)=>{var l,d,f;if(t._parsedPath.svgCache){let e=Object.assign({},s);e.fill=null!==(l=s.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(d=s.fill)&&void 0!==d?d:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(f=s.stroke)&&void 0!==f?f:t.attribute.stroke,s=e}s.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,s,u-i,c-r,h),e.fill())),s.stroke&&(o?o(e,t.attribute,h):(e.setStrokeStyle(t,s,(u-i)/p,(c-r)/g,h),e.stroke()))})&&e.closePath(),e.camera=s}else!1===x.draw(e,d,i,r,A,(n,s)=>{var l,d,f;if(t._parsedPath.svgCache){let e=Object.assign({},s);e.fill=null!==(l=s.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(d=s.opacity)&&void 0!==d?d:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(f=s.stroke)&&void 0!==f?f:t.attribute.stroke,s=e}s.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,s,u-i,c-r,h),e.fill())),s.stroke&&(o?o(e,t.attribute,h):(e.setStrokeStyle(t,s,(u-i)/p,(c-r)/g,h),e.stroke()))})&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,r,y,b,m,v,h,n,a,o),y&&!x.isSvg&&(a?a(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,u-i,c-r,h),e.fill())),b&&!x.isSvg&&(o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,(u-i)/p,(c-r)/g,h),e.stroke())),this.afterRenderStep(t,e,i,r,y,b,m,v,h,n,a,o)}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).symbol;this._draw(t,n,!1,i,r)}};fB=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),fk(0,ez(eH)),fk(0,eZ(a0)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],fB);let fC=!1,fE=new eM(t=>{fC||(fC=!0,t(fB).toSelf().inSingletonScope(),t(sG).to(fB).inSingletonScope(),t(sR).toService(sG),t(a0).toService(a6),eV(t,a0))}),fM=class extends gt{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=su}contains(t,e,i){let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=t.getParsedPath();if(!r.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(n.isSvg||"imprecise"===t.attribute.pickMode)return!0}r.highPerformanceSave();let s=rQ(t).symbol,{x:a,y:o,z:l,lastModelMatrix:h}=this.transform(t,s,r),d=e;if(r.camera){d=e.clone();let i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,r,a,o,{},null,(t,e,i)=>!!u||(u=t.isPointInPath(d.x,d.y)),(t,e,i)=>{if(u)return!0;let n=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return r.lineWidth=aM(r,n+s,r.dpr),u=t.isPointInStroke(d.x,d.y)}),this.canvasRenderer.z=0,r.modelMatrix!==h&&s1.free(r.modelMatrix),r.modelMatrix=h,r.highPerformanceRestore(),u}};fM=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(F=0,G=ez(sG),function(t,e){G(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],fM);let fP=!1,fO=new eM((t,e,i,r)=>{fP||(fP=!0,t(p2).to(fM).inSingletonScope(),t(p9).toService(p2))}),fR=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=su}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).symbol,{x:s=n.x,y:a=n.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,i,r)=>!!o||(o=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(o)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=s+a,o=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),o}};fR=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(z=0,Z=ez(sG),function(t,e){Z(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],fR);let fI=!1,fL=new eM((t,e,i,r)=>{fI||(fI=!0,t(pH).to(fR).inSingletonScope(),t(pL).toService(pH))});function fD(){fD.__loaded||(fD.__loaded=!0,as.RegisterGraphicCreator("symbol",fS),rR.load(fE),rR.load(pI?fO:fL))}fD.__loaded=!1;pC(),go(),gS(),fD();class fj extends pB{getStartAngle(){return this._startAngle}getEndAngle(){return this._endAngle}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},fj.defaultAttributes,t)),this.name="segment"}render(){this.removeAllChild(!0),this._reset();let{startSymbol:t,endSymbol:e,lineStyle:i,state:r,visible:n=!0,multiSegment:s,mainSegmentIndex:a}=this.attribute;if(!n)return;this._computeLineAngle();let o=this._renderSymbol(t,"start"),l=this._renderSymbol(e,"end");if(this.startSymbol=o,this.endSymbol=l,s){let t=[...this.attribute.points];if((0,eg.Z)(a))t[a]=this._clipPoints(t[a]);else{let e=this._clipPoints(eT(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach((t,e)=>{var n,s;let a=as.line(Object.assign(Object.assign({points:t},(0,ev.Z)(i)?null!==(n=i[e])&&void 0!==n?n:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),dn(null==r?void 0:r.line)||(a.states=(0,ev.Z)(r.line)?null!==(s=r.line[e])&&void 0!==s?s:r.line[r.line.length-1]:r.line),this.add(a)})}else{let t=as.polygon(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},ex(i)[0]),{fill:!1,closePath:!1}));t.name=`${this.name}-line`,t.id=this._getNodeId("line"),dn(null==r?void 0:r.line)||(t.states=[].concat(r.line)[0]),this.add(t)}}_renderSymbol(t,e){let i;let r=this._getMainSegmentPoints();if(!r.length)return;let{autoRotate:n=!0}=t;if(t&&t.visible){let s,a;let o=this._startAngle,l=this._endAngle,{state:h}=this.attribute,d=r[0],u=r[r.length-1],{refX:c=0,refY:p=0,refAngle:g=0,style:f,symbolType:m,size:v=12}=t;"start"===e?(s={x:d.x+((0,eg.Z)(o)?c*Math.cos(o)+p*Math.cos(o-Math.PI/2):0),y:d.y+((0,eg.Z)(o)?c*Math.sin(o)+p*Math.sin(o-Math.PI/2):0)},a=o+Math.PI/2):(s={x:u.x+((0,eg.Z)(l)?c*Math.cos(l)+p*Math.cos(l-Math.PI/2):0),y:u.y+((0,eg.Z)(l)?c*Math.sin(l)+p*Math.sin(l-Math.PI/2):0)},a=l+Math.PI/2),(i=as.symbol(Object.assign(Object.assign(Object.assign({},s),{symbolType:m,size:v,angle:n?a+g:0,strokeBoundsBuffer:0}),f))).name=`${this.name}-${e}-symbol`,i.id=this._getNodeId(`${e}-symbol`),dn(null==h?void 0:h.symbol)||(i.states=h.symbol),this.add(i)}return i}_getMainSegmentPoints(){let t;if(this._mainSegmentPoints)return this._mainSegmentPoints;let{points:e,multiSegment:i,mainSegmentIndex:r}=this.attribute;return t=i?(0,eg.Z)(r)?e[r]:eT(e):e,this._mainSegmentPoints=t,t}_clipPoints(t){let{startSymbol:e={},endSymbol:i={}}=this.attribute,r=t;if(e.visible){let i=e.clip?e.size||10:0;r=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...r.slice(1)]}if(i.visible){let e=i.clip?i.size||10:0,n={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};r=[...r.slice(0,r.length-1),n]}return r}_computeLineAngle(){let t=this._getMainSegmentPoints();if(t.length<=1)return;let e=t[0],i=t[1],r=t[t.length-2],n=t[t.length-1],s=[e.x-i.x,e.y-i.y],a=Math.atan2(s[1],s[0]),o=[n.x-r.x,n.y-r.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}function fN(t,e){return[t[0]*e,t[1]*e]}fj.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}};function fF(t,e){t.forEachChildren(t=>{let i=e(t);t.isContainer&&!i&&fF(t,e)})}let fG=t=>!(0,eB.Z)(t)&&!1!==t.visible;function fz(t){return h||(h=as.CreateGraphic("text",{})),h.initAttributes(t),h.AABBBounds}let fZ=-.5*Math.PI,fH=1.5*Math.PI,fU="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";(H=t2||(t2={})).selected="selected",H.selectedReverse="selected_reverse",H.hover="hover",H.hoverReverse="hover_reverse";let fV={[t2.selectedReverse]:{},[t2.selected]:{},[t2.hover]:{},[t2.hoverReverse]:{}},fW={container:"",width:30,height:30,style:{}},f$=(t,e,i)=>new rT(Object.assign({defaultFontParams:{fontFamily:fU,fontSize:11},getTextBounds:i?void 0:fz,specialCharSet:"-/: .,@%'\"~"+rT.ALPHABET_CHAR_SET+rT.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function fY(t,e,i=fU){var r,n;if(!t)return{width:0,height:0};let s=fz({text:t,fontFamily:null!==(r=e.fontFamily)&&void 0!==r?r:i,fontSize:e.fontSize||12,fontWeight:e.fontWeight,textAlign:null!==(n=e.textAlign)&&void 0!==n?n:"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||12});return{width:s.width(),height:s.height()}}function fX(t,e="type"){return e in t&&"rich"===t[e]||(0,ep.Z)(t.text)&&"rich"===t.text.type}function fK(t){var e,i;return t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.maxWidth=t.maxLineWidth,t.textConfig=t.text.text||t.text,t}(U=t5||(t5={})).innerView="inner-view",U.axisContainer="axis-container",U.labelContainer="axis-label-container",U.tickContainer="axis-tick-container",U.tick="axis-tick",U.subTick="axis-sub-tick",U.label="axis-label",U.title="axis-title",U.gridContainer="axis-grid-container",U.grid="axis-grid",U.gridRegion="axis-grid-region",U.line="axis-line",U.background="axis-background",U.axisLabelBackground="axis-label-background",(V=t3||(t3={})).selected="selected",V.selectedReverse="selected_reverse",V.hover="hover",V.hoverReverse="hover_reverse";let fq={[t3.selectedReverse]:{},[t3.selected]:{},[t3.hover]:{},[t3.hoverReverse]:{}},fJ={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}},fQ=["width","x1","y1","height","cornerRadius",...nR];class f0 extends nF{constructor(t){super(t),this.type="rect",this.numberType=sl}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}doUpdateAABBBounds(){let t=rQ(this).rect;this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updateRectAABBBounds(e,rQ(this).rect,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=e,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw Error("暂不支持")}getDefaultAttribute(t){return rQ(this).rect[t]}needUpdateTags(t){return super.needUpdateTags(t,fQ)}needUpdateTag(t){return super.needUpdateTag(t,fQ)}toCustomPath(){let{x:t,y:e,width:i,height:r}=d6(this.attribute),n=new iK;return n.moveTo(t,e),n.rect(t,e,i,r),n}clone(){return new f0(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return f0.NOWORK_ANIMATE_ATTR}}function f1(t){return new f0(t)}f0.NOWORK_ANIMATE_ATTR=nN;var f2=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let f5=class{constructor(){this.time=oF.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,r,n,s,a,o,l,h,d,u,c){let{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some(t=>!1===t)&&(c.doStroke=!1)}};f5=f2([ej()],f5);let f3=class{constructor(){this.time=oF.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,r,n,s,a,o,l,h,d,u){let{width:c=l.width,height:p=l.height,stroke:g=l.stroke}=t.attribute;if(Array.isArray(g)&&g.some(t=>!1===t)){if(e.setStrokeStyle(t,t.attribute,i,r,l),e.beginPath(),e.moveTo(i,r),g[0]?e.lineTo(i+c,r):e.moveTo(i+c,r),g[1]?e.lineTo(i+c,r+p):e.moveTo(i+c,r+p),g[2]?e.lineTo(i,r+p):e.moveTo(i,r+p),g[3]){let t=g[0]?r-e.lineWidth/2:r;e.lineTo(i,t)}else e.moveTo(i,r);e.stroke()}}};f3=f2([ej()],f3);let f4=new class t{constructor(){this.time=oF.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,r,n,s,a,o,l,h,d,u){let{outerBorder:c,innerBorder:p}=t.attribute,g=c&&!1!==c.visible,f=p&&!1!==p.visible;if(!g&&!f)return;let{cornerRadius:m=l.cornerRadius,opacity:v=l.opacity,x:y=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:_=l.scaleY,x1:A,y1:w}=t.attribute,{width:S,height:T}=t.attribute;S=(null!=S?S:A-i)||0,T=(null!=T?T:w-r)||0;let k=!(!c||!c.stroke),B=!(!p||!p.stroke);if(g){let{distance:n=l.outerBorder.distance}=c,s=aM(e,n,e.dpr),a=i-s,o=r-s,h=2*s;if(0===m||(0,ev.Z)(m)&&m.every(t=>0===t)?(e.beginPath(),e.rect(a,o,S+h,T+h)):(e.beginPath(),aD(e,a,o,S+h,T+h,m)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,c,l.outerBorder);else if(k){let n=l.outerBorder.opacity;l.outerBorder.opacity=v,e.setStrokeStyle(t,c,(y-i)/x,(b-r)/_,l.outerBorder),l.outerBorder.opacity=n,e.stroke()}}if(f){let{distance:n=l.innerBorder.distance}=p,s=aM(e,n,e.dpr),a=i+s,o=r+s,h=2*s;if(0===m||(0,ev.Z)(m)&&m.every(t=>0===t)?(e.beginPath(),e.rect(a,o,S-h,T-h)):(e.beginPath(),aD(e,a,o,S-h,T-h,m)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(B){let n=l.innerBorder.opacity;l.innerBorder.opacity=v,e.setStrokeStyle(t,p,(y-i)/x,(b-r)/_,l.innerBorder),l.innerBorder.opacity=n,e.stroke()}}}};var f6=function(t,e){return function(i,r){e(i,r,t)}};let f8=class extends oe{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=sl,this.builtinContributions=[f4,a4,oh],this.init(t)}drawShape(t,e,i,r,n,s,a,o){var l,h,d;let u=null!==(l=this.tempTheme)&&void 0!==l?l:rQ(t,null==s?void 0:s.theme).rect,{fill:c=u.fill,background:p,stroke:g=u.stroke,cornerRadius:f=u.cornerRadius,opacity:m=u.opacity,fillOpacity:v=u.fillOpacity,lineWidth:y=u.lineWidth,strokeOpacity:b=u.strokeOpacity,visible:x=u.visible,x1:_,y1:A,x:w=u.x,y:S=u.y}=t.attribute,{width:T,height:k}=t.attribute;T=(null!=T?T:_-w)||0;let B=aG(m,v,T,k=(null!=k?k:A-S)||0,c),C=aZ(m,b,T,k),E=(h=c,d=p,!(!h&&!d)),M=aN(g,y);if(!t.valid||!x||!E&&!M||!(B||C||a||o||p))return;0===f||(0,ev.Z)(f)&&f.every(t=>0===t)?(e.beginPath(),e.rect(i,r,T,k)):(e.beginPath(),aD(e,i,r,T,k,f));let P={doFill:E,doStroke:M};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,r,E,M,B,C,u,n,a,o,P),P.doFill&&(a?a(e,t.attribute,u):B&&(e.setCommonStyle(t,t.attribute,w-i,S-r,u),e.fill())),P.doStroke&&(o?o(e,t.attribute,u):C&&(e.setStrokeStyle(t,t.attribute,w-i,S-r,u),e.stroke())),this.afterRenderStep(t,e,i,r,E,M,B,C,u,n,a,o)}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).rect;this.tempTheme=n,this._draw(t,n,!1,i,r),this.tempTheme=null}};f8=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),f6(0,ez(eH)),f6(0,eZ(aQ)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],f8);let f7=!1,f9=new eM(t=>{f7||(f7=!0,t(f8).toSelf().inSingletonScope(),t(sN).to(f8).inSingletonScope(),t(sR).toService(sN),t(f3).toSelf(),t(f5).toSelf(),t(aQ).toService(f3),t(aQ).toService(f5),t(aQ).toService(a6),eV(t,aQ))}),mt=new il,me=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=sl}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).rect,{cornerRadius:s=n.cornerRadius}=t.attribute,{x:a=n.x,y:o=n.y}=t.attribute;r.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,l=!1,r.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||(0,iy.Z)(s,!0)&&0!==s||(0,ev.Z)(s)&&s.some(t=>0!==t))h=!1,this.canvasRenderer.drawShape(t,r,a,o,{},null,(t,i,r)=>!!h||(h=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(h)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=aM(r,s+a,r.dpr),h=t.isPointInStroke(e.x,e.y)});else{let{fill:i=n.fill,stroke:r=n.stroke,lineWidth:s=n.lineWidth}=t.attribute;if(i)h=!0;else if(r){let i=t.AABBBounds;mt.setValue(i.x1,i.y1,i.x2,i.y2),mt.expand(-s/2),h=!mt.containsPoint(e)}}return r.highPerformanceRestore(),h}};me=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(W=0,$=ez(sN),function(t,e){$(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],me);let mi=!1,mr=new eM((t,e,i,r)=>{mi||(mi=!0,t(p0).to(me).inSingletonScope(),t(p9).toService(p0))}),mn=new il,ms=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=sl}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).rect,{cornerRadius:s=n.cornerRadius}=t.attribute,{x:a=n.x,y:o=n.y}=t.attribute;r.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);a+=e.x,o+=e.y,r.setTransformForCurrent()}else a=0,o=0,l=!1,r.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||(0,iy.Z)(s,!0)&&0!==s||(0,ev.Z)(s)&&s.some(t=>0!==t))h=!1,this.canvasRenderer.drawShape(t,r,a,o,{},null,(t,i,r)=>!!h||(h=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(h)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=s+a,h=t.isPointInStroke(e.x,e.y)});else if(h){let{fill:i=n.fill,stroke:r=n.stroke,lineWidth:s=n.lineWidth}=t.attribute;if(i)h=!0;else if(r){let i=t.AABBBounds;mn.setValue(i.x1,i.y1,i.x2,i.y2),mn.expand(-s/2),h=!mn.containsPoint(e)}}return r.highPerformanceRestore(),h}};ms=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(Y=0,X=ez(sN),function(t,e){X(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ms);let ma=!1,mo=new eM((t,e,i,r)=>{ma||(ma=!0,t(pZ).to(ms).inSingletonScope(),t(pL).toService(pZ))});function ml(){ml.__loaded||(ml.__loaded=!0,as.RegisterGraphicCreator("rect",f1),rR.load(f9),rR.load(pI?mr:mo))}ml.__loaded=!1;class mh{constructor(t,e,i,r,n,s,a,o,l,h,d,u,c,p){this.left=t,this.top=e,this.width=i,this.height=r,this.actualHeight=0,this.bottom=e+r,this.right=t+i,this.ellipsis=n,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=rc[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=u,this.singleLine=c,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){let{width:i,height:r}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0,s=this.isHeightMax?Math.min(this.height,r):this.height||r||0;s=Math.min(s,r);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-n:"center"===this.globalAlign&&(o=-n/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection){if(this.actualHeight>=l&&0!==l)for(let i=0;i<this.lines.length;i++){let{top:r,height:n}=this.lines[i];if(r+n<this[this.directionKey.top]||r+n>this[this.directionKey.top]+l)break;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}else{let i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){let{top:r,height:n}=this.lines[i],s=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,o,s+a,e);else{if(s+n>this[this.directionKey.top]+l||s<this[this.directionKey.top])return h;{let r=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(r=!0,h=!0),this.lines[i].draw(t,r,o,s+a,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);let{top:r,height:n}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e);else{if(r+n<this[this.directionKey.top]||r+n>this[this.directionKey.top]+l)return h;{let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){let r=this.lines[i];r.actualWidth>t&&(t=r.actualWidth),e+=r.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0,{width:i,height:r}=this.getRawActualSize();this.width;let n=this.height||r||0;n=Math.min(n,r);let s=this[this.directionKey.height];if(this.singleLine&&(s=this.lines[0].height+1),"middle"===this.verticalDirection){if(this.actualHeight>=s&&0!==s)for(let i=0;i<this.lines.length;i++){let{top:r,height:n}=this.lines[i];if(r+n<this[this.directionKey.top]||r+n>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){let r=this.lines[i].getWidthWithEllips();r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{this.actualHeight;for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){let{top:r,height:n}=this.lines[i],a=s-this.lines[i].top-this.lines[i].height;if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+n>this[this.directionKey.top]+s||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){let r=this.lines[i].getWidthWithEllips();r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){let{top:r,height:n}=this.lines[i];if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(r+n<this[this.directionKey.top]||r+n>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){let r=this.lines[i].getWidthWithEllips();r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class md{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";let r=n0(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof r?r>this.fontSize?r:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;let{ascent:n,height:s,descent:a,width:o}=rb(t,i),l=0,h=0,d=0;this.height>s&&(h=Math.ceil(l=(this.height-s)/2),d=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=s-l):"bottom"===this.textBaseline?(this.ascent=s-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=a+d),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){let{width:t}=rb(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,r,n){let s=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)s="...",o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"!==n&&"end"!==n||(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){let t=rv(s,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t)+"...","right"===n||"end"===n){let{width:e}=rb(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.stroke&&(function(t,e){let i=e&&e.stroke||rp.stroke;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i;let r=e.fontSize||16;switch(e.script){case"super":case"sub":r*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:r,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,a,e)),function(t,e){let i=e&&e.fill||rp.fill;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=i;let r=e.fontSize||16;switch(e.script){case"super":case"sub":r*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:r,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text,i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){let t=rv(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t)+"...";let{width:r}=rb(this.text.slice(t),this.character);return i+this.ellipsisWidth-r}return i}}let mu=["width","height","image",...nR];class mc extends nF{constructor(t){super(t),this.type="image",this.numberType=sr,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,()=>{this.successCallback&&this.successCallback()})}imageLoadFail(t,e){super.imageLoadFail(t,()=>{this.failCallback&&this.failCallback()})}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,r){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,r)}doUpdateAABBBounds(){let t=rQ(this).image;this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updateImageAABBBounds(e,rQ(this).image,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=e,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw Error("暂不支持")}getDefaultAttribute(t){return rh[t]}needUpdateTags(t){return super.needUpdateTags(t,mu)}needUpdateTag(t){return super.needUpdateTag(t,mu)}clone(){return new mc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return mc.NOWORK_ANIMATE_ATTR}}function mp(t){return new mc(t)}mc.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},nN);class mg extends mc{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){let e=nH(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if((0,ev.Z)(i)&&-1!==i.indexOf("margin")||"margin"===i){if(e.margin){let t=nH(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();let{width:t=rh.width,height:e=rh.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:r=e}=this.attribute;return this._AABBBounds.expand([0,(i-t)/2*2,(r-e)/2*2,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class mf{constructor(t,e,i,r,n,s,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=r,this.descent=n,this.top=i-r,this.paragraphs=s.map(t=>t),this.textAlign=(this.paragraphs[0]instanceof mg?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=rc[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach((t,e)=>{if(0===e&&t instanceof md){let e=rm.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)}),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){let i=this.directionKey,r=this.height,n=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?n=t-this.actualWidth:"center"===this.textAlign?n=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?n=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map(function(t){t instanceof mg?(t["_"+i.x]=n,n+=t[i.width]+s,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?r-t.height:(r-t.height)/2):(t[i.left]=n,n+=t[i.width]+s)})}draw(t,e,i,r,n){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){let i=this.paragraphs[e];if(i instanceof mg)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}let{width:r}=rb("...",i.character),n=r||0;if(n<=this.blankWidth+t){i.ellipsis="add";break}if(n<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=n,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}}this.paragraphs.map((e,s)=>{if(e instanceof mg)return e.setAttributes({x:i+e._x,y:r+e._y}),void n(e,t,i+e._x,r+e._y,this.ascent);e.draw(t,r+this.ascent,i,0===s,this.textAlign)})}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){let i=this.paragraphs[e];if(i instanceof mg)break;let{width:r}=rb("...",i.character),n=r||0;if(n<=this.blankWidth+t){i.ellipsis="add",i.ellipsisWidth=n;break}if(n<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=n,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}let e=0;return this.paragraphs.map((t,i)=>{e+=t instanceof mg?t.width:t.getWidthWithEllips(this.direction)}),e}}class mm{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=rc[this.direction]}store(t){if(t instanceof mg){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;let t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new mf(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof mg?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t)))}cut(t){let e=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(e/t[this.directionKey.width]*t.length)||0,r=rv(t.text,e,t.character,i,"break-word"===this.frame.wordBreak);if(0!==r){let[e,i]=function(t,e){let i=t.text.slice(0,e),r=t.text.slice(e);return[new md(i,t.newLine,t.character),new md(r,!0,t.character)]}(t,r);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let mv=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...nR];class my extends nF{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=sd}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:rl.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:rl.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:rl.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:rl.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:rl.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:rl.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:rl.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:rl.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){let t=rQ(this).richtext;this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updateRichTextAABBBounds(e,rQ(this).richtext,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=e,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw Error("暂不支持")}getDefaultAttribute(t){return rl[t]}needUpdateTags(t){return super.needUpdateTags(t,mv)}needUpdateTag(t){return super.needUpdateTag(t,mv)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}combinedStyleToCharacter(t){let{fill:e,stroke:i,fontSize:r,fontFamily:n,fontStyle:s,fontWeight:a,lineWidth:o}=this.attribute;return Object.assign({fill:e,stroke:i,fontSize:r,fontFamily:n,fontStyle:s,fontWeight:a,lineWidth:o},t)}doUpdateFrameCache(){var t;let{textConfig:e=[],maxWidth:i,maxHeight:r,width:n,height:s,ellipsis:a,wordBreak:o,verticalDirection:l,textAlign:h,textBaseline:d,layoutDirection:u,singleLine:c}=this.attribute,p=[];for(let t=0;t<e.length;t++)if("image"in e[t]){let i=this.combinedStyleToCharacter(e[t]),r=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(r)p.push(r);else{let t=new mg(i);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else{let i=this.combinedStyleToCharacter(e[t]);if((0,iy.Z)(i.text)&&(i.text=`${i.text}`),i.text&&i.text.includes("\n")){let t=i.text.split("\n");for(let e=0;e<t.length;e++)p.push(new md(t[e],0!==e,i))}else i.text&&p.push(new md(i.text,!1,i))}let g="number"==typeof i&&Number.isFinite(i)&&i>0,f="number"==typeof r&&Number.isFinite(r)&&r>0,m="number"==typeof n&&Number.isFinite(n)&&n>0&&(!g||n<=i),v="number"==typeof s&&Number.isFinite(s)&&s>0&&(!f||s<=r),y=new mh(0,0,(m?n:g?i:0)||0,(v?s:f?r:0)||0,a,o,l,h,d,u||"horizontal",!m&&g,!v&&f,c||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),b=new mm(y);for(let t=0;t<p.length;t++)b.deal(p[t]);if(b.send(),!("horizontal"===y.layoutDirection?m:v)){let t=y.getActualSizeWidthEllipsis(),e="horizontal"===y.layoutDirection?t.width:t.height;("horizontal"===y.layoutDirection?g:f)&&(e=Math.min(e,"horizontal"===y.layoutDirection?i:r)),y.lines.forEach(function(t){t.calcOffset(e,!1)})}this._frameCache=y}clone(){return new my(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach(i=>{i.setStage(t,e)})}bindIconEvent(){this.addEventListener("pointermove",t=>{var e,i,r,n,s;let a=this.pickIcon(t.global);a&&a===this._currentHoverIcon||(a?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=a,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(a.attribute.cursor),null===(r=this.stage)||void 0===r||r.renderNextFrame()):!a&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame()))}),this.addEventListener("pointerleave",t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(i=this.stage)||void 0===i||i.renderNextFrame())})}pickIcon(t){let e;let i=this.getFrameCache(),{e:r,f:n}=this.globalTransMatrix;return i.icons.forEach(i=>{var s,a;i.AABBBounds.containsPoint({x:t.x-r,y:t.y-n})&&((e=i).globalX=(null!==(s=e.attribute.x)&&void 0!==s?s:0)+r,e.globalY=(null!==(a=e.attribute.y)&&void 0!==a?a:0)+n)}),e}getNoWorkAnimateAttr(){return my.NOWORK_ANIMATE_ATTR}}function mb(t){return new my(t)}my.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},nN);let mx=new class t extends a3{constructor(){super(...arguments),this.time=oF.beforeFillStroke}drawShape(t,e,i,r,n,s,a,o,l,h,d,u){var c,p,g,f,m,v,y,b,x,_;let{backgroundMode:A=l.backgroundMode,backgroundFit:w=l.backgroundFit}=t.attribute,S,{background:T}=t.attribute;if(!T)return;let k=(0,ep.Z)(T)&&T.background,B=t.transMatrix.onlyTranslate();if(k){let e=t.AABBBounds,i=(null!==(c=T.x)&&void 0!==c?c:e.x1)+(null!==(p=T.dx)&&void 0!==p?p:0),r=(null!==(g=T.y)&&void 0!==g?g:e.y1)+(null!==(f=T.dy)&&void 0!==f?f:0),n=null!==(m=T.width)&&void 0!==m?m:e.width(),s=null!==(v=T.height)&&void 0!==v?v:e.height();if(S=aO.allocate(i,r,i+n,r+s),T=T.background,!B){let t=S.width(),e=S.height();S.set((null!==(y=T.x)&&void 0!==y?y:0)+(null!==(b=T.dx)&&void 0!==b?b:0),(null!==(x=T.y)&&void 0!==x?x:0)+(null!==(_=T.dy)&&void 0!==_?_:0),t,e)}}else S=t.AABBBounds,B||(S=fz(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){let n=t.resources.get(T);if("success"!==n.state||!n.data)return;e.highPerformanceSave(),B&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,r,l),this.doDrawImage(e,n.data,S,A,w),e.highPerformanceRestore(),e.setTransformForCurrent()}else{let{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,r,l),e.fillStyle=T,n?(aD(e,S.x1,S.y1,S.width(),S.height(),n),e.fill()):e.fillRect(S.x1,S.y1,S.width(),S.height()),e.highPerformanceRestore()}k&&aO.free(S)}},m_=class extends oe{constructor(){super(),this.numberType=sd,this.builtinContributions=[mx],this.init()}drawShape(t,e,i,r,n){var s,a,o,l;let h=rQ(t).richtext,{strokeOpacity:d=h.strokeOpacity,opacity:u=h.opacity,fillOpacity:c=h.fillOpacity,visible:p=h.visible}=t.attribute;if(!t.valid||!p)return;let g=(s=u,a=c,s*a>0),f=(o=u,l=d,o*l>0);g&&(e.translate(i,r),this.beforeRenderStep(t,e,i,r,g,f,g,f,h,n),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,r,g,f,g,f,h,n))}drawIcon(t,e,i,r,n){var s;let a=rQ(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:d,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:c=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:v=o,backgroundHeight:y=l}=t.attribute;if(m&&(i+=t._marginArray[3],r+=t._marginArray[0]),t._hovered){let t=(v-o)/2,n=(y-l)/2;0===f?(e.beginPath(),e.rect(i-t,r-n,v,y)):(e.beginPath(),aD(e,i-t,r-n,v,y,f)),u&&(e.globalAlpha=c,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}let b=d&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(d));b&&"success"===b.state&&(e.globalAlpha=h,e.drawImage(b.data,i,r,o,l))}draw(t,e,i){let r=rQ(t).richtext;this._draw(t,r,!1,i)}};m_=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],m_);let mA=!1,mw=new eM(t=>{mA||(mA=!0,t(sZ).to(m_).inSingletonScope(),t(sR).toService(sZ))}),mS=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=sd}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};mS=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(K=0,q=ez(sZ),function(t,e){q(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],mS);let mT=!1,mk=new eM((t,e,i,r)=>{mT||(mT=!0,t(p6).to(mS).inSingletonScope(),t(p9).toService(p6))}),mB=class{constructor(){this.type="image",this.numberType=sr}contains(t,e,i){let{pickContext:r}=null!=i?i:{};return!!r&&!!t.AABBBounds.containsPoint(e)}};mB=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],mB);let mC=!1,mE=new eM((t,e,i,r)=>{mC||(mC=!0,t(pF).to(mB).inSingletonScope(),t(mB).toService(pF))});function mM(){mM.__loaded||(mM.__loaded=!0,as.RegisterGraphicCreator("richtext",mb),rR.load(mw),rR.load(pI?mk:mE))}mM.__loaded=!1;function mP(t,e={},i){i||(i=1);let{fontStyle:r=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(r?r+" ":"")+(n?n+" ":"")+(s?s+" ":"")+a*i+"px "+(o||"sans-serif")}function mO(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function mR(t,e,i,r=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?r-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}class mI{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=-(t.width/2);else{if("right"!==e&&"end"!==e)throw Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?-(t.height/2):"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,r,n,s,a,o,l){let h=[],d=[e,i],u=[0,0];for(;t.length>0;){let{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a,o,l);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===r||"start"===r||("center"===r?u[0]=-(d[0]/2):"right"!==r&&"end"!==r||(u[0]=-d[0])),"top"===n||("middle"===n?u[1]=-(d[1]/2):"bottom"===n&&(u[1]=-d[1]));let c={xOffset:u[0],yOffset:u[1],width:d[0],height:d[1]};return this.layoutWithBBox(c,h,r,n,s)}GetLayoutByLines(t,e,i,r,n="",s,a,o="end"){t=t.map(t=>t.toString());let l=[],h=[0,0];if("number"==typeof a&&a!==1/0){let e;for(let i=0,r=t.length;i<r;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),a),l.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,n,s,o).str,width:e});h[0]=a}else{let e,i;a=0;for(let r=0,n=t.length;r<n;r++)i=t[r],e=this.textMeasure.measureTextWidth(i,this.textOptions),a=Math.max(a,e),l.push({str:i,width:e});h[0]=a}h[1]=l.length*r,h[0]=l.reduce((t,e)=>Math.max(t,e.width),0);let d={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(d,e,i),this.layoutWithBBox(d,l,e,i,r)}layoutWithBBox(t,e,i,r,n){let s=[0,0],a=e.length*n;"top"===r||("middle"===r?s[1]=(t.height-a)/2:"bottom"===r&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,r,n,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:n,textAlign:i,textBaseline:r}}lineOffset(t,e,i,r,n,s){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(n-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=n,e}}let mL=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...nR];class mD extends nF{get font(){let t=rQ(this).text;return this._font||(this._font=mP(this.attribute,t)),this._font}get clipedText(){var t;let e=this.attribute,i=rQ(this).text;if(!this.isSimplify())return;let{maxLineWidth:r=i.maxLineWidth}=e;return Number.isFinite(r)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){let t=rQ(this).text,e=this.attribute;if(this.isMultiLine)return;let{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),"vertical"===e.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map(t=>t.text).join("")!==e.text.toString():null!=this.clipedText&&this.clipedText!==e.text.toString())}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=sc,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{text:t}=this.attribute;return(0,ev.Z)(t)?!t.every(t=>null==t||""===t):null!=t&&""!==t}doUpdateAABBBounds(){let t=rQ(this).text;this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=this.attribute,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),i}updateWrapAABBBounds(t){var e,i,r,n;let s=rQ(this).text,{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,ellipsis:d=s.ellipsis,maxLineWidth:u,stroke:c=s.stroke,lineWidth:p=s.lineWidth,wordBreak:g=s.wordBreak,fontWeight:f=s.fontWeight,ignoreBuf:m=s.ignoreBuf,suffixPosition:v=s.suffixPosition,heightLimit:y=0,lineClamp:b}=this.attribute,x=null!==(e=n0(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){let t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}let _=new mI(a,{fontSize:h,fontWeight:f,fontFamily:a},ru.graphicUtil.textMeasure),A=(0,ev.Z)(t)?t.map(t=>t.toString()):[t.toString()],w=[],S=[0,0],T=1/0;if(y>0&&(T=Math.max(Math.floor(y/x),1)),b&&(T=Math.min(T,b)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<A.length;t++){let e=A[t],i=!0;if(t===T-1){let t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,u,d,!1,v);w.push({str:t.str,width:t.width});break}let s=_.textMeasure.clipText(e,_.textOptions,u,"break-word"===g);if(""!==e&&""===s.str){if(d){let t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,u,d,!1,v);s.str=null!==(r=t.str)&&void 0!==r?r:"",s.width=null!==(n=t.width)&&void 0!==n?n:0}else s.str="",s.width=0;i=!1}if(w.push({str:s.str,width:s.width}),s.str.length===e.length);else if(i){let i=e.substring(s.str.length);A.splice(t+1,0,i)}}let t=0;w.forEach(e=>{t=Math.max(t,e.width)}),S[0]=t}else{let t,e,i=0;for(let r=0,n=A.length;r<n;r++){if(r===T-1){let t=_.textMeasure.clipTextWithSuffix(A[r],_.textOptions,u,d,!1,v);w.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=A[r],i=Math.max(i,t=_.textMeasure.measureTextWidth(e,_.textOptions,"break-word"===g)),w.push({str:e,width:t})}S[0]=i}S[1]=w.length*(x+(m?0:2));let k={xOffset:0,yOffset:0,width:S[0],height:S[1]};_.LayoutBBox(k,o,l);let B=_.layoutWithBBox(k,w,o,l,x);return this.cache.layoutData=B,this.clearUpdateShapeTag(),this._AABBBounds.set(k.xOffset,k.yOffset,k.xOffset+k.width,k.yOffset+k.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}updateSingallineAABBBounds(t){let e=rQ(this).text,{direction:i=e.direction,underlineOffset:r=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===i&&r&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+r),n}updateMultilineAABBBounds(t){let e=rQ(this).text,{direction:i=e.direction,underlineOffset:r=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&r&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+r),n}updateHorizontalSinglelineAABBBounds(t){var e,i;let r,n;let s=rQ(this).text,{wrap:a=s.wrap}=this.attribute;if(a)return this.updateWrapAABBBounds([t]);let o=ru.graphicUtil.textMeasure,l=this.attribute,{maxLineWidth:h=s.maxLineWidth,ellipsis:d=s.ellipsis,textAlign:u=s.textAlign,textBaseline:c=s.textBaseline,fontFamily:p=s.fontFamily,fontSize:g=s.fontSize,fontWeight:f=s.fontWeight,stroke:m=s.stroke,lineWidth:v=s.lineWidth,ignoreBuf:y=s.ignoreBuf,whiteSpace:b=s.whiteSpace,suffixPosition:x=s.suffixPosition}=l;if("normal"===b)return this.updateWrapAABBBounds(t);let _=y?0:Math.max(2,.075*g),A=l.fontSize||s.fontSize,w=null!==(e=n0(l.lineHeight,A))&&void 0!==e?e:A+_;if(!this.shouldUpdateShape()&&this.cache){let t=mO(u,r=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0),e=mR(c,w,g);return this._AABBBounds.set(t,e,t+r,e+w),m&&this._AABBBounds.expand(v/2),this._AABBBounds}if(Number.isFinite(h)){if(d){let e=!0===d?s.ellipsis:d,i=o.clipTextWithSuffix(t.toString(),{fontSize:g,fontWeight:f,fontFamily:p},h,e,!1,x);n=i.str,r=i.width}else{let e=o.clipText(t.toString(),{fontSize:g,fontWeight:f,fontFamily:p},h,!1);n=e.str,r=e.width}this.cache.clipedText=n,this.cache.clipedWidth=r}else r=o.measureTextWidth(t.toString(),{fontSize:g,fontWeight:f,fontFamily:p}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=r;this.clearUpdateShapeTag();let S=mO(u,r),T=w;ru.global&&ru.global.isSafari()&&(T+=.2*g);let k=mR(c,T,g,_);return this._AABBBounds.set(S,k,S+r,k+T),m&&this._AABBBounds.expand(v/2),this._AABBBounds}getBaselineMapAlign(){return mD.baselineMapAlign}getAlignMapBaseline(){return mD.alignMapBaseline}updateVerticalSinglelineAABBBounds(t){var e,i,r;let n;let s=rQ(this).text,a=ru.graphicUtil.textMeasure,o=this.attribute,{ignoreBuf:l=s.ignoreBuf}=o,{maxLineWidth:h=s.maxLineWidth,ellipsis:d=s.ellipsis,fontSize:u=s.fontSize,fontWeight:c=s.fontWeight,fontFamily:p=s.fontFamily,stroke:g=s.stroke,lineWidth:f=s.lineWidth,verticalMode:m=s.verticalMode,suffixPosition:v=s.suffixPosition}=o,y=null!==(e=n0(o.lineHeight,o.fontSize||s.fontSize))&&void 0!==e?e:(o.fontSize||s.fontSize)+(l?0:2),{textAlign:b=s.textAlign,textBaseline:x=s.textBaseline}=o;if(!m){let t=b;b=null!==(i=mD.baselineMapAlign[x])&&void 0!==i?i:"left",x=null!==(r=mD.alignMapBaseline[t])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){let t=mO(b,n=this.cache.clipedWidth),e=mR(x,y,u);return this._AABBBounds.set(e,t,e+y,t+n),g&&this._AABBBounds.expand(f/2),this._AABBBounds}let _=[n3(t.toString())];if(Number.isFinite(h)){if(d){let t=!0===d?s.ellipsis:d,e=a.clipTextWithSuffixVertical(_[0],{fontSize:u,fontWeight:c,fontFamily:p},h,t,!1,v);_=[e.verticalList],n=e.width}else{let t=a.clipTextVertical(_[0],{fontSize:u,fontWeight:c,fontFamily:p},h,!1);_=[t.verticalList],n=t.width}this.cache.verticalList=_,this.cache.clipedWidth=n}else n=0,_[0].forEach(t=>{let e=t.direction===oH.HORIZONTAL?u:a.measureTextWidth(t.text,{fontSize:u,fontWeight:c,fontFamily:p});n+=e,t.width=e}),this.cache.verticalList=_,this.cache.clipedWidth=n;this.clearUpdateShapeTag();let A=mO(b,n),w=mR(x,y,u);return this._AABBBounds.set(w,A,w+y,A+n),g&&this._AABBBounds.expand(f/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;let r=rQ(this).text,{wrap:n=r.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds(t);let s=this.attribute,{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,fontWeight:d=r.fontWeight,ellipsis:u=r.ellipsis,maxLineWidth:c,stroke:p=r.stroke,lineWidth:g=r.lineWidth,whiteSpace:f=r.whiteSpace,suffixPosition:m=r.suffixPosition}=s,v=null!==(e=n0(s.lineHeight,s.fontSize||r.fontSize))&&void 0!==e?e:s.fontSize||r.fontSize;if("normal"===f)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){let t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}let y=new mI(a,{fontSize:h,fontWeight:d,fontFamily:a},ru.graphicUtil.textMeasure).GetLayoutByLines(t,o,l,v,!0===u?r.ellipsis:u||void 0,!1,c,m),{bbox:b}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(b.xOffset,b.yOffset,b.xOffset+b.width,b.yOffset+b.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,r;let n;let s=rQ(this).text,a=ru.graphicUtil.textMeasure,o=this.attribute,{ignoreBuf:l=s.ignoreBuf}=o,{maxLineWidth:h=s.maxLineWidth,ellipsis:d=s.ellipsis,fontFamily:u=s.fontFamily,fontSize:c=s.fontSize,fontWeight:p=s.fontWeight,stroke:g=s.stroke,lineWidth:f=s.lineWidth,verticalMode:m=s.verticalMode,suffixPosition:v=s.suffixPosition}=o,y=null!==(e=n0(o.lineHeight,o.fontSize||s.fontSize))&&void 0!==e?e:(o.fontSize||s.fontSize)+(l?0:2),{textAlign:b=s.textAlign,textBaseline:x=s.textBaseline}=o;if(!m){let t=b;b=null!==(i=mD.baselineMapAlign[x])&&void 0!==i?i:"left",x=null!==(r=mD.alignMapBaseline[t])&&void 0!==r?r:"top"}if(n=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach(t=>{let e=t.reduce((t,e)=>t+e.width,0);n=(0,eJ.Fp)(e,n)});let t=mO(b,n),e=this.cache.verticalList.length*y,i=mR(x,e,c);return this._AABBBounds.set(i,t,i+e,t+n),g&&this._AABBBounds.expand(f/2),this._AABBBounds}let _=t.map(t=>n3(t.toString()));_.forEach((t,e)=>{if(Number.isFinite(h)){if(d){let i=!0===d?s.ellipsis:d,r=a.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:p,fontFamily:u},h,i,!1,v);_[e]=r.verticalList,n=r.width}else{let i=a.clipTextVertical(t,{fontSize:c,fontWeight:p,fontFamily:u},h,!1);_[e]=i.verticalList,n=i.width}}else n=0,t.forEach(t=>{let e=t.direction===oH.HORIZONTAL?c:a.measureTextWidth(t.text,{fontSize:c,fontWeight:p,fontFamily:u});n+=e,t.width=e})}),this.cache.verticalList=_,this.clearUpdateShapeTag(),this.cache.verticalList.forEach(t=>{let e=t.reduce((t,e)=>t+e.width,0);n=(0,eJ.Fp)(e,n)});let A=mO(b,n),w=this.cache.verticalList.length*y,S=mR(x,w,c);return this._AABBBounds.set(S,A,S+w,A+n),g&&this._AABBBounds.expand(f/2),this._AABBBounds}tryUpdateOBBBounds(){throw Error("暂不支持")}getDefaultAttribute(t){return rQ(this).text[t]}needUpdateTags(t,e=mL){return super.needUpdateTags(t,e)}needUpdateTag(t,e=mL){return super.needUpdateTag(t,e)}clone(){return new mD(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return mD.NOWORK_ANIMATE_ATTR}}function mj(t){return new mD(t)}mD.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},nN),mD.baselineMapAlign={top:"left",bottom:"right",middle:"center"},mD.alignMapBaseline={left:"top",right:"bottom",center:"middle"};var mN=function(t,e){return function(i,r){e(i,r,t)}};let mF=class extends oe{constructor(t){super(),this.textRenderContribitions=t,this.numberType=sc,this.builtinContributions=[mx],this.init(t)}drawShape(t,e,i,r,n,s,a,o){var l,h,d;let u=rQ(t,null==s?void 0:s.theme).text,{text:c,underline:p=u.underline,lineThrough:g=u.lineThrough,keepDirIn3d:f=u.keepDirIn3d,direction:m=u.direction,whiteSpace:v=u.whiteSpace,fontSize:y=u.fontSize,verticalMode:b=u.verticalMode,x:x=u.x,y:_=u.y}=t.attribute,{textAlign:A=u.textAlign,textBaseline:w=u.textBaseline}=t.attribute;if(!b&&"vertical"===m){let e=A;A=null!==(l=t.getBaselineMapAlign()[w])&&void 0!==l?l:"left",w=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"top"}let S=null!==(d=n0(t.attribute.lineHeight,y))&&void 0!==d?d:y,T=this.valid(t,u,a,o);if(!T)return;let{fVisible:k,sVisible:B,doFill:C,doStroke:E}=T,M=!f,P=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,r,C,E,k,B,u,n,a,o),M&&this.transformUseContext2d(t,u,P,e);let O=(n,s,l,h)=>{let d=i+s,c=r+l;if(h){e.highPerformanceSave(),d+=y;let t=s0.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,d,c),e.transformFromMatrix(t,!0),s0.free(t)}E&&(o?o(e,t.attribute,u):B&&(e.setStrokeStyle(t,t.attribute,x-i,_-r,u),e.strokeText(n,d,c,P))),C&&(a?a(e,t.attribute,u):k&&(e.setCommonStyle(t,t.attribute,x-i,_-r,u),e.fillText(n,d,c,P),this.drawUnderLine(p,g,t,d,c,P,u,e))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine){if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,P),"horizontal"===m){let{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();let{xOffset:s,yOffset:l}=n.bbox;E&&(o?o(e,t.attribute,u):B&&(e.setStrokeStyle(t,t.attribute,x-i,_-r,u),n.lines.forEach(t=>{e.strokeText(t.str,(t.leftOffset||0)+s+i,(t.topOffset||0)+l+r,P)}))),C&&(a?a(e,t.attribute,u):k&&(e.setCommonStyle(t,t.attribute,x-i,_-r,u),n.lines.forEach(n=>{var a,o;e.fillText(n.str,(n.leftOffset||0)+s+i,(n.topOffset||0)+l+r,P),this.drawMultiUnderLine(p,g,t,(n.leftOffset||0)+i,(n.topOffset||0)+l+r-(a="bottom",o=y,"top"===a?Math.ceil(.79*o):"middle"===a?Math.round(.3*o):"bottom"===a?Math.round(-.21*o):0)-.05*y,P,n.width,u,e)})))}else{t.tryUpdateAABBBounds();let{verticalList:i}=t.cache;e.textAlign="left",e.textBaseline="top";let r=S*i.length,n=0;i.forEach(t=>{let e=t.reduce((t,e)=>t+(e.width||0),0);n=(0,eJ.Fp)(e,n)});let s=0,a=0;"bottom"===w?a=-r:"middle"===w&&(a=-r/2),"center"===A?s-=n/2:"right"===A&&(s-=n),i.forEach((t,e)=>{let i=t.reduce((t,e)=>t+(e.width||0),0),o=n-i,l=s;"center"===A?l+=o/2:"right"===A&&(l+=o),t.forEach(t=>{let{text:i,width:n,direction:s}=t;O(i,r-(e+1)*S+a,l,s),l+=n})})}}else if("horizontal"===m){e.setTextStyle(t.attribute,u,P);let i=t.clipedText,r=0;S!==y&&("top"===w?r=(S-y)/2:"middle"===w||"bottom"===w&&(r=-(S-y)/2)),O(i,0,r,0)}else{t.tryUpdateAABBBounds();let i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,u,P);let{verticalList:r}=i,n=0,s=r[0].reduce((t,e)=>t+(e.width||0),0),a=0;"bottom"===w?a=-S:"middle"===w&&(a=-S/2),"center"===A?n-=s/2:"right"===A&&(n-=s),e.textAlign="left",e.textBaseline="top",r[0].forEach(t=>{let{text:e,width:i,direction:r}=t;O(e,a,n,r),n+=i})}}M&&this.restoreTransformUseContext2d(t,u,P,e),this.afterRenderStep(t,e,i,r,C,E,k,B,u,n,a,o)}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).text,{keepDirIn3d:s=n.keepDirIn3d}=t.attribute;this._draw(t,n,!s,i,r)}drawUnderLine(t,e,i,r,n,s,a,o){if(e+t<=0)return;let{textAlign:l=a.textAlign,textBaseline:h=a.textBaseline,fontSize:d=a.fontSize,fill:u=a.fill,opacity:c=a.opacity,underlineOffset:p=a.underlineOffset,underlineDash:g=a.underlineDash,fillOpacity:f=a.fillOpacity}=i.attribute,m=i.clipedWidth,v=mO(l,m),y=mR(h,d,d),b={lineWidth:0,stroke:u,opacity:c,strokeOpacity:f};if(t){b.lineWidth=t,o.setStrokeStyle(i,b,r,n,a),o.setLineDash(g),o.beginPath();let e=n+y+d+p;o.moveTo(r+v,e,s),o.lineTo(r+v+m,e,s),o.stroke()}if(e){b.lineWidth=e,o.setStrokeStyle(i,b,r,n,a),o.beginPath();let t=n+y+d/2;o.moveTo(r+v,t,s),o.lineTo(r+v+m,t,s),o.stroke()}}drawMultiUnderLine(t,e,i,r,n,s,a,o,l){if(e+t<=0)return;let{textAlign:h=o.textAlign,fontSize:d=o.fontSize,fill:u=o.fill,opacity:c=o.opacity,underlineOffset:p=o.underlineOffset,underlineDash:g=o.underlineDash,fillOpacity:f=o.fillOpacity}=i.attribute,m=mO(h,a),v=mR("alphabetic",d,d),y={lineWidth:0,stroke:u,opacity:c,strokeOpacity:f},b=-3;if(t){y.lineWidth=t,l.setStrokeStyle(i,y,r,n,o),l.setLineDash(g),l.beginPath();let e=n+v+d+b+p;l.moveTo(r+m,e,s),l.lineTo(r+m+a,e,s),l.stroke()}if(b=-1,e){y.lineWidth=e,l.setStrokeStyle(i,y,r,n,o),l.beginPath();let t=n+v+d/2+b;l.moveTo(r+m,t,s),l.lineTo(r+m+a,t,s),l.stroke()}}};mF=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),mN(0,ez(eH)),mN(0,eZ(a1)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],mF);let mG=!1,mz=new eM(t=>{mG||(mG=!0,t(sz).to(mF).inSingletonScope(),t(sR).toService(sz),t(a1).toService(a6),eV(t,a1))}),mZ=class extends gt{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=sc}contains(t,e,i){let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=t.AABBBounds;if(!r.camera)return!!n.containsPoint(e);r.highPerformanceSave();let s=rQ(t).text,{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,{x:o,y:l,z:h,lastModelMatrix:d}=this.transform(t,s,r,!a);this.canvasRenderer.z=h;let u=e;if(r.camera){u=e.clone();let i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}let c=!1;return this.canvasRenderer.drawShape(t,r,o,l,{},null,(e,i,r)=>{if(c)return!0;let{fontSize:n=s.fontSize,textBaseline:a=s.textBaseline,textAlign:d=s.textAlign}=t.attribute,p=t.AABBBounds,g=p.height(),f=p.width(),m=mR(a,g,n),v=mO(d,f);return e.rect(v+o,m+l,f,g,h),c=e.isPointInPath(u.x,u.y)},(t,e,i)=>c),this.canvasRenderer.z=0,r.modelMatrix!==d&&s1.free(r.modelMatrix),r.modelMatrix=d,r.highPerformanceRestore(),c}};mZ=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(J=0,Q=ez(sz),function(t,e){Q(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],mZ);let mH=!1,mU=new eM((t,e,i,r)=>{mH||(mH=!0,t(p5).to(mZ).inSingletonScope(),t(p9).toService(p5))}),mV=class{constructor(){this.type="text",this.numberType=sc}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};mV=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],mV);let mW=!1,m$=new eM((t,e,i,r)=>{mW||(mW=!0,t(pU).to(mV).inSingletonScope(),t(pL).toService(pU))});function mY(){mY.__loaded||(mY.__loaded=!0,as.RegisterGraphicCreator("text",mj),rR.load(mz),rR.load(pI?mU:m$))}mY.__loaded=!1;function mX(){pC(),ml(),fD(),mM(),mY()}var mK=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)0>e.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i};mX();class mq extends pB{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},mq.defaultAttributes,t)),this.name="tag"}render(){var t,e;let i;let{text:r="",textStyle:n={},shape:s={},panel:a={},space:o=4,minWidth:l,maxWidth:h,padding:d=4,visible:u,state:c,type:p,textAlwaysCenter:g}=this.attribute,f=(0,pT.o)(d),m=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group"),v,y=f[1]+f[3],b=f[0]+f[2],x=0,_=0,{visible:A}=s,w=mK(s,["visible"]);if(r4(A)){let t=(null==w?void 0:w.size)||10,e=(0,iy.Z)(t)?t:Math.max(t[0],t[1]);v=m.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},w),{visible:A,x:e/2,y:e/2}),"symbol"),dn(null==c?void 0:c.shape)||(v.states=c.shape),A&&(_=e+o)}if(y+=_,x+=_,fX({text:r})||"rich"===p){let t=Object.assign(Object.assign(Object.assign({},fK(Object.assign({type:p,text:r},n))),n),{visible:eb(r)&&!1!==u,x:x,y:0});i=m.createOrUpdateChild("tag-text",t,"richtext");let{visible:e}=a,s=mK(a,["visible"]);if(u&&r4(e)){let t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},s),{visible:e&&!!r,x:i.AABBBounds.x1,y:i.AABBBounds.y1,width:i.AABBBounds.width(),height:i.AABBBounds.height()}),"rect");dn(null==c?void 0:c.panel)||(t.states=c.panel)}}else{let o=Object.assign(Object.assign({text:(0,ep.Z)(r)&&"type"in r&&"text"===r.type?r.text:r,visible:eb(r)&&!1!==u,lineHeight:null==n?void 0:n.fontSize},n),{x:x,y:0});(0,eB.Z)(o.lineHeight)&&(o.lineHeight=n.fontSize),i=m.createOrUpdateChild("tag-text",o,"text"),dn(null==c?void 0:c.text)||(i.states=c.text);let d=fY(o.text,n,null===(t=this.stage)||void 0===t?void 0:t.getTheme().text.fontFamily),p=d.width,A=d.height;y+=p;let w=null!==(e=s.size)&&void 0!==e?e:10,S=(0,iy.Z)(w)?w:Math.max(w[0],w[1]);b+=Math.max(A,s.visible?S:0);let{textAlign:T,textBaseline:k}=n;(eb(l)||eb(h))&&(eb(l)&&y<l&&(y=l),eb(h)&&y>h&&(y=h,i.setAttribute("maxLineWidth",h-f[1]-f[2])));let B=0,C=0,E=0;if("left"===T||"start"===T?E=1:"right"===T||"end"===T?E=-1:"center"===T&&(E=0),E?E<0?(B-=y,v&&v.setAttribute("x",(v.attribute.x||0)-p),m.setAttribute("x",-f[1]-_)):E>0&&m.setAttribute("x",f[3]):(B-=y/2,v&&v.setAttribute("x",(v.attribute.x||0)-p/2),m.setAttribute("x",-_/2)),g&&E){let t=y-f[1]-f[3],e=p+_,r=(t-e)/2+_+p/2;i.setAttributes({x:r*E,textAlign:"center"}),null==v||v.setAttributes({x:((t-e)/2+S/2)*E}),m.setAttribute("x",f[2+E]*E)}"middle"===k?(C-=b/2,v&&v.setAttribute("y",0)):"bottom"===k?(C-=b,v&&v.setAttribute("y",-A/2),m.setAttribute("y",-f[2])):"top"===k&&(m.setAttribute("y",f[0]),v&&v.setAttribute("y",A/2));let{visible:M}=a,P=mK(a,["visible"]);if(u&&r4(M)){let t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},P),{visible:M&&!!r,x:B,y:C,width:y,height:b}),"rect");dn(null==c?void 0:c.panel)||(t.states=c.panel)}}}}mq.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};let mJ=(t=0)=>{if(t<0)for(;t<0;)t+=eJ.BZ;else if(t>0)for(;t>eJ.BZ;)t-=eJ.BZ;return t};function mQ(t,e,i){return!dQ(t,e,0,1e-6)&&!dJ(t,i,0,1e-6)}function m0(t){let e={};return fF(t,t=>{"group"!==t.type&&t.id&&(e[t.id]=t)}),e}class m1 extends pB{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{let e=t.target;e!==this._lastHover&&e.name&&!dn(e.states)&&(e.addState(t2.hover,!0),fF(this.axisContainer,t=>{t!==e&&t.name&&!dn(t.states)&&t.addState(t2.hoverReverse,!0)}),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(fF(this.axisContainer,t=>{t.name&&!dn(t.states)&&(t.removeState(t2.hoverReverse),t.removeState(t2.hover))}),this._lastHover=null)},this._onClick=t=>{let e=t.target;if(this._lastSelect===e&&e.hasState(t2.selected))return this._lastSelect=null,void fF(this.axisContainer,t=>{t.name&&!dn(t.states)&&(t.removeState(t2.selectedReverse),t.removeState(t2.selected))});e.name&&!dn(e.states)&&(e.addState(t2.selected,!0),fF(this.axisContainer,t=>{t!==e&&t.name&&!dn(t.states)&&t.addState(t2.selectedReverse,!0)}),this._lastSelect=e)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){let e=lb(this.attribute);lT(this.attribute,t);let i=as.group({x:this.attribute.x,y:this.attribute.y});return this.add(i),this._renderInner(i),this.removeChild(i),this.attribute=e,i.AABBBounds}render(){this._prevInnerView=this._innerView&&m0(this._innerView),this.removeAllChild(!0),this._innerView=as.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;let{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(t){let{title:e,label:i,tick:r,line:n,items:s}=this.attribute,a=as.group({x:0,y:0,zIndex:1});if(a.name=t5.axisContainer,a.id=this._getNodeId("container"),a.setMode(this.mode),this.axisContainer=a,t.add(a),n&&n.visible&&this.renderLine(a),s&&s.length&&(this.data=this._transformItems(s[0]),r&&r.visible&&this.renderTicks(a),i&&i.visible)){let t=as.group({x:0,y:0,pickable:!1});t.name=t5.labelContainer,t.id=this._getNodeId("label-container"),this.axisLabelsContainer=t,a.add(t),s.forEach((e,i)=>{let r=this.renderLabels(t,e,i),n=r.getChildren();this.beforeLabelsOverlap(n,e,r,i,s.length),this.handleLabelsOverlap(n,e,r,i,s.length),this.afterLabelsOverlap(n,e,r,i,s.length);let a=0,o=0,l="center",h="middle";n.forEach(t=>{var e;let i=t.attribute,r=null!==(e=i.angle)&&void 0!==e?e:0,n=t.AABBBounds,s=n.width(),d=n.height();r&&(s=Math.abs(s*Math.cos(r)),d=Math.abs(d*Math.sin(r))),a=Math.max(a,s),o=Math.max(o,d),l=i.textAlign,h=i.textBaseline}),this.axisLabelLayerSize[i]={width:a,height:o,textAlign:l,textBaseline:h}})}e&&e.visible&&this.renderTitle(a)}renderTicks(t){let e=this.getTickLineItems(),i=as.group({x:0,y:0,pickable:!1});i.name=t5.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach((t,r)=>{var n;let s=as.line(Object.assign({},this._getTickLineAttribute("tick",t,r,e)));if(s.name=t5.tick,s.id=this._getNodeId(t.id),dn(null===(n=this.attribute.tick)||void 0===n?void 0:n.state))s.states=fV;else{let t=this.data[r],e=lT({},fV,this.attribute.tick.state);Object.keys(e).forEach(i=>{r6(e[i])&&(e[i]=e[i](t.rawValue,r,t,this.data))}),s.states=e}i.add(s)}),this.tickLineItems=e;let{subTick:r}=this.attribute;if(r&&r.visible){let t=this.getSubTickLineItems();t.length&&t.forEach((t,n)=>{let s=as.line(Object.assign({},this._getTickLineAttribute("subTick",t,n,e)));if(s.name=t5.subTick,s.id=this._getNodeId(`${n}`),dn(r.state))s.states=fV;else{let i=lT({},fV,r.state);Object.keys(i).forEach(r=>{r6(i[r])&&(i[r]=i[r](t.value,n,t,e))}),s.states=i}i.add(s)}),this.subTickLineItems=t}}renderLabels(t,e,i){let{dataFilter:r}=this.attribute.label;r&&r6(r)&&(e=r(e,i));let n=this._transformItems(e),s=as.group({x:0,y:0,pickable:!1});return s.name=`${t5.labelContainer}-layer-${i}`,s.id=this._getNodeId(`label-container-layer-${i}`),t.add(s),n.forEach((t,e)=>{var r;let a;let o=this._getLabelAttribute(t,e,n,i);if((a=fX(o)?as.richtext(fK(o)):as.text(o)).name=t5.label,a.id=this._getNodeId(`layer${i}-label-${t.id}`),dn(null===(r=this.attribute.label)||void 0===r?void 0:r.state))a.states=fV;else{let r=lT({},fV,this.attribute.label.state);Object.keys(r).forEach(s=>{r6(r[s])&&(r[s]=r[s](t,e,n,i))}),a.states=r}s.add(a)}),s}renderTitle(t){let e=new mq(Object.assign({},this.getTitleAttribute()));e.name=t5.title,e.id=this._getNodeId("title"),t.add(e)}getVerticalCoord(t,e,i){let r=this.getVerticalVector(e,i,t);return{x:t.x+r[0],y:t.y+r[1]}}getTextAlign(t){let e="center";return dq(t[0],0)?dq(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTickLineItems(){let{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:r,inside:n=!1,length:s,dataFilter:a}=t,o=1;return e.length>=2&&(o=e[1].value-e[0].value),(a&&r6(a)?a(e):e).forEach(t=>{let e=t.point,a=t.value;if(!r){let i=t.value-o/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),a=i}let l=this.getVerticalCoord(e,s,n);if("3d"===this.mode){let r=this.getVerticalVector(s,n,e),o=0,h=0;(0,eJ.Wn)(r[0])>(0,eJ.Wn)(r[1])?o=eJ.pi/2*(l.x>e.x?1:-1):h=eJ.pi/2*(l.y>e.y?-1:1),i.push({start:e,end:l,value:a,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:o,beta:h})}else i.push({start:e,end:l,value:a,id:`tick-${t.id}`})}),i}getSubTickLineItems(){let{subTick:t}=this.attribute,e=[],{count:i=4,inside:r=!1,length:n=2}=t,s=this.tickLineItems,a=s.length;if(a>=2)for(let t=0;t<a-1;t++){let a=s[t],o=s[t+1];for(let t=0;t<i;t++){let s=(t+1)/(i+1),l=(1-s)*a.value+s*o.value,h=this.getTickCoord(l),d=this.getVerticalCoord(h,n,r);e.push({start:h,end:d,value:l,id:`sub-tick-${l}`})}}return e}_getTickLineAttribute(t,e,i,r){let n=lX(this.attribute,`${t}.style`),s=this.data[i];n=r6(n)?lT({},lX(fJ,`${t}.style`),"tick"===t?n(s.rawValue,i,s,this.data):n(e.value,i,e,r)):n;let{start:a,end:o,anchor:l,alpha:h,beta:d}=e;return Object.assign({points:[a,o],anchor:l,alpha:h,beta:d},n)}_getLabelAttribute(t,e,i,r){var n,s;let{space:a=4,inside:o=!1,formatMethod:l,type:h="text",text:d}=this.attribute.label,u=a,c=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&this.attribute.tick.inside===o&&(c=this.attribute.tick.length||4),(null===(s=this.attribute.subTick)||void 0===s?void 0:s.visible)&&this.attribute.subTick.inside===o&&(c=Math.max(c,this.attribute.subTick.length||2)),u+=c;let p=this.getRelativeVector(t.point);r>0&&(0===p[1]?u+=(this.axisLabelLayerSize[r-1].height+lX(this.attribute,"label.space",4))*r:u+=(this.axisLabelLayerSize[r-1].width+lX(this.attribute,"label.space",4))*r);let g=this.getVerticalCoord(t.point,u,o),f=this.getVerticalVector(u||1,o,g),m=l?l(`${t.label}`,t,e,i,r):t.label,{style:v}=this.attribute.label;return v=r6(v)?lT({},fJ.label.style,v(t,e,i,r)):v,r6((v=lT(this.getLabelAlign(f,o,v.angle),v)).text)&&(v.text=v.text({label:t.label,value:t.rawValue,index:t.index,layer:r})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(g,f,m,v)),{text:null!=d?d:m,lineHeight:null==v?void 0:v.fontSize,type:h}),v)}getLabelPosition(t,e,i,r){return t}_transformItems(t){let e=[];return t.forEach(t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))}),e}release(){super.release(),this._prevInnerView=null,this._innerView=null}}function m2(t){t.forEach(t=>{var e,i,r,n,s;if(t.rotatedBounds||!t.attribute.angle)return;let a=function(t){let e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),o=(e=a.centerX,i=a.centerY,r=a.angle,n=t.attribute.x,{x:(e-n)*Math.cos(r)+(i-(s=t.attribute.y))*Math.sin(r)+n,y:(e-n)*Math.sin(r)+(s-i)*Math.cos(r)+s}),l=o.x-a.centerX,h=o.y-a.centerY;a.x1+=l,a.x2+=l,a.y1+=h,a.y2+=h,a.centerX+=l,a.centerY+=h,t.rotatedBounds=a})}let m5={parity:function(t){return t.filter((t,e)=>e%2?t.setAttribute("opacity",0):1)},greedy:function(t,e){let i;return t.filter((t,r)=>r&&m3(i,t,e)?t.setAttribute("opacity",0):(i=t,1))}};function m3(t,e,i){let r=t.AABBBounds,n=e.AABBBounds;return i>Math.max(n.x1-r.x2,r.x1-n.x2,n.y1-r.y2,r.y1-n.y2)&&(!t.rotatedBounds||!e.rotatedBounds||i>Math.max(e.rotatedBounds.x1-t.rotatedBounds.x2,t.rotatedBounds.x1-e.rotatedBounds.x2,e.rotatedBounds.y1-t.rotatedBounds.y2,t.rotatedBounds.y1-e.rotatedBounds.y2))}function m4(t,e){for(let i,r=1,n=t.length,s=t[0];r<n;s=i,++r)if(m3(s,i=t[r],e))return!0}function m6(t){let e=t.AABBBounds;return e.width()>1&&e.height()>1}function m8(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function m7(t,e=0){let i,r=["center","left","left","left","center","right","right","right","left"],n=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(r=["center","right","right","right","center","left","left","left","right"],n=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);let s=(e=m8(e))/(.5*Math.PI);return{textAlign:r[i=s===Math.floor(s)?2*Math.floor(s):2*Math.floor(s)+1],textBaseline:n[i]}}function m9(t,e=0){let i,r=["right","right","center","left","center","left","center","right","right"],n=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(r=["left","right","right","right","left","left","left","left","right"],n=["middle","bottom","middle","top","top","top","middle","bottom","bottom"]);let s=(e=m8(e))/(.5*Math.PI);return{textAlign:r[i=s===Math.floor(s)?2*Math.floor(s):2*Math.floor(s)+1],textBaseline:n[i]}}class vt{isInValidValue(t){return t<0||t>1}getTickCoord(t){let{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){let{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){let{verticalFactor:r=1}=this.attribute,n=function(t){let[e,i]=t,r=e*e+i*i;return r>0&&(r=1/Math.sqrt(r)),[t[0]*r,t[1]*r]}(this.getRelativeVector());return fN([n[1],-1*n[0]],t*(e?1:-1)*r)}}let ve=["radius","startAngle","endAngle",...nR];class vi extends nF{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=st}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}doUpdateAABBBounds(t){let e=rQ(this).circle;this._AABBBounds.clear();let i=this.attribute,r=ru.graphicService.updateCircleAABBBounds(i,rQ(this).circle,this._AABBBounds,t,this),{boundsPadding:n=e.boundsPadding}=i,s=nH(n);return s&&r.expand(s),this.clearUpdateBoundTag(),r}tryUpdateOBBBounds(){throw Error("暂不支持")}getDefaultAttribute(t){return rQ(this).circle[t]}needUpdateTags(t){return super.needUpdateTags(t,ve)}needUpdateTag(t){return super.needUpdateTag(t,ve)}toCustomPath(){var t,e,i;let r=this.attribute,n=null!==(t=r.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=r.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(i=r.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new iK;return o.arc(0,0,n,s,a),o}clone(){return new vi(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return vi.NOWORK_ANIMATE_ATTR}}function vr(t){return new vi(t)}vi.NOWORK_ANIMATE_ATTR=nN;let vn=new class t{constructor(){this.time=oF.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,r,n,s,a,o,l,h,d,u){let{outerBorder:c,innerBorder:p}=t.attribute,g=c&&!1!==c.visible,f=p&&!1!==p.visible;if(!g&&!f)return;let{radius:m=l.radius,startAngle:v=l.startAngle,endAngle:y=l.endAngle,opacity:b=l.opacity,x:x=l.x,y:_=l.y,scaleX:A=l.scaleX,scaleY:w=l.scaleY}=t.attribute,S=!(!c||!c.stroke),T=!(!p||!p.stroke);if(g){let{distance:n=l.outerBorder.distance}=c,s=aM(e,n,e.dpr);if(e.beginPath(),e.arc(i,r,m+s,v,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,c,l.outerBorder);else if(S){let n=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,c,(x-i)/A,(_-r)/w,l.outerBorder),l.outerBorder.opacity=n,e.stroke()}}if(f){let{distance:n=l.innerBorder.distance}=p,s=aM(e,n,e.dpr);if(e.beginPath(),e.arc(i,r,m-s,v,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(T){let n=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/A,(_-r)/w,l.innerBorder),l.innerBorder.opacity=n,e.stroke()}}}};var vs=function(t,e){return function(i,r){e(i,r,t)}};let va=class extends oe{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=st,this.builtinContributions=[vn,a4,oh],this.init(t)}drawShape(t,e,i,r,n,s,a,o){let l=rQ(t,null==s?void 0:s.theme).circle,{radius:h=l.radius,startAngle:d=l.startAngle,endAngle:u=l.endAngle,x:c=l.x,y:p=l.y}=t.attribute,g=this.valid(t,l,a,o);if(!g)return;let{fVisible:f,sVisible:m,doFill:v,doStroke:y}=g;e.beginPath(),e.arc(i,r,h,d,u),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,r,v,y,f,m,l,n,a,o),v&&(a?a(e,t.attribute,l):f&&(e.setCommonStyle(t,t.attribute,c-i,p-r,l),e.fill())),y&&(o?o(e,t.attribute,l):m&&(e.setStrokeStyle(t,t.attribute,c-i,p-r,l),e.stroke())),this.afterRenderStep(t,e,i,r,v,y,f,m,l,n,a,o)}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).circle;this._draw(t,n,!1,i,r)}};va=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),vs(0,ez(eH)),vs(0,eZ(aY)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],va);let vo=!1,vl=new eM(t=>{vo||(vo=!0,t(va).toSelf().inSingletonScope(),t(sO).to(va).inSingletonScope(),t(sR).toService(sO),t(aY).toService(a6),eV(t,aY))}),vh=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=st}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).circle,{x:s=n.x,y:a=n.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,i,r)=>!!o||(o=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(o)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=aM(r,s+a,r.dpr),o=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),o}};vh=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tt=0,te=ez(sO),function(t,e){te(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],vh);let vd=!1,vu=new eM((t,e,i,r)=>{vd||(vd=!0,t(pK).to(vh).inSingletonScope(),t(p9).toService(pK))}),vc=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=st}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).circle,{x:s=n.x,y:a=n.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,i,r)=>!!o||(o=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(o)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=s+a,o=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),o}};vc=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(ti=0,tr=ez(sO),function(t,e){tr(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],vc);let vp=!1,vg=new eM((t,e,i,r)=>{vp||(vp=!0,t(pN).to(vc).inSingletonScope(),t(pL).toService(pN))});function vf(){vf.__loaded||(vf.__loaded=!0,as.RegisterGraphicCreator("circle",vr),rR.load(vl),rR.load(pI?vu:vg))}vf.__loaded=!1;let vm=["path","customPath",...nR];class vv extends nF{constructor(t){super(t),this.type="path",this.numberType=ss}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){let t=rQ(this).path;if(!this.valid)return t.path;let e=this.attribute;return e.path instanceof iK?e.path:((0,eB.Z)(this.cache)&&this.doUpdatePathShape(),this.cache instanceof iK?this.cache:t.path)}doUpdateAABBBounds(){let t=rQ(this).path;this.doUpdatePathShape(),this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updatePathAABBBounds(e,rQ(this).path,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=e,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),i}doUpdatePathShape(){let t=this.attribute;(0,ek.Z)(t.path,!0)?this.cache=(new iK).fromString(t.path):t.customPath&&(this.cache=new iK,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw Error("暂不支持")}getDefaultAttribute(t){return rQ(this).path[t]}needUpdateTags(t){return super.needUpdateTags(t,vm)}needUpdateTag(t){return super.needUpdateTag(t,vm)}toCustomPath(){return(new iK).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new vv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return vv.NOWORK_ANIMATE_ATTR}}function vy(t){return new vv(t)}vv.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},nN);var vb=function(t,e){return function(i,r){e(i,r,t)}};let vx=class extends oe{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=ss,this.builtinContributions=[a4,oh],this.init(t)}drawShape(t,e,i,r,n,s,a,o){var l,h,d;let u=null!==(l=this.tempTheme)&&void 0!==l?l:rQ(t,null==s?void 0:s.theme).path,{x:c=u.x,y:p=u.y}=t.attribute,g=null!==(h=this.z)&&void 0!==h?h:0,f=this.valid(t,u,a,o);if(!f)return;let{fVisible:m,sVisible:v,doFill:y,doStroke:b}=f;(e.beginPath(),t.pathShape)?iv(t.pathShape.commandList,e,i,r,1,1,g):iv((null!==(d=t.attribute.path)&&void 0!==d?d:u.path).commandList,e,i,r,1,1,g),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,r,y,b,m,v,u,n,a,o),b&&(o?o(e,t.attribute,u):v&&(e.setStrokeStyle(t,t.attribute,c-i,p-r,u),e.stroke())),y&&(a?a(e,t.attribute,u):m&&(e.setCommonStyle(t,t.attribute,c-i,p-r,u),e.fill())),this.afterRenderStep(t,e,i,r,y,b,m,v,u,n,a,o)}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).path;this.tempTheme=n,this._draw(t,n,!1,i,r),this.tempTheme=null}};vx=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),vb(0,ez(eH)),vb(0,eZ(aq)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],vx);let v_=!1,vA=new eM(t=>{v_||(v_=!0,t(vx).toSelf().inSingletonScope(),t(sD).to(vx).inSingletonScope(),t(sR).toService(sD),t(aq).toService(a6),eV(t,aq))}),vw=class extends gt{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=ss}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).path;r.highPerformanceSave();let{x:s,y:a,z:o,lastModelMatrix:l}=this.transform(t,n,r),h=e;if(r.camera){h=e.clone();let i=t.parent.globalTransMatrix;h.x=i.a*e.x+i.c*e.y+i.e,h.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=o;let d=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,e,i)=>!!d||(d=t.isPointInPath(h.x,h.y)),(t,e,i)=>{if(d)return!0;let n=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return r.lineWidth=aM(r,n+s,r.dpr),d=t.isPointInStroke(h.x,h.y)}),this.canvasRenderer.z=0,r.modelMatrix!==l&&s1.free(r.modelMatrix),r.modelMatrix=l,r.highPerformanceRestore(),d}};vw=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tn=0,ts=ez(sD),function(t,e){ts(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],vw);let vS=!1,vT=new eM((t,e,i,r)=>{vS||(vS=!0,t(pQ).to(vw).inSingletonScope(),t(p9).toService(pQ))}),vk=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=ss}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).path,{x:s=n.x,y:a=n.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,i,r)=>!!o||(o=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(o)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=s+a,o=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),o}};vk=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(ta=0,to=ez(sD),function(t,e){to(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],vk);let vB=!1,vC=new eM((t,e,i,r)=>{vB||(vB=!0,t(pz).to(vk).inSingletonScope(),t(pL).toService(pz))});function vE(){vE.__loaded||(vE.__loaded=!0,as.RegisterGraphicCreator("path",vy),rR.load(vA),rR.load(pI?vT:vC))}vE.__loaded=!1;function vM(){pC(),go(),mM(),mY()}var vP=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)0>e.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i};vM(),ml();class vO extends m1{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},vO.defaultAttributes,t),e)}_renderInner(t){var e;super._renderInner(t);let{panel:i}=this.attribute;if(i&&i.visible){let t=this.axisContainer,r=t.AABBBounds,n=as.rect(Object.assign({x:r.x1,y:r.y1,width:r.width(),height:r.height()},i.style));n.name=t5.background,n.id=this._getNodeId("background"),n.states=lT({},fq,null!==(e=i.state)&&void 0!==e?e:{}),t.insertBefore(n,t.firstChild)}}renderLine(t){let{start:e,end:i,line:r}=this.attribute,{startSymbol:n,endSymbol:s,style:a,breakRange:o,breakShape:l,breakShapeStyle:h,state:d}=r,u=Object.assign({points:[e,i],startSymbol:n,endSymbol:s,lineStyle:a},vP(r,["startSymbol","endSymbol","style","breakRange","breakShape","breakShapeStyle","state"]));dn(d)||(u.state={line:lT({},fq,d),symbol:lT({},fq,d)});let c=new fj(u);c.name=t5.line,c.id=this._getNodeId("line"),t.add(c)}getTitleAttribute(){var t,e,i;let r=this.attribute.title,{position:n="middle",space:s=4,textStyle:a={},autoRotate:o=!0,shape:l,background:h,state:d={},maxWidth:u}=r,c=vP(r,["position","space","textStyle","autoRotate","shape","background","state","maxWidth"]),p=.5;"start"===n?p=0:"end"===n&&(p=1);let{verticalFactor:g=1}=this.attribute,f=this.getTickCoord(p),m=this.getRelativeVector(),v=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside){let t=+lX(this.attribute,"label.space",4);v+=t;let e=Object.keys(this.axisLabelLayerSize).length;if(0===m[1]){let i=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(i)?v+=i+(e-1)*t:v=0}else{if(0===m[0]){let i=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.width():0;isFinite(i)?v+=i+(e-1)*t:v=0}else Object.keys(this.axisLabelLayerSize).forEach((e,i)=>{v+=this.axisLabelLayerSize[e].width+(i>0?t:0)});let i=this.axisLabelLayerSize[0].textAlign,r="start"===i||"left"===i,n="center"===i,s=m[1]>0;v=1==-1*g?s?r?v:n?v/2:t:r?t:n?v/2:v:s?r?t:n?v/2:v:r?v:n?v/2:t}}let y=0;(null===(e=this.attribute.tick)||void 0===e?void 0:e.visible)&&!1===this.attribute.tick.inside&&(y=this.attribute.tick.length||4),(null===(i=this.attribute.subTick)||void 0===i?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(y=Math.max(y,this.attribute.subTick.length||2));let b=y+v+s,x=this.getVerticalCoord(f,b,!1),_=this.getVerticalVector(b,!1,{x:0,y:0}),A,w,{angle:S}=c;if(A="start"===n?"start":"end"===n?"end":"center",(0,eB.Z)(S)&&o){S=function(t,e,i){var r,n;let s=function(t,e){let[i,r]=t,[n,s]=e,a=Math.sqrt((i*i+r*r)*(n*n+s*s));return Math.acos(Math.min(Math.max(a&&(i*n+r*s)/a,-1),1))}(t,e),a=(r=t,n=e,r[0]*n[1]-n[0]*r[1]>=0);return i?a?2*Math.PI-s:s:a?s:2*Math.PI-s}(m,[1,0],!0);let{verticalFactor:t=1}=this.attribute;w=1==-1*t?"bottom":"top"}else A=this.getTextAlign(_),w=this.getTextBaseline(_,!1);let T=u;if((0,eB.Z)(T)){let{verticalLimitSize:t,verticalMinSize:e,orient:i}=this.attribute,r=Math.min(t||1/0,e||1/0);if((0,eg.Z)(r)){if("bottom"===i||"top"===i){if(S!==Math.PI/2){let t=Math.abs(Math.cos(null!=S?S:0));T=t<1e-6?1/0:this.attribute.end.x/t}else T=r-b}else if(S&&0!==S){let t=Math.abs(Math.sin(S));T=t<1e-6?1/0:this.attribute.end.y/t}else T=r-b}}let k=Object.assign(Object.assign(Object.assign({},x),c),{maxWidth:T,textStyle:Object.assign({textAlign:A,textBaseline:w},a),state:{text:lT({},fq,d.text),shape:lT({},fq,d.shape),panel:lT({},fq,d.background)}});return k.angle=S,l&&l.visible&&(k.shape=Object.assign({visible:!0},l.style),l.space&&(k.space=l.space)),h&&h.visible&&(k.panel=Object.assign({visible:!0},h.style)),k}getTextBaseline(t,e){let i="middle",{verticalFactor:r=1}=this.attribute;return dq(t[1],0)?i=!dq(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1==(e?1:-1)*r?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){let r=this.attribute.orient;if((0,eg.Z)(i)||0===t[0]&&0===t[1]){if("top"===r||"bottom"===r)return m7(r,i);if("left"===r||"right"===r)return m9(r,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,r,n){var s,a,o,l;let{flush:h=!1}=this.attribute.label||{};if(h&&t.length){let{orient:e,start:i,end:r}=this.attribute,n="bottom"===e||"top"===e,h=t[0],d=e_(t),u=n?h.attribute.x>d.attribute.x:h.attribute.y<d.attribute.y;if(n){let t=u?d:h,e=u?h:d,n=i.x,o=r.x,l=t.AABBBounds.x1,c=e.AABBBounds.x2;l<n&&(t.attribute.angle?t.setAttributes({dx:(null!==(s=t.attribute.dx)&&void 0!==s?s:0)+n-l}):t.setAttributes({x:n,textAlign:"left"})),c>o&&(e.attribute.angle?e.setAttributes({dx:(null!==(a=e.attribute.dx)&&void 0!==a?a:0)+o-c}):e.setAttributes({x:o,textAlign:"right"}))}else{let t=u?d:h,e=u?h:d,n=t.AABBBounds.y2,s=e.AABBBounds.y1,a=i.y,c=r.y;s<a&&(e.attribute.angle?e.setAttributes({dy:(null!==(o=e.attribute.dy)&&void 0!==o?o:0)+a-s}):e.setAttributes({y:a,textBaseline:"top"})),n>c&&(t.attribute.angle?t.setAttributes({dy:(null!==(l=t.attribute.dy)&&void 0!==l?l:0)+c-n}):t.setAttributes({y:c,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,r,n){if(dn(t))return;let{verticalLimitSize:s,label:a,orient:o}=this.attribute,l=this._getAxisLabelLimitLength(s,n),{layoutFunc:h,autoRotate:d,autoRotateAngle:u,autoLimit:c,limitEllipsis:p,autoHide:g,autoHideMethod:f,autoHideSeparation:m,lastVisible:v}=a;if(r6(h))h(t,e,r,this);else{if(d&&function(t,e){if(dn(t))return;let{orient:i,labelRotateAngle:r=[0,45,90]}=e;if(0===r.length||t.some(t=>!!t.attribute.angle))return;let n=0,s=0;for(r&&r.length>0&&(s=r.length);n<s;){let e=r[n++];if(t.forEach(t=>{t.attribute.angle=eQ(e)}),function(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach(e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},m7(t,e.attribute.angle)),{angle:m8(e.attribute.angle)}))})}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},m9(t,e.attribute.angle)),{angle:m8(e.attribute.angle)}))})}(t,e),m2(e)}(i,t),!function(t){for(let r=1;r<t.length;r++){var e,i;if(e=t[r-1],i=t[r],it(e.AABBBounds,i.AABBBounds,!1)&&(!e.rotatedBounds||!i.rotatedBounds||function(t,e,i=!1,r){let n=is(t,i),s=is(e,i),a=(t,e)=>[e.x-t.x,e.y-t.y],o=ir(t),l=ir(e);r&&r.fillRect(o.x,o.y,2,2),r&&r.fillRect(l.x,l.y,2,2);let h=a(o,l),d=a(n[0],n[1]),u=a(n[1],n[2]),c=a(s[0],s[1]),p=a(s[1],s[2]),g=i?eQ(t.angle):t.angle,f=i?eQ(90-t.angle):t.angle+eJ.ou,m=i?eQ(e.angle):e.angle,v=i?eQ(90-e.angle):e.angle+eJ.ou;f>eJ.f7&&(f-=eJ.f7),v>eJ.f7&&(v-=eJ.f7);let y=(t,e,i,r)=>{let n=[Math.cos(e),Math.sin(e)];return t+(ie(n,i)+ie(n,r))/2>ie(n,h)};return y((t.x2-t.x1)/2,g,c,p)&&y((t.y2-t.y1)/2,f,c,p)&&y((e.x2-e.x1)/2,m,d,u)&&y((e.y2-e.y1)/2,v,d,u)}(e.rotatedBounds,i.rotatedBounds,!0)))return!0}return!1}(t))break}}(t,{labelRotateAngle:u,orient:o}),c&&(0,eg.Z)(l)&&l>0){let e="left"===o||"right"===o,i=e?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x),r=e?i/t.length:g||d?1/0:i/t.length;!function(t,e){let{limitLength:i,verticalLimitLength:r,ellipsis:n="...",orient:s,axisLength:a}=e;!dn(t)&&(0,eg.Z)(i)&&t.forEach(t=>{var e;let o=t.attribute.angle,l=!(0,eB.Z)(o),h=!l||0===o||o===Math.PI,d=l&&(o===Math.PI/2||o===2*Math.PI/3),u="top"===s||"bottom"===s;if(u&&(d&&Math.floor(t.AABBBounds.height())<=i||h&&Math.floor(t.AABBBounds.width())<=r))return;let c=t.attribute.direction;if(!u&&("vertical"===c&&Math.floor(t.AABBBounds.height())<=r||"vertical"!==c&&(h&&Math.floor(t.AABBBounds.width())<=i||d&&Math.floor(t.AABBBounds.height())<=r)))return;let p=null;if(h||d)p=u||"vertical"===c?r:i;else{let{x1:e,y1:r}=t.AABBBounds,n=function(t,e,i){if(e.x<t.left||e.x>t.left+t.width||e.y<t.top||e.y>t.top+t.height)return null;let r=Math.cos(i),n=Math.sin(i);if(r<1e-16){let i=(t.left-e.x)*n/r+e.y;if(i>=t.top&&i<=t.top+t.height)return{x:t.left,y:i}}if(r>1e-16){let i=(t.left+t.width-e.x)*n/r+e.y;if(i>=t.top&&i<=t.top+t.height)return{x:t.left+t.width,y:i}}if(n<1e-16){let i=(t.top-e.y)*r/n+e.x;if(i>=t.left&&i<=t.left+t.width)return{x:i,y:t.top}}if(n>1e-16){let i=(t.top+t.height-e.y)*r/n+e.x;if(i>=t.left&&i<=t.left+t.width)return{x:i,y:t.top+t.height}}return null}({width:u?a:i,height:u?i:a,left:0,top:0},{x:e,y:r},t.attribute.angle);if(n){let{x:t,y:i}=n;p=Math.floor(Math.sqrt((t-e)**2+(i-r)**2))}else p=Math.abs(i/Math.sin(o))}(0,eg.Z)(t.attribute.maxLineWidth)&&(p=(0,eg.Z)(p)?Math.min(t.attribute.maxLineWidth,p):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:p,ellipsis:null!==(e=t.attribute.ellipsis)&&void 0!==e?e:n})})}(t,{limitLength:l,verticalLimitLength:r,ellipsis:p,orient:o,axisLength:i})}g&&function(t,e){var i;let r;if(dn(t))return;let n=t.filter(m6);if(dn(n))return;(i=n).forEach(t=>t.setAttribute("opacity",1)),m2(r=i);let{method:s="parity",separation:a=0}=e,o=r6(s)?s:m5[s]||m5.parity;if(r.length>=3&&m4(r,a)){do r=o(r,a);while(r.length>=3&&m4(r,a));if(r.length<3||e.lastVisible){let t=e_(n);if(!t.attribute.opacity){let e=r.length;if(e>1){t.setAttribute("opacity",1);for(let i=e-1;i>=0&&m3(r[i],t,a);i--)r[i].setAttribute("opacity",0)}}}}n.forEach(t=>{t.setAttribute("visible",!!t.attribute.opacity)})}(t,{orient:o,method:f,separation:m,lastVisible:v})}}afterLabelsOverlap(t,e,i,r,n){let{verticalLimitSize:s,orient:a}=this.attribute,o="bottom"===a||"top"===a,l=i.AABBBounds,h=o?l.height():l.width(),{verticalMinSize:d}=this.attribute;if((0,eg.Z)(d)&&(!(0,eg.Z)(s)||d<=s)){let t,e;h=Math.max(h,this._getAxisLabelLimitLength(d,n)),"left"===a?(t=l.x2-h,e=l.y1):"right"===a?(t=l.x1,e=l.y1):"top"===a?(t=l.x1,e=l.y2-h):"bottom"===a&&(t=l.x1,e=l.y1);let r=as.rect({x:t,y:e,width:o?l.width():h,height:o?h:l.height(),pickable:!1});r.name=t5.axisLabelBackground,r.id=this._getNodeId("axis-label-background"),i.insertBefore(r,i.firstChild)}if(eb(this.attribute.label.containerAlign)){let e;"left"===a?e=l.x2:"right"===a?e=l.x1:"top"===a?e=l.y2:"bottom"===a&&(e=l.y1),function(t,e,i,r,n){if("right"===r||"left"===r){if("left"===n){let n="right"===r?0:-1;t.forEach(t=>{t.setAttributes({x:e+i*n,textAlign:"left"})})}else if("right"===n){let n="right"===r?1:0;t.forEach(t=>{t.setAttributes({x:e+i*n,textAlign:"right"})})}else if("center"===n){let n="right"===r?1:-1;t.forEach(t=>{t.setAttributes({x:e+.5*i*n,textAlign:"center"})})}}else if("bottom"===r||"top"===r){if("top"===n){let n="bottom"===r?0:-1;t.forEach(t=>{t.setAttributes({y:e+i*n,textBaseline:"top"})})}else if("bottom"===n){let n="bottom"===r?1:0;t.forEach(t=>{t.setAttributes({y:e+i*n,textBaseline:"bottom"})})}else if("middle"===n){let n="bottom"===r?1:-1;t.forEach(t=>{t.setAttributes({y:e+.5*i*n,textBaseline:"middle"})})}}}(t,e,h,a,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var i,r,n,s;let{label:a,title:o,line:l,tick:h}=this.attribute,d=null!==(i=a.space)&&void 0!==i?i:4,u=t,c=0,p=0,g=l&&l.visible?null!==(r=l.style.lineWidth)&&void 0!==r?r:1:0,f=h&&h.visible?null!==(n=h.length)&&void 0!==n?n:4:0;if(o&&o.visible&&"string"==typeof o.text){c=fY(o.text,o.textStyle,null===(s=this.stage)||void 0===s?void 0:s.getTheme().text.fontFamily).height;let t=(0,pT.o)(o.padding);p=o.space+t[0]+t[2]}return u&&(u=(u-d-p-c-g-f)/e),u}}vO.defaultAttributes=fJ,cI(vO,vt);class vR{isInValidValue(t){let{startAngle:e=fZ,endAngle:i=fH}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){let{startAngle:e=fZ,endAngle:i=fH,center:r,radius:n,inside:s=!1,innerRadius:a=0}=this.attribute;return e2(r,s&&a>0?a:n,e+(i-e)*t)}getVerticalVector(t,e=!1,i){let{inside:r=!1}=this.attribute,{center:n}=this.attribute,s=[i.x-n.x,i.y-n.y];return fN(s,(e?-1:1)*(r?-1:1)*t/function(t){let[e,i]=t;return Math.sqrt(e*e+i*i)}(s))}getRelativeVector(t){let{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}var vI=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)0>e.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i};vM(),vf();class vL extends m1{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},vL.defaultAttributes,t))}renderLine(t){let{startAngle:e=fZ,endAngle:i=fH,radius:r,center:n,innerRadius:s=0,line:a={},inside:o=!1}=this.attribute,l=r,h=s;o&&s>0&&(l=s,h=0);let d=Object.assign(Object.assign(Object.assign({},n),{startAngle:e,endAngle:i,radius:l,innerRadius:h}),a.style),u=as.circle(d);u.name=t5.line,u.id=this._getNodeId("line"),dn(a.state)||(u.states=lT({},fq,a.state)),t.add(u)}getTitleAttribute(){var t,e,i;let{center:r,radius:n,innerRadius:s=0}=this.attribute,a=this.attribute.title,{space:o=4,textStyle:l={},shape:h,background:d,state:u={}}=a,c=vI(a,["space","textStyle","shape","background","state"]),p=r,g=0;(null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside&&(g=lX(this.attribute.label,"style.fontSize",12)+lX(this.attribute.label,"space",4));let f=0;(null===(e=this.attribute.tick)||void 0===e?void 0:e.visible)&&!1===this.attribute.tick.inside&&(f=this.attribute.tick.length||4),(null===(i=this.attribute.subTick)||void 0===i?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(f=Math.max(f,this.attribute.subTick.length||2));let m=n+f+g+o,v="middle",{position:y}=this.attribute.title;(0,eB.Z)(y)&&(y=0===s?"end":"middle"),"start"===y?(v="bottom",p={x:r.x,y:r.y-m}):"end"===y&&(v="top",p={x:r.x,y:r.y+m});let b=Object.assign(Object.assign(Object.assign({},p),c),{textStyle:Object.assign({textBaseline:v,textAlign:"center"},l),state:{text:lT({},fq,u.text),shape:lT({},fq,u.shape),panel:lT({},fq,u.background)}}),{angle:x}=c;return b.angle=x,h&&h.visible&&(b.shape=Object.assign({visible:!0},h.style),h.space&&(b.space=h.space)),d&&d.visible&&(b.panel=Object.assign({visible:!0},d.style)),b}getSubTickLineItems(){var t,e;let{subTick:i}=this.attribute,r=[],{count:n=4,inside:s=!1,length:a=2}=i,o=this.tickLineItems,l=o.length;if(l>=2){let i=this.data[1].value-this.data[0].value,h=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t<l;t++){let e=o[t],l=o[t+1];for(let t=0;t<n;t++){let o=(t+1)/(n+1),d=(1-o)*e.value+o*(l?l.value:h?1:e.value+i),u=this.getTickCoord(d),c=this.getVerticalCoord(u,a,s);r.push({start:u,end:c,value:d})}}}return r}getTextBaseline(t){let e="middle";return dq(t[1],0)?e="middle":t[1]>0&&t[1]>Math.abs(t[0])?e="top":t[1]<0&&Math.abs(t[1])>Math.abs(t[0])&&(e="bottom"),e}beforeLabelsOverlap(t,e,i,r,n){}handleLabelsOverlap(t,e,i,r,n){}afterLabelsOverlap(t,e,i,r,n){}getLabelAlign(t,e,i){return{textAlign:"center",textBaseline:"middle"}}getLabelPosition(t,e,i,r){return function(t,e,i,r){let n=fz(Object.assign({text:i},r)),s=n.width(),a=n.height(),o=mJ(Math.atan2(e[1],e[0]))-Math.PI,l=3*Math.PI/4,h=Math.PI/4,d=Math.PI/2,u=t.x,c=0,p=u-(c=mQ(o,-l,-h)?((o+l)/d-.5)*s:mQ(o,h,l)?(.5-(o-h)/d)*s:Math.cos(o)>=0?.5*s:-(.5*s)),g=t.y,f=0;return{x:p,y:g-(f=mQ(o,-l,-h)?-(.5*a):mQ(o,h,l)?.5*a:Math.cos(o)>=0?(.5-(h-o)/d)*a:(.5-mJ(o-l)/d)*a)}}(t,e,i,r)}}vL.defaultAttributes=fJ,cI(vL,vR);class vD extends uI{parseAddition(t){return super.parseAddition(t),this.scale(t.scale),this}scale(t){if(this.spec.scale){let t=(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this.detach(t),this.spec.scale=void 0}let e=(0,ek.Z)(t)?this.view.getScaleById(t):t;return this.spec.scale=e,this.attach(e),this._updateComponentEncoders(),this.commit(),this}getScale(){return(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale}}let vj=(t,e,i,r)=>{var n,s,a,o;let l=null!==(s=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.axis)&&void 0!==s?s:{};return t?lT({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,r))&&void 0!==o?o:[]).map(t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick}))]},null!=i?i:{}):lT({},l,null!=i?i:{})},vN=(t,e,i,r)=>{var n,s,a,o;let l=null!==(s=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleAxis)&&void 0!==s?s:{};return t?lT({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,r))&&void 0!==o?o:[]).map(t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick}))]},null!=i?i:{}):lT({},l,null!=i?i:{})},vF=(t,e,i,r,n,s)=>{var a;let o=t.getCoordinateAxisPosition();n&&"auto"===n.position&&(n.position=i?"content":o);let l=t.getCoordinateAxisPoints(r);if(l){let r={start:l[0],end:l[1],verticalFactor:("top"===o||"left"===o?-1:1)*(i?-1:1)*((null===(a=t.getSpec().range)||void 0===a?void 0:a.reversed)?-1:1)};if(s&&"polar"===e.type){let t=e.angle();r.center=e.origin(),r.startAngle=t[0],r.endAngle=t[1]}return r}let h=e.radius(),d=e.angle();return{center:e.origin(),radius:h[1],innerRadius:h[0],inside:i,startAngle:d[0],endAngle:d[1]}};class vG extends vD{constructor(t,e,i){super(t,tG.axis,e),this.spec.componentType=tG.axis,this.mode=i}parseAddition(t){return super.parseAddition(t),this.axisType(t.axisType),this.tickCount(t.tickCount),this.inside(t.inside),this.baseValue(t.baseValue),this}scale(t){return super.scale(t),this._axisComponentType=null,this}axisType(t){return this.spec.axisType=t,this._axisComponentType=null,this._prepareRejoin(),this.commit(),this}addGraphicItem(t,e){let i=lT({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),r=ld.createGraphicComponent(this._getAxisComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,r)}tickCount(t){let e=(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}getAxisComponentType(){return this._axisComponentType}_updateComponentEncoders(){let t=(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale,e=Object.assign({update:{}},this.spec.encode),i=Object.keys(e).reduce((i,r)=>{let n=e[r];return n&&(i[r]={callback:(e,i,r)=>{var s,a;let o=this.spec.skipTheme?null:this.view.getCurrentTheme(),l=du(n,e,i,r),h=lt(this.spec.inside,r,e,i),d=lt(this.spec.baseValue,r,e,i),u=null===(s=null==t?void 0:t.getCoordinate)||void 0===s?void 0:s.call(t);u&&(l=Object.assign(vF(t,u,h,d,this.spec.layout),l));let c=null===(a=null==t?void 0:t.getScale)||void 0===a?void 0:a.call(t),p=lt(this.spec.tickCount,r,e,i);switch(this._getAxisComponentType()){case tZ.lineAxis:return vj(c,o,l,p);case tZ.circleAxis:return vN(c,o,l,p)}return l}}),i},{});this._encoders=i}_getAxisComponentType(){var t;if(this._axisComponentType)return this._axisComponentType;let e=this.spec.axisType;if((0,eB.Z)(e)){let i=(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;e=(null===(t=null==i?void 0:i.getCoordinate)||void 0===t?void 0:t.call(i))?i.getCoordinateAxisPoints()?"line":"circle":"line"}return this._axisComponentType="circle"===e?tZ.circleAxis:tZ.lineAxis,this._axisComponentType}}vG.componentType=tG.axis;(tl=t4||(t4={})).selected="selected",tl.unSelected="unSelected",tl.selectedHover="selectedHover",tl.unSelectedHover="unSelectedHover",tl.focus="focus",(th=t6||(t6={})).legendItemHover="legendItemHover",th.legendItemUnHover="legendItemUnHover",th.legendItemClick="legendItemClick",th.legendItemAttributeUpdate="legendItemAttributeUpdate",(td=t8||(t8={})).innerView="innerView",td.title="legendTitle",td.item="legendItem",td.itemShape="legendItemShape",td.itemLabel="legendItemLabel",td.itemValue="legendItemValue",td.focus="legendItemFocus";class vz extends pB{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild(!0);let{interactive:t=!0,title:e,padding:i=0}=this.attribute,r=(0,pT.o)(i),n=as.group({x:r[3],y:r[0],pickable:t,childrenPickable:t});n.name=t8.innerView,this.add(n),this._innerView=n,(null==e?void 0:e.visible)&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();let s=this._innerView.AABBBounds;this.attribute.width=s.width()+r[1]+r[3],this.attribute.height=s.height()+r[0]+r[2]}_renderTitle(t){let{text:e="",textStyle:i,padding:r=0,background:n,minWidth:s,maxWidth:a,shape:o}=t,l={x:0,y:0,text:e,textStyle:i,padding:(0,pT.o)(r),minWidth:s,maxWidth:a};o&&o.visible&&(l.shape=Object.assign({visible:!0},o.style),eb(o.space)&&(l.space=o.space)),n&&n.visible&&(l.panel=Object.assign({visible:!0},n.style));let h=new mq(l);h.name=t8.title,this._title=h,this._innerView.add(h)}_adjustLayout(){var t;if(this._title){let e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),r=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===r?this._title.setAttribute("x",(e-i)/2):"end"===r&&this._title.setAttribute("x",e-i)}}}function vZ(){pC(),fD(),mY()}let vH={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};vZ();class vU extends pB{getCurrent(){return this._current}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},vU.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{let e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{let e=t.target;if("preHandler"===e.name){if(1===this._current)return;this._current-=1,1===this._current?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:t})}if("nextHandler"===e.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:t})}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",this._getPageText(this._current))}}render(){var t,e;this._reset();let{layout:i="horizontal",handler:r=vH,total:n,defaultCurrent:s=1,textStyle:a,padding:o=0}=this.attribute;this._current=s;let l=(0,pT.o)(o),h="horizontal"===i,d=as.group({x:0,y:0}),u=r.style||{},c=u.size||15,p=null!==(t=r.space)&&void 0!==t?t:8,g=r.state||{},{preShape:f,nextShape:m}=r;f||(f=h?"triangleLeft":"triangleUp"),m||(m=h?"triangleRight":"triangleDown");let v=as.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},u),{x:0,y:0,symbolType:f,size:c}));v.states=g,v.name="preHandler",this.preHandler=v,d.add(v);let{width:y,height:b}=fY(this._getPageText(n),Object.assign({textAlign:"center",textBaseline:"middle"},a),null===(e=this.stage)||void 0===e?void 0:e.getTheme().text.fontFamily),x=(0,iy.Z)(c)?c:c[0],_=(0,iy.Z)(c)?c:c[1],A=as.text(Object.assign({x:h?x/2+p+y/2:0,y:h?0:_/2+p+b/2,text:this._getPageText(s),textAlign:"center",textBaseline:"middle",lineHeight:null==a?void 0:a.fontSize},a));this.text=A,d.add(A);let w=as.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},u),{x:h?x+2*p+y:0,y:h?0:_+2*p+b,symbolType:m,size:c}));w.name="nextHandler",w.states=g,this.nextHandler=w,d.add(w),1===this._total?(v.addState("disable"),w.addState("disable")):1===this._current?v.addState("disable"):this._current===n&&w.addState("disable");let S=d.AABBBounds,T=S.width(),k=S.height();d.translateTo(0-S.x1+l[3],0-S.y1+l[0]),this.add(d),this.attribute.width=T+l[1]+l[3],this.attribute.height=k+l[0]+l[2],this._bindEvents()}_bindEvents(){this.attribute.disableTriggerEvent||(this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick)))}_reset(){this.removeAllChild(!0),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}_getPageText(t){let{pageFormatter:e}=this.attribute;return e?r6(e)?e(t,this._total):`${e}`.replace("{current}",`${t}`).replace("{total}",`${this._total}`):`${t}/${this._total}`}setTotal(t){t!==this.attribute.total&&(this._total=t,1!==this._current&&this._current<=t?this.setAttributes({total:t,defaultCurrent:this._current}):this.setAttribute("total",t))}}function vV(){pC(),mY(),ml(),fD()}function vW(){pC(),ml()}function v$(){pC(),mX()}vU.defaultAttributes={handler:vH,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};var vY=(t,e,i)=>{let[r,n]=t;n<r&&(r=t[1],n=t[0]);let s=n-r;return s>=i-e?[e,i]:[r=Math.min(Math.max(r,e),i-s),r+s]};let vX={debounce:em,throttle:hK};pC(),ml();class vK extends pB{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},vK.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{let e;let{viewX:i,viewY:r}=t,{direction:n,width:s,height:a,range:o}=this.attribute,l=this._sliderSize,[h,d]=this._getScrollRange();if("vertical"===n){let t=r-this._viewPosition.y,i=nd(t-l/2,h,d);e=t/a,this._slider.setAttribute("y",i,!0)}else{let t=i-this._viewPosition.x,r=nd(t-l/2,h,d);e=t/s,this._slider.setAttribute("x",r,!0)}this.setScrollRange([e-(o[1]-o[0])/2,e+(o[1]-o[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{t.stopPropagation();let{direction:e}=this.attribute;this._prePos="horizontal"===e?t.clientX:t.clientY,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t}),"browser"===o2.env?(o2.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),o2.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{let{direction:e}=this.attribute,i,r,n=0,{width:s,height:a}=this._getSliderRenderBounds();return i="vertical"===e?(n=(r=t.clientY)-this._prePos)/a:(n=(r=t.clientX)-this._prePos)/s,[r,i]},this._onSliderPointerMove=t=>{t.stopPropagation();let e=this.getScrollRange(),[i,r]=this._computeScrollValue(t);this.setScrollRange([e[0]+r,e[1]+r],!0),this._prePos=i},this._onSliderPointerMoveWithDelay=0===this.attribute.delayTime?this._onSliderPointerMove:vX[this.attribute.delayType](this._onSliderPointerMove,this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();let{realTime:e=!0,range:i,limitRange:r=[0,1]}=this.attribute,n=this.getScrollRange(),[s,a]=this._computeScrollValue(t),o=[n[0]+a,n[1]+a];this._dispatchEvent("scrollUp",{pre:i,value:vY(o,r[0],r[1])}),"browser"===o2.env?(o2.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),o2.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,e=!0){let{direction:i="horizontal",limitRange:r=[0,1],range:n,realTime:s=!0}=this.attribute,a=vY(t,r[0],r[1]);if(e){let t=this._getSliderPos(a);if(this._slider){let e=t[1]-t[0];this._sliderSize=e,"horizontal"===i?this._slider.setAttributes({x:t[0],width:e},!0):this._slider.setAttributes({y:t[0],height:e},!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()}}this.attribute.range=a,s&&this._dispatchEvent("scrollDrag",{pre:n,value:a})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;let{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",vX[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){let t;this._reset();let{direction:e="horizontal",width:i,height:r,range:n,limitRange:s=[0,1],railStyle:a,sliderStyle:o,padding:l=2}=this.attribute,h=this.createOrUpdateChild("scrollbar-container",{},"group"),d=h.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:i,height:r},a),"rect");this._rail=d;let u=this._getSliderRenderBounds(),c=this._getSliderPos(vY(n,s[0],s[1])),p=c[1]-c[0];this._sliderSize=p,t="horizontal"===e?{x:c[0],y:u.y1,width:p,height:u.height}:{x:u.x1,y:c[0],width:u.width,height:p};let g=h.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},t),{cornerRadius:this._getDefaultSliderCornerRadius()}),o),{boundsPadding:(0,pT.o)(l),pickMode:"imprecise"}),"rect");this._slider=g,this._container=h;let f=this._container.AABBBounds;this._viewPosition={x:f.x1,y:f.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;let{width:t,height:e,padding:i=2}=this.attribute,[r,n,s,a]=(0,pT.o)(i),o={x1:a,y1:r,x2:t-n,y2:e-s,width:Math.max(0,t-(a+n)),height:Math.max(0,e-(r+s))};return this._sliderRenderBounds=o,o}_getDefaultSliderCornerRadius(){let{direction:t,round:e}=this.attribute;if(e){let{width:e,height:i}=this._getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){let{direction:e}=this.attribute,{width:i,height:r,x1:n,y1:s}=this._getSliderRenderBounds();return"horizontal"===e?[i*t[0]+n,i*t[1]+n]:[r*t[0]+s,r*t[1]+s]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;let{limitRange:t=[0,1],direction:e}=this.attribute,[i,r]=vY(t,0,1),{width:n,height:s,x1:a,y1:o}=this._getSliderRenderBounds(),l=this._sliderSize;return"horizontal"===e?vY([a+i*n,a+r*n],a,n-l):vY([o+i*s,o+r*s],o,s-l)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}vK.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0};var vq=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)0>e.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i};let vJ={[t4.focus]:{},[t4.selected]:{},[t4.selectedHover]:{},[t4.unSelected]:{},[t4.unSelectedHover]:{}};v$(),vZ(),pC(),ml();class vQ extends vz{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},vQ.defaultAttributes,t)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._onHover=t=>{let e=t.target;if(e&&e.name&&e.name.startsWith(t8.item)){let i=e.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===i.id)return;this._unHover(this._lastActiveItem,t)}this._hover(i,t)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=t=>{var e,i,r,n;let s=t.target;if(s&&s.name&&s.name.startsWith(t8.item)){let a=s.delegate;if(s.name===t8.focus){let r=a.hasState(t4.focus);a.toggleState(t4.focus),r?null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach(e=>{this._removeLegendItemState(e,[t4.unSelected,t4.unSelectedHover,t4.focus],t),this._setLegendItemState(e,t4.selected,t)}):(this._setLegendItemState(a,t4.selected,t),this._removeLegendItemState(a,[t4.unSelected,t4.unSelectedHover],t),null===(i=this._itemsContainer)||void 0===i||i.getChildren().forEach(e=>{a!==e&&(this._removeLegendItemState(e,[t4.selected,t4.selectedHover,t4.focus],t),this._setLegendItemState(e,t4.unSelected,t))}))}else{null===(r=this._itemsContainer)||void 0===r||r.getChildren().forEach(t=>{t.removeState(t4.focus)});let{selectMode:e="multiple",allowAllCanceled:i=!0}=this.attribute,s=a.hasState(t4.selected),o=this._getSelectedLegends();if("multiple"===e){if(!1===i&&s&&1===o.length)return void this._dispatchLegendEvent(t6.legendItemClick,a,t);s?(this._removeLegendItemState(a,[t4.selected,t4.selectedHover],t),this._setLegendItemState(a,t4.unSelected,t)):(this._setLegendItemState(a,t4.selected,t),this._removeLegendItemState(a,[t4.unSelected,t4.unSelectedHover],t))}else this._setLegendItemState(a,t4.selected,t),this._removeLegendItemState(a,[t4.unSelected,t4.unSelectedHover],t),null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach(e=>{a!==e&&(this._removeLegendItemState(e,[t4.selected,t4.selectedHover],t),this._setLegendItemState(e,t4.unSelected,t))})}this._dispatchLegendEvent(t6.legendItemClick,a,t)}}}setSelected(t){var e;(null===(e=this._itemsContainer)||void 0===e?void 0:e.getChildren()).forEach(e=>{let i=e.data;t.includes(i.label)?(this._setLegendItemState(e,t4.selected),this._removeLegendItemState(e,[t4.unSelected,t4.unSelectedHover])):(this._removeLegendItemState(e,[t4.selected,t4.selectedHover]),this._setLegendItemState(e,t4.unSelected))})}_renderItems(){let{item:t={},maxCol:e=1,maxRow:i=2,maxWidth:r,maxHeight:n,defaultSelected:s=[],lazyload:a,autoPage:o}=this.attribute,{spaceCol:l=16,spaceRow:h=8}=t,d=this._itemsContainer,{items:u,isHorizontal:c,startIndex:p,isScrollbar:g}=this._itemContext,f=g?1:c?i:e,m,{doWrap:v,maxWidthInCol:y,startX:b,startY:x,pages:_}=this._itemContext;for(let t=p,e=u.length;t<e&&!(a&&_>this._itemContext.currentPage*f);t++){a&&(this._itemContext.startIndex=t+1),(m=u[t]).id||(m.id=m.label),m.index=t;let e=this._renderEachItem(m,!!dn(s)||(null==s?void 0:s.includes(m.label)),t,u),i=e.attribute.width,p=e.attribute.height;this._itemHeight=Math.max(this._itemHeight,p),y=Math.max(i,y),this._itemMaxWidth=Math.max(i,this._itemMaxWidth),c?(eb(r)&&(g&&o?v=(_=Math.ceil((b+i)/r))>1:b+i>r&&(v=!0,b>0&&(_+=1,b=0,x+=p+h))),0===b&&0===x||e.setAttributes({x:b,y:x}),b+=l+i):(eb(n)&&(g&&o?v=(_=Math.ceil((x+p)/n))>1:n<x+p&&(_+=1,v=!0,x=0,b+=y+l,y=0)),0===b&&0===x||e.setAttributes({x:b,y:x}),x+=h+p),d.add(e)}return this._itemContext.doWrap=v,this._itemContext.startX=b,this._itemContext.startY=x,this._itemContext.maxWidthInCol=y,this._itemContext.pages=_,this._itemContext.maxPages=f,g&&(this._itemContext.totalPage=_),a||(this._itemContext.startIndex=u.length),this._itemContext}_renderContent(){let{item:t={},items:e,reversed:i,maxWidth:r}=this.attribute;if(!1===t.visible||dn(e))return;let n=e;i&&(n=null==e?void 0:e.reverse());let s=as.group({x:0,y:0});this._itemsContainer=s;let{layout:a,autoPage:o}=this.attribute,{maxWidth:l,width:h,height:d}=t,u=[];eb(l)&&u.push(l),eb(h)&&u.push(h),u.length&&(eb(r)&&u.push(r),this._itemWidthByUser=ew(u)),eb(d)&&(this._itemHeightByUser=d);let c=this.attribute.pager;this._itemContext={currentPage:c&&c.defaultCurrent||1,doWrap:!1,maxWidthInCol:0,maxPages:1,pages:1,startX:0,startY:0,startIndex:0,items:n,isHorizontal:"horizontal"===a,totalPage:1/0,isScrollbar:c&&"scrollbar"===c.type},this._itemContext=this._renderItems();let p=!1;this._itemContext.doWrap&&o&&this._itemContext.pages>this._itemContext.maxPages&&(p=this._renderPagerComponent()),p||(s.setAttribute("y",this._title?this._title.AABBBounds.height()+lX(this.attribute,"title.space",8):0),this._innerView.add(s))}_bindEvents(){if(this.attribute.disableTriggerEvent||!this._itemsContainer)return;let{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_autoEllipsis(t,e,i,r){var n,s;let{label:a,value:o}=this.attribute.item,l=r.AABBBounds,h=i.AABBBounds,d=l.width(),u=h.width(),c=!1;"labelFirst"===t?u>e?c=!0:r.setAttribute("maxLineWidth",e-u):"valueFirst"===t?d>e?c=!0:i.setAttribute("maxLineWidth",e-d):d+u>e&&(c=!0),c&&(r.setAttribute("maxLineWidth",Math.max(e*(null!==(n=a.widthRatio)&&void 0!==n?n:.5),e-u)),i.setAttribute("maxLineWidth",Math.max(e*(null!==(s=o.widthRatio)&&void 0!==s?s:.5),e-d)))}_renderEachItem(t,e,i,r){var n,s;let a;let{id:o,label:l,value:h,shape:d}=t,{padding:u=0,focus:c,focusIconStyle:p,align:g,autoEllipsisStrategy:f}=this.attribute.item,{shape:m,label:v,value:y,background:b}=this.attribute.item,x=this._handleStyle(m,t,e,i,r),_=this._handleStyle(v,t,e,i,r),A=this._handleStyle(y,t,e,i,r),w=this._handleStyle(b,t,e,i,r),S=(0,pT.o)(u);!1===b.visible?(a=as.group({x:0,y:0,cursor:null===(n=w.style)||void 0===n?void 0:n.cursor}),this._appendDataToShape(a,t8.item,t,a)):(a=as.group(Object.assign({x:0,y:0},w.style)),this._appendDataToShape(a,t8.item,t,a,w.state)),a.id=`${null!=o?o:l}-${i}`,a.addState(e?t4.selected:t4.unSelected);let T=as.group({x:0,y:0,pickable:!1});a.add(T);let k,B=0,C=0,E=0;if(m&&!1!==m.visible){let i=lX(x,"style.size",10);C=(0,ev.Z)(i)?i[0]||0:i,E=lX(m,"space",8);let r=as.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},d),x.style));Object.keys(x.state||{}).forEach(t=>{let e=x.state[t].fill||x.state[t].stroke;d.fill&&(0,eB.Z)(x.state[t].fill)&&e&&(x.state[t].fill=e),d.stroke&&(0,eB.Z)(x.state[t].stroke)&&e&&(x.state[t].stroke=e)}),this._appendDataToShape(r,t8.itemShape,t,a,x.state),r.addState(e?t4.selected:t4.unSelected),T.add(r)}let M,P=0;if(c){let e=lX(p,"size",10);k=as.symbol(Object.assign(Object.assign({x:0,y:-e/2-1,strokeBoundsBuffer:0},p),{visible:!0,pickMode:"imprecise",boundsPadding:S})),this._appendDataToShape(k,t8.focus,t,a),P=e}let O=v.formatMethod?v.formatMethod(l,t,i):l,R=Object.assign(Object.assign({x:C/2+E,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null===(s=_.style)||void 0===s?void 0:s.fontSize},_.style),{text:O});M=fX(R)?as.richtext(fK(R)):as.text(R),this._appendDataToShape(M,t8.itemLabel,t,a,_.state),M.addState(e?t4.selected:t4.unSelected),T.add(M);let I=lX(v,"space",8);if(eb(h)){let r;let n=lX(y,"space",c?8:0),s=y.formatMethod?y.formatMethod(h,t,i):h,o=Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:A.style.fontSize},A.style),{text:s});if(r=fX(o)?as.richtext(fK(o)):as.text(o),this._appendDataToShape(r,t8.itemValue,t,a,A.state),r.addState(e?t4.selected:t4.unSelected),this._itemWidthByUser){let t=this._itemWidthByUser-S[1]-S[3]-C-E-I-P-n;this._autoEllipsis(f,t,M,r),y.alignRight?r.setAttributes({textAlign:"right",x:this._itemWidthByUser-C/2-S[1]-S[3]-P-n}):r.setAttribute("x",n+(M.AABBBounds.empty()?0:M.AABBBounds.x2))}else r.setAttribute("x",n+(M.AABBBounds.empty()?0:M.AABBBounds.x2));B=n+(r.AABBBounds.empty()?0:r.AABBBounds.x2),T.add(r)}else this._itemWidthByUser&&M.setAttribute("maxLineWidth",this._itemWidthByUser-S[1]-S[3]-C-E-P),B=I+(M.AABBBounds.empty()?0:M.AABBBounds.x2);k&&(k.setAttribute("x",B),T.add(k));let L=T.AABBBounds,D=L.width();if("right"===g){let t=L.x2,e=L.x1;T.forEachChildren((i,r)=>{"symbol"!==i.type&&"right"!==i.attribute.textAlign||i===k?i.setAttribute("x",e+t-i.attribute.x-i.AABBBounds.width()):"symbol"!==i.type?i.setAttributes({x:e+t-i.attribute.x,textAlign:"left"}):i.setAttribute("x",e+t-i.attribute.x)})}let j=L.height(),N=eb(this.attribute.item.width)?this.attribute.item.width:D+S[1]+S[3],F=this._itemHeightByUser||j+S[0]+S[2];return a.attribute.width=N,a.attribute.height=F,k&&k.setAttribute("visible",!1),T.translateTo(-L.x1+S[3],-L.y1+S[0]),a}_createPager(t){var e,i;let{disableTriggerEvent:r,maxRow:n}=this.attribute;return new vU(this._itemContext.isHorizontal?Object.assign(Object.assign({layout:1===n?"horizontal":"vertical",total:99},lT({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},t)),{defaultCurrent:null===(e=this.attribute.pager)||void 0===e?void 0:e.defaultCurrent,disableTriggerEvent:r}):Object.assign({layout:"horizontal",total:99,disableTriggerEvent:r,defaultCurrent:null===(i=this.attribute.pager)||void 0===i?void 0:i.defaultCurrent},t))}_createScrollbar(t,e){let{disableTriggerEvent:i}=this.attribute;return new vK(this._itemContext.isHorizontal?Object.assign(Object.assign({direction:"horizontal",disableTriggerEvent:i,range:[0,.5],height:12},t),{width:e}):Object.assign(Object.assign({direction:"vertical",width:12,range:[0,.5]},t),{height:e,disableTriggerEvent:i}))}_updatePositionOfPager(t,e,i,r,n){let{maxHeight:s,pager:a}=this.attribute,{totalPage:o,isHorizontal:l}=this._itemContext,h=a&&a.position||"middle";if(this._pagerComponent.setTotal(o),l){let e;e="start"===h?i:"end"===h?i+n-this._pagerComponent.AABBBounds.height()/2:i+n/2-this._pagerComponent.AABBBounds.height()/2,this._pagerComponent.setAttributes({x:t,y:e})}else{let t;t="start"===h?0:"end"===h?r-this._pagerComponent.AABBBounds.width():(r-this._pagerComponent.AABBBounds.width())/2,this._pagerComponent.setAttributes({x:t,y:s-this._pagerComponent.AABBBounds.height()})}}_updatePositionOfScrollbar(t,e,i){let{currentPage:r,totalPage:n,isHorizontal:s}=this._itemContext;this._pagerComponent.setScrollRange([(r-1)/n,r/n]),s?this._pagerComponent.setAttributes({x:0,y:i+e}):this._pagerComponent.setAttributes({x:t,y:i})}_bindEventsOfPager(t,e){let i=this.attribute.pager||{},{animation:r=!0,animationDuration:n=450,animationEasing:s="quadIn"}=i,a=this._itemContext.isScrollbar?t=>{let{value:e}=t.detail,r=e[0]*this._itemContext.totalPage;return i.scrollByPosition?r+=1:r=Math.floor(r)+1,r}:t=>t.detail.current,o=i=>{let o=a(i);if(o!==this._itemContext.currentPage){if(this._itemContext.currentPage=o,this._itemContext&&this._itemContext.startIndex<this._itemContext.items.length){this._renderItems();let t=Math.ceil(this._itemContext.pages/this._itemContext.maxPages);this._itemContext.totalPage=t,this._pagerComponent.setScrollRange([(o-1)/t,o/t])}r?this._itemsContainer.animate().to({[e]:-(o-1)*t},n,s):this._itemsContainer.setAttribute(e,-(o-1)*t)}};this._itemContext.isScrollbar?(this._pagerComponent.addEventListener("scrollDrag",o),this._pagerComponent.addEventListener("scrollUp",o)):(this._pagerComponent.addEventListener("toPrev",o),this._pagerComponent.addEventListener("toNext",o))}_renderPager(){let t=this._title?this._title.AABBBounds.height()+lX(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,maxCol:r=1,maxRow:n=2,item:s={},pager:a={}}=this.attribute,{spaceCol:o=16,spaceRow:l=8}=s,h=this._itemsContainer,{space:d=12,defaultCurrent:u=1}=a,c=vq(a,["space","defaultCurrent"]),{isHorizontal:p}=this._itemContext,g,f=0,m=0,v=0,y=0,b=0,x=0,_=1;if(p){if(m=(n-1)*l+this._itemHeight*n,f=e,g=this._createPager(c),this._pagerComponent=g,this._innerView.add(g),(v=e-g.AABBBounds.width()-d)<=0)return this._innerView.removeChild(g),!1;h.getChildren().forEach((t,e)=>{let{width:i,height:r}=t.attribute;v<b+i&&(b=0,x+=r+l,_+=1),e>0&&t.setAttributes({x:b,y:x}),b+=o+i}),this._itemContext.startX=b,this._itemContext.startY=x,this._itemContext.pages=_;let i=Math.ceil(_/n);this._itemContext.totalPage=i,this._updatePositionOfPager(v,y,t,f,m)}else{if(f=this._itemMaxWidth*r+(r-1)*o,m=i,v=f,g=this._createPager(c),this._pagerComponent=g,this._innerView.add(g),(y=i-g.AABBBounds.height()-d-t)<=0)return this._innerView.removeChild(g),!1;h.getChildren().forEach((t,e)=>{let{height:i}=t.attribute;y<x+i&&(x=0,b+=this._itemMaxWidth+o,_+=1),e>0&&t.setAttributes({x:b,y:x}),x+=l+i});let e=Math.ceil(_/r);this._itemContext.totalPage=e,this._updatePositionOfPager(v,y,t,f,m)}u>1&&(p?h.setAttribute("y",-(u-1)*(m+l)):h.setAttribute("x",-(u-1)*(f+o)));let A=as.group({x:0,y:t,width:p?v:f,height:p?m:y,clip:!0,pickable:!1});return A.add(h),this._innerView.add(A),this._bindEventsOfPager(p?m+l:f+o,p?"y":"x"),!0}_renderScrollbar(){let t=this._title?this._title.AABBBounds.height()+lX(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,item:r={},pager:n={}}=this.attribute,{spaceCol:s=16,spaceRow:a=8}=r,o=this._itemsContainer,{space:l=12,defaultCurrent:h=1}=n,d=vq(n,["space","defaultCurrent"]),{isHorizontal:u}=this._itemContext,c,p=0,g=0,f=0,m=0,v=1;if(u)p=e,g=e,f=this._itemHeight,c=this._createScrollbar(d,p),this._pagerComponent=c,this._innerView.add(c),this._updatePositionOfScrollbar(g,f,t);else{if(p=i,c=this._createScrollbar(d,p),this._pagerComponent=c,this._innerView.add(c),f=i-t,g=this._itemMaxWidth,f<=0)return this._innerView.removeChild(c),!1;o.getChildren().forEach((t,e)=>{let{height:i}=t.attribute;v=Math.floor((m+i)/f)+1,m+=a+i}),this._itemContext.totalPage=v,this._itemContext.pages=v,this._updatePositionOfScrollbar(g,f,t)}h>1&&(u?o.setAttribute("x",-(h-1)*(g+s)):o.setAttribute("y",-(h-1)*(f+a)));let y=as.group({x:0,y:t,width:g,height:f,clip:!0,pickable:!1});return y.add(o),this._innerView.add(y),this._bindEventsOfPager(u?g:f,u?"x":"y"),!0}_renderPagerComponent(){return this._itemContext.isScrollbar?this._renderScrollbar():this._renderPager(),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(t4.selected)?this._setLegendItemState(t,t4.selectedHover,e):this._setLegendItemState(t,t4.unSelectedHover,e);let i=t.getChildren()[0].find(t=>t.name===t8.focus,!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(t6.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(t4.unSelectedHover)||t.hasState(t4.selectedHover))&&(i=!0),t.removeState(t4.unSelectedHover),t.removeState(t4.selectedHover),t.getChildren()[0].getChildren().forEach(t=>{!i&&(t.hasState(t4.unSelectedHover)||t.hasState(t4.selectedHover))&&(i=!0),t.removeState(t4.unSelectedHover),t.removeState(t4.selectedHover)});let r=t.getChildren()[0].find(t=>t.name===t8.focus,!1);r&&r.setAttribute("visible",!1),i&&this._dispatchLegendEvent(t6.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(t6.legendItemUnHover,t,e)}_setLegendItemState(t,e,i){let r=!1;t.hasState(e)||(r=!0),t.addState(e,!0),t.getChildren()[0].getChildren().forEach(t=>{t.name!==t8.focus&&(r||t.hasState(e)||(r=!0),t.addState(e,!0))}),r&&this._dispatchLegendEvent(t6.legendItemAttributeUpdate,t,i)}_removeLegendItemState(t,e,i){let r=!1;e.forEach(e=>{!r&&t.hasState(e)&&(r=!0),t.removeState(e)}),t.getChildren()[0].getChildren().forEach(t=>{t.name!==t8.focus&&e.forEach(e=>{!r&&t.hasState(e)&&(r=!0),t.removeState(e)})}),r&&this._dispatchLegendEvent(t6.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;let e=[];return null===(t=this._itemsContainer)||void 0===t||t.getChildren().forEach(t=>{t.hasState(t4.selected)&&e.push(t.data)}),e}_appendDataToShape(t,e,i,r,n={}){t.name=e,t.data=i,t.delegate=r,t.states=lT({},vJ,n)}_dispatchLegendEvent(t,e,i){let r=this._getSelectedLegends();r.sort((t,e)=>t.index-e.index);let n=r.map(t=>t.label);this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(t4.selected),currentSelectedItems:r,currentSelected:n,event:i})}_handleStyle(t,e,i,r,n){let s={};return t.style&&(r6(t.style)?s.style=t.style(e,i,r,n):s.style=t.style),t.state&&(s.state={},Object.keys(t.state).forEach(a=>{t.state[a]&&(r6(t.state[a])?s.state[a]=t.state[a](e,i,r,n):s.state[a]=t.state[a])})),s}}vQ.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:16,spaceRow:8,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},(tu=t7||(t7={})).Identity="identity",tu.Linear="linear",tu.Log="log",tu.Pow="pow",tu.Sqrt="sqrt",tu.Symlog="symlog",tu.Time="time",tu.Quantile="quantile",tu.Quantize="quantize",tu.Threshold="threshold",tu.Ordinal="ordinal",tu.Point="point",tu.Band="band";let v0={};Object.values(t7).forEach(t=>{v0[t]=!0});var v1=t=>null!=t;let v2=t=>{let e=null,i=null;return(...r)=>(e&&r.every((t,i)=>t===e[i])||(e=r,i=t(...r)),i)};var v5=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`,v3=(t,e=!1)=>{let i=typeof t;return e?"number"===i:"number"===i||v5(t,"Number")},v4=t=>null==t;function v6(t){return t}function v8(t,e){if(t=Number(t),e=Number(e)-t)return i=>(i-t)/e;let i=Number.isNaN(e)?NaN:.5;return()=>i}function v7(t,e,i){let r,n;let s=t[0],a=t[1],o=e[0],l=e[1];return a<s?(r=v8(a,s),n=i(l,o)):(r=v8(s,a),n=i(o,l)),t=>n(r(t))}function v9(t,e,i){let r=Math.min(t.length,e.length)-1,n=Array(r),s=Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)n[a]=v8(t[a],t[a+1]),s[a]=i(e[a],e[a+1]);return function(e){let i=function(t,e,i=0,r){for(v4(r)&&(r=t.length);i<r;){var n,s;let a=i+r>>>1;(n=t[a],(n<(s=e)?-1:n>s?1:n>=s?0:NaN)>0)?r=a:i=a+1}return i}(t,e,1,r)-1;return s[i](n[i](e))}}let yt=(t,e=!1)=>{let i=Math.floor(Math.log10(t)),r=t/Math.pow(10,i);return(e?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10)*Math.pow(10,i)},ye=(t,e)=>{let i,r;return e[0]<e[1]?(i=e[0],r=e[1]):(i=e[1],r=e[0]),Math.min(Math.max(t,i),r)},yi=Math.sqrt(50),yr=Math.sqrt(10),yn=Math.sqrt(2),ys=[1,2,5,10],ya=(t,e,i)=>{let r=1,n=t,s=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&a<1?r=yu(a).step:(i||a>1)&&(n=Math.floor(t)-s*r),r>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*r)),(function(t,e,i){v1(e)||(e=t,t=0),v1(i)||(i=1);let r=-1,n=0|Math.max(0,Math.ceil((e-t)/i)),s=Array(n);for(;++r<n;)s[r]=t+r*i;return s})(0,e).map(t=>n+t*r)):t>0?yl(0,-(e-1)/r,r):yl((e-1)/r,0,r)},yo=v2((t,e,i,r)=>{let n,s,a,o,l=-1;if(i=+i,(t=+t)==(e=+e)||Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((n=e<t)&&(s=t,t=e,e=s),!isFinite(o=yc(t,e,i).step))return[];if(o>0){let i=Math.round(t/o),r=Math.round(e/o);for(i*o<t&&++i,r*o>e&&--r,a=Array(s=r-i+1);++l<s;)a[l]=(i+l)*o}else if(o<0&&(null==r?void 0:r.noDecimals)){o=1;let i=Math.ceil(t),r=Math.floor(e);if(!(i<=r))return[];for(a=Array(s=r-i+1);++l<s;)a[l]=i+l}else{let i=Math.round(t*(o=-o)),r=Math.round(e*o);for(i/o<t&&++i,r/o>e&&--r,a=Array(s=r-i+1);++l<s;)a[l]=(i+l)/o}return n&&a.reverse(),a}),yl=(t,e,i)=>{let r,n,s=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*i<t&&++a,(o-1)*i>e&&--o,n=Array(r=o-a+1);++s<r;)n[s]=(a+s)*i}else{let a=Math.floor(t*(i=-i)),o=Math.ceil(e*i);for((a+1)/i<t&&++a,(o-1)/i>e&&--o,n=Array(r=o-a+1);++s<r;)n[s]=(a+s)/i}return n},yh=(t,e,i)=>{let r;let n=t[0],s=t[t.length-1],a=e-t.length;if(s<=0){let e=[];for(r=a;r>=1;r--)e.push(n-r*i);return e.concat(t)}if(n>=0){for(r=1;r<=a;r++)t.push(s+r*i);return t}let o=[],l=[];for(r=1;r<=a;r++)r%2==0?o=[n-Math.floor(r/2)*i].concat(o):l.push(s+Math.ceil(r/2)*i);return o.concat(t).concat(l)},yd=v2((t,e,i,r)=>{let n,s,a;if(i=+i,(t=+t)==(e=+e)||Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return ya(t,i,null==r?void 0:r.noDecimals);(n=e<t)&&(a=t,t=e,e=a);let o=yc(t,e,i),l=o.step;if(!isFinite(l))return[];if(l>0){let r=1,{power:n,gap:a}=o,h=10===a?2*10**n:1*10**n;for(;r<=5&&(s=yl(t,e,l)).length>i+1&&i>2;)l+=h,r+=1;i>2&&s.length<i-1&&(s=yh(s,i,l))}else(null==r?void 0:r.noDecimals)&&l<0&&(l=1),s=yl(t,e,l);return n&&s.reverse(),s}),yu=t=>{let e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e,r=1;return i>=yi?r=10:i>=yr?r=5:i>=yn&&(r=2),e>=0?{step:r*10**e,gap:r,power:e}:{step:-(10**-e)/r,gap:r,power:e}};function yc(t,e,i){return yu((e-t)/Math.max(0,i))}function yp(t,e,i){let r;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(r=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(r))return[];let n=Array(i);for(let e=0;e<i;e++)n[e]=t+e*r;return n}function yg(t,e,i){let r,n,s=-1;if(i=+i,(n=(e=+e)<(t=+t))&&(r=t,t=e,e=r),!isFinite(i)||e-t<=i)return[t];let a=Math.floor((e-t)/i+1),o=Array(a);for(;++s<a;)o[s]=t+s*i;return n&&o.reverse(),o}function yf(t,e=10){let i,r,n=0,s=t.length-1,a=t[n],o=t[s],l=10;for(o<a&&(r=a,a=o,o=r,r=n,n=s,s=r);l-- >0;){if((r=yc(a,o,e).step)===i)return t[n]=a,t[s]=o,t;if(r>0)a=Math.floor(a/r)*r,o=Math.ceil(o/r)*r;else{if(!(r<0))break;a=Math.ceil(a*r)/r,o=Math.floor(o*r)/r}i=r}}let ym=(t,e,i)=>1>Math.abs(e-t)?+i.toFixed(1):Math.round(+i);v2((t,e,i,r,n,s,a)=>{let o=t,l=e,h=l<o;h&&([o,l]=[l,o]);let d,u,c=n(o),p=n(l),g=[];if(!(r%1)&&p-c<i){if(c=Math.floor(c),p=Math.ceil(p),o>0){for(;c<=p;++c)for(d=1;d<r;++d)if(!((u=c<0?d/s(-c):d*s(c))<o)){if(u>l)break;g.push(u)}}else for(;c<=p;++c)for(d=r-1;d>=1;--d)if(!((u=c>0?d/s(-c):d*s(c))<o)){if(u>l)break;g.push(u)}2*g.length<i&&(g=yd(o,l,i))}else g=yd(c,p,Math.min(p-c,i)).map(s);return g=g.filter(t=>0!==t),(null==a?void 0:a.noDecimals)&&(g=Array.from(new Set(g.map(t=>Math.floor(t))))),h?g.reverse():g}),v2((t,e,i,r,n,s)=>{let a=[],o={},l=n(t),h=n(e),d=[];if(Number.isInteger(r))d=yd(l,h,i);else{let t=(h-l)/(i-1);for(let e=0;e<i;e++)d.push(l+e*t)}return d.forEach(i=>{let n=s(i),l=Number.isInteger(r)?ym(t,e,n):ym(t,e,yt(n)),h=ym(t,e,ye(l,[t,e]));o[h]||isNaN(h)||!(d.length>1)||(o[h]=1,a.push(h))}),a}),v2((t,e,i,r,n)=>yp(r(t),r(e),i).map(t=>yt(n(t)))),v2((t,e,i,r,n)=>yg(r(t),r(e),i).map(t=>yt(n(t))));var yv=function(t,e,i){return t<e?e:t>i?i:t};class yy{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:v1(this._rangeFactorStart)&&v1(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=function(t,e){let i=(t[1]-t[0])/(e[1]-e[0]),r=t[0]-i*e[0];return[r,i+r]}(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every(t=>t>=0&&t<=1)&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):v1(this._rangeFactorStart)&&v1(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return v4(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0===t&&(v4(this._rangeFactorEnd)||1===this._rangeFactorEnd)?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1)),this)}rangeFactorEnd(t,e){var i;return v4(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0===t&&(v4(this._rangeFactorStart)||0===this._rangeFactorStart)?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);let{distortion:e=2,radiusRatio:i=.1,radius:r}=this._fishEyeOptions,n=this.range(),s=n[0],a=n[n.length-1],o=Math.min(s,a),l=Math.max(s,a),h=yv(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,l),d=v4(r)?(l-o)*i:r,u=Math.exp(e);u=u/(u-1)*d;let c=e/d;this._fishEyeTransform=t=>{let e=Math.abs(t-h);return e>=d?t:e<=1e-6?h:h+(t-h)*(u*(1-Math.exp(-e*c))/e*.75+.25)}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}}var yb=t=>Array.isArray?Array.isArray(t):v5(t,"Array");function yx(t,e,i){e/=100;let r=(1-Math.abs(2*(i/=100)-1))*e,n=r*(1-Math.abs(t/60%2-1)),s=i-r/2,a=0,o=0,l=0;return 0<=t&&t<60?(a=r,o=n,l=0):60<=t&&t<120?(a=n,o=r,l=0):120<=t&&t<180?(a=0,o=r,l=n):180<=t&&t<240?(a=0,o=n,l=r):240<=t&&t<300?(a=n,o=0,l=r):300<=t&&t<360&&(a=r,o=0,l=n),{r:a=Math.round(255*(a+s)),g:o=Math.round(255*(o+s)),b:l=Math.round(255*(l+s))}}function y_(t,e,i){t/=255,e/=255;let r=Math.min(t,e,i/=255),n=Math.max(t,e,i),s=n-r,a=0,o=0,l=0;return(a=Math.round(60*(a=0===s?0:n===t?(e-i)/s%6:n===e?(i-t)/s+2:(t-e)/s+4)))<0&&(a+=360),l=(n+r)/2,o=+(100*(o=0===s?0:s/(1-Math.abs(2*l-1)))).toFixed(1),{h:a,s:o,l:l=+(100*l).toFixed(1)}}let yA=/^#([0-9a-f]{3,8})$/,yw={transparent:0xffffff00},yS={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function yT(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function yk(t){return v3(t)?new yM(t>>16,t>>8&255,255&t,1):yb(t)?new yM(t[0],t[1],t[2]):new yM(255,255,255)}function yB(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function yC(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class yE{static Brighter(t,e=1){return 1===e?t:new yE(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new yE(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){let i=t instanceof yE?t:new yE(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(v1(yw[t])){var e;return v3(e=yw[t])?new yM(e>>>24,e>>>16&255,e>>>8&255,255&e):yb(e)?new yM(e[0],e[1],e[2],e[3]):new yM(255,255,255,1)}if(v1(yS[t]))return yk(yS[t]);let i=`${t}`.trim().toLowerCase(),r=yA.exec(i);if(r){let t=parseInt(r[1],16),e=r[1].length;return 3===e?new yM((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?yk(t):8===e?new yM(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(i)){let t=i.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new yM(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(i)){let t=i.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),e=yx(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new yM(e.r,e.g,e.b,parseFloat(t[3]))}}constructor(t){let e=yE.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new yM(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){let{r:e,g:i,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t))),this}add(t){let{r:e,g:i,b:r}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,r+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){let{r:e,g:i,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return .5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){let r=this.color.opacity,n=y_(this.color.r,this.color.g,this.color.b),s=yx(v4(t)?n.h:yv(t,0,360),v4(e)?n.s:e>=0&&e<=1?100*e:e,v4(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new yM(s.r,s.g,s.b,r),this}setRGB(t,e,i){return v4(t)||(this.color.r=t),v4(e)||(this.color.g=e),v4(i)||(this.color.b=i),this}setHex(t){let e=`${t}`.trim().toLowerCase(),i=yA.exec(e),r=parseInt(i[1],16),n=i[1].length;return 3===n?new yM((r>>8&15)+((r>>8&15)<<4),(r>>4&15)+((r>>4&15)<<4),(15&r)+((15&r)<<4),1):6===n?yk(r):8===n?new yM(r>>24&255,r>>16&255,r>>8&255,(255&r)/255):this}setColorName(t){let e=yS[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new yE(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){let i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=yB(t.color.r),this.color.g=yB(t.color.g),this.color.b=yB(t.color.b),this}copyLinearToSRGB(t){return this.color.r=yC(t.color.r),this.color.g=yC(t.color.g),this.color.b=yC(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class yM{constructor(t,e,i,r){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),v1(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}formatHex(){return`#${yT(this.r)+yT(this.g)+yT(this.b)+(1===this.opacity?"":yT(255*this.opacity))}`}formatRgb(){let t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){let t=this.opacity,{h:e,s:i,l:r}=y_(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${r}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}function yP(t){let e="",i="",r="",n="#"===t[0]?1:0;for(let s=n;s<t.length;s++)"#"!==t[s]&&(s<n+2?e+=t[s]:s<n+4?i+=t[s]:s<n+6&&(r+=t[s]));return[parseInt(e,16),parseInt(i,16),parseInt(r,16)]}function yO(t,e,i){return Number(0x1000000+(t<<16)+(e<<8)+i).toString(16).slice(1)}function yR(t,e){let i=t.r,r=e.r,n=t.g,s=e.g,a=t.b,o=e.b,l=t.opacity,h=e.opacity;return t=>new yM(Math.round(i*(1-t)+r*t),Math.round(n*(1-t)+s*t),Math.round(a*(1-t)+o*t),l*(1-t)+h*t)}function yI(t,e){return i=>t*(1-i)+e*i}function yL(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}RegExp(/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g.source,"g");let{interpolateRgb:yD}=ed;function yj(t,e){let i;let r=typeof e;if(v4(e)||"boolean"===r)return()=>e;if("number"===r)return yI(t,e);if("string"===r){if(i=yE.parseColorString(e)){let e=yD(yE.parseColorString(t),i);return t=>e(t).formatRgb()}return yI(Number(t),Number(e))}return e instanceof yM?yD(t,e):e instanceof yE?yD(t.color,e.color):e instanceof Date?function(t,e){let i=t.valueOf(),r=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+r*t),n)}(t,e):yI(Number(t),Number(e))}function yN(t){return Number(t)}class yF extends yy{constructor(t=v6,e=v6){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=v6,this._piecewise=v7,this._interpolate=yj}calculateVisibleDomain(t){var e;return v1(this._rangeFactorStart)&&v1(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(Number.isNaN(t=Number(t))||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));let i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),yI)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;let r=Array.from(t,yN);return this._domain=r,this.rescale(e)}range(t,e){if(!t)return this._range.slice();let i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){let i=Array.from(t);return this._range=i,this._interpolate=yL,this.rescale(e)}rescale(t){var e,i,r;let n;if(t)return this;let s=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,a=s.length,o=this._range.length,l=Math.min(a,o);if(a&&a<o&&this._forceAlign){let t=o-a+1,e=s[a-1],i=a>=2?(e-s[a-2])/t:0;for(let r=1;r<=t;r++)s[a-2+r]=e-i*(t-r);l=o}return this._autoClamp&&(this._clamp=(i=s[0],r=s[l-1],i>r&&(n=i,i=r,r=n),t=>Math.max(i,Math.min(r,t)))),this._piecewise=l>2?v9:v7,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:v6),this.rescale(i)):this._clamp!==v6}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){let e=this.ticks(t);return(null!=e?e:[]).map((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])}))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return v4(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return v4(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}class yG extends yF{constructor(){super(...arguments),this.type=t7.Linear}clone(){return(new yG).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){let i=this.calculateVisibleDomain(this._range);return yo(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(v1(this._rangeFactorStart)&&v1(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);let r=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,s=r[0],a=r[r.length-1],o=yd(n[0],n[n.length-1],t,e);if(!o.length)return o;if(this._domainValidator)o=o.filter(this._domainValidator);else if((o[0]!==s||o[o.length-1]!==a)&&this._niceType){let t=r.slice();if("all"===this._niceType?(t[0]=o[0],t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&o[0]!==s?(t[0]=o[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&o[o.length-1]!==a&&(t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){let e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);o=o.filter(t=>t>=e&&t<=i)}}return o}forceTicks(t=10){let e=this.calculateVisibleDomain(this._range);return yp(e[0],e[e.length-1],t)}stepTicks(t){let e=this.calculateVisibleDomain(this._range);return yg(e[0],e[e.length-1],t)}nice(t=10,e){var i,r;let n=this._domain,s=[];if(e){let t=function(t,e){let i=v3(e.forceMin),r=v3(e.forceMax),n=null,s=[],a=null,o=i&&r?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:r?t=>t<=e.forceMax:null;return i?s[0]=e.forceMin:v3(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(s[0]=e.min),r?s[1]=e.forceMax:v3(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(s[1]=e.max),v3(s[0])&&v3(s[1])?((a=t.slice())[0]=s[0],a[a.length-1]=s[1]):n=v3(s[0])||v3(s[1])?v3(s[0])?"max":"min":"all",{niceType:n,niceDomain:a,niceMinMax:s,domainValidator:o}}(n,e);if(s=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){let e=yf(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=s[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(r=s[0])&&void 0!==r?r:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";let e=this._domain[this._domain.length-1],i=yf(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";let e=this._domain[0],i=yf(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}function yz(t){return(0,ev.Z)(t)?t:[t,t]}function yZ(t){return t?"ew-resize":"ns-resize"}(tc=t9||(t9={})).innerView="innerView",tc.railContainer="sliderRailContainer",tc.rail="sliderRail",tc.startText="sliderStartText",tc.endText="sliderEndText",tc.startHandler="sliderStartHandler",tc.startHandlerText="startHandlerText",tc.endHandler="sliderEndHandler",tc.endHandlerText="sliderEndHandlerText",tc.track="sliderTrack",tc.trackContainer="sliderTrackContainer",vV();class yH extends pB{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}get tooltipShape(){return this._tooltipShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},yH.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onTooltipShow=t=>{this._isChanging||this._tooltipState&&this._tooltipState.isActive||(this._tooltipState?this._tooltipState.isActive=!0:this._tooltipState={isActive:!0},this._onTooltipUpdate(t),this._dispatchTooltipEvent("sliderTooltipShow"))},this._onTooltipUpdate=t=>{if(this._isChanging||!this._tooltipState||!this._tooltipState.isActive)return;let{min:e,max:i}=this.attribute,r=nd(this._isHorizontal?(t.viewX-this._rail.globalAABBBounds.x1)/this._rail.globalAABBBounds.width():(t.viewY-this._rail.globalAABBBounds.y1)/this._rail.globalAABBBounds.height(),0,1);r!==this._tooltipState.pos&&(this._tooltipState.pos=r,this._tooltipState.value=e+(i-e)*r,this._updateTooltip(),this._dispatchTooltipEvent("sliderTooltipUpdate"))},this._onTooltipHide=()=>{let{tooltip:t}=this.attribute;t&&t.alwaysShow||(this._tooltipState=null,this._tooltipShape&&this._tooltipShape.setAttribute("visible",!1),this._tooltipText&&this._tooltipText.setAttribute("visible",!1),this._dispatchTooltipEvent("sliderTooltipHide"))},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._isChanging=!0,this._currentHandler=t.target,this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===o2.env?(o2.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),o2.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var e,i;t.stopPropagation(),this._isChanging=!0;let{railWidth:r,railHeight:n,min:s,max:a}=this.attribute;if(a===s)return;let o,l,h,d=0;this._isHorizontal?(d=(o=t.clientX)-this._prePos,l=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.x,h=r):(d=(o=t.clientY)-this._prePos,l=null===(e=this._currentHandler)||void 0===e?void 0:e.attribute.y,h=n);let u=nd(l+d,0,h),c=u/h*(a-s)+s;"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,u,c):this._updateHandler(this._currentHandler,u,c),this._updateTrack(),this._prePos=o,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._isChanging=!1,this._currentHandler=null,"browser"===o2.env?(o2.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),o2.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._isChanging=!0,this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===o2.env?(o2.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),o2.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{let e,i,r;t.stopPropagation(),this._isChanging=!0;let{railWidth:n,railHeight:s,min:a,max:o}=this.attribute;if(o===a)return;let{startHandler:l,endHandler:h}=this._getHandlers();this._isHorizontal?(e=t.clientX,i=this._track.attribute.width,r=n):(e=t.clientY,i=this._track.attribute.height,r=s);let d=e-this._prePos;if(l){let t=nd((this._isHorizontal?l.attribute.x:l.attribute.y)+d,0,r-i),e=t/r*(o-a)+a;this._updateHandler(l,t,e)}if(h){let t=nd((this._isHorizontal?h.attribute.x:h.attribute.y)+d,i,r),e=t/r*(o-a)+a,n=null==l?void 0:l.attribute;this._updateHandler(h,t,e),this._track.setAttributes(this._isHorizontal?{x:Math.min(n.x,h.attribute.x),width:Math.abs(n.x-h.attribute.x)}:{y:Math.min(n.y,h.attribute.y),height:Math.abs(n.y-h.attribute.y)})}this._prePos=e,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),this._isChanging=!1,"browser"===o2.env?(o2.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),o2.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{let e,i,r,n;t.stopPropagation(),this._isChanging=!0;let{railWidth:s,railHeight:a,min:o,max:l}=this.attribute;if(l===o)return;let h=this._startHandler,d=this._endHandler;this._isHorizontal?(e=t.viewX-this._rail.globalAABBBounds.x1,i=null==h?void 0:h.attribute.x,r=null==d?void 0:d.attribute.x,n=s):(e=t.viewY-this._rail.globalAABBBounds.y1,i=null==h?void 0:h.attribute.y,r=null==d?void 0:d.attribute.y,n=a);let u=e/n*(l-o)+o;if(eb(r)){let t=Math.abs(e-i)>Math.abs(e-r)?d:h;this._updateHandler(t,e,u)}else this._updateHandler(h,e,u);this._updateTrack(),this._dispatchChangeEvent()}}setValue(t){let{layout:e,railWidth:i,railHeight:r,min:n,max:s}=this.attribute;if(s===n)return;let[a,o]=ex(t),{startHandler:l,endHandler:h}=this._getHandlers(),d="vertical"===e?r:i;l&&this._updateHandler(l,(a-n)/(s-n)*d,a),h&&this._updateHandler(h,(o-n)/(s-n)*d,o),this._updateTrack()}render(){var t,e;let i;this.removeAllChild(!0);let{layout:r="horizontal",railWidth:n,railHeight:s,startText:a,endText:o,min:l,max:h,showHandler:d=!0,showTooltip:u}=this.attribute,{value:c}=this.attribute;(0,eB.Z)(c)&&(c=[l,h]),this._currentValue={startValue:yz(c)[0],endValue:yz(c)[1]};let p="horizontal"===r;this._isHorizontal=p;let g=as.group({x:0,y:0});g.name=t9.innerView,this.add(g),this._innerView=g;let f,m=0;if(a&&a.visible){(f=as.text(Object.assign({x:p?0:n/2,y:p?s/2:0,textAlign:p?"start":"center",textBaseline:p?"middle":"top",text:a.text,lineHeight:null===(t=a.style)||void 0===t?void 0:t.fontSize},a.style))).name=t9.startText,g.add(f);let e=eb(a.space)?a.space:0;m+=(p?f.AABBBounds.width():f.AABBBounds.height())+e}let v=as.group({x:p?m:0,y:p?0:m});g.add(v);let y=as.group({x:0,y:0});if(y.name=t9.railContainer,this._railContainer=y,v.add(y),this._mainContainer=v,this._renderRail(y),m+=p?n:s,o&&o.visible){let t=eb(o.space)?o.space:0;(i=as.text(Object.assign({x:p?m+t:n/2,y:p?s/2:m+t,textAlign:p?"start":"center",textBaseline:p?"middle":"top",text:o.text,lineHeight:null===(e=o.style)||void 0===e?void 0:e.fontSize},o.style))).name=t9.endText,g.add(i)}this._renderTrack(y),d&&(this._renderHandlers(v),this._bindEvents()),u&&(this._renderTooltip(),this._bindTooltipEvents())}_renderRail(t){let{railWidth:e,railHeight:i,railStyle:r,slidable:n}=this.attribute,s="default";!1!==n&&(s="pointer");let a=as.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:s},r));return a.name=t9.rail,t.add(a),this._rail=a,a}_renderHandlers(t){let{range:e,min:i,max:r,handlerSize:n=14,handlerStyle:s,handlerText:a,railHeight:o,railWidth:l,slidable:h}=this.attribute,{value:d}=this.attribute;(0,eB.Z)(d)&&(d=[i,r]);let u=a&&a.visible,c=this._isHorizontal,p=c?l:o,[g,f]=yz(d),m=r===i?e?0:p:(g-i)/(r-i)*p,v=this._renderHandler(Object.assign({x:c?m:l/2,y:c?o/2:m,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":yZ(c)},s));if(v.name=t9.startHandler,this._startHandler=v,t.add(v),this._currentValue.startPos=m,u){let i=this._renderHandlerText(g,e?"start":"end");i.name=t9.startHandlerText,t.add(i),this._startHandlerText=i}if(e){let e=r===i?p:(f-i)/(r-i)*p,a=this._renderHandler(Object.assign({x:c?e:l/2,y:c?o/2:e,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":yZ(c)},s));if(a.name=t9.endHandler,this._endHandler=a,t.add(a),this._currentValue.endPos=e,u){let e=this._renderHandlerText(f,"end");e.name=t9.endHandlerText,t.add(e),this._endHandlerText=e}}}_renderTrack(t){let e,i,r;let{range:n,min:s,max:a,railHeight:o,railWidth:l,trackStyle:h,railStyle:d,slidable:u,value:c}=this.attribute;if((0,eB.Z)(c))n?(e=s,i=a):e=i=s;else if(n){let t=vY(c,s,a);e=t[0],i=t[1]}else e=s,i=nd(c,s,a);let p=this._isHorizontal,g=p?l:o;n||(e=s);let f=as.group({x:0,y:0,width:l,height:o,cornerRadius:null==d?void 0:d.cornerRadius,clip:!0,pickable:!1});f.name=t9.trackContainer;let m=(0,ep.Z)(n)&&!0===n.draggableTrack;r=!1===u?"default":!1===n||!1===m?"pointer":yZ(p);let v=a===s?g:(i-e)/(a-s)*g,y=a===s?0:(e-s)/(a-s)*g,b=as.rect(Object.assign({x:p?y:0,y:p?0:y,width:p?v:l,height:p?o:v,cursor:r},h));b.name=t9.track,this._track=b,f.add(b),t.add(f)}_renderHandler(t){return as.symbol(t)}_renderHandlerText(t,e){var i,r,n;let{align:s,min:a,max:o,handlerSize:l=14,handlerText:h={},railHeight:d,railWidth:u,slidable:c}=this.attribute,p=this._isHorizontal,g=p?u:d,f=o===a?"start"===e?0:g:(t-a)/(o-a)*g,m=null!==(i=h.space)&&void 0!==i?i:4,v={text:h.formatter?h.formatter(t):t.toFixed(null!==(r=h.precision)&&void 0!==r?r:0),lineHeight:null===(n=h.style)||void 0===n?void 0:n.lineHeight,cursor:!1===c?"default":yZ(p)};return p?"top"===s?(v.textBaseline="bottom",v.textAlign="center",v.x=f,v.y=(d-l)/2-m):(v.textBaseline="top",v.textAlign="center",v.x=f,v.y=(d+l)/2+m):("left"===s?(v.textBaseline="middle",v.textAlign="end",v.x=(u-l)/2-m):(v.textBaseline="middle",v.textAlign="start",v.x=(u+l)/2+m),v.y=f),as.text(Object.assign(Object.assign({},v),h.style))}_renderTooltip(){var t;let{tooltip:e,railHeight:i,railWidth:r,align:n}=this.attribute;e&&e.alwaysShow?this._tooltipState={value:this._currentValue.startValue,pos:this._currentValue.startPos}:this._tooltipState=null;let s=this._isHorizontal?0:r/2,a=this._isHorizontal?i/2:0;if(e&&e.shape){let t=as.symbol(Object.assign({pickable:!1,visible:!!this._tooltipState,x:s,y:a,symbolType:"circle"},e.shapeStyle));this._tooltipShape=t,this._mainContainer.add(t)}let o=e&&e.text||{},l=null!==(t=o.space)&&void 0!==t?t:6,h={pickable:!1,visible:!!this._tooltipState,text:""};this._isHorizontal?(h.x=s,h.y="top"===n?a-i/2-l:a+i/2+l,h.textAlign="center",h.textBaseline="top"===n?"bottom":"top"):(h.y=a,h.x="left"===n?s-r/2-l:a+r/2+l,h.textAlign="left"===n?"end":"start",h.textBaseline="middle");let d=as.text(Object.assign(Object.assign({},h),o.style));this._mainContainer.add(d),this._tooltipText=d,this._tooltipState&&this._updateTooltip()}_updateTooltip(){var t,e;if(!this._tooltipShape&&!this._tooltipText||!this._tooltipState)return;let i=this._isHorizontal?this._tooltipState.pos*this.attribute.railWidth:this._tooltipState.pos*this.attribute.railHeight,r=this._isHorizontal?"x":"y";this._tooltipShape&&this._tooltipShape.setAttributes({visible:!0,[r]:i});let{align:n}=this.attribute;if(this._tooltipText){let s=this.attribute.tooltip&&this.attribute.tooltip.text||{};this._tooltipText.setAttributes({visible:!0,[r]:i,text:s.formatter?s.formatter(this._tooltipState.value):this._isHorizontal||"left"!==n?`≈ ${this._tooltipState.value.toFixed(null!==(e=s.precision)&&void 0!==e?e:0)}`:`${this._tooltipState.value.toFixed(null!==(t=s.precision)&&void 0!==t?t:0)} ≈`})}}_bindEvents(){if(this.attribute.disableTriggerEvent)return;let{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),(0,ep.Z)(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_bindTooltipEvents(){this.attribute.disableTriggerEvent||(this._mainContainer.addEventListener("pointerenter",this._onTooltipShow),this._mainContainer.addEventListener("pointermove",this._onTooltipUpdate),this._mainContainer.addEventListener("pointerleave",this._onTooltipHide))}_updateTrack(){let t=this._startHandler,e=this._endHandler;if(this._isHorizontal){let i=null==t?void 0:t.attribute.x;if(e){let t=null==e?void 0:e.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else this._track.setAttributes({width:i})}else{let i=null==t?void 0:t.attribute.y;if(e){let t=null==e?void 0:e.attribute.y;this._track.setAttributes({y:Math.min(i,t),height:Math.abs(i-t)})}else this._track.setAttributes({height:i})}}_updateHandler(t,e,i){var r;let n=this._isHorizontal;t.setAttribute(n?"x":"y",e);let s=t.name===t9.startHandler?this._startHandlerText:this._endHandlerText;if(s){let{handlerText:t={}}=this.attribute;s.setAttributes({text:t.formatter?t.formatter(i):i.toFixed(null!==(r=t.precision)&&void 0!==r?r:0),[n?"x":"y"]:e})}t.name===t9.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){var r;let n=this._isHorizontal,{handlerText:s={}}=this.attribute;t.setAttributes({[n?"x":"y"]:e,text:s.formatter?s.formatter(i):i.toFixed(null!==(r=s.precision)&&void 0!==r?r:0)});let a=t.name===t9.startHandlerText?this._startHandler:this._endHandler;a&&a.setAttributes({[n?"x":"y"]:e}),t.name===t9.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){let t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_dispatchTooltipEvent(t){this._dispatchEvent("sliderTooltip",{type:t,position:this._tooltipState&&this._tooltipState.pos,value:this._tooltipState&&this._tooltipState.value})}_getHandlers(){let t,e=this._startHandler,i=this._endHandler;return this._isHorizontal?i&&i.attribute.x<(null==e?void 0:e.attribute.x)&&(t=e,e=i,i=t):i&&i.attribute.y<(null==e?void 0:e.attribute.y)&&(t=e,e=i,i=t),{startHandler:e,endHandler:i}}}yH.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},tooltip:{shapeStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},text:{style:{fill:"#2C3542",fontSize:12}}},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}},v$(),vV();class yU extends vz{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},yU.defaultAttributes,t)),this.name="colorLegend",this._onSliderToolipChange=t=>{let e=this._slider.tooltipShape;if(e&&t.detail&&!(0,eB.Z)(t.detail.value)){let i=this._colorScale.scale(t.detail.value);e.setAttribute("fill",i)}this.dispatchEvent(t)},this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){let{colors:t,slidable:e,layout:i,align:r,min:n,max:s,value:a,railWidth:o,railHeight:l,showHandler:h=!0,handlerSize:d,handlerStyle:u,railStyle:c,trackStyle:p,startText:g,endText:f,handlerText:m,showTooltip:v,tooltip:y,disableTriggerEvent:b}=this.attribute,x=[],_=(s-n)/(t.length-1);for(let e=0;e<t.length;e++)x.push(n+_*e);this._colorScale=(new yG).domain(x,!0).range(t),this._color=this._getTrackColor();let A=new yH({x:0,y:0,range:{draggableTrack:!0},slidable:e,layout:i,align:r,min:n,max:s,value:a,railWidth:o,railHeight:l,showHandler:h,handlerSize:d,handlerStyle:u,railStyle:c,trackStyle:Object.assign({fill:this._color},p),startText:g,endText:f,handlerText:m,showTooltip:v,tooltip:y,disableTriggerEvent:b});this._innerView.add(A),this._slider=A,A.translateTo(0-A.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+lX(this.attribute,"title.space",12):0)-A.AABBBounds.y1),this._updateColor()}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}_getTrackColor(){let{colors:t,layout:e}=this.attribute;if(dn(t))return;let i=t.length;if(1===i)return t[0];let r=[];for(let e=0;e<i;e++){let n=e/(i-1);r.push({offset:n,color:t[e]})}let n="horizontal"===e;return{gradient:"linear",stops:r,x0:0,y0:0,x1:n?1:0,y1:n?0:1}}_updateColor(){let{layout:t="horizontal",colors:e,railWidth:i,railHeight:r}=this.attribute,{startHandler:n,endHandler:s,track:a}=this._slider,{startValue:o,endValue:l,startPos:h,endPos:d}=this._slider.currentValue,u=this._colorScale.scale(o),c=this._colorScale.scale(l);null==n||n.setAttribute("fill",u),null==s||s.setAttribute("fill",c);let p="horizontal"===t?i:r;if(Math.abs(h-d)!==p&&e&&e.length>1){let t=this._color.stops,e=Math.min(h,d)/p,i=Math.max(h,d)/p,r=i-e,n=t.filter(t=>t.offset>e&&t.offset<i),s=Math.min(o,l),u=Math.max(o,l),c=this._colorScale.scale(s),g=this._colorScale.scale(u),f=[{offset:0,color:c}];n.forEach(t=>{f.push({offset:(t.offset-e)/r,color:t.color})}),f.push({offset:1,color:g}),a.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:f}))}}}yU.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}},tooltip:{shapeStyle:{lineWidth:4,stroke:"#fff"}}};v$(),vV(),vE();class yV extends vz{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},yV.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)},this._onSliderToolipChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){let{slidable:t,layout:e,align:i,min:r,max:n,value:s,railWidth:a,railHeight:o,showHandler:l=!0,handlerSize:h,handlerStyle:d,railStyle:u,trackStyle:c,startText:p,endText:g,handlerText:f,showTooltip:m,tooltip:v,sizeBackground:y,disableTriggerEvent:b}=this.attribute,x=as.group({x:0,y:0});this._innerView.add(x);let _=new yH({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:r,max:n,value:s,railWidth:a,railHeight:o,showHandler:l,handlerSize:h,handlerStyle:Object.assign({symbolType:function(t="bottom"){let e=0;return"top"===t?`
|
|
|
`}(i)},d),railStyle:u,trackStyle:c,startText:p,endText:g,handlerText:f,showTooltip:m,tooltip:v,disableTriggerEvent:b});x.add(_);let A,w=0;"horizontal"===e?"top"===i?(A=`M0,0L${a},0L${a},12Z`,w=o):(A=`M0,12L${a},12L${a},0Z`,_.setAttribute("y",12)):"left"===i?A=`M${a},0L${a},0L${a+12},${o}L${a},${o}Z`:(A=`M0,${o}L12,${o}L12,0Z`,_.setAttribute("x",12));let S=as.path(Object.assign(Object.assign({x:0,y:w,path:A},y),{zIndex:0}));x.add(S);let T=this._title?this._title.AABBBounds.height()+lX(this.attribute,"title.space",12):0;x.translate(0-x.AABBBounds.x1,T-x.AABBBounds.y1),this._slider=_}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}}yV.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};class yW{constructor(t,e){this.references=new Map,this.view=t,this.depend(null==e?void 0:e.dependency)}depend(t){this.references.clear(),ex(t).map(t=>(0,ek.Z)(t)?this.view.getGrammarById(t):t).filter(t=>!(0,eB.Z)(t)).forEach(t=>{var e;this.references.set(t,(null!==(e=this.references.get(t))&&void 0!==e?e:0)+1)})}parameters(){let t={};return this.references.forEach((e,i)=>{eb(i.id())&&(t[i.id()]=i.output())}),t}bind(){let t=this.getEvents();(null!=t?t:[]).forEach(t=>{t.type&&t.handler&&((0,ev.Z)(t.type)?t.type.forEach(e=>{e&&"none"!==e&&this.view.addEventListener(e,t.handler)}):"none"!==t.type&&this.view.addEventListener(t.type,t.handler))})}unbind(){let t=this.getEvents();(null!=t?t:[]).forEach(t=>{t.type&&t.handler&&((0,ev.Z)(t.type)?t.type.forEach(e=>{e&&"none"!==e&&this.view.removeEventListener(e,t.handler)}):"none"!==t.type&&this.view.removeEventListener(t.type,t.handler))})}start(t){}reset(t){}dispatchEvent(t,e){this.view.emit(`${this.type}:${t}`,e),"start"===t&&this.options.onStart?this.options.onStart(e):"reset"===t&&this.options.onReset?this.options.onReset(e):"update"===t&&this.options.onUpdate?this.options.onUpdate(e):"end"===t&&this.options.onEnd&&this.options.onEnd(e)}}class y${_filterData(t,e,i,r,n,s){let a=(0,ek.Z)(t)?this.view.getDataById(t):t;return a&&(this.handleFilter=t=>{let i=null==t?void 0:t.element;a&&(!e||i&&i.mark===e)&&(r&&(this._filterValue=r(t)),a.commit(),this.view.run())},this._dataFilter={source:e?`${e.uid}`:null,rank:i,filter:t=>{if(!this._filterValue)return t;let e=n?t.filter(t=>n(t,this._filterValue)):t;return s?s(e,this._filterValue):e}},a.addDataFilter(this._dataFilter)),this}}class yY extends yW{constructor(t,e){super(t,e),e.target&&(this._data=(0,ek.Z)(e.target.data)?t.getDataById(e.target.data):e.target.data)}}yY.defaultOptions={};class yX extends yY{constructor(t,e){super(t,e),this.type=yX.type,this.options=Object.assign({},yX.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.source).filter(t=>t.markType===tF.component&&"legend"===t.componentType),this._data=(0,ek.Z)(this.options.target.data)?t.getDataById(this.options.target.data):this.options.target.data}getEvents(){if(!this._marks||0===this._marks.length)return[];let t=this._marks[0];if(!this._data||!t)return[];let e=t.isContinuousLegend(),i=this.options.target.filter,r=this.options.target.transform,n=(0,ek.Z)(i)?e?(t,e)=>t[i]>=e.start&&t[i]<=e.end:(t,e)=>e.includes(t[i]):i;return this._filterData(this._data,t,tz.legend,t=>e?{start:t.detail.value[0],end:t.detail.value[1]}:t.detail.currentSelected,n,r),[{type:e?"change":t6.legendItemClick,handler:this.handleFilter}]}}yX.type="legend-filter",yX.defaultOptions={};let yK=(t,e,i,r)=>{var n;let s=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.discreteLegend;if(!t)return lT({},s,null!=i?i:{});let a=Array.from(new Set(ex(t.domain()))).map((e,i)=>{var n,a,o,l,h,d;let u=ln(t.scale(e)),c=u?Object.assign(Object.assign({},null!==(o=null===(a=null===(n=null==s?void 0:s.items)||void 0===n?void 0:n[0])||void 0===a?void 0:a.shape)&&void 0!==o?o:{}),{fill:u,stroke:u}):null!==(d=null===(h=null===(l=null==s?void 0:s.items)||void 0===l?void 0:l[0])||void 0===h?void 0:h.shape)&&void 0!==d?d:{};return r&&Object.assign(c,{symbolType:r.scale(e)}),{label:e.toString(),id:e,shape:c,index:i}});return lT({},s,{items:a},null!=i?i:{})},yq=(t,e,i)=>{var r;let n=null===(r=null==e?void 0:e.components)||void 0===r?void 0:r.colorLegend;if(!t)return lT({},n,null!=i?i:{});let s=t.domain();return lT({},n,{colors:t.range().slice(),min:s[0],max:e_(s)},null!=i?i:{})},yJ=(t,e,i)=>{var r;let n=null===(r=null==e?void 0:e.components)||void 0===r?void 0:r.sizeLegend;if(!t)return lT({},n,null!=i?i:{});let s=t.domain();return lT({},n,{min:s[0],max:s[s.length-1],value:[s[0],s[s.length-1]]},null!=i?i:{})};class yQ extends vD{constructor(t,e){super(t,tG.legend,e),this.spec.componentType=tG.legend,this.spec.legendType="auto"}parseAddition(t){return this.shapeScale(t.shapeScale),super.parseAddition(t),this.legendType(t.legendType),this}scale(t){return super.scale(t),this._legendComponentType=null,this}shapeScale(t){if(this.spec.shapeScale){let t=(0,ek.Z)(this.spec.shapeScale)?this.view.getScaleById(this.spec.shapeScale):this.spec.shapeScale;this.detach(t),this.spec.shapeScale=void 0}let e=(0,ek.Z)(t)?this.view.getScaleById(t):t;return this.spec.shapeScale=e,this.attach(e),this.commit(),this}legendType(t){return this.spec.legendType=t,this._legendComponentType=null,this._prepareRejoin(),this.commit(),this}isContinuousLegend(){return this._getLegendComponentType()!==tU.discreteLegend}setSelected(t){return this.getGroupGraphicItem().setSelected(t),this}addGraphicItem(t,e){let i=ld.createGraphicComponent(this._getLegendComponentType(),t,{skipDefault:this.spec.skipTheme});return super.addGraphicItem(t,e,i)}_updateComponentEncoders(){let t=(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale,e=(0,ek.Z)(this.spec.shapeScale)?this.view.getScaleById(this.spec.shapeScale):this.spec.shapeScale,i=Object.assign({update:{}},this.spec.encode),r=Object.keys(i).reduce((r,n)=>{let s=i[n];return s&&(r[n]={callback:(i,r,n)=>{var a,o;let l=this.spec.skipTheme?null:this.view.getCurrentTheme(),h=du(s,i,r,n),d=null===(a=null==t?void 0:t.getScale)||void 0===a?void 0:a.call(t);switch(this._getLegendComponentType()){case tU.discreteLegend:return yK(d,l,h,null===(o=null==e?void 0:e.getScale)||void 0===o?void 0:o.call(e));case tU.colorLegend:return yq(d,l,h);case tU.sizeLegend:return yJ(d,l,h)}return h}}),r},{});this._encoders=r}_getLegendComponentType(){var t;if(this._legendComponentType)return this._legendComponentType;if(this.spec.legendType&&"auto"!==this.spec.legendType)this._legendComponentType="color"===this.spec.legendType?"colorLegend":"size"===this.spec.legendType?"sizeLegend":"discreteLegend";else{let e=(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale,i=null===(t=null==e?void 0:e.getScaleType)||void 0===t?void 0:t.call(e);if(i&&uj(i)){let t=e.getScale().range();ln(null==t?void 0:t[0])?this._legendComponentType=tU.colorLegend:this._legendComponentType=tU.sizeLegend}else this._legendComponentType=tU.discreteLegend}return this._legendComponentType}}yQ.componentType=tG.legend;class y0 extends yY{constructor(t,e){super(t,e),this.type=y0.type,this.options=Object.assign({},y0.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.source).filter(t=>t.markType===tF.component&&"slider"===t.componentType),this._data=(0,ek.Z)(this.options.target.data)?t.getDataById(this.options.target.data):this.options.target.data}getEvents(){if(!this._marks||0===this._marks.length)return[];let t=this._marks[0];if(!this._data||!t)return[];let e=this.options.target.filter,i=this.options.target.transform,r=(0,ek.Z)(e)?(t,i)=>t[e]>=i.start&&t[e]<=i.end:e;return this._filterData(this._data,t,tz.slider,t=>({start:t.detail.value[0],end:t.detail.value[1]}),r,i),[{type:"change",handler:this.handleFilter}]}}y0.type="slider-filter",y0.defaultOptions={};let y1=(t,e,i,r)=>{var n;return lT({},null===(n=null==i?void 0:i.components)||void 0===n?void 0:n.slider,{min:t,max:e,value:[t,e]},null!=r?r:{})};class y2 extends uI{constructor(t,e){super(t,tG.slider,e),this.spec.componentType=tG.slider}parseAddition(t){return super.parseAddition(t),this.min(t.min),this.max(t.max),this}min(t){return this.setFunctionSpec(t,"min")}max(t){return this.setFunctionSpec(t,"max")}setStartEndValue(t,e){return this.getGroupGraphicItem().setValue([t,e]),this}_updateComponentEncoders(){let t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce((e,i)=>{let r=t[i];return r&&(e[i]={callback:(t,e,i)=>{let n=(0,eB.Z)(this.spec.min)?0:lt(this.spec.min,i,t,e),s=(0,eB.Z)(this.spec.max)?1:lt(this.spec.max,i,t,e),a=this.spec.skipTheme?null:this.view.getCurrentTheme();return y1(n,s,a,du(r,t,e,i))}}),e},{});this._encoders=e}}y2.componentType=tG.slider;let y5=new Uint32Array(33),y3=new Uint32Array(33);y3[0]=0,y5[0]=~y3[0];for(let t=1;t<=32;++t)y3[t]=y3[t-1]<<1|1,y5[t]=~y3[t];function y4(t,e,i={top:0,left:0,right:0,bottom:0}){let{top:r=0,left:n=0,right:s=0,bottom:a=0}=i,o=Math.max(1,Math.sqrt(t*e/1e6)),l=~~((t+n+s+o)/o),h=~~((e+r+a+o)/o),d=t=>~~(t/o);return d.bitmap=()=>(function(t,e){let i=new Uint32Array(~~((t*e+32)/32));function r(t,e){i[t]|=e}function n(t,e){i[t]&=e}return{array:i,get:(e,r)=>{let n=r*t+e;return i[n>>>5]&1<<(31&n)},set:(e,r)=>{var n,s;let a=r*t+e;n=a>>>5,s=1<<(31&a),i[n]|=s},clear:(e,r)=>{var n,s;let a=r*t+e;n=a>>>5,s=~(1<<(31&a)),i[n]&=s},getRange:({x1:r,y1:n,x2:s,y2:a})=>{if(s<0||a<0||r>t||n>e)return!0;let o,l,h,d,u=a;for(;u>=n;--u)if(o=u*t+r,l=u*t+s,(h=o>>>5)==(d=l>>>5)){if(i[h]&y5[31&o]&y3[1+(31&l)])return!0}else{if(i[h]&y5[31&o]||i[d]&y3[1+(31&l)])return!0;for(let t=h+1;t<d;++t)if(i[t])return!0}return!1},setRange:({x1:r,y1:n,x2:s,y2:a})=>{var o,l,h,d,u,c,p;let g,f,m,v,y;if(!(s<0)&&!(a<0)&&!(r>t)&&!(n>e))for(;n<=a;++n)if(g=n*t+r,f=n*t+s,(m=g>>>5)==(v=f>>>5)){;o=m,l=y5[31&g]&y3[1+(31&f)],i[o]|=l}else{;for(h=m,d=y5[31&g],i[h]|=d,u=v,c=y3[1+(31&f)],i[u]|=c,y=m+1;y<v;++y){;p=y,i[p]|=0xffffffff}}},clearRange:({x1:e,y1:r,x2:n,y2:s})=>{var a,o,l,h,d,u,c;let p,g,f,m,v;for(;r<=s;++r)if(p=r*t+e,g=r*t+n,(f=p>>>5)==(m=g>>>5)){;a=f,o=y3[31&p]|y5[1+(31&g)],i[a]&=o}else{;for(l=f,h=y3[31&p],i[l]&=h,d=m,u=y5[1+(31&g)],i[d]&=u,v=f+1;v<m;++v){;c=v,i[c]&=0}}},outOfBounds:({x1:i,y1:r,x2:n,y2:s})=>i<0||r<0||s>=e||n>=t,toImageData:r=>{let n=r.createImageData(t,e),s=n.data;for(let r=0;r<e;++r)for(let e=0;e<t;++e){let n=r*t+e,a=4*n,o=i[n>>>5]&1<<(31&n);s[a+0]=255*o,s[a+1]=255*o,s[a+2]=255*o,s[a+3]=31}return n}}})(l,h),d.x=t=>~~((t+n)/o),d.y=t=>~~((t+r)/o),d.ratio=o,d.padding=i,d.width=t,d.height=e,d}function y6(t,e,i=!1){if(i){let{x1:i,x2:r,y1:n,y2:s}=e,a=nd(i,0,t.width),o=nd(r,0,t.width),l=nd(n,0,t.height),h=nd(s,0,t.height);return{x1:t.x(a),x2:t.x(o),y1:t.y(l),y2:t.y(h)}}return{x1:t.x(e.x1),x2:t.x(e.x2),y1:t.y(e.y1),y2:t.y(e.y2)}}let y8=["#ffffff","#000000"];function y7(t,e,i,r,n,s){if("string"!=typeof t||"string"!=typeof e)return t;let a=new n_(t).toHex(),o=new n_(e).toHex();return y9(a,o,i,r,s)?a:function(t,e,i,r,n,s){let a=[];for(let o of(n&&(n instanceof Array?a.push(...n):a.push(n)),a.push(...y8),a))if(t!==o&&y9(o,e,i,r,s))return o}(a,o,i,r,n,s)}function y9(t,e,i,r,n){if("lightness"===n){let i=n_.getColorBrightness(new n_(e));return .5>n_.getColorBrightness(new n_(t))?i>=.5:i<.5}return r?bt(t,e)>r:"largeText"===i?bt(t,e)>3:bt(t,e)>4.5}function bt(t,e){let i=be(t),r=be(e);return((i>r?i:r)+.05)/((i>r?r:i)+.05)}function be(t){let e,i;let r=cT(t),n=r[0]/255,s=r[1]/255,a=r[2]/255;return e=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4),i=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),.2126*e+.7152*i+.0722*(a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4))}function bi(t,e,i,r){let n;switch(t){case"base":n=e;break;case"invertBase":n=i;break;case"similarBase":n=r}return n}function br(t,e,i,r=!0,n=0){let s=i;return n>0&&(s={x1:i.x1-n,x2:i.x2+n,y1:i.y1-n,y2:i.y2+n}),s=y6(t,s),!(r&&e.outOfBounds(s))&&!e.getRange(s)}function bn(t,e,i,r=[],n=!0,s=0){let a=r.filter(t=>eb(t));for(let r=0;r<a.length;r++){let o=i.clone();if(o.setAttributes(a[r]),o.update(),br(t,e,o.AABBBounds,n,s))return e.setRange(y6(t,o.AABBBounds,!0)),a[r]}return!1}let bs=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],ba=["top","inside-top","inside"],bo={fadeIn:(t={})=>{var e,i,r;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(r=t.strokeOpacity)&&void 0!==r?r:1}}},fadeOut:(t={})=>{var e,i,r;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(r=t.strokeOpacity)&&void 0!==r?r:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function bl(t,e){var i,r;return null!==(r=null===(i=bo[e])||void 0===i?void 0:i.call(bo,t))&&void 0!==r?r:{from:{},to:{}}}let bh=(t,e,i,r)=>{let n=Object.assign({},t.attribute),s=Object.assign({},e.attribute);return ex(null==r?void 0:r.excludeChannels).forEach(t=>{delete s[t]}),Object.keys(s).forEach(t=>{i&&!i.includes(t)&&delete s[t]}),{from:n,to:s}};function bd(t,e,i,r){t.attribute.text!==e.attribute.text&&(0,eg.Z)(Number(t.attribute.text)*Number(e.attribute.text))&&t.animate().play(new dT({text:t.attribute.text},{text:e.attribute.text},i,r))}let bu={mode:"same-time",duration:300,easing:"linear"};function bc(t,e,i,r){var n;let s=(n={radius:i,angle:r}).radius?{x:Math.cos(n.angle)*n.radius,y:Math.sin(n.angle)*n.radius}:{x:0,y:0};return{x:t+s.x,y:e+s.y}}function bp(t){return 3===t||4===t}let bg=(t,e,i="top",r=0)=>{if(!t)return;let{x1:n,y1:s,x2:a,y2:o}=t,l=Math.abs(a-n),h=Math.abs(o-s),d=(e.x1+e.x2)/2,u=(e.y1+e.y2)/2,c=0,p=0,g=0,f=0;e&&(g=Math.abs(e.x1-e.x2)/2,f=Math.abs(e.y1-e.y2)/2);let m={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":p=-1;break;case"bottom":p=1;break;case"left":c=-1;break;case"right":c=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":c=Math.sin(m[i]*(Math.PI/180)),p=Math.cos(m[i]*(Math.PI/180));break;case"center":c=0,p=0}return{x:d+c*(r+g)+l/2*Math.sign(c),y:u+p*(r+f)+h/2*Math.sign(p)}},bf=t=>{if(!t||!t.attribute)return[];let{points:e,segments:i}=t.attribute;if(i&&i.length){let t=[];return i.forEach(e=>{e.points.forEach(e=>{t.push(e)})}),t}return e};function bm(t,e,i="end",r=0){if(!t||!e)return{x:1/0,y:1/0};let{x1:n,x2:s}=t,a=Math.abs(s-n),o=e.x1,l=o;return"end"===i?l=o+a/2+r:"start"===i&&(l=o-a/2-r),{x:l,y:e.y1}}function bv(t,e,i,r,n,s){return Math.abs(e/t)<s/n?{x:i+(t>0?n:-n),y:r+e*n/Math.abs(t)}:{x:i+t*s/Math.abs(e),y:r+(e>0?s:-s)}}pC(),mY(),mM(),go();class by extends pB{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},by.defaultAttributes,t)),this.name="label",this._onHover=t=>{let e=t.target;e===this._lastHover||dn(e.states)||(e.addState(t2.hover,!0),fF(this,t=>{t===e||dn(t.states)||t.addState(t2.hoverReverse,!0)}),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(fF(this,t=>{dn(t.states)||(t.removeState(t2.hoverReverse),t.removeState(t2.hover))}),this._lastHover=null)},this._onClick=t=>{let e=t.target;if(this._lastSelect===e&&e.hasState("selected"))return this._lastSelect=null,void fF(this,t=>{dn(t.states)||(t.removeState(t2.selectedReverse),t.removeState(t2.selected))});dn(e.states)||(e.addState(t2.selected,!0),fF(this,t=>{t===e||dn(t.states)||t.addState(t2.selectedReverse,!0)}),this._lastSelect=e)},this._handleRelatedGraphicSetState=t=>{var e,i,r,n,s;if((null===(e=t.detail)||void 0===e?void 0:e.type)===oR.STATE||(null===(i=t.detail)||void 0===i?void 0:i.type)===oR.ANIMATE_UPDATE&&(null===(r=t.detail.animationState)||void 0===r?void 0:r.isFirstFrameOfStep)){let e=null!==(s=null===(n=t.target)||void 0===n?void 0:n.currentStates)&&void 0!==s?s:[];(this._isCollectionBase?[...this._graphicToText.values()]:[this._graphicToText.get(t.target)]).forEach(t=>{t&&(t.text&&t.text.useStates(e),t.labelLine&&t.labelLine.useStates(e))})}}}labeling(t,e,i,r){}_createLabelLine(t,e){let i=function(t,e){if(!t||!e||it(t,e,!0))return;let i=Math.min(t.x1,t.x2),r=Math.min(t.y1,t.y2),n=Math.min(e.x1,e.x2),s=Math.min(e.y1,e.y2),a=Math.abs(t.x2-i)/2,o=Math.abs(t.y2-r)/2,l=Math.abs(e.x2-n)/2,h=Math.abs(e.y2-s)/2,d=i+a,u=r+o,c=n+l,p=s+h,g=c-d,f=p-u;return[bv(g,f,d,u,a,o),bv(-g,-f,c,p,l,h)]}(t.AABBBounds,null==e?void 0:e.AABBBounds);if(i){let t=as.line({points:i});return e&&e.attribute.fill&&t.setAttribute("stroke",e.attribute.fill),this.attribute.line&&!dn(this.attribute.line.style)&&t.setAttributes(this.attribute.line.style),this._setStatesOfLabelLine(t),t}}render(){if(this._prepare(),(0,eB.Z)(this._idToGraphic)||this._isCollectionBase&&(0,eB.Z)(this._idToPoint))return;let{overlap:t,smartInvert:e,dataFilter:i,customLayoutFunc:r,customOverlapFunc:n}=this.attribute,s=this.attribute.data;r6(i)&&(s=i(s));let a=this._initText(s);a=r6(r)?r(s,a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):this._layout(a),r6(n)?a=n(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):!1!==t&&(a=this._overlapping(a)),a&&a.length&&a.forEach(t=>{this._bindEvent(t),this._setStatesOfText(t)}),!1!==e&&this._smartInvert(a),this._renderLabels(a)}_bindEvent(t){if(this.attribute.disableTriggerEvent||!t)return;let{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStatesOfText(t){if(!t)return;let e=this.attribute.state;e&&!dn(e)&&(t.states=e)}_setStatesOfLabelLine(t){if(!t)return;let e=this.attribute.labelLineState;e&&!dn(e)&&(t.states=e)}_createLabelText(t){return fX(t,"textType")?as.richtext(fK(t)):as.text(t)}_prepare(){var t,e,i,r,n;let s=[];if((r6(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():function(t,e){if(!e)return[];let i=t.find(t=>t.name===e,!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName)).forEach(t=>{"willRelease"!==t.releaseStatus&&s.push(t)}),null===(t=this._idToGraphic)||void 0===t||t.clear(),null===(e=this._idToPoint)||void 0===e||e.clear(),this._baseMarks=s,this._isCollectionBase="line-data"===this.attribute.type,!s||0===s.length)return;let{data:a}=this.attribute;if(a&&0!==a.length){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let t=0;for(let e=0;e<s.length;e++){let i=s[e],r=bf(i);if(r&&r.length)for(let e=0;e<r.length;e++){let n=a[t];n&&r[e]&&(eb(n.id)||(n.id=`vrender-component-${this.name}-${t}`),this._idToPoint.set(n.id,r[e]),this._idToGraphic.set(n.id,i)),t++}}}else for(let t=0;t<s.length;t++){let e=a[t],i=s[t];e&&i&&(eb(e.id)||(e.id=`vrender-component-${this.name}-${t}`),this._idToGraphic.set(e.id,i))}if(!1!==this.attribute.animation){let t=(0,ep.Z)(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:lT({},bu,t,null!==(i=this.attribute.animationEnter)&&void 0!==i?i:{}),exit:lT({},bu,t,null!==(r=this.attribute.animationExit)&&void 0!==r?r:{}),update:(0,ev.Z)(this.attribute.animationUpdate)?this.attribute.animationUpdate:lT({},bu,t,null!==(n=this.attribute.animationUpdate)&&void 0!==n?n:{})}}}}getRelatedGraphic(t){return this._idToGraphic.get(t.id)}_initText(t=[]){let{textStyle:e={}}=this.attribute,i=[];for(let r=0;r<t.length;r++){let n=t[r],s=this.getRelatedGraphic(n);if(!s)continue;let a=Object.assign(Object.assign({fill:this._isCollectionBase?(0,ev.Z)(s.attribute.stroke)?s.attribute.stroke.find(t=>!!t&&!0!==t):s.attribute.stroke:s.attribute.fill},e),n),o=this._createLabelText(a);i.push(o)}return i}_layout(t){let{position:e,offset:i}=this.attribute;for(let r=0;r<t.length;r++){let n=t[r];if(!n)return;let s=n.attribute,a=this.getRelatedGraphic(s);if(!a)continue;n.attachedThemeGraphic=this;let o=this.getGraphicBounds(n);n.attachedThemeGraphic=null;let l=r6(e)?e(s):e,h=this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(s.id),l):this.getGraphicBounds(a,{x:s.x,y:s.y},l),d=this.labeling(o,h,l,i);d&&n.setAttributes(d)}return t}_overlapping(t){var e,i,r,n;if(0===t.length)return[];let s=(0,ep.Z)(this.attribute.overlap)?this.attribute.overlap:{},a=[],o=this.getBaseMarkGroup(),l=null!==(e=s.size)&&void 0!==e?e:{width:null!==(i=null==o?void 0:o.AABBBounds.width())&&void 0!==i?i:0,height:null!==(r=null==o?void 0:o.AABBBounds.height())&&void 0!==r?r:0};if(0===l.width||0===l.height)return t;let{avoidBaseMark:h,strategy:d=[],hideOnHit:u=!0,clampForce:c=!0,avoidMarks:p=[],overlapPadding:g}=s,f=this._bmpTool||y4(l.width,l.height),m=this._bitmap||f.bitmap(),v=d.some(t=>"bound"===t.type);h&&(null===(n=this._baseMarks)||void 0===n||n.forEach(t=>{t.AABBBounds&&m.setRange(y6(f,t.AABBBounds,!0))})),p.length>0&&p.forEach(t=>{(0,ek.Z)(t)?(function(t,e){if(!e)return[];let i=t.find(t=>t.name===e,!0);return i?i.findAll(t=>"group"!==t.type,!0):[]})(this.getRootNode(),t).forEach(t=>{t.AABBBounds&&m.setRange(y6(f,t.AABBBounds,!0))}):t.AABBBounds&&m.setRange(y6(f,t.AABBBounds,!0))});for(let e=0;e<t.length;e++){if(!1===t[e].visible)continue;let i=t[e],r=this.getRelatedGraphic(i.attribute);if(i.update(),!it(r.AABBBounds,{x1:0,x2:f.width,y1:0,y2:f.height},!0))continue;if(br(f,m,i.AABBBounds,c,g)&&(!v||v&&r&&r.AABBBounds&&this._canPlaceInside(i.AABBBounds,r.AABBBounds))){m.setRange(y6(f,i.AABBBounds,!0)),a.push(i);continue}let n=!1;for(let s=0;s<d.length;s++)if(!1!==(n=function(t,e,i,r,n,s,a){var o,l;let h=null===(o=r.overlap)||void 0===o?void 0:o.clampForce,d=null===(l=r.overlap)||void 0===l?void 0:l.overlapPadding;if("bound"===i.type||"position"===i.type){if(r6(a)){let o=((r6(i.position)?i.position(n.attribute):i.position)||function(t){return"rect"===t?ba:bs}(r.type)).map(t=>a(n.AABBBounds,s,t,r.offset));return bn(t,e,n,o,h,d)}return!1}if("moveY"===i.type){let r=(i.offset?r6(i.offset)?i.offset(n.attribute):i.offset:[]).map(t=>({x:n.attribute.x,y:n.attribute.y+t}));return bn(t,e,n,r,h,d)}if("moveX"===i.type){let r=(i.offset?r6(i.offset)?i.offset(n.attribute):i.offset:[]).map(t=>({x:n.attribute.x+t,y:n.attribute.y}));return bn(t,e,n,r,h,d)}return!1}(f,m,d[s],this.attribute,i,this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(t[e].attribute.id)):this.getGraphicBounds(r,t[e].attribute),this.labeling))){i.setAttributes({x:n.x,y:n.y}),a.push(i);break}if(!n&&c){let{dx:t=0,dy:e=0}=function(t,e,i){let{x1:r,x2:n,y1:s,y2:a}=t.AABBBounds,o=Math.min(r,n),l=Math.max(r,n),h=Math.min(s,a),d=Math.max(s,a),u=0,c=0;return o<0&&l-o<=e?u=-o:l>e&&o-(l-e)>=0&&(u=e-l),h<0&&d-h<=i?c=-h:d>i&&h-(d-i)>=0&&(c=i-d),{dx:u,dy:c}}(i,f.width,f.height);if(0===t&&0===e){if(br(f,m,i.AABBBounds)){m.setRange(y6(f,i.AABBBounds,!0)),a.push(i);continue}}else if(br(f,m,{x1:i.AABBBounds.x1+t,x2:i.AABBBounds.x2+t,y1:i.AABBBounds.y1+e,y2:i.AABBBounds.y2+e})){i.setAttributes({x:i.attribute.x+t,y:i.attribute.y+e}),m.setRange(y6(f,i.AABBBounds,!0)),a.push(i);continue}}n||u||a.push(i)}return r6(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(m),a}getBaseMarkGroup(){let{baseMarkGroupName:t}=this.attribute;if(t)return this.getRootNode().find(e=>e.name===t,!0)}getGraphicBounds(t,e={}){if(t){if(!1!==t.attribute.visible)return t.AABBBounds;let{x:e,y:i}=t.attribute;return{x1:e,x2:e,y1:i,y2:i}}let{x:i,y:r}=e;return{x1:i,x2:i,y1:r,y2:r}}_renderLabels(t){!1===this._enableAnimation||!1===this.attribute.animation?this._renderWithOutAnimation(t):this._renderWithAnimation(t)}_renderWithAnimation(t){var e;let i=new Map,r=this._graphicToText||new Map,n=[],s=[],{visible:a}=null!==(e=this.attribute.line)&&void 0!==e?e:{};t.forEach((t,e)=>{let o;let l=this.getRelatedGraphic(t.attribute),h=t.attribute.id,d=this._isCollectionBase?h:l,u=(null==r?void 0:r.get(d))?"update":"enter";if(a&&(o=this._createLabelLine(t,l)),"enter"===u){if(n.push(t),i.set(d,o?{text:t,labelLine:o}:{text:t}),l){let{from:i,to:r}=bl(t.attribute,"fadeIn");this.add(t),o&&(s.push(o),this.add(o)),this._syncStateWithRelatedGraphic(l),this._animationConfig.enter.duration>0&&l.once("animate-bind",a=>{t.setAttributes(i),o&&o.setAttributes(i);let h=this._afterRelatedGraphicAttributeUpdate(t,n,o,s,e,l,r,this._animationConfig.enter);l.on("afterAttributeUpdate",h)})}}else if("update"===u){let e=r.get(d);r.delete(d),i.set(d,e);let n=e.text,{duration:s,easing:a}=this._animationConfig.update;(function(t,e,i){if(!(0,ev.Z)(i)){let{duration:r,easing:n,increaseEffect:s=!0}=i;return t.animate().to(e.attribute,r,n),void(s&&bd(t,e,r,n))}i.forEach((i,r)=>{let{duration:n,easing:s,increaseEffect:a=!0,channel:o}=i,{from:l,to:h}=bh(t,e,o,i.options);dn(h)||t.animate().to(h,n,s),"text"in l&&"text"in h&&a&&bd(t,e,n,s)})})(n,t,this._animationConfig.update),e.labelLine&&o&&e.labelLine.animate().to(o.attribute,s,a)}}),r.forEach(t=>{var e;null===(e=t.text)||void 0===e||e.animate().to(bl(t.text.attribute,"fadeOut").to,this._animationConfig.exit.duration,this._animationConfig.exit.easing).onEnd(()=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)})}),this._graphicToText=i}_renderWithOutAnimation(t){var e;let i=new Map,r=this._graphicToText||new Map,n=[],{visible:s}=null!==(e=this.attribute.line)&&void 0!==e?e:{};t.forEach(t=>{let e;let a=this.getRelatedGraphic(t.attribute),o=(null==r?void 0:r.get(a))?"update":"enter",l=this._isCollectionBase?t.attribute.id:a;if(s&&(e=this._createLabelLine(t,a)),"enter"===o)n.push(t),i.set(l,e?{text:t,labelLine:e}:{text:t}),this.add(t),e&&this.add(e),this._syncStateWithRelatedGraphic(a);else if("update"===o){let n=r.get(l);r.delete(l),i.set(l,n),n.text.setAttributes(t.attribute),n.labelLine&&e&&n.labelLine.setAttributes(e.attribute)}}),r.forEach(t=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)}),this._graphicToText=i}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,r,n,s,a,{mode:o,duration:l,easing:h,delay:d}){let u=c=>{var p,g,f;let{detail:m}=c;if(!m)return{};let v=null===(p=m.animationState)||void 0===p?void 0:p.step;if(!(m.type===oR.ANIMATE_UPDATE&&v&&!("wait"===v.type&&null==(null===(g=v.prev)||void 0===g?void 0:g.type))))return{};if(m.type===oR.ANIMATE_END)return t.setAttributes(a),void(i&&i.setAttributes(a));let y=()=>{s&&(s.onAnimateBind=void 0,s.removeEventListener("afterAttributeUpdate",u))};switch(o){case"after":m.animationState.end&&(t.animate({onStart:y}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h));break;case"after-all":n===e.length-1&&m.animationState.end&&(e.forEach(t=>{t.animate({onStart:y}).wait(d).to(a,l,h)}),r.forEach(t=>{t.animate().wait(d).to(a,l,h)}));break;default:if(this._isCollectionBase){let e=this._idToPoint.get(t.attribute.id);!e||t.animates&&t.animates.has("label-animate")||!s.containsPoint(e.x,e.y,oO.LOCAL,null===(f=this.stage)||void 0===f?void 0:f.pickerService)||(t.animate({onStart:y}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}else m.animationState.isFirstFrameOfStep&&(t.animate({onStart:y}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}};return u}_smartInvert(t){var e,i,r,n,s;let a=(0,ep.Z)(this.attribute.smartInvert)?this.attribute.smartInvert:{},{textType:o,contrastRatiosThreshold:l,alternativeColors:h,mode:d}=a,u=null!==(e=a.fillStrategy)&&void 0!==e?e:"invertBase",c=null!==(i=a.strokeStrategy)&&void 0!==i?i:"base",p=null!==(r=a.brightColor)&&void 0!==r?r:"#ffffff",g=null!==(n=a.darkColor)&&void 0!==n?n:"#000000",f=null!==(s=a.outsideEnable)&&void 0!==s&&s;if("null"!==u||"null"!==c)for(let e=0;e<t.length;e++){let i=t[e];if(!i)continue;let r=this.getRelatedGraphic(i.attribute),n=r.attribute.fill,s=y7(i.attribute.fill,n,o,l,h,d),a=y9(s,p)?p:g;if(f){let t=bi(u,n,s,a);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;let e=bi(c,n,s,a);e&&i.setAttributes({stroke:e})}else if(this._canPlaceInside(i.AABBBounds,r.AABBBounds)){let t=bi(u,n,s,a);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;let e=bi(c,n,s,a);e&&i.setAttributes({stroke:e})}else{if(0===i.attribute.lineWidth)continue;if(i.attribute.stroke){i.setAttributes({fill:y7(i.attribute.fill,i.attribute.stroke,o,l,h,d)});continue}let t=bi(u,n,s,a);t&&i.setAttributes({fill:t});let e=bi(c,n,s,a);e&&i.setAttributes({stroke:e})}}}_canPlaceInside(t,e){return!(!t||!e)&&e.encloses(t)}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}by.defaultAttributes={textStyle:{fontSize:12,textAlign:"center",textBaseline:"middle",boundsPadding:[-2,-1,-2,-1]},offset:0,pickable:!1};class bb extends by{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},bb.defaultAttributes,t))}labeling(t,e,i="top",r=0){if(!t||!e)return;let{x1:n,y1:s,x2:a,y2:o}=t,l=Math.abs(a-n),h=Math.abs(o-s),d=Math.abs(e.x2-e.x1),u=Math.abs(e.y2-e.y1),c=(e.x1+e.x2)/2,p=(e.y1+e.y2)/2,g=0,f=0;switch(i){case"top":case"inside-top":f=-.5;break;case"bottom":case"inside-bottom":f=.5;break;case"left":case"inside-left":g=-.5;break;case"right":case"inside-right":g=.5;break;case"top-right":g=.5,f=-.5;break;case"top-left":g=-.5,f=-.5;break;case"bottom-right":g=.5,f=.5;break;case"bottom-left":g=-.5,f=.5}c+=g*d,p+=f*u;let m=0,v=0,y=i.includes("inside");switch(i.includes("top")?v=y?1:-1:i.includes("bottom")?v=y?-1:1:i.includes("left")?m=y?1:-1:i.includes("right")&&(m=y?-1:1),i){case"top-right":case"bottom-right":m=-1;break;case"top-left":case"bottom-left":m=1}return{x:c+m*r+m*l/2,y:p+v*r+v*h/2}}}bb.tag="rect-label",bb.defaultAttributes={textStyle:{fill:"#000"},position:"top",offset:5};class bx extends by{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},bx.defaultAttributes,t)),this.name="symbol-label"}labeling(t,e,i="top",r=0){return bg(t,e,i,r)}}bx.defaultAttributes={textStyle:{fill:"#000"},position:"top",offset:5};class b_{constructor(t,e,i,r,n,s,a,o,l){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=r,this.radian=n,this.middleAngle=s,this.innerRadius=a,this.outerRadius=o,this.circleCenter=l,this.labelVisible=!0,this.labelLimit=0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class bA extends by{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},bA.defaultAttributes,t)),this.name="arc-label",this._ellipsisWidth=0,this._arcLeft=new Map,this._arcRight=new Map}_overlapping(t){return t}labeling(t,e,i="outside",r=0){if(t&&e)return{x:0,y:0}}_layout(t){let e=super._layout(t),i=e.map(t=>this.getGraphicBounds(t)),r=Object.assign(Object.assign({},this.attribute.textStyle),{text:"…"}),n=this._createLabelText(r),s=this.getGraphicBounds(n),a=s.x2-s.x1,o=e.map(t=>t.attribute),l=this.layoutArcLabels(this.attribute.position,this.attribute,Array.from(this._idToGraphic.values()),o,i,a);for(let t=0;t<o.length;t++){let i=o[t],r=l.find(t=>{var e;return(null===(e=t.refDatum)||void 0===e?void 0:e.id)===i.id});if(r){let i={visible:r.labelVisible,x:r.labelPosition.x,y:r.labelPosition.y,angle:r.angle,maxLineWidth:r.labelLimit,points:r.pointA&&r.pointB&&r.pointC?[r.pointA,r.pointB,r.pointC]:void 0,line:r.labelLine};e[t].setAttributes(i)}}return e}layoutArcLabels(t,e,i,r,n,s){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=s;let a=0;i.forEach(t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)}),r.forEach((t,i)=>{var s,o,l,h;let d=this._idToGraphic.get(t.id).attribute,u={x:null!==(s=null==d?void 0:d.x)&&void 0!==s?s:0,y:null!==(o=null==d?void 0:d.y)&&void 0!==o?o:0};if(!(0,eB.Z)(r[i])&&!(0,eB.Z)(n[i])){;let t=r[i]?r[i]:null,s=n[i]?n[i]:{x1:0,x2:0,y1:0,y2:0},o=(d.startAngle+d.endAngle)/2,c=d.endAngle-d.startAngle,p=(l=function(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}(l=d.endAngle-c/2))>0&&l<=Math.PI/2?2:l>Math.PI/2&&l<=Math.PI?3:l>Math.PI&&l<=3*Math.PI/2?4:1,g=bc(u.x,u.y,d.outerRadius,o),f=new b_(t,g,bc(u.x,u.y,a+e.line.line1MinLength,o),p,c,o,d.innerRadius,d.outerRadius,u);f.pointA=bc(u.x,u.y,this.computeDatumRadius(2*u.x,2*u.y,d.outerRadius),f.middleAngle),f.labelSize={width:s.x2-s.x1,height:s.y2-s.y1},1===(h=f.quadrant)||2===h?this._arcRight.set(f.refDatum,f):bp(f.quadrant)&&this._arcLeft.set(f.refDatum,f)}});let o=Array.from(this._arcLeft.values()),l=Array.from(this._arcRight.values()),h=[];switch(t){case"inside":case"inside-inner":case"inside-outer":h.push(...this._layoutInsideLabels(l,e,i)),h.push(...this._layoutInsideLabels(o,e,i));break;default:h.push(...this._layoutOutsideLabels(l,e,i)),h.push(...this._layoutOutsideLabels(o,e,i))}return h}_layoutInsideLabels(t,e,i){var r,n;let s=e.spaceWidth,a=null!==(r=e.position)&&void 0!==r?r:"inside",o=null!==(n=e.offsetRadius)&&void 0!==n?n:-s;return t.forEach(t=>{var i,r,n,l,h;let d;let{labelSize:u,radian:c}=t,p=t.innerRadius,g=t.outerRadius;if(c<(l=g,(h=u.height)>2*l?NaN:2*Math.asin(h/2/l)))d=0;else d=g-(c>=Math.PI?p:Math.max(p,u.height/2/Math.tan(c/2)))-s;!0!==e.rotate&&(d=g-s);let f=this._getFormatLabelText(t.refDatum,d);t.labelText=f;let m=Math.min(d,t.labelSize.width),v=this._computeAlign(t,e),y,b=0;"inside"===a&&(b="left"===v?m:"right"===v?0:m/2),y="inside-inner"===a?p-o+b:g+o-b,t.labelPosition=bc(t.circleCenter.x,t.circleCenter.y,y,t.middleAngle),t.labelLimit=m,dJ(m,0)||(t.labelVisible=!1),t.angle=null!==(r=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==r?r:t.middleAngle;let x=null!==(n=e.offsetAngle)&&void 0!==n?n:0;["inside-inner","inside-outer"].includes(a)&&(x+=Math.PI/2),t.angle+=x}),t}_layoutOutsideLabels(t,e,i){var r,n,s;let a=null!==(r=i[0].attribute.x)&&void 0!==r?r:0,o=2*(null!==(n=i[0].attribute.y)&&void 0!==n?n:0),l=e.line.line2MinLength,h=e.layout,d=e.spaceWidth;if(t.forEach(t=>{let e=bp(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+l+d),y:t.outerCenter.y}}),t.sort((t,e)=>t.labelPosition.y-e.labelPosition.y),!1!==e.coverEnable||"none"===h.strategy){for(let r of t){let{labelPosition:t,labelSize:n}=r;r.labelLimit=n.width,r.pointB=bp(r.quadrant)?{x:t.x+n.width/2+l+d,y:t.y}:{x:t.x-n.width/2-l-d,y:t.y},this._computeX(r,e,i)}!1===e.coverEnable&&"none"===h.strategy&&this._coverLabels(t)}else{let r=o/((null===(s=e.textStyle)||void 0===s?void 0:s.fontSize)||16);this._adjustY(t,r,e,i);let{minY:n,maxY:a}=t.reduce((t,e)=>{let{y1:i,y2:r}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(o,Math.max(r,t.maxY)),t},{minY:1/0,maxY:-Infinity}),l=Math.max(Math.abs(o/2-n),Math.abs(a-o/2)),h=this._computeLayoutRadius(l,e,i);for(let r of t)this._computePointB(r,h,e,i),this._computeX(r,e,i)}let u=2*a;return t.forEach(t=>{var i,r;t.labelVisible&&(dQ(t.pointB.x,l+d)||dJ(t.pointB.x,u-l-d))&&(t.labelVisible=!1),t.angle=null!==(r=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==r?r:0,e.offsetAngle&&(t.angle+=e.offsetAngle),t.labelLine=Object.assign({},e.line)}),t}_computeX(t,e,i){var r;let n=t.circleCenter,s=2*n.x;n.y;let a=0;i.forEach(t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)});let o=this.computeLayoutOuterRadius(a,e.width,e.height),l=e.line.line1MinLength,h=e.line.line2MinLength,d=null===(r=e.layout)||void 0===r?void 0:r.align,u=e.spaceWidth,{labelPosition:c,quadrant:p,pointB:g}=t;(0,eg.Z)(g.x*g.y)||(t.pointC={x:NaN,y:NaN},c.x=NaN,t.labelLimit=0);let f=this.computeRadius(o,e.width,e.height),m=bp(p)?-1:1,v=0,y=(m>0?s-g.x:g.x)-h-u;"labelLine"===d&&(v=(f+l+h)*m+n.x,y=(m>0?s-v:v)-u);let b=this._getFormatLabelText(t.refDatum,y);t.labelText=b;let x=Math.min(y,t.labelSize.width);switch(d){case"labelLine":break;case"edge":v=m>0?s-x-u:x+u;break;default:v=g.x+m*h}x=Math.max(this._ellipsisWidth,x),t.labelLimit=x,t.pointC={x:v,y:c.y};let _=.5*(t.labelLimit<t.labelSize.width?t.labelLimit:t.labelSize.width);"edge"===d?c.x=(m>0?s+0:0)-m*_:c.x=v+0+m*(u+_)}_computeAlign(t,e){var i,r,n,s,a,o;let l=null!==(r=null===(i=e.textStyle)||void 0===i?void 0:i.textAlign)&&void 0!==r?r:null===(n=e.textStyle)||void 0===n?void 0:n.align,h=null!==(a=null===(s=e.layout)||void 0===s?void 0:s.textAlign)&&void 0!==a?a:null===(o=e.layout)||void 0===o?void 0:o.align;return"inside"!==e.position?(0,eB.Z)(l)||"auto"===l?"edge"===h?bp(t.quadrant)?"left":"right":bp(t.quadrant)?"right":"left":l:(0,eB.Z)(l)||"auto"===l?"center":l}_getFormatLabelText(t,e){var i;return null!==(i=null==t?void 0:t.text)&&void 0!==i?i:""}_adjustY(t,e,i,r){var n,s;r[0].attribute.x;let a=2*(null!==(s=r[0].attribute.y)&&void 0!==s?s:0),o=i.layout;if("vertical"===o.strategy){let e,i=0,r=t.length;if(r<=0)return;for(let n=0;n<r;n++){let{y1:s}=t[n].getLabelBounds();if(dQ(e=s-i,0)){let i=this._shiftY(t,n,r-1,-e);this._shiftY(t,i,0,e/2)}let{y2:a}=t[n].getLabelBounds();i=a}let{y1:n}=t[0].getLabelBounds();dQ(e=n-0,0)&&this._shiftY(t,0,r-1,-e);for(let e=t.length-1;e>=0&&t[e].getLabelBounds().y2>a;e--)t[e].labelVisible=!1}else if("none"!==o.strategy){let n=t.map((t,e)=>({arc:t,originIndex:e,priorityIndex:0}));n.sort((t,e)=>e.arc.radian-t.arc.radian),n.forEach((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1});let s=1/0,l=-Infinity;for(let h=0;h<e&&h<t.length;h++){let e;this._storeY(t);let d=n[h].arc;this._computeYRange(d,i,r),d.labelVisible=!0;let u=d.labelPosition.y,{lastIndex:c,nextIndex:p}=this._findNeighborIndex(t,n[h]),g=t[c],f=t[p];if(-1===c&&-1!==p){let e=f.labelPosition.y;u>e?d.labelPosition.y=e-f.labelSize.height/2-d.labelSize.height/2:this._twoWayShift(t,d,f,p)}else if(-1!==c&&-1===p){let e=g.labelPosition.y;u<e?d.labelPosition.y=e+g.labelSize.height/2+d.labelSize.height/2:this._twoWayShift(t,g,d,n[h].originIndex)}else if(-1!==c&&-1!==p){let e=g.labelPosition.y,i=f.labelPosition.y;u>i?(d.labelPosition.y=i-f.labelSize.height/2-d.labelSize.height/2,this._twoWayShift(t,g,d,n[h].originIndex)):(u<e?d.labelPosition.y=e+g.labelSize.height/2+d.labelSize.height/2:this._twoWayShift(t,g,d,n[h].originIndex),this._twoWayShift(t,d,f,p))}let m=Math.min(s,n[h].originIndex),v=Math.max(l,n[h].originIndex);if(dJ(e=t[v].getLabelBounds().y2-a,0)&&this._shiftY(t,v,0,-e),dQ(e=t[m].getLabelBounds().y1-0,0)&&this._shiftY(t,m,t.length-1,-e),dJ(e=t[v].getLabelBounds().y2-a,0)){d.labelVisible=!1,this._restoreY(t);break}o.tangentConstraint&&!this._checkYRange(t)?(d.labelVisible=!1,this._restoreY(t)):(s=m,l=v)}}}_shiftY(t,e,i,r){let n=e<i?1:-1,s=e;for(;-1!==s;){t[s].labelPosition.y+=r;let e=this._findNextVisibleIndex(t,s,i,n);if(e>=0&&e<t.length){let{y1:i,y2:r}=t[s].getLabelBounds(),{y1:a,y2:o}=t[e].getLabelBounds();if(n>0&&r<a||n<0&&i>o)return s}s=e}return i}_findNextVisibleIndex(t,e,i,r){let n=(i-e)*r;for(let i=1;i<=n;i++){let n=e+i*r;if(t[n].labelVisible)return n}return -1}_computePointB(t,e,i,r){let n=0;r.forEach(t=>{t.attribute.outerRadius>n&&(n=t.attribute.outerRadius)});let s=this.computeLayoutOuterRadius(n,i.width,i.height),a=i.line.line1MinLength;if("none"===i.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{let r=t.circleCenter,n=this.computeRadius(s,i.width,i.height),{labelPosition:o,quadrant:l}=t,h=e-Math.max(n+a,t.outerRadius),d=Math.sqrt(e**2-Math.abs(r.y-o.y)**2)-h;(0,eg.Z)(d)?t.pointB={x:r.x+d*(bp(l)?-1:1),y:o.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(let e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,e,i){let r,n,s,a,o;let l=t.circleCenter,h={width:2*l.x,height:2*l.y},d=0;i.forEach(t=>{t.attribute.outerRadius>d&&(d=t.attribute.outerRadius)});let u=this.computeLayoutOuterRadius(d,e.width,e.height),c=e.line.line1MinLength,{width:p,height:g}=h,f=this.computeRadius(u,e.width,e.height),m=this._computeLayoutRadius(g/2,e,i),v=Math.abs(t.center.x-p/2),y=t.center.y-g/2;if(dq(p/2,v))r=0,n=1,s=-y;else if(dq(g/2,y))r=1,n=0,s=-v;else{let t=-1/(y/v);r=t,n=-1,s=y-t*v}let b=function(t,e,i,r,n,s){if(0===t&&0===e||s<=0)return[];if(0===t){let t=-i/e,n=s**2-(t-0)**2;return n<0?[]:0===n?[{x:r,y:t}]:[{x:Math.sqrt(n)+r,y:t},{x:-Math.sqrt(n)+r,y:t}]}if(0===e){let e=-i/t,a=s**2-(e-r)**2;return a<0?[]:0===a?[{x:e,y:n}]:[{x:e,y:Math.sqrt(a)+n},{x:e,y:-Math.sqrt(a)+n}]}let a=(e/t)**2+1,o=2*(e/t*(i/t+r)-n),l=o**2-4*a*((i/t+r)**2+n**2-s**2);if(l<0)return[];let h=(-o+Math.sqrt(l))/(2*a),d=(-o-Math.sqrt(l))/(2*a),u=-(e*h+i)/t;return 0===l?[{x:u,y:h}]:[{x:u,y:h},{x:-(e*d+i)/t,y:d}]}(r,n,s,c+f-m,0,m);!(b.length<2)&&(b[0].x>b[1].x&&b.reverse(),b[0].x<0?dq(b[0].y,b[1].y)?dJ(t.middleAngle,-Math.PI)&&dQ(t.middleAngle,0)||dJ(t.middleAngle,Math.PI)&&dQ(t.middleAngle,2*Math.PI)?(a=0,o=b[1].y+g/2):(a=b[1].y+g/2,o=g):b[0].y<b[1].y?(a=0,o=b[1].y+g/2):(a=b[1].y+g/2,o=h.height):(a=Math.min(b[0].y,b[1].y)+g/2,o=Math.max(b[0].y,b[1].y)+g/2),t.labelYRange=[a,o])}_computeLayoutRadius(t,e,i){let r=e.layoutArcGap,n=e.line.line1MinLength,s=0;i.forEach(t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)});let a=this.computeLayoutOuterRadius(s,e.width,e.height),o=this.computeRadius(a,e.width,e.height)+n,l=o-r;return Math.max((l**2+t**2)/(2*l),o)}_findNeighborIndex(t,e){let i=e.originIndex,r=-1,n=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){r=e;break}for(let e=i+1;e<t.length;e++)if(t[e].labelVisible){n=e;break}return{lastIndex:r,nextIndex:n}}_twoWayShift(t,e,i,r){let n=i.getLabelBounds().y1-e.getLabelBounds().y2;if(dQ(n,0)){let e=this._shiftY(t,r,t.length-1,-n);this._shiftY(t,e,0,n/2)}}_restoreY(t){for(let e of t)e.labelVisible&&(e.labelPosition.y=e.lastLabelY)}_checkYRange(t){for(let e of t){let{labelYRange:t,labelPosition:i}=e;if(e.labelVisible&&t&&(dQ(i.y,t[0])||dJ(i.y,t[1])))return!1}return!0}_coverLabels(t){if(t.length<=1)return;let e=t[0].getLabelBounds();for(let i=1;i<t.length;i++){let r=t[i].getLabelBounds();!function(t,e){let{x1:i,y1:r,x2:n,y2:s}=t,{x1:a,y1:o,x2:l,y2:h}=e;return!(i<=a&&n<=a||i>=l&&n>=l||r<=o&&s<=o||r>=h&&s>=h)}(e,r)?e=r:t[i].labelVisible=!1}}_createLabelLine(t,e){var i,r,n,s,a,o,l;let{points:h,line:d={},visible:u,fill:c}=t.attribute,p=t.attribute.points?as.line({visible:null===(n=null!==(i=d.visible&&u)&&void 0!==i?i:null===(r=t.attribute)||void 0===r?void 0:r.visible)||void 0===n||n,stroke:null!==(a=null===(s=d.style)||void 0===s?void 0:s.stroke)&&void 0!==a?a:c,lineWidth:null!==(l=null===(o=d.style)||void 0===o?void 0:o.lineWidth)&&void 0!==l?l:1,points:h,curveType:d.smooth?"basis":null}):void 0;return p&&this._setStatesOfLabelLine(p),p}computeRadius(t,e,i,r){return this.computeLayoutRadius(e||0,i||0)*t*((0,eB.Z)(r)?1:r)}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}_canPlaceInside(t,e){return"inside"===this.attribute.position}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i){let r=this.computeLayoutOuterRadius(i,t,e);return this.computeLayoutRadius(t||0,e||0)*r}}bA.defaultAttributes={coverEnable:!1,spaceWidth:5,layoutArcGap:6,textStyle:{visible:!0,fontSize:14,fontWeight:"normal",fillOpacity:1,boundsPadding:[-1,0,-1,0]},position:"outside",line:{visible:!0,line1MinLength:20,line2MinLength:10},layout:{align:"arc",strategy:"priority",tangentConstraint:!0}};class bw extends by{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},bw.defaultAttributes,t)),this.name="line-data-label"}labeling(t,e,i="top",r=0){return bg(t,e,i,r)}}bw.defaultAttributes={textStyle:{fill:"#000"},position:"top",offset:5};class bS extends by{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},bS.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){if(!t||"line"!==t.type)return super.getGraphicBounds(t,e);let r=t.attribute.points||[e],n="start"===i?0:r.length-1;return r[n]?{x1:r[n].x,x2:r[n].x,y1:r[n].y,y2:r[n].y}:void 0}labeling(t,e,i="end",r=0){return bm(t,e,i,r)}}bS.defaultAttributes={textStyle:{fill:"#000"},position:"end",offset:6};class bT extends by{constructor(t){super(lT({},bT.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){var r;if("area"!==t.type)return super.getGraphicBounds(t,e);let n=(null===(r=null==t?void 0:t.attribute)||void 0===r?void 0:r.points)||[e],s="start"===i?0:n.length-1;return{x1:n[s].x,x2:n[s].x,y1:n[s].y,y2:n[s].y}}labeling(t,e,i="end",r=0){return bm(t,e,i,r)}}bT.defaultAttributes={textStyle:{fill:"#000"},position:"end",offset:6};let bk={rect:bb,symbol:bx,arc:bA,line:bS,area:bT,"line-data":bw};class bB extends pB{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},bB.defaultAttributes,t)),this.name="data-label"}render(){var t;let{dataLabels:e,size:i}=this.attribute;if(!e||0===e.length)return;let{width:r=0,height:n=0,padding:s}=i||{};if(!r||!n||!(0,eg.Z)(n*r))return;this._componentMap||(this._componentMap=new Map);let a=y4(r,n,s),o=a.bitmap(),l=new Map,h=this._componentMap;for(let i=0;i<e.length;i++){let r=e[i],n=bk[r.type]||by;if(n){let{baseMarkGroupName:e,type:s}=r,h=null!==(t=r.id)&&void 0!==t?t:`${e}-${s}-${i}`,d=this._componentMap.get(h);d?(d.setBitmapTool(a),d.setBitmap(o),d.setAttributes(r)):((d=new n(r)).setBitmap(o),d.setBitmapTool(a),this.add(d)),l.set(h,d)}}h.forEach((t,e)=>{l.get(e)||this.removeChild(t)}),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach(t=>{t.disableAnimation()})}enableAnimation(){this._componentMap.forEach(t=>{t.enableAnimation()})}}bB.defaultAttributes={pickable:!1};let bC=(t,e,i,r,n,s={})=>{var a;let o=null===(a=s.components)||void 0===a?void 0:a.dataLabel,l=t.map((t,e)=>{var a,o,l,h,d;let u=Object.assign(Object.assign({},n),{labelIndex:e}),c=null!==(a=lt(r,u,t))&&void 0!==a?a:{},{components:p={}}=s,g={};switch(t.markType){case tF.line:case tF.area:g="line"===c.type?p.lineLabel:"area"===c.type?p.areaLabel:p.lineDataLabel;break;case tF.rect:case tF.rect3d:case tF.interval:g=p.rectLabel;break;case tF.symbol:case tF.circle:case tF.cell:g=p.symbolLabel;break;case tF.arc:case tF.arc3d:g=p.arcLabel;break;case tF.polygon:case tF.path:default:g=p.pointLabel}let f=null!==(o=c.data)&&void 0!==o?o:[],m=null!==(h=null===(l=null==g?void 0:g.data)||void 0===l?void 0:l[0])&&void 0!==h?h:{};return f&&f.length>0?f.forEach((e,r)=>{if(t.elements[r]){let n=du(i,e,t.elements[r],u);lT(e,m,n)}}):t.elements.forEach(e=>{if("willRelease"!==e.getGraphicItem().releaseStatus){if(t.isCollectionMark())e.getDatum().forEach(t=>{let r=du(i,t,e,u);f.push(lT({},m,r))});else{let t=lT({},m,du(i,e.getDatum(),e,u));f.push(t)}}}),lT({},g,{data:f,baseMarkGroupName:null===(d=t.graphicItem)||void 0===d?void 0:d.name,getBaseMarks:()=>t.elements.map(t=>t.getGraphicItem())},null!=c?c:{})}).filter(t=>!(0,eB.Z)(t));return lT({},o,{size:e,dataLabels:l})};class bE extends uI{constructor(t,e){super(t,tG.label,e),this.spec.componentType=tG.label}parseAddition(t){return super.parseAddition(t),this.labelStyle(t.labelStyle),this.size(t.size),this.target(t.target),this}labelStyle(t){return this.setFunctionSpec(t,"labelStyle")}size(t){return this.setFunctionSpec(t,"size")}target(t){if(this.spec.target){let t=ex(this.spec.target).map(t=>(0,ek.Z)(t)?this.view.getMarkById(t):t);this.detach(t)}if(this.spec.target=t,t){let e=ex(t).map(t=>(0,ek.Z)(t)?this.view.getMarkById(t):t);this.attach(e)}return this.commit(),this}_updateComponentEncoders(){let t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce((e,i)=>{let r=t[i];return r&&(e[i]={callback:(t,e,i)=>{var n,s,a,o;let l=ex(this.spec.target).map(t=>(0,ek.Z)(t)?this.view.getMarkById(t):t),h=null===(s=null===(n=this.group)||void 0===n?void 0:n.getGroupGraphicItem)||void 0===s?void 0:s.call(n),d=lt(this.spec.size,i);d||(d=h?{width:null!==(a=h.attribute.width)&&void 0!==a?a:h.AABBBounds.width(),height:null!==(o=h.attribute.height)&&void 0!==o?o:h.AABBBounds.height()}:{width:1/0,height:1/0});let u=this.spec.skipTheme?null:this.view.getCurrentTheme();return bC(l,d,r,this.spec.labelStyle,i,u)}}),e},{});this._encoders=e}}bE.componentType=tG.label;let bM="M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",bP={horizontal:{angle:0,strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",cursor:"ew-resize"},vertical:{angle:Math.PI/180*90,cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0}};(tp=et||(et={})).startHandler="startHandler",tp.endHandler="endHandler",tp.middleHandler="middleHandler",tp.background="background";let bO=["segments","points","curveType",...nR];class bR extends nF{constructor(t){super(t),this.type="area",this.numberType=n9}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;let{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){let t=rQ(this).area;this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updateAreaAABBBounds(e,rQ(this).area,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=e,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw Error("暂不支持")}_interpolate(t,e,i,r,n){"points"===t&&(n.points=nY(i,r,e))}getDefaultAttribute(t){return rQ(this).area[t]}needUpdateTags(t){return super.needUpdateTags(t,bO)}needUpdateTag(t){return super.needUpdateTag(t,bO)}toCustomPath(){let t=new iK,e=this.attribute,i=e.segments,r=e=>{if(e&&e.length){let i=!0,r=[];if(e.forEach(e=>{var n,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),r.push({x:null!==(n=e.x1)&&void 0!==n?n:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),i=!1)}),r.length){for(let e=r.length-1;e>=0;e--)t.lineTo(r[e].x,r[e].y);t.closePath()}}};return e.points?r(e.points):i&&i.length&&i.forEach(t=>{r(t.points)}),t}clone(){return new bR(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return bR.NOWORK_ANIMATE_ATTR}}function bI(t){return new bR(t)}bR.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},nN);let bL=!1,bD=new eM(t=>{bL||(bL=!0,t(op).toSelf().inSingletonScope(),t(sP).to(op).inSingletonScope(),t(sR).toService(sP),t(a$).toService(a6),eV(t,a$),t(og).toSelf().inSingletonScope())}),bj=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=n9}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).area,{x:s=n.x,y:a=n.y}=t.attribute,{fillPickable:o=n.fillPickable,strokePickable:l=n.strokePickable}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let h=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,t=>!!h||!!o&&(h=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(h)return!0;if(!l)return!1;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=aM(r,s+a,r.dpr),h=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),h}};bj=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tg=0,tf=ez(sP),function(t,e){tf(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],bj);let bN=!1,bF=new eM((t,e,i,r)=>{bN||(bN=!0,t(pX).to(bj).inSingletonScope(),t(p9).toService(pX))}),bG=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=n9}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).area,{x:s=n.x,y:a=n.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,t=>!!o||(o=t.isPointInPath(e.x,e.y))),r.highPerformanceRestore(),o}};bG=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tm=0,tv=ez(sP),function(t,e){tv(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],bG);let bz=!1,bZ=new eM((t,e,i,r)=>{bz||(bz=!0,t(pj).to(bG).inSingletonScope(),t(pL).toService(pj))});function bH(){bH.__loaded||(bH.__loaded=!0,as.RegisterGraphicCreator("area",bI),rR.load(bD),rR.load(pI?bF:bZ))}bH.__loaded=!1;var bU=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)0>e.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i};let bV={debounce:em,throttle:hK};mX(),ml(),fD(),bH(),go();class bW extends pB{setPropsFromAttrs(){let{start:t,end:e,orient:i,previewData:r,previewPointsX:n,previewPointsY:s,previewPointsX1:a,previewPointsY1:o}=this.attribute;t&&(this.state.start=t),e&&(this.state.end=e);let{width:l,height:h}=this.getLayoutAttrFromConfig();this._spanCache=this.state.end-this.state.start,this._isHorizontal="top"===i||"bottom"===i,this._layoutCache.max=this._isHorizontal?l:h,this._layoutCache.attPos=this._isHorizontal?"x":"y",this._layoutCache.attSize=this._isHorizontal?"width":"height",r&&(this._previewData=r),r6(n)&&(this._previewPointsX=n),r6(s)&&(this._previewPointsY=s),r6(a)&&(this._previewPointsX1=a),r6(o)&&(this._previewPointsY1=o)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},bW.defaultAttributes,t)),this.name="dataZoom",this._previewData=[],this._activeState=!1,this._activeCache={startPos:{x:0,y:0},lastPos:{x:0,y:0}},this._layoutCache={attPos:"x",attSize:"width",max:0},this.state={start:0,end:1},this._statePointToData=t=>t,this._onHandlerPointerDown=(t,e)=>{t.stopPropagation(),"start"===e?(this._activeTag=et.startHandler,this._activeItem=this._startHandlerMask):"end"===e?(this._activeTag=et.endHandler,this._activeItem=this._endHandlerMask):"middleRect"===e?(this._activeTag=et.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=et.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=et.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(t),this._activeCache.lastPos=this.eventPosToStagePos(t),"browser"===o2.env&&(o2.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),o2.addEventListener("pointerup",this._onHandlerPointerUp)),this.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})},this._pointerMove=t=>{t.stopPropagation();let{start:e,end:i,brushSelect:r,realTime:n=!0}=this.attribute,s=this.eventPosToStagePos(t),{attPos:a,max:o}=this._layoutCache,l=(s[a]-this._activeCache.lastPos[a])/o,{start:h,end:d}=this.state;this._activeState&&(this._activeTag===et.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+l):this._activeTag===et.startHandler?h+l>d?(d=(h=d)+l,this._activeTag=et.endHandler):h+=l:this._activeTag===et.endHandler&&(d+l<h?(h=(d=h)+l,this._activeTag=et.startHandler):d+=l),this._activeCache.lastPos=s,r&&this.renderDragMask()),h=Math.min(Math.max(h,0),1),d=Math.min(Math.max(d,0),1),e===h&&i===d||this.setStateAttr(h,d,!0),n&&this._dispatchEvent("change",{start:h,end:d,tag:this._activeTag})},this._onHandlerPointerMove=0===this.attribute.delayTime?this._pointerMove:bV[this.attribute.delayType](this._pointerMove,this.attribute.delayTime),this._onHandlerPointerUp=t=>{t.preventDefault();let{start:e,end:i,brushSelect:r,realTime:n=!0}=this.attribute;if(this._activeState&&this._activeTag===et.background){let e=this.eventPosToStagePos(t);this.backgroundDragZoom(this._activeCache.startPos,e)}this._activeState=!1,r&&this.renderDragMask(),e===this.state.start&&i===this.state.end||this.setStateAttr(this.state.start,this.state.end,!0),this._dispatchEvent("change",{start:this.state.start,end:this.state.end,tag:this._activeTag}),"browser"===o2.env&&(o2.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),o2.removeEventListener("pointerup",this._onHandlerPointerUp)),this.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.removeEventListener("pointerup",this._onHandlerPointerUp)};let{position:i,showDetail:r}=t;this._activeCache.startPos=i,this._activeCache.lastPos=i,this._showText="auto"!==r&&r,this.setPropsFromAttrs()}setAttributes(t,e){super.setAttributes(t,e),this.setPropsFromAttrs()}bindEvents(){if(this.attribute.disableTriggerEvent)return;let{showDetail:t,brushSelect:e}=this.attribute;this._startHandlerMask&&this._startHandlerMask.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"start")),this._endHandlerMask&&this._endHandlerMask.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"end")),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"middleSymbol")),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"middleRect"));let i=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,i)),e&&this._background&&this._background.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"background")),e&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"background")),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,i)),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){let{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}setStateAttr(t,e,i){let{zoomLock:r=!1,minSpan:n=0,maxSpan:s=1}=this.attribute,a=e-t;a!==this._spanCache&&(r||a<n||a>s)||(this._spanCache=a,this.state.start=t,this.state.end=e,i&&this.setAttributes({start:t,end:e}))}eventPosToStagePos(t){var e,i,r,n,s,a;let{x:o,y:l}=o2.mapToCanvasPoint(t,null===(n=null===(r=null===(i=null===(e=this.stage)||void 0===e?void 0:e.window)||void 0===i?void 0:i.getContext())||void 0===r?void 0:r.canvas)||void 0===n?void 0:n.nativeCanvas);return{x:o-((null===(s=this.stage)||void 0===s?void 0:s.x)||0),y:l-((null===(a=this.stage)||void 0===a?void 0:a.y)||0)}}_onHandlerPointerEnter(t){t.stopPropagation(),this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){t.stopPropagation(),this._showText=!1,this.renderText()}backgroundDragZoom(t,e){let{attPos:i,max:r}=this._layoutCache,{position:n}=this.attribute,s=t[i]-n[i],a=e[i]-n[i],o=Math.min(Math.max(Math.min(s,a)/r,0),1),l=Math.min(Math.max(Math.max(s,a)/r,0),1);.01>Math.abs(o-l)?this.moveZoomWithMiddle(o):this.setStateAttr(o,l,!1)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.setStateAttr(this.state.start+e,this.state.end+e,!1))}renderDragMask(){let{dragMaskStyle:t}=this.attribute,{position:e,width:i,height:r}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:nd(0>this.dragMaskSize()?this._activeCache.lastPos.x:this._activeCache.startPos.x,e.x,e.x+i),y:e.y,width:this._activeState&&this._activeTag===et.background&&Math.abs(this.dragMaskSize())||0,height:r},t),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:e.x,y:nd(0>this.dragMaskSize()?this._activeCache.lastPos.y:this._activeCache.startPos.y,e.y,e.y+r),width:i,height:this._activeState&&this._activeTag===et.background&&Math.abs(this.dragMaskSize())||0},t),"rect")}isTextOverflow(t,e,i){if(!e)return!1;if(this._isHorizontal){if("start"===i){if(e.x1<t.x1)return!0}else if(e.x2>t.x2)return!0}else if("start"===i){if(e.y1<t.y1)return!0}else if(e.y2>t.y2)return!0;return!1}setTextAttr(t,e){let i,r,n,s;let{startTextStyle:a,endTextStyle:o}=this.attribute,{formatMethod:l}=a,h=bU(a,["formatMethod"]),{formatMethod:d}=o,u=bU(o,["formatMethod"]),{start:c,end:p}=this.state;this._startValue=this._statePointToData(c),this._endValue=this._statePointToData(p);let{position:g,width:f,height:m}=this.getLayoutAttrFromConfig(),v=l?l(this._startValue):this._startValue,y=d?d(this._endValue):this._endValue,b={x1:g.x,y1:g.y,x2:g.x+f,y2:g.y+m};this._isHorizontal?(i={x:g.x+c*f,y:g.y+m/2},r={x:g.x+p*f,y:g.y+m/2},n={textAlign:this.isTextOverflow(b,t,"start")?"left":"right",textBaseline:"middle"},s={textAlign:this.isTextOverflow(b,e,"end")?"right":"left",textBaseline:"middle"}):(i={x:g.x+f/2,y:g.y+c*m},r={x:g.x+f/2,y:g.y+p*m},n={textAlign:"center",textBaseline:this.isTextOverflow(b,t,"start")?"top":"bottom"},s={textAlign:"center",textBaseline:this.isTextOverflow(b,e,"end")?"bottom":"top"}),this._startText=this.maybeAddLabel(this._container,lT({},h,{text:v,x:i.x,y:i.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:n}),`data-zoom-start-text-${g}`),this._endText=this.maybeAddLabel(this._container,lT({},u,{text:y,x:r.x,y:r.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:s}),`data-zoom-end-text-${g}`)}renderText(){let t=null,e=null;this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds,this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds;let{x1:i,x2:r,y1:n,y2:s}=t,{dx:a=0,dy:o=0}=this.attribute.startTextStyle;if((new io).set(i,n,r,s).intersects(e)){let t="bottom"===this.attribute.orient||"right"===this.attribute.orient?-1:1;this._isHorizontal?this._startText.setAttribute("dy",o+t*Math.abs(e.y1-e.y2)):this._startText.setAttribute("dx",a+t*Math.abs(e.x1-e.x2))}else this._isHorizontal?this._startText.setAttribute("dy",o):this._startText.setAttribute("dx",a)}getLayoutAttrFromConfig(){var t,e,i,r,n,s;let a,o,l;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;let{position:h,size:d,orient:u,middleHandlerStyle:c={},startHandlerStyle:p={},endHandlerStyle:g={},backgroundStyle:f={}}=this.attribute,{width:m,height:v}=d,y=null!==(e=null===(t=c.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;c.visible?this._isHorizontal?(a=m,o=v-y,l={x:h.x,y:h.y+y}):(a=m-y,o=v,l={x:h.x+("left"===u?y:0),y:h.y}):(a=m,o=v,l=h);let b=null!==(i=p.size)&&void 0!==i?i:this._isHorizontal?o:a,x=null!==(r=g.size)&&void 0!==r?r:this._isHorizontal?o:a;return p.visible&&(this._isHorizontal?(a-=(b+x)/2,l={x:l.x+b/2,y:l.y}):(o-=(b+x)/2,l={x:l.x,y:l.y+b/2})),o+=(n=f.lineWidth/2,n),a+=(s=f.lineWidth/2,s),this._layoutAttrFromConfig={position:l,width:a,height:o},this._layoutAttrFromConfig}render(){var t,e,i,r,n,s,a,o,l,h,d,u,c,p,g,f,m,v,y,b,x,_,A,w,S,T,k,B,C,E,M,P,O,R;this._layoutAttrFromConfig=null;let{orient:I,backgroundStyle:L,backgroundChartStyle:D={},selectedBackgroundStyle:j={},selectedBackgroundChartStyle:N={},middleHandlerStyle:F={},startHandlerStyle:G={},endHandlerStyle:z={},brushSelect:Z,zoomLock:H}=this.attribute,{start:U,end:V}=this.state,{position:W,width:$,height:Y}=this.getLayoutAttrFromConfig(),X=null!==(t=G.triggerMinSize)&&void 0!==t?t:40,K=null!==(e=z.triggerMinSize)&&void 0!==e?e:40,q=this.createOrUpdateChild("dataZoom-container",{},"group");if(this._container=q,this._background=q.createOrUpdateChild("background",Object.assign(Object.assign({x:W.x,y:W.y,width:$,height:Y,cursor:Z?"crosshair":"auto"},L),{pickable:!H&&(null===(i=L.pickable)||void 0===i||i)}),"rect"),(null===(r=D.line)||void 0===r?void 0:r.visible)&&this.setPreviewAttributes("line",q),(null===(n=D.area)||void 0===n?void 0:n.visible)&&this.setPreviewAttributes("area",q),Z&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=q.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:W.x+U*$,y:W.y,width:(V-U)*$,height:Y,cursor:Z?"crosshair":"move"},j),{pickable:!H&&(null===(s=N.pickable)||void 0===s||s)}),"rect"):this._selectedBackground=q.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:W.x,y:W.y+U*Y,width:$,height:(V-U)*Y,cursor:Z?"crosshair":"move"},j),{pickable:!H&&(null===(a=j.pickable)||void 0===a||a)}),"rect"),(null===(o=N.line)||void 0===o?void 0:o.visible)&&this.setSelectedPreviewAttributes("line",q),(null===(l=N.area)||void 0===l?void 0:l.visible)&&this.setSelectedPreviewAttributes("area",q),this._isHorizontal){if(F.visible){let t=(null===(h=F.background)||void 0===h?void 0:h.size)||10;this._middleHandlerRect=q.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:W.x+U*$,y:W.y-t,width:(V-U)*$,height:t},null===(d=F.background)||void 0===d?void 0:d.style),{pickable:!H&&(null===(p=null===(c=null===(u=F.background)||void 0===u?void 0:u.style)||void 0===c?void 0:c.pickable)||void 0===p||p)}),"rect"),this._middleHandlerSymbol=q.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:W.x+(U+V)/2*$,y:W.y-t/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(f=null===(g=F.icon)||void 0===g?void 0:g.symbolType)&&void 0!==f?f:"square"},F.icon),{pickable:!H&&(null===(m=F.icon.pickable)||void 0===m||m)}),"symbol")}this._startHandler=q.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:W.x+U*$,y:W.y+Y/2,size:Y,symbolType:null!==(v=G.symbolType)&&void 0!==v?v:"square"},bP.horizontal),G),{pickable:!H&&(null===(y=G.pickable)||void 0===y||y)}),"symbol"),this._endHandler=q.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:W.x+V*$,y:W.y+Y/2,size:Y,symbolType:null!==(b=z.symbolType)&&void 0!==b?b:"square"},bP.horizontal),z),{pickable:!H&&(null===(x=z.pickable)||void 0===x||x)}),"symbol");let t=Math.max(this._startHandler.AABBBounds.width(),X),e=Math.max(this._startHandler.AABBBounds.height(),X),i=Math.max(this._endHandler.AABBBounds.width(),K),r=Math.max(this._endHandler.AABBBounds.height(),K);this._startHandlerMask=q.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:W.x+U*$-t/2,y:W.y+Y/2-e/2,width:t,height:e,fill:"white",fillOpacity:0,zIndex:999},bP.horizontal),{pickable:!H}),"rect"),this._endHandlerMask=q.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:W.x+V*$-i/2,y:W.y+Y/2-r/2,width:i,height:r,fill:"white",fillOpacity:0,zIndex:999},bP.horizontal),{pickable:!H}),"rect")}else{if(F.visible){let t=(null===(_=F.background)||void 0===_?void 0:_.size)||10;this._middleHandlerRect=q.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:"left"===I?W.x-t:W.x+$,y:W.y+U*Y,width:t,height:(V-U)*Y},null===(A=F.background)||void 0===A?void 0:A.style),{pickable:!H&&(null===(T=null===(S=null===(w=F.background)||void 0===w?void 0:w.style)||void 0===S?void 0:S.pickable)||void 0===T||T)}),"rect"),this._middleHandlerSymbol=q.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:"left"===I?W.x-t/2:W.x+$+t/2,y:W.y+(U+V)/2*Y,angle:Math.PI/180*90,symbolType:null!==(B=null===(k=F.icon)||void 0===k?void 0:k.symbolType)&&void 0!==B?B:"square",strokeBoundsBuffer:0},F.icon),{pickable:!H&&(null===(E=null===(C=F.icon)||void 0===C?void 0:C.pickable)||void 0===E||E)}),"symbol")}this._startHandler=q.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:W.x+$/2,y:W.y+U*Y,size:$,symbolType:null!==(M=G.symbolType)&&void 0!==M?M:"square"},bP.vertical),G),{pickable:!H&&(null===(P=G.pickable)||void 0===P||P)}),"symbol"),this._endHandler=q.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:W.x+$/2,y:W.y+V*Y,size:$,symbolType:null!==(O=z.symbolType)&&void 0!==O?O:"square"},bP.vertical),z),{pickable:!H&&(null===(R=z.pickable)||void 0===R||R)}),"symbol");let t=Math.max(this._startHandler.AABBBounds.width(),X),e=Math.max(this._startHandler.AABBBounds.height(),X),i=Math.max(this._endHandler.AABBBounds.width(),K),r=Math.max(this._endHandler.AABBBounds.height(),K);this._startHandlerMask=q.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:W.x+$/2+t/2,y:W.y+U*Y-e/2,width:r,height:i,fill:"white",fillOpacity:0,zIndex:999},bP.vertical),{pickable:!H}),"rect"),this._endHandlerMask=q.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:W.x+$/2+i/2,y:W.y+V*Y-r/2,width:r,height:i,fill:"white",fillOpacity:0,zIndex:999},bP.vertical),{pickable:!H}),"rect")}this._showText&&this.renderText()}computeBasePoints(){let t,e;let{orient:i}=this.attribute,{position:r,width:n,height:s}=this.getLayoutAttrFromConfig();return this._isHorizontal?(t=[{x:r.x,y:r.y+s}],e=[{x:r.x+n,y:r.y+s}]):"left"===i?(t=[{x:r.x+n,y:r.y}],e=[{x:r.x+n,y:r.y+s}]):(t=[{x:r.x,y:r.y+s}],e=[{x:r.x,y:r.y}]),{basePointStart:t,basePointEnd:e}}simplifyPoints(t){var e;return t.length>1e4?function(t,e,i){if(t.length<=10)return t;let r=void 0!==e?e*e:1;return t=function(t,e){let i=t.length-1,r=[t[0]];return function t(e,i,r,n,s){let a,o,l,h=n,d=i,u=e[i].x,c=e[i].y,p=e[r].x-u,g=e[r].y-c,f=p*p+g*g;for(let t=i+1,n=r-1;t<n;t++)l=e[t].x-u,(o=(a=l*g-p*(e[t].y-c))*a/f)>h&&(h=o,d=t);h>n&&(d-i>2&&t(e,i,d,n,s),s.push(e[d],e[d+1]),r-d>2&&t(e,d,r,n,s))}(t,0,i,e,r),r.push(t[i]),r}(t=i?t:function(t,e){let i,r,n=t[0].x,s=t[0].y,a=[t[0]];for(let o=1,l=t.length;o<l;o++)i=t[o].x-n,i*i+(r=t[o].y-s)*r>e&&(n=t[o].x,s=t[o].y,a.push(t[o]));return t[t.length-1].x===n&&t[t.length-1].y===s||a.push(t[t.length-1]),a}(t,r),r)}(t,null!==(e=this.attribute.tolerance)&&void 0!==e?e:this._previewData.length/1e4,!1):t}getPreviewLinePoints(){let t=this._previewData.map(t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t)}));if(0===t.length)return t;t=this.simplifyPoints(t);let{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){let t=this._previewData.map(t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t),x1:this._previewPointsX1&&this._previewPointsX1(t),y1:this._previewPointsY1&&this._previewPointsY1(t)}));if(0===t.length)return t;t=this.simplifyPoints(t);let{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");let{backgroundChartStyle:i={}}=this.attribute;"line"===t&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");let{selectedBackgroundChartStyle:i={}}=this.attribute,{start:r,end:n}=this.state,{position:s,width:a,height:o}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?s.x+r*a:s.x,y:this._isHorizontal?s.y:s.y+r*o,width:this._isHorizontal?(n-r)*a:a,height:this._isHorizontal?o:(n-r)*o,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?s.x+r*a:s.x),y:-(this._isHorizontal?s.y:s.y+r*o),width:this._isHorizontal?(n-r)*a:a,height:this._isHorizontal?o:(n-r)*o,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}maybeAddLabel(t,e,i){let r=this.find(t=>t.name===i,!0);return r?r.setAttributes(e):(r=new mq(e)).name=i,t.add(r),r}setStartAndEnd(t,e){let{start:i,end:r}=this.attribute;eb(t)&&eb(e)&&(t!==this.state.start||e!==this.state.end)&&(this.state.start=t,this.state.end=e,i===this.state.start&&r===this.state.end||(this.setStateAttr(t,e,!0),this._dispatchEvent("change",{start:t,end:e,tag:this._activeTag})))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,e,i,r;let{middleHandlerStyle:n={}}=this.attribute,s=null!==(e=null===(t=n.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;return Math.max(s,...ex(null!==(r=null===(i=n.icon)||void 0===i?void 0:i.size)&&void 0!==r?r:10))}setPreviewPointsX(t){r6(t)&&(this._previewPointsX=t)}setPreviewPointsY(t){r6(t)&&(this._previewPointsY=t)}setPreviewPointsX1(t){r6(t)&&(this._previewPointsX1=t)}setPreviewPointsY1(t){r6(t)&&(this._previewPointsY1=t)}setStatePointToData(t){r6(t)&&(this._statePointToData=t)}}bW.defaultAttributes={orient:"bottom",showDetail:"auto",brushSelect:!0,zoomLock:!1,minSpan:0,maxSpan:1,delayType:"throttle",delayTime:0,realTime:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:bM,fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:bM,fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}};class b$ extends yY{constructor(t,e){super(t,e),this.type=b$.type,this.options=Object.assign({},b$.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.source).filter(t=>t.markType===tF.component&&"datazoom"===t.componentType),this._data=(0,ek.Z)(this.options.target.data)?t.getDataById(this.options.target.data):this.options.target.data}getEvents(){if(!this._marks||0===this._marks.length)return[];let t=this._marks[0];if(!this._data||!t)return[];let e=this.options.target.filter,i=this.options.target.transform,r=(0,ek.Z)(e)?(i,r)=>{if((0,eB.Z)(r.start)||(0,eB.Z)(r.end))return!0;let n=pA(t.getDatazoomMainScale(),i[e]);return r.startRatio<=n&&r.endRatio>=n}:e;return this._filterData(this._data,t,tz.datazoom,e=>{let i=e.detail.start,r=e.detail.end;return{startRatio:i,endRatio:r,start:t.invertDatazoomRatio(i),end:t.invertDatazoomRatio(r)}},r,i),[{type:"change",handler:this.handleFilter}]}}b$.type="datazoom-filter",b$.defaultOptions={};let bY=(t,e,i)=>{var r;let n=null===(r=null==e?void 0:e.components)||void 0===r?void 0:r.datazoom;return t?lT({},n,{previewData:t},null!=i?i:{}):lT({},n,null!=i?i:{})};class bX extends uI{constructor(t,e){super(t,tG.datazoom,e),this.spec.componentType=tG.datazoom}parseAddition(t){var e;super.parseAddition(t);let{data:i,x:r,y:n,x1:s,y1:a}=null!==(e=t.preview)&&void 0!==e?e:{};return this.preview(i,r,n,s,a),this._updateComponentEncoders(),this}preview(t,e,i,r,n){if(!(0,eB.Z)(this.spec.preview)){let t=this.spec.preview.data,e=(0,ek.Z)(t)?this.view.getDataById(t):t;this.detach(e),this.detach(dh(this.spec.preview.x,this.view)),this.detach(dh(this.spec.preview.y,this.view)),this.detach(dh(this.spec.preview.x1,this.view)),this.detach(dh(this.spec.preview.y1,this.view))}if(this.spec.preview=void 0,t){this.spec.preview={data:t,x:e,y:i,x1:r,y1:n};let s=(0,ek.Z)(t)?this.view.getDataById(t):t;this.attach(s),this.attach(dh(e,this.view)),this.attach(dh(i,this.view)),this.attach(dh(r,this.view)),this.attach(dh(n,this.view))}return this._updateComponentEncoders(),this.commit(),this}setStartEndValue(t,e){let i=this.getGroupGraphicItem();return i&&i.setStartAndEnd&&i.setStartAndEnd(t,e),this}getStartEndValue(){let t=this.getGroupGraphicItem();if(t){let e=t.state;return{start:e.start,end:e.end}}return null}addGraphicItem(t,e){var i;let r=this.spec.skipTheme?null:this.view.getCurrentTheme(),n=Object.assign({},null===(i=null==r?void 0:r.components)||void 0===i?void 0:i.datazoom,t),s=ld.createGraphicComponent(this.componentType,n,{skipDefault:this.spec.skipTheme});return this.setDatazoomHandlers(s),super.addGraphicItem(n,e,s)}reuse(t){return super.reuse(t),this.setDatazoomHandlers(),this}_updateComponentEncoders(){var t;let e=null===(t=this.spec.preview)||void 0===t?void 0:t.data,i=(0,ek.Z)(e)?this.view.getDataById(e):e,r=Object.assign({update:{}},this.spec.encode),n=Object.keys(r).reduce((t,e)=>{let n=r[e];return n&&(t[e]={callback:(t,e,r)=>{var s;let a=this.spec.skipTheme?null:this.view.getCurrentTheme(),o=du(n,t,e,r);return bY(null===(s=null==i?void 0:i.getValue)||void 0===s?void 0:s.call(i),a,o)}}),t},{});this._encoders=n}invertDatazoomRatio(t){let e=this.getDatazoomMainScale();if(e){let i=e.range(),r=(i[i.length-1]-i[0])*t+i[0];return e.invert(r)}return null}getDatazoomMainScale(){var t,e;let i=this.getGroupGraphicItem();if(i&&this.spec.preview){let r="top"===i.attribute.orient||"bottom"===i.attribute.orient?null===(t=this.spec.preview.x)||void 0===t?void 0:t.scale:null===(e=this.spec.preview.y)||void 0===e?void 0:e.scale,n=(0,ek.Z)(r)?this.view.getScaleById(r):r;return null==n?void 0:n.getScale()}return null}setDatazoomHandlers(t){var e;let i=null!=t?t:this.getGroupGraphicItem();i.setStatePointToData(t=>{var e;return this.spec.preview&&null!==(e=this.invertDatazoomRatio(t))&&void 0!==e?e:t});let{data:r,x:n,y:s,x1:a,y1:o}=null!==(e=this.spec.preview)&&void 0!==e?e:{};i.setPreviewPointsX(t=>{if(n&&r)return du({x:n},t,this.elements[0],this.parameters()).x}),i.setPreviewPointsY(t=>{if(s&&r)return du({y:s},t,this.elements[0],this.parameters()).y}),i.setPreviewPointsX1(t=>{if(a&&r)return du({x1:a},t,this.elements[0],this.parameters()).x1}),i.setPreviewPointsY1(t=>{if(o&&r)return du({y1:o},t,this.elements[0],this.parameters()).y1})}}bX.componentType=tG.datazoom;class bK extends fw{constructor(t){super(t)}}(ty=ee||(ee={})).OnPlay="onPlay",ty.OnPause="onPause",ty.OnForward="onForward",ty.OnBackward="onBackward",(tb=ei||(ei={})).Start="start",tb.Pause="pause",tb.Forward="forward",tb.Backward="backward";class bq extends pB{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},bq.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z"},bq.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z"},bq.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},bq.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},bq.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var t,e,i,r;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(t=this._backwardAttr.style.symbolType)&&void 0!==t?t:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(e=this._forwardAttr.style.symbolType)&&void 0!==e?e:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(i=this._backwardAttr.style.symbolType)&&void 0!==i?i:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(r=this._forwardAttr.style.symbolType)&&void 0!==r?r:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{(0,eB.Z)(this._playController)&&(this._playController=new bK(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{(0,eB.Z)(this._backwardController)&&(this._backwardController=new bK(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{(0,eB.Z)(this._forwardController)&&(this._forwardController=new bK(Object.assign({},this._forwardAttr.style)),this.add(this._forwardController))},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._playController.addEventListener("pointerdown",t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()}),this._backwardController.addEventListener("pointerdown",t=>{t.stopPropagation(),this.backward()}),this._forwardController.addEventListener("pointerdown",t=>{t.stopPropagation(),this.forward()}))},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._pauseAttr.style))},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{this._dispatchEvent("ControllerEventEnum.OnPlay")},this.pause=()=>{this._dispatchEvent("ControllerEventEnum.OnPause")},this.forward=()=>{this._dispatchEvent("ControllerEventEnum.OnForward")},this.backward=()=>{this._dispatchEvent("ControllerEventEnum.OnBackward")},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}bq.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},bq.defaultAttributes={[ei.Start]:{},[ei.Pause]:{},[ei.Backward]:{},[ei.Forward]:{}};let bJ={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},bQ=[200,10];(tx=er||(er={})).Default="default",tx.Reverse="reverse";let b0=({direction:t,maxIndex:e,dataIndex:i})=>t===er.Default&&i===e,b1=({direction:t,minIndex:e,dataIndex:i})=>t===er.Reverse&&i===e,b2=({direction:t,maxIndex:e,minIndex:i,dataIndex:r})=>b0({direction:t,maxIndex:e,dataIndex:r})||b1({direction:t,minIndex:i,dataIndex:r}),b5=({direction:t,minIndex:e,dataIndex:i})=>t===er.Default&&i===e,b3=({direction:t,maxIndex:e,dataIndex:i})=>t===er.Reverse&&i===e,b4=({direction:t,maxIndex:e,minIndex:i,dataIndex:r})=>b5({direction:t,minIndex:i,dataIndex:r})||b3({direction:t,maxIndex:e,dataIndex:r}),b6=t=>"top"===t||"bottom"===t,b8=(t,e,i,r)=>"default"===t?Math.min(e+1,r):Math.max(e-1,i);class b7 extends pB{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},b7.defaultAttributes,t)),this._data=[],this._layoutInfo={},this._updateSliderAttrs=()=>{var t,e,i;let r;(0,eg.Z)(this._handlerStyle.size)?r=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(r=(0,eJ.Fp)(this._handlerStyle.size[0],this._handlerStyle.size[1]));let n={visible:this._sliderVisible,min:this._minIndex,max:this._maxIndex,value:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:(0,eg.Z)(r)?r:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1},disableTriggerEvent:this.attribute.disableTriggerEvent};if(b6(this._orient)){let t=Math.max(0,this._layoutInfo.slider.size),i=null!==(e=this._railStyle.height)&&void 0!==e?e:bQ["1"];n.layout="horizontal",n.railHeight=i,n.railWidth=t,n.x=this._layoutInfo.slider.x,n.y=this._layoutInfo.slider.y}else{let t=Math.max(0,this._layoutInfo.slider.size),e=null!==(i=this._railStyle.width)&&void 0!==i?i:bQ["1"];n.layout="vertical",n.railWidth=e,n.railHeight=t,n.x=this._layoutInfo.slider.x,n.y=this._layoutInfo.slider.y}return n},this._initSlider=()=>{let t=this._updateSliderAttrs();this._slider=new yH(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{let t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return b6(this._orient)?t.layout="horizontal":t.layout="vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})}),t},this._initController=()=>{let t=this._updateControllerAttrs();this._controller=new bq(t),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1;let{slider:t={},controller:e={}}=this.attribute;this._sliderVisible=t.visible,this._railStyle=Object.assign({},t.railStyle),this._trackStyle=Object.assign({},t.trackStyle),this._handlerStyle=Object.assign({},t.handlerStyle),this._controllerVisible=e.visible,this._start=Object.assign({},e.start),this._pause=Object.assign({},e.pause),this._forward=Object.assign({},e.forward),this._backward=Object.assign({},e.backward)}_initLayoutInfo(){var t,e,i;let r=[this._start,this._backward,this._forward].sort((t,e)=>t.order-e.order),n=r.filter(t=>"end"!==t.position),s=r.filter(t=>"end"===t.position),a=null!==(t=b6(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:bQ["1"],o=r.reduce((t,e)=>{let i=e.style.size,r=(0,iy.Z)(i)?i:(0,eJ.Fp)(i[0],i[1]);return t+e.space+r},0),l=this._sliderVisible?(b6(this._orient)?null===(e=this._size)||void 0===e?void 0:e.width:null===(i=this._size)||void 0===i?void 0:i.height)-o:0,h=l-this.attribute.slider.space,d=n.reduce((t,e)=>{let{key:i,space:r,style:{size:n}}=e,s=(0,iy.Z)(n)?n:(0,eJ.Fp)(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:s,x:b6(this._orient)?t+r:(this._size.width-s)/2,y:b6(this._orient)?(this._size.height-s)/2:t+r}),t+r+s},0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:h,x:b6(this._orient)?d+this.attribute.slider.space:(this._size.width-a)/2,y:b6(this._orient)?(this._size.height-a)/2:d+this.attribute.slider.space}),s.reduce((t,e)=>{let{key:i,space:r,style:{size:n}}=e,s=(0,iy.Z)(n)?n:(0,eJ.Fp)(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:s,x:b6(this._orient)?t+r:(this._size.width-s)/2,y:b6(this._orient)?(this._size.height-s)/2:t+r}),t+r+s},d+l)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){let t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){let t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){this._dispatchEvent(t,{eventType:t,index:e,value:this._data[e]})}}function b9(){vV(),pC(),fD()}b7.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},bJ),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},bJ),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},bJ),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},bJ),{key:"backward",position:"start"})}},(t_=en||(en={})).change="change",t_.play="play",t_.pause="pause",t_.backward="backward",t_.forward="forward",t_.end="end",t_.OnChange="change",t_.OnPlay="play",t_.OnPause="pause",t_.OnBackward="backward",t_.OnForward="forward",t_.OnEnd="end";b9();class xt extends b7{constructor(t){super(t),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t,e;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3,this._dataIndex=null!==(e=this.attribute.dataIndex)&&void 0!==e?e:this._minIndex;let i=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=i?i:1)):(this._totalDuration=this._interval*i,this._interval=this.attribute.interval)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(ee.OnPlay,t=>{t.stopPropagation(),this.play()}),this._controller.addEventListener(ee.OnPause,t=>{t.stopPropagation(),this.pause()}),this._controller.addEventListener(ee.OnForward,t=>{t.stopPropagation(),this.forward()}),this._controller.addEventListener(ee.OnBackward,t=>{t.stopPropagation(),this.backward()}),this._slider.addEventListener("change",t=>{var e;t.stopPropagation();let i=null===(e=t.detail)||void 0===e?void 0:e.value,r=i/this._maxIndex;this._elapsed=r*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)}))},this._getSliderValue=()=>Math.min(this._elapsed/this._totalDuration*this._maxIndex,this._maxIndex),this._updateSlider=()=>{let t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=t=>{let e=Math.floor(t);e!==this._activeIndex&&(this._dataIndex=e,this._activeIndex=e,e!==this._maxIndex&&this.dispatchCustomEvent(en.change))},this.play=()=>{var t,e,i,r;return t=this,e=void 0,i=void 0,r=function*(){this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(en.play),this._rafId=o2.getRequestAnimationFrame()(this._play.bind(this)))},new(i||(i=Promise))(function(n,s){function a(t){try{l(r.next(t))}catch(t){s(t)}}function o(t){try{l(r.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?n(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(a,o)}l((r=r.apply(t,e||[])).next())})},this._play=()=>{this._elapsed=Date.now()-this._startTime;let t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=o2.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,o2.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(en.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,o2.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(en.pause))},this.backward=()=>{let t=Date.now(),e=1*this._interval,i=this._elapsed-e;i<=0?(this._elapsed=0,this._startTime=t):(this._elapsed=i,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(en.backward)},this.forward=()=>{let t=Date.now(),e=1*this._interval,i=this._elapsed+e;i>=this._totalDuration?(this._startTime=t-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-e,this._elapsed=i),this._updateSlider(),this.dispatchCustomEvent(en.forward)},this._initAttributes(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}}b9();class xe extends b7{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},t)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var t,e,i,r;super._initAttributes(),this._alternate=null!==(t=this.attribute.alternate)&&void 0!==t&&t,this._interval=null!==(e=this.attribute.interval)&&void 0!==e?e:1e3,this._direction=null!==(i=this.attribute.direction)&&void 0!==i?i:er.Default,this._dataIndex=(0,eB.Z)(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(r=this.attribute.dataIndex)&&void 0!==r?r:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(ee.OnPlay,t=>{t.stopPropagation(),this.play()}),this._controller.addEventListener(ee.OnPause,t=>{t.stopPropagation(),this.pause()}),this._controller.addEventListener(ee.OnForward,t=>{t.stopPropagation(),this.forward()}),this._controller.addEventListener(ee.OnBackward,t=>{t.stopPropagation(),this.backward()}),this._slider.addEventListener("change",t=>{let e=Math.floor(t.detail.value)+.5;this._dataIndex=t.detail.value>=e?Math.ceil(t.detail.value):Math.floor(t.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(en.change)}))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,(b2({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||b4({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===er.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(en.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=o2.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=t=>{let e=Date.now();if(this._isReachEnd&&e-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();t&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(en.change),this._activeIndex=this._dataIndex):e-this._tickTime>=this._interval&&(this._tickTime=e,this._updateDataIndex(b8(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(en.change)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=o2.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),o2.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(en.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,o2.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(en.pause))},this.backward=()=>{let t=Math.max(this._dataIndex-1,this._minIndex);this._updateDataIndex(t),this.dispatchCustomEvent(en.change),this.dispatchCustomEvent(en.backward)},this.forward=()=>{let t=Math.min(this._dataIndex+1,this._maxIndex);this._updateDataIndex(t),this.dispatchCustomEvent(en.change),this.dispatchCustomEvent(en.forward)},this._initAttributes(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}}class xi extends yY{constructor(t,e){super(t,e),this.type=xi.type,this.options=Object.assign({},xi.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.source).filter(t=>t.markType===tF.component&&"player"===t.componentType),this._data=(0,ek.Z)(this.options.target.data)?t.getDataById(this.options.target.data):this.options.target.data}getEvents(){if(!this._marks||0===this._marks.length)return[];let t=this._marks[0];if(!this._data||!t)return[];let e=this.options.target.transform;return this._filterData(this._data,t,tz.player,t=>({index:t.detail.index,value:t.detail.value}),void 0,(t,i)=>e?e(t,i):i.value),[{type:en.OnChange,handler:this.handleFilter}]}}xi.type="player-filter",xi.defaultOptions={};let xr=(t,e,i)=>{var r;return lT({},null===(r=null==e?void 0:e.components)||void 0===r?void 0:r.continuousPlayer,{data:t,dataIndex:0},null!=i?i:{})},xn=(t,e,i)=>{var r;return lT({},null===(r=null==e?void 0:e.components)||void 0===r?void 0:r.discretePlayer,{data:t,dataIndex:0},null!=i?i:{})};class xs extends uI{constructor(t,e){super(t,tG.player,e),this.spec.componentType=tG.player,this.spec.playerType="auto"}parseAddition(t){return super.parseAddition(t),this.playerType(t.playerType),this.source(t.source),this}playerType(t){return this.spec.playerType=t,this._playerComponentType=null,this._prepareRejoin(),this.commit(),this}source(t){var e;if(this.spec.source){let t=null===(e=this.spec)||void 0===e?void 0:e.source,i=(0,ev.Z)(t)?null:(0,ek.Z)(t)?this.view.getDataById(t):t;this.detach(i)}this.spec.source=t;let i=(0,ev.Z)(t)?null:(0,ek.Z)(t)?this.view.getDataById(t):t;return this.attach(i),this.commit(),this}play(){return this.getGroupGraphicItem().play(),this}pause(){return this.getGroupGraphicItem().pause(),this}backward(){return this.getGroupGraphicItem().backward(),this}forward(){return this.getGroupGraphicItem().forward(),this}addGraphicItem(t,e,i){let r=lT({slider:{handlerStyle:{size:16}}},t),n=null!=i?i:ld.createGraphicComponent(this._getPlayerComponentType(),r,{skipDefault:this.spec.skipTheme});return super.addGraphicItem(r,e,n)}_updateComponentEncoders(){let t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce((e,i)=>{let r=t[i];return r&&(e[i]={callback:(t,e,i)=>{var n;let s=this.spec.skipTheme?null:this.view.getCurrentTheme(),a=du(r,t,e,i),o=this.spec.source,l=(0,ev.Z)(o)?null:(0,ek.Z)(o)?this.view.getDataById(o):o,h=(0,ev.Z)(o)?o:null!==(n=null==l?void 0:l.getValue())&&void 0!==n?n:[];switch(this._getPlayerComponentType()){case"continuousPlayer":return xr(h,s,a);case"discretePlayer":return xn(h,s,a)}}}),e},{});this._encoders=e}_getPlayerComponentType(){return this._playerComponentType||(this.spec.playerType&&"auto"!==this.spec.playerType?this._playerComponentType="discrete"===this.spec.playerType?"discretePlayer":"continuous"===this.spec.playerType?"continuousPlayer":"discretePlayer":this._playerComponentType="discretePlayer"),this._playerComponentType}}xs.componentType=tG.player;let xa=["heightLimit","lineClamp"];class xo extends mD{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){let{text:t}=this.attribute;return(0,ev.Z)(t)?!t.every(t=>null==t||""===t):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,r,n;let s=rQ(this).text,{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,ellipsis:d=s.ellipsis,maxLineWidth:u,stroke:c=s.stroke,lineWidth:p=s.lineWidth,wordBreak:g=s.wordBreak,fontWeight:f=s.fontWeight,ignoreBuf:m=s.ignoreBuf,heightLimit:v=0,suffixPosition:y=s.suffixPosition,lineClamp:b}=this.attribute,x=null!==(e=n0(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){let t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}let _=new mI(a,{fontSize:h,fontWeight:f,fontFamily:a},ru.graphicUtil.textMeasure),A=t.map(t=>t.toString()),w=[],S=[0,0],T=1/0;if(v>0&&(T=Math.max(Math.floor(v/x),1)),b&&(T=Math.min(T,b)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<A.length;t++){let e=A[t],i=!0;if(t===T-1){let t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,u,d,!1,y);w.push({str:t.str,width:t.width});break}let s=_.textMeasure.clipText(e,_.textOptions,u,"break-word"===g);if(""!==e&&""===s.str){if(d){let t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,u,d,!1,y);s.str=null!==(r=t.str)&&void 0!==r?r:"",s.width=null!==(n=t.width)&&void 0!==n?n:0}else s.str="",s.width=0;i=!1}if(w.push({str:s.str,width:s.width}),s.str.length===e.length);else if(i){let i=e.substring(s.str.length);A.splice(t+1,0,i)}}let t=0;w.forEach(e=>{t=Math.max(t,e.width)}),S[0]=t}else{let t,e,i=0;for(let r=0,n=A.length;r<n;r++){if(r===T-1){let t=_.textMeasure.clipTextWithSuffix(A[r],_.textOptions,u,d,!1,y);w.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=A[r],i=Math.max(i,t=_.textMeasure.measureTextWidth(e,_.textOptions,"break-word"===g)),w.push({str:e,width:t})}S[0]=i}S[1]=w.length*(x+(m?0:2));let k={xOffset:0,yOffset:0,width:S[0],height:S[1]};_.LayoutBBox(k,o,l);let B=_.layoutWithBBox(k,w,o,l,x);return this.cache.layoutData=B,this.clearUpdateShapeTag(),this._AABBBounds.set(k.xOffset,k.yOffset,k.xOffset+k.width,k.yOffset+k.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<xa.length;e++){let i=xa[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<xa.length;e++)if(t===xa[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return xo.NOWORK_ANIMATE_ATTR}}function xl(t){return new xo(t)}function xh(){xh.__loaded||(xh.__loaded=!0,as.RegisterGraphicCreator("wrapText",xl))}xh.__loaded=!1;pC(),xh(),mM();class xd extends pB{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},xd.defaultAttributes,t)),this.name="title"}render(){var t,e,i,r,n,s,a,o,l,h,d,u,c,p,g,f,m,v,y,b,x,_,A,w,S,T,k,B,C,E,M,P,O,R,I,L,D,j,N,F,G,z;let{textType:Z,text:H,subtextType:U,textStyle:V={},subtext:W,subtextStyle:$={},width:Y,height:X,minWidth:K,maxWidth:q,minHeight:J,maxHeight:Q,align:tt,verticalAlign:te,padding:ti=0}=this.attribute,tr=(0,pT.o)(ti),tn=this.createOrUpdateChild("title-container",{x:tr[3],y:tr[0],zIndex:1},"group");if(!1!==this.attribute.visible&&!1!==V.visible){if("rich"===Z||eb(V.character)){let h=Object.assign({x:null!==(t=V.x)&&void 0!==t?t:0,y:null!==(e=V.y)&&void 0!==e?e:0,width:null!==(r=null!==(i=V.width)&&void 0!==i?i:Y)&&void 0!==r?r:0,height:null!==(s=null!==(n=V.height)&&void 0!==n?n:X)&&void 0!==s?s:0,ellipsis:null===(a=V.ellipsis)||void 0===a||a,wordBreak:null!==(o=V.wordBreak)&&void 0!==o?o:"break-word",maxHeight:V.maxHeight,maxWidth:V.maxWidth,textConfig:null!==(l=V.character)&&void 0!==l?l:H},V);this._mainTitle=tn.createOrUpdateChild("mainTitle",h,"richtext")}else if("html"===Z){let t=Object.assign({html:Object.assign(Object.assign({dom:H},fW),V),x:null!==(h=V.x)&&void 0!==h?h:0,y:null!==(d=V.y)&&void 0!==d?d:0,width:null!==(c=null!==(u=V.width)&&void 0!==u?u:Y)&&void 0!==c?c:0,height:null!==(g=null!==(p=V.height)&&void 0!==p?p:X)&&void 0!==g?g:0,ellipsis:null===(f=V.ellipsis)||void 0===f||f,wordBreak:null!==(m=V.wordBreak)&&void 0!==m?m:"break-word",maxHeight:V.maxHeight,maxWidth:V.maxWidth,textConfig:[]},V);this._mainTitle=tn.createOrUpdateChild("mainTitle",t,"richtext")}else eb(H)&&(this._mainTitle=tn.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:(0,ev.Z)(H)?H:[H]},V),{maxLineWidth:null!==(v=V.maxLineWidth)&&void 0!==v?v:Y,heightLimit:V.heightLimit,lineClamp:V.lineClamp,ellipsis:null===(y=V.ellipsis)||void 0===y||y,x:0,y:0}),"wrapText"))}let ts=this._mainTitle?this._mainTitle.AABBBounds.height():0,ta=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==$.visible){if("rich"===U||eb($.character)){let t=Object.assign({x:null!==(b=$.x)&&void 0!==b?b:0,y:null!==(x=$.y)&&void 0!==x?x:0,width:null!==(A=null!==(_=$.width)&&void 0!==_?_:Y)&&void 0!==A?A:0,height:null!==(S=null!==(w=$.height)&&void 0!==w?w:X)&&void 0!==S?S:0,ellipsis:null===(T=$.ellipsis)||void 0===T||T,wordBreak:null!==(k=$.wordBreak)&&void 0!==k?k:"break-word",maxHeight:$.maxHeight,maxWidth:$.maxWidth,textConfig:null!==(B=$.character)&&void 0!==B?B:W},$);this._subTitle=tn.createOrUpdateChild("subTitle",t,"richtext")}else if("html"===U){let t=Object.assign({html:Object.assign(Object.assign({dom:W},fW),$),x:null!==(C=$.x)&&void 0!==C?C:0,y:null!==(E=$.y)&&void 0!==E?E:0,width:null!==(P=null!==(M=$.width)&&void 0!==M?M:Y)&&void 0!==P?P:0,height:null!==(R=null!==(O=$.height)&&void 0!==O?O:X)&&void 0!==R?R:0,ellipsis:null===(I=$.ellipsis)||void 0===I||I,wordBreak:null!==(L=$.wordBreak)&&void 0!==L?L:"break-word",maxHeight:$.maxHeight,maxWidth:$.maxWidth,textConfig:[]},$);this._subTitle=tn.createOrUpdateChild("subTitle",t,"richtext")}else eb(W)&&(this._subTitle=tn.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:(0,ev.Z)(W)?W:[W]},$),{maxLineWidth:null!==(D=$.maxLineWidth)&&void 0!==D?D:Y,heightLimit:$.heightLimit,lineClamp:$.lineClamp,ellipsis:null===(j=$.ellipsis)||void 0===j||j,x:0,y:ts}),"wrapText"))}let to=this._subTitle?this._subTitle.AABBBounds.height():0,tl=this._subTitle?this._subTitle.AABBBounds.width():0,th=Math.max(ta,tl),td=ts+(null!==(N=$.height)&&void 0!==N?N:to);if(eb(Y)&&(th=Y,this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",Y),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",Y)),eb(X)&&(td=X),eb(K)&&th<K&&(th=K),eb(q)&&(this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",q),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",q),this._mainTitle&&this._mainTitle.setAttribute("maxWidth",q),this._subTitle&&this._subTitle.setAttribute("maxWidth",q),th>q&&(th=q)),eb(J)&&td<J&&(td=J),eb(Q)&&(this._mainTitle&&this._mainTitle.setAttribute("maxHeight",Q),this._subTitle&&this._subTitle.setAttribute("maxHeight",Q-ts),td>Q&&(td=Q)),tn.attribute.width=th,tn.attribute.height=td,tn.attribute.boundsPadding=tr,this._mainTitle){if(eb(tt)||eb(V.align)){let t=V.align?V.align:tt,e=null!==(F=V.width)&&void 0!==F?F:ta;"left"===t?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):"center"===t?(this._mainTitle.setAttribute("x",e/2),this._mainTitle.setAttribute("textAlign","center")):"right"===t&&(this._mainTitle.setAttribute("x",e),this._mainTitle.setAttribute("textAlign","right"))}if(eb(te)||eb(V.verticalAlign)){let t=V.verticalAlign?V.verticalAlign:te,e=V.height?V.height:td;"top"===t?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):"middle"===t?(this._mainTitle.setAttribute("y",e/2),this._mainTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._mainTitle.setAttribute("y",e),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(eb(tt)||eb($.align)){let t=$.align?$.align:tt,e=null!==(G=$.width)&&void 0!==G?G:tl;"left"===t?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):"center"===t?(this._subTitle.setAttribute("x",e/2),this._subTitle.setAttribute("textAlign","center")):"right"===t&&(this._subTitle.setAttribute("x",e),this._subTitle.setAttribute("textAlign","right"))}if(eb(te)||eb(V.verticalAlign)){let t=$.verticalAlign?$.verticalAlign:te,e=null!==(z=$.height)&&void 0!==z?z:0;"top"===t?(this._subTitle.setAttribute("y",ts),this._subTitle.setAttribute("textBaseline","top")):"middle"===t?(this._subTitle.setAttribute("y",ts+e/2),this._subTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._subTitle.setAttribute("y",ts+e),this._subTitle.setAttribute("textBaseline","bottom"))}}}}xd.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};let xu=(t,e,i,r)=>{var n;let s=null===(n=null==i?void 0:i.components)||void 0===n?void 0:n.title,a={};return eb(t)&&(a.text=t),eb(e)&&(a.subtext=e),lT({},s,a,null!=r?r:{})};class xc extends uI{constructor(t,e){super(t,tG.title,e),this.spec.componentType=tG.title}parseAddition(t){return super.parseAddition(t),this.title(t.title),this.subTitle(t.subTitle),this}title(t){return this.setFunctionSpec(t,"title")}subTitle(t){return this.setFunctionSpec(t,"subTitle")}_updateComponentEncoders(){let t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce((e,i)=>{let r=t[i];return r&&(e[i]={callback:(t,e,i)=>{let n=this.spec.skipTheme?null:this.view.getCurrentTheme(),s=lt(this.spec.title,i,t,e),a=lt(this.spec.subTitle,i,t,e);return xu(s,a,n,du(r,t,e,i))}}),e},{});this._encoders=e}}xc.componentType=tG.title;function xp(t,e){let i="";return 0===t.length||(t.forEach((t,e)=>{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`}),e&&(i+="Z")),i}function xg(t,e,i,r){let n="";if(!t||0===e.length)return n;let s=e[0],a=ix.distancePP(t,s),o=i?0:1;return r?n+=`M${t.x},${t.y-a}A${a},${a},0,0,${o},${t.x},${t.y+a}A${a},${a},0,0,${o},${t.x},${t.y-a}Z`:e.forEach((t,e)=>{0===e?n=`M${t.x},${t.y}`:n+=`A${a},${a},0,0,${o},${t.x},${t.y}`}),n}class xf extends pB{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this._prevInnerView=this._innerView&&m0(this._innerView),this.removeAllChild(!0),this._innerView=as.group({x:0,y:0,pickable:!1}),this.add(this._innerView);let{items:t,visible:e}=this.attribute;t&&t.length&&!1!==e&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){let r=this.getVerticalVector(e,i,t);return{x:t.x+r[0],y:t.y+r[1]}}_transformItems(t){let e=[];return t.forEach(t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))}),e}_renderGrid(t){let{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(t,e){let i=lT({},this.attribute,this.getGridAttribute(t)),{type:r,items:n,style:s,closed:a,alternateColor:o,depth:l=0}=i,h=t?`${t5.grid}-sub`:`${t5.grid}`;if(n.forEach((t,i)=>{let{id:n,points:o}=t,d="";if("line"===r||"polygon"===r)d=xp(o,!!a);else if("circle"===r){let{center:t}=this.attribute;d=xg(t,o,!1,!!a)}let u=as.path(Object.assign({path:d,z:l},r6(s)?lT({},this.skipDefault?null:xf.defaultAttributes.style,s(t,i)):s));u.name=`${h}-line`,u.id=this._getNodeId(`${h}-path-${n}`),e.add(u)}),l&&"line"===r&&n.forEach((t,i)=>{let{id:r,points:n}=t,o=[];o.push(n[0]);let d=n[1].x-n[0].x,u=n[1].y-n[0].y,c=l/Math.sqrt(d*d+u*u);o.push({x:n[0].x+d*c,y:n[0].y+u*c});let p=xp(o,!!a),g=(0,eJ.Wn)(o[0].x-o[1].x),f=(0,eJ.Wn)(o[0].y-o[1].y),m=as.path(Object.assign({path:p,z:0,alpha:g>f?(n[1].x-n[0].x>0?-1:1)*eJ.pi/2:0,beta:g<f?-eJ.pi/2:0,anchor3d:g>f?[o[0].x,0]:[0,o[0].y]},r6(s)?lT({},this.skipDefault?null:xf.defaultAttributes.style,s(t,i)):s));m.name=`${h}-line`,m.id=this._getNodeId(`${h}-path-${r}`),e.add(m)}),n.length>1&&o){let t=(0,ev.Z)(o)?o:[o,"transparent"],r=e=>t[e%t.length];for(let t=0;t<n.length-1;t++){let[s,a]=[n[t].points,n[t+1].points],o=function(t,e,i){let{type:r,closed:n}=i,s=e.slice(0).reverse(),a="",o="";if("line"===r&&i.smoothLink&&i.center){let e=t[0],r=s[0],l=i.center;a=xp(t,!!n),o=xp(s,!!n);let h=ix.distancePP(r,l),d=ix.distancePP(e,l);a+=`A${h},${h},0,0,1,${r.x},${r.y}L${r.x},${r.y}`,o+=`A${d},${d},0,0,0,${e.x},${e.y}`}else if("circle"===r){let{center:e}=i;a=xg(e,t,!1,!!n),o=xg(e,s,!0,!!n)}else"line"!==r&&"polygon"!==r||(a=xp(t,!!n),o=xp(s,!!n));return n?a+=o:(a+=o="L"+o.substring(1),a+="Z"),a}(s,a,i),l=as.path({path:o,fill:r(t)});l.name=`${h}-region`,l.id=this._getNodeId(`${h}-region-${t}`),e.add(l)}}}_getNodeId(t){return`${this.id}-${t}`}release(){super.release(),this._prevInnerView=null,this._innerView=null}}xf.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}};pC(),vE();class xm extends xf{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},xf.defaultAttributes,t),e)}_getGridPoint(t,e){let i;if("line"===t){let{length:t}=this.attribute;i=[e,this.getVerticalCoord(e,t,!0)]}else if("circle"===t||"polygon"===t){let{center:t,sides:r=6,startAngle:n=fZ,endAngle:s=fH}=this.attribute;i=function(t,e,i,r,n){let s=[],a=n-r;for(let n=0;n<e;n++){let o=r+n*a/e;s.push(e2(t,i,o))}return s}(t,r,ix.distancePP(t,e),n,s)}return i}getGridAttribute(t){let e;let{type:i,alignWithLabel:r=!0}=this.attribute,n=1;this.data.length>=2&&(n=this.data[1].value-this.data[0].value);let s=[];if(t){e=lT({},this.attribute,this.attribute.subGrid);let t=[],{count:a=4}=this.attribute.subGrid||{};if(this.data.length>=2){let e=[];this.data.forEach(t=>{let i=t.value;if(!r){let e=t.value-n/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})});for(let r=0;r<e.length-1;r++){let n=e[r],s=e[r+1];t.push({id:`sub-${r}-0`,points:this._getGridPoint(i,this.getTickCoord(n.value)),datum:{}});for(let e=0;e<a;e++){let o=(e+1)/(a+1),l=(1-o)*n.value+o*s.value,h=this.getTickCoord(l);t.push({id:`sub-${r}-${e+1}`,points:this._getGridPoint(i,h),datum:{}})}r===e.length-2&&t.push({id:`sub-${r}-${a+1}`,points:this._getGridPoint(i,this.getTickCoord(s.value)),datum:{}})}s=t}}else{e=this.attribute;let t=[];this.data.forEach(e=>{let{point:s}=e;if(!r){let t=e.value-n/2;if(this.isInValidValue(t))return;s=this.getTickCoord(t)}t.push({id:e.label,datum:e,points:this._getGridPoint(i,s)})}),s=t}return Object.assign(Object.assign({},e),{items:s})}}cI(xm,vt);var xv=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)0>e.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(i[r[n]]=t[r[n]])}return i};pC(),vE();class xy extends xf{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},xf.defaultAttributes,t),e)}getGridAttribute(t){let e,i=[],r=this.attribute,{radius:n,innerRadius:s=0,startAngle:a=fZ,endAngle:o=fH,center:l,subGrid:h}=r,d=xv(r,["radius","innerRadius","startAngle","endAngle","center","subGrid"]),{alignWithLabel:u=!0}=d||{},c=n-s,p=1;if(this.data.length>=2&&(p=this.data[1].value-this.data[0].value),t){e=lT({},d,h);let t=[],{count:r=4}=h||{},n=this.data.length;if(n>=2){let e=[];this.data.forEach(t=>{let i=t.value;if(!u){let e=t.value-p/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})});for(let i=0;i<n;i++){let n=e[i],s=e[i+1];t.push({id:`sub-${i}-0`,points:[this.getTickCoord(n.value),this.getVerticalCoord(this.getTickCoord(n.value),c,!0)],datum:{}});for(let e=0;e<r;e++){let a=(e+1)/(r+1),o=(1-a)*n.value+a*(s?s.value:u?1:n.value+p),l=this.getTickCoord(o),h=this.getVerticalCoord(l,c,!0);t.push({id:`sub-${i}-${e+1}`,points:[l,h],datum:{}})}}Math.abs(o-a)%(2*Math.PI)==0&&t.push(t[0]),i=t}}else{e=d;let t=[];(Math.abs(o-a)%(2*Math.PI)==0?[...this.data].concat(this.data[0]):this.data).forEach(e=>{let{point:i}=e;if(!u){let t=e.value-p/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}let r=this.getVerticalCoord(i,c,!0);t.push({id:e.id,points:[i,r],datum:e})}),i=t}return Object.assign(Object.assign({},e),{items:i,center:l,type:"line"})}}cI(xy,vR);let xb=(t,e,i,r)=>{var n,s,a,o;let l=null!==(s=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.grid)&&void 0!==s?s:{};return t?lT({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,r))&&void 0!==o?o:[]).map(t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick}))},null!=i?i:{}):lT({},l,null!=i?i:{})},xx=(t,e,i,r)=>{var n,s,a,o;let l=null!==(s=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleGrid)&&void 0!==s?s:{};return t?lT({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,r))&&void 0!==o?o:[]).map(t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick}))},null!=i?i:{}):lT({},l,null!=i?i:{})};class x_ extends vD{constructor(t,e,i){super(t,tG.grid,e),this.spec.componentType=tG.grid,this.mode=i}parseAddition(t){return super.parseAddition(t),this.target(t.target),this.gridType(t.gridType),this.gridShape(t.gridShape),this}scale(t){return super.scale(t),this._gridComponentType=null,this}gridType(t){return this.spec.gridType=t,this._gridComponentType=null,this._prepareRejoin(),this.commit(),this}gridShape(t){return this.spec.gridShape=t,this.commit(),this}target(t){if(this.spec.target){let t=(0,ek.Z)(this.spec.target)?this.view.getMarkById(this.spec.target):this.spec.target;this.detach(t)}this.spec.target=t;let e=(0,ek.Z)(t)?this.view.getMarkById(t):t;return this.attach(e),this._targetAxis=e,this._gridComponentType=null,this._updateComponentEncoders(),this.commit(),this}tickCount(t){let e=(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}addGraphicItem(t,e){let i=lT({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),r=ld.createGraphicComponent(this._getGridComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,r)}_updateComponentEncoders(){let t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce((e,i)=>{let r=t[i];return r&&(e[i]={callback:(t,e,i)=>{var n,s,a,o;let l=this.spec.skipTheme?null:this.view.getCurrentTheme(),h,d=du(r,t,e,i),u=lt(this.spec.baseValue,i,t,e);if(this._targetAxis){let t=null===(n=this._targetAxis.getSpec())||void 0===n?void 0:n.scale;h=(0,ek.Z)(t)?this.view.getScaleById(t):t;let e=this._targetAxis.elements[0];if(e)switch(this._getGridComponentType()){case tH.lineAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),start:e.getGraphicAttribute("start"),end:e.getGraphicAttribute("end"),verticalFactor:null!==(s=e.getGraphicAttribute("verticalFactor"))&&void 0!==s?s:1},d);break;case tH.circleAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),center:e.getGraphicAttribute("center"),radius:e.getGraphicAttribute("radius"),innerRadius:e.getGraphicAttribute("innerRadius"),inside:e.getGraphicAttribute("inside"),startAngle:e.getGraphicAttribute("startAngle"),endAngle:e.getGraphicAttribute("endAngle")},d)}}else{h=(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;let r=lt(this.spec.inside,i,t,e),n=null===(a=null==h?void 0:h.getCoordinate)||void 0===a?void 0:a.call(h);n&&(d=Object.assign(vF(h,n,r,u,this.spec.layout,!0),d))}this._getGridComponentType()===tH.lineAxisGrid&&(d="line"!==this.spec.gridShape&&this.spec.gridShape?Object.assign({center:d.start,closed:!0},d,{type:this.spec.gridShape}):Object.assign({},d,{type:"line"}));let c=null===(o=null==h?void 0:h.getScale)||void 0===o?void 0:o.call(h),p=lt(this.spec.tickCount,i,t,e);switch(this._getGridComponentType()){case tH.lineAxisGrid:return xb(c,l,d,p);case tH.circleAxisGrid:return xx(c,l,d,p)}return d}}),e},{});this._encoders=e}_getGridComponentType(){var t;if(this._gridComponentType)return this._gridComponentType;if(this.spec.gridType)"circle"===this.spec.gridType?this._gridComponentType=tH.circleAxisGrid:this._gridComponentType=tH.lineAxisGrid;else if(this._targetAxis)switch(this._targetAxis.getAxisComponentType()){case tZ.circleAxis:this._gridComponentType=tH.circleAxisGrid;break;case tZ.lineAxis:default:this._gridComponentType=tH.lineAxisGrid}else if(this.spec.scale){let e=(0,ek.Z)(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this._gridComponentType=(null===(t=null==e?void 0:e.getCoordinate)||void 0===t?void 0:t.call(e))?e.getCoordinateAxisPoints()?tH.lineAxisGrid:tH.circleAxisGrid:tH.lineAxisGrid}else this._gridComponentType=tH.lineAxisGrid;return this._gridComponentType}}x_.componentType=tG.grid;class xA extends yY{constructor(t,e){super(t,e),this.type=xA.type,this.options=Object.assign({},xA.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.source).filter(t=>t.markType===tF.component&&"scrollbar"===t.componentType),this._data=(0,ek.Z)(this.options.target.data)?t.getDataById(this.options.target.data):this.options.target.data}getEvents(){if(!this._marks||0===this._marks.length)return[];let t=this._marks[0];if(!this._data||!t)return[];let e=this.options.target.filter,i=this.options.target.transform,r=(0,ek.Z)(e)?(i,r)=>{let n=t.getScale().getScale(),s=n.range(),a=(n.scale(i[e])-s[0])/(s[s.length-1]-s[0]);return r.startRatio<=a&&r.endRatio>=a}:e;return this._filterData(this._data,t,tz.scrollbar,i=>{if((0,ek.Z)(e)){let e=i.detail.value,r=t.getScale();if(r){let t=r.getScale(),i=t.range();return{start:t.invert(e[0]*(i[1]-i[0])+i[0]),end:t.invert(e[1]*(i[1]-i[0])+i[0]),startRatio:e[0],endRatio:e[1]}}return{startRatio:e[0],endRatio:e[1]}}return{startRatio:i.detail.value[0],endRatio:i.detail.value[1]}},r,i),[{type:"scrollUp",handler:this.handleFilter},{type:"scrollDrag",handler:this.handleFilter}]}}function xw(t){return"horizontal"===t}xA.type="scrollbar-filter",xA.defaultOptions={};function xS(t){return"vertical"===t||"horizontal"===t}function xT(t){return"top"===t||"bottom"===t||"left"===t||"right"===t}function xk(t){return"top"===t||"bottom"===t}let xB=(t,e,i,r,n)=>{var s,a,o,l,h;let d=null===(s=null==r?void 0:r.components)||void 0===s?void 0:s.scrollbar,u="horizontal",c="bottom";xS(e)||xT(i)?!xS(e)&&xT(i)?(u=xk(i)?"horizontal":"vertical",c=i):xS(e)&&!xT(i)?(u=e,c=xw(e)?"bottom":"right"):(u=e,c=xw(e)&&!xk(i)?"bottom":"vertical"===e&&xk(i)?"right":i):(u="horizontal",c="bottom");let p={direction:u};if(xw(u)){let e=null!==(o=null!==(a=n.height)&&void 0!==a?a:null==d?void 0:d.height)&&void 0!==o?o:12;"top"===c?Object.assign(p,{width:t.width,height:e,x:0,y:0}):Object.assign(p,{width:t.width,height:e,x:0,y:t.height-e})}else{let e=null!==(h=null!==(l=n.width)&&void 0!==l?l:null==d?void 0:d.width)&&void 0!==h?h:12;"left"===c?Object.assign(p,{width:e,height:t.height,x:0,y:0}):Object.assign(p,{width:e,height:t.height,x:t.width-e,y:0})}return lT({},d,p,null!=n?n:{})};class xC extends vD{constructor(t,e){super(t,tG.scrollbar,e),this.spec.componentType=tG.scrollbar}parseAddition(t){return super.parseAddition(t),this.container(t.container),this.direction(t.direction),this.position(t.position),this}container(t){if(this.spec.container){let t=(0,ek.Z)(this.spec.container)?this.view.getMarkById(this.spec.container):this.spec.container;this.detach(t)}if(this.spec.container=t,t){let e=(0,ek.Z)(t)?this.view.getMarkById(t):t;this.attach(e)}return this.commit(),this}direction(t){return this.setFunctionSpec(t,"direction")}position(t){return this.setFunctionSpec(t,"position")}setScrollStart(t){var e;let i=this.getGroupGraphicItem(),r=null===(e=null==i?void 0:i.attribute)||void 0===e?void 0:e.range;if(i&&r){let e=[t,r[1]-r[0]+t];i.setScrollRange(e)}return this}getScrollRange(){let t=this.getGroupGraphicItem();if(t)return t.getScrollRange()}addGraphicItem(t,e){let i=lT({range:[0,1]},t),r=ld.createGraphicComponent(tG.scrollbar,i,{skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,r)}_updateComponentEncoders(){let t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce((e,i)=>{let r=t[i];return r&&(e[i]={callback:(t,e,i)=>{var n,s;let a=this.spec.skipTheme?null:this.view.getCurrentTheme(),o=lt(this.spec.direction,i,t,e),l=lt(this.spec.position,i,t,e),h=du(r,t,e,i),d=this.spec.container?(0,ek.Z)(this.spec.container)?this.view.getMarkById(this.spec.container):this.spec.container:null,u=(d&&d.markType===tF.group?d:this.group).getGroupGraphicItem();return xB(u?{width:null!==(n=u.attribute.width)&&void 0!==n?n:u.AABBBounds.width(),height:null!==(s=u.attribute.height)&&void 0!==s?s:u.AABBBounds.height()}:{width:this.view.width(),height:this.view.height()},o,l,a,h)}}),e},{});this._encoders=e}}xC.componentType=tG.scrollbar;let xE=(t,e)=>{if(!e||0===e.length)return e;let{extent:i,step:r}=t,n=eb(t.bins)?Math.max(t.bins,1):10,s=i[1]-i[0],a=eb(r)?r:s/n;return e.map(e=>{var r,n,s,o;let l=Object.assign({},e),h=Math.floor((e[t.field]-i[0])/a),d=i[0]+h*a,u=Math.min(i[1],i[0]+(h+1)*a);return l[null!==(n=null===(r=t.as)||void 0===r?void 0:r[0])&&void 0!==n?n:"binStart"]=d,l[null!==(o=null===(s=t.as)||void 0===s?void 0:s[1])&&void 0!==o?o:"binEnd"]=u,l})},xM=(t,e,i,r,n,s)=>{let a=[i[0]>=s?1:0,i[1]>=s?1:0,i[2]>=s?1:0,i[3]>=s?1:0],o=[];a[0]!==a[1]&&o.push({id:`${t}-${e-1}-${t}-${e}`,currentCell:e*n+t,nextCell:(e-1)*n+t,point:{x:t+(s-i[0])/(i[1]-i[0]),y:e},siblingPoint:null}),a[1]!==a[2]&&o.push({id:`${t}-${e}-${t+1}-${e}`,currentCell:e*n+t,nextCell:e*n+t+1,point:{x:t+1,y:e+(s-i[1])/(i[2]-i[1])},siblingPoint:null}),a[2]!==a[3]&&o.push({id:`${t}-${e}-${t}-${e+1}`,currentCell:e*n+t,nextCell:(e+1)*n+t,point:{x:t+(s-i[3])/(i[2]-i[3]),y:e+1},siblingPoint:null}),a[3]!==a[0]&&o.push({id:`${t-1}-${e}-${t}-${e}`,currentCell:e*n+t,nextCell:e*n+t-1,point:{x:t,y:e+(s-i[0])/(i[3]-i[0])},siblingPoint:null});let l=(8&a[0])+(4&a[1])+(2&a[2])+(1&a[3]);return 6===l||9===l?(o[0].siblingPoint=o[1],o[1].siblingPoint=o[0],o[2].siblingPoint=o[3],o[3].siblingPoint=o[2]):2===o.length&&(o[0].siblingPoint=o[1],o[1].siblingPoint=o[0]),o},xP=(t,e)=>{let i=t.siblingPoint,r=xO(t,e);return"loop"===r.result?r.points:xO(i,e).points.reverse().concat(r.points)},xO=(t,e)=>{let i=[t],r=t,n=t=>t.id===r.id,s="break";do{let t=e[r.nextCell],a=null==t?void 0:t.find(n);if(a){if(r=a.siblingPoint,i.includes(r)){s="loop",i.push(r);break}if(!r)break;i.push(r)}else r=null}while(r);return{points:i,result:s}},xR=(t,e)=>{var i;if(!e||0===e.length)return e;let r=t.row,n=t.column,s=r-1,a=n-1,o=e.map(e=>e[t.field]),l=[ew(o),eA(o)],h=null!==(i=t.thresholds)&&void 0!==i?i:[];if(!eb(t.thresholds)&&(0,eg.Z)(t.levels)){let e=(l[1]-l[0])/t.levels;for(let i=1;i<t.levels;i++)h.push(l[0]+i*e)}let d=[];for(let t=1;t<r;t++)for(let e=1;e<n;e++){let i=o[(t-1)*n+e-1],r=o[(t-1)*n+e],s=o[t*n+e],a=o[t*n+e-1];d.push([i,r,s,a])}let u=[];return h.forEach(e=>{var i,o;let l=[],h=[];for(let t=0;t<s;t++)for(let i=0;i<a;i++){let r=d[t*a+i],n=xM(i,t,r,0,a,e);l.push(...n),h.push(n)}let c=l.slice();do{let s=xP(c[0],h);if(c.splice(0,1),s.length){let a=s.map(t=>t.id);c=c.filter(t=>!a.includes(t.id));let l={[null!==(i=t.asThreshold)&&void 0!==i?i:"threshold"]:e,[null!==(o=t.asPoints)&&void 0!==o?o:"points"]:s.map(t=>({x:t.point.x/r,y:t.point.y/n}))};u.push(l)}}while(c.length>0)}),u},xI=(t,e)=>{if((t<e||(0,eB.Z)(t))&&!(0,eB.Z)(e))return -1;if((t>e||(0,eB.Z)(e))&&!(0,eB.Z)(t))return 1;let i=e instanceof Date?+e:e,r=t instanceof Date?+t:t;return Number.isNaN(r)&&!Number.isNaN(i)?-1:Number.isNaN(i)&&!Number.isNaN(r)?1:0},xL=(t,e,i)=>(e.push(0),(r,n)=>{let s,a=0,o=-1;for(;0===a&&o+1<i;)o+=1,a=xI((s=t[o])(r),s(n));return a*e[o]}),xD=(t,e)=>{var i,r;return 1===t.length?(i=t[0],r=e[0],(t,e)=>xI(i(t),i(e))*r):xL(t,e,t.length)},xj=(t,e,i={})=>{let r=ex(e)||[],n=[],s=[],a={},o=i.comparator||xD;return ex(t).forEach((t,e)=>{var o;if((0,eB.Z)(t))return;n.push("desc"===r[e]?-1:1);let l=r6(t)?t:l0(t,null,i);s.push(l),(o=l,((0,eB.Z)(o)?null:o.fields)||[]).forEach(t=>{a[t]=1})}),0===s.length?null:lY(o(s,n),Object.keys(a))},xN=(t,e)=>{let i=t.sort;if(i&&e){let t=r6(i)?i:xj(i.field,i.order);e.sort((e,i)=>t(e,i))}return e},xF=(t,e,i)=>e.filter(e=>t.callback(e,i)),xG=(t,e,i)=>{let r=t.callback,n=t.as;if(!t.all)return e.forEach(t=>{let e=r(t,i);if(!(0,eB.Z)(n)){if((0,eB.Z)(t))return;t[n]=e}return e}),e;let s=r(e,i);return(0,eB.Z)(n)||(0,eB.Z)(e)?s:(e[n]=s,e)},xz=["x","kde"],xZ=["x","y","kde"],xH=Math.sqrt(2*Math.PI),xU=Math.sqrt((2*Math.PI)**2),xV=(t,e=1)=>Math.exp(-(t**2)/2)/(1===e?xH:2===e?xU:Math.sqrt((2*Math.PI)**e)),xW=(t,e=1)=>{let i=t.length,r=t.reduce((t,e)=>t+e.x,0)/i,n=Math.sqrt(t.reduce((t,e)=>t+(e.x-r)**2,0)/i),s=t.sort((t,e)=>t.x-e.x).map(t=>t.x),a=cz(s,.25);return .9*Math.min(n,(cz(s,.75)-a)/1.34)*i**-.2},x$=(t,e=1)=>t.length**(-1/(e+4)),xY=(t,e,i)=>{let r=e.length;return e.reduce((e,r)=>e+xV(Math.abs(t.x-r.x)/i,1),0)/(r*i)},xX=(t,e,i)=>{let r=e.length;return e.reduce((e,r)=>e+xV(ix.distancePP(t,r)/i**2,1),0)/(r*i**2)},xK=(t,e)=>{var i,r,n,s,a,o,l,h,d,u,c,p,g,f,m,v,y,b,x,_,A;if(!e||0===e.length)return e;let w=null!==(i=t.dimension)&&void 0!==i?i:"1d",S=ex(t.field),T=ex(null!==(r=t.bins)&&void 0!==r?r:256),k=ex(t.as);if("1d"===w){let i=e.map(t=>({x:t[S[0]]})),r=null!==(n=t.bandwidth)&&void 0!==n?n:xW(i),u=i.reduce((t,e)=>Math.min(t,e.x),i[0].x),c=i.reduce((t,e)=>Math.max(t,e.x),i[0].x),p=null!==(a=null===(s=t.extent)||void 0===s?void 0:s[0])&&void 0!==a?a:u,g=null!==(l=null===(o=t.extent)||void 0===o?void 0:o[1])&&void 0!==l?l:c,f=[(0,iy.Z)(p)?p:null!==(h=p.x)&&void 0!==h?h:u,(0,iy.Z)(g)?g:null!==(d=g.x)&&void 0!==d?d:c],m=(f[1]-f[0])/T[0];return Array(T[0]).fill(0).map((t,e)=>{var n,s;let a=Math.min(f[0]+m*(e+.5),f[1]);return{[null!==(n=k[0])&&void 0!==n?n:"x"]:a,[null!==(s=k[1])&&void 0!==s?s:"x"]:xY({x:a},i,r)}})}if("2d"===w){let i=e.map(t=>({x:t[S[0]],y:t[S[1]]})),r=t.bandwidth||x$(i,2),n=i.reduce((t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y)}),i[0]),s=i.reduce((t,e)=>({x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)}),i[0]),a=null!==(c=null===(u=t.extent)||void 0===u?void 0:u[0])&&void 0!==c?c:n,o=null!==(g=null===(p=t.extent)||void 0===p?void 0:p[1])&&void 0!==g?g:s,l=[(0,iy.Z)(a)?{x:a,y:a}:{x:null!==(f=a.x)&&void 0!==f?f:n.x,y:null!==(m=a.y)&&void 0!==m?m:n.y},(0,iy.Z)(o)?{x:o,y:o}:{x:null!==(v=o.x)&&void 0!==v?v:s.x,y:null!==(y=o.y)&&void 0!==y?y:s.y}],h=T[0],d=null!==(b=T[1])&&void 0!==b?b:T[0],w=(l[1].x-l[0].x)/h,B=(l[1].y-l[0].y)/d,C=[];for(let t=0;t<d;t++)for(let e=0;e<h;e++){let n=Math.min(l[0].x+w*(e+.5),l[1].x),s=Math.min(l[0].y+B*(t+.5),l[1].y);C.push({[null!==(x=k[0])&&void 0!==x?x:"x"]:n,[null!==(_=k[1])&&void 0!==_?_:"y"]:s,[null!==(A=k[2])&&void 0!==A?A:"kde"]:xX({x:n,y:s},i,r)})}return C}return[]},xq=(t,e)=>{let i=eC.Y.getInstance(),r=t.as,{fields:n,from:s,key:a,values:o}=t,l=l0(a),h=(s||[]).reduce((t,e)=>(t[l(e)]=e,t),{}),d=(0,eB.Z)(t.default)?null:t.default,u=n.map(t=>l0(t));if(o){n.length>1&&!r&&i.error('Multi-field lookup requires explicit "as" parameter.'),r&&r.length!==n.length*o.length&&i.error('The "as" parameter has too few output field names.'),(0,eB.Z)(r)&&(r=o);let t=o.map(t=>l0(t));return e.map(e=>u.reduce((i,n,s)=>{let a=h[n(e)],l=o.length;return((0,eB.Z)(a)?t.map(t=>d):t.map(t=>t(a))).reduce((t,e,i)=>(t[r[s*l+i]]=e,t),i)},e))}return r||i.error("Missing output field names."),e.map(t=>u.reduce((e,i,n)=>{let s=h[i(t)];return e[r[n]]=(0,eB.Z)(s)?d:s,e},t))};function xJ(t){return t.reduce((t,e)=>t+e,0)}let xQ=(t,e)=>{var i,r;let{fields:n=[]}=t,s=(i=n,r=t.as||[],i?i.map((t,e)=>{var i,n;return null!==(i=r[e])&&void 0!==i?i:(0,ek.Z)(t)?t:(n=t,(0,eB.Z)(n)?null:n.fname)}):null),a=n.map(t=>(0,ek.Z)(t)?l0(t):t);return a.length?e.map((t,e)=>{var i,r,n;return i=t,r=a,n=s,r.reduce((t,e,r)=>(t[n[r]]=e(i),t),{})}):e.map((t,e)=>({}))},x0=t=>{let{start:e,stop:i,step:r=1,as:n="data"}=t;return cn(e,i,r).map(t=>({[n]:t}))},x1=(t,e)=>{var i;let r=new Map,n=new Map,s=null!==(i=t.offset)&&void 0!==i?i:"diverging";return e.map(e=>{var i;let a=e[t.dimensionField],o="diverging"===s?e[t.stackField]:Math.abs(e[t.stackField]),l=o>=0?r:n,h=null!==(i=l.get(a))&&void 0!==i?i:0,d=o+h;return l.set(a,d),{dimension:a,value:o,stack:d,prevStack:h,datum:e}})},x2=(t,e)=>{if(!e||0===e.length)return e;let i=dw(e,l0("dimension"));return i.keys.forEach(t=>{let e=i.data.get(t);if(!e||e.length<=0)return 0;let r=-e.reduce((t,e)=>t+e.value,0)/2;e.forEach(t=>{t.stack=t.stack+r,t.prevStack=t.prevStack+r})}),e},x5=(t,e)=>{if(!e||0===e.length)return e;let i=dw(e,l0("dimension"));return i.keys.forEach(t=>{let e=i.data.get(t);if(!e||e.length<=0)return 0;let r=e.length,n=-1/(r+1)*e.reduce((t,e,i)=>e.value*(r-i+1),0);e.forEach(t=>{t.stack=t.stack+n,t.prevStack=t.prevStack+n})}),e},x3=(t,e)=>{if(!(t.asPercentStack||t.asPrevPercentStack||t.asPercent||t.asSum))return e.map(e=>{var i;let{stack:r,prevStack:n,datum:s}=e,a=Object.assign({},s);return a[null!==(i=t.asStack)&&void 0!==i?i:t.stackField]=r,t.asPrevStack&&(a[t.asPrevStack]=n),a});let i=new Map,r=new Map;return e.forEach(t=>{var e;let{dimension:n,value:s}=t,a=s>=0?i:r;a.set(n,(null!==(e=a.get(n))&&void 0!==e?e:0)+s)}),e.map(e=>{var n,s;let{dimension:a,value:o,stack:l,prevStack:h,datum:d}=e,u=Object.assign({},d),c=null!==(n=(o>=0?i:r).get(a))&&void 0!==n?n:0;return u[null!==(s=t.asStack)&&void 0!==s?s:t.stackField]=l,t.asPrevStack&&(u[t.asPrevStack]=h),t.asSum&&(u[t.asSum]=c),t.asPercent&&(u[t.asPercent]=0===c?0:o/c),t.asPercentStack&&(u[t.asPercentStack]=0===c?0:l/c),t.asPrevPercentStack&&(u[t.asPrevPercentStack]=0===c?0:h/c),u})},x4=(t,e)=>{var i;let r=null!==(i=t.offset)&&void 0!==i?i:"diverging",n="negative"===t.order?e.slice().reverse():e,s=x1(t,n);"silhouette"===r?x2(0,s):"wiggle"===r&&x5(0,s);let a=x3(t,s);return"negative"===t.order?a.reverse():a},x6=(t,e)=>{if(!e||!e.length)return[];let{fields:i,asKey:r="key",asValue:n="value",retains:s}=t,a=[];for(let t=0,o=e.length;t<o;t++){let o=e[t];i.forEach(t=>{let e={};if(s)s.forEach(t=>{e[t]=o[t]});else for(let t in o)-1===i.indexOf(t)&&(e[t]=o[t]);e[r]=t,e[n]=o[t],a.push(e)})}return a},x8={sum:t=>t.reduce((t,e)=>t+e,0),min:t=>ew(t),max:t=>eA(t),count:t=>t.length,mean:t=>t.reduce((t,e)=>t+e,0)/t.length},x7=(t,e)=>{var i;if(!e||!e.length)return[];let r=[],n={},s=t.keyField,a=t.valueField,o=x8[null!==(i=t.aggregateType)&&void 0!==i?i:"sum"];if(t.groupBy){let i=ex(t.groupBy);e.forEach(t=>{if(!t)return;let e={},r=[];i.forEach(i=>{e[i]=t[i],r.push(t[i])});let o=r.join("~");n[o]?n[o].values[t[s]]?n[o].values[t[s]].push(t[a]):n[o].values[t[s]]=[t[a]]:n[o]={datum:e,values:{[t[s]]:[t[a]]}}})}else n[0]={datum:{},values:{}},e.forEach(t=>{t&&(n[0].values[t[s]]?n[0].values[t[s]].push(t[a]):n[0].values[t[s]]=[t[a]])});return Object.keys(n).forEach(t=>{let e=n[t].datum,i=n[t].values;Object.keys(i).forEach(t=>{let r=i[t];e[t]=o(r)}),r.push(e)}),r},x9=(t,e)=>{var i,r;let{field:n,asTransformRatio:s,asReachRatio:a,asHeightRatio:o,asValueRatio:l,asNextValueRatio:h,asLastValueRatio:d,asLastValue:u,asCurrentValue:c,asNextValue:p,heightVisual:g=!1,isCone:f=!0,range:m}=t,v=e.reduce((t,e)=>Math.max(t,Number.parseFloat(e[n])||-Infinity),-Infinity),y=e.reduce((t,e)=>Math.min(t,Number.parseFloat(e[n])||1/0),1/0),b=[null!==(i=null==m?void 0:m.min)&&void 0!==i?i:y,null!==(r=null==m?void 0:m.max)&&void 0!==r?r:v];return e.map((t,i)=>{var r,m;let v=Object.assign({},t),y=Number.parseFloat(v[n]),x=Number.parseFloat(null===(r=e[i-1])||void 0===r?void 0:r[n]),_=Number.parseFloat(null===(m=e[i+1])||void 0===m?void 0:m[n]),A=(0,eg.Z)(_*y)?_/y:null,w=(0,eg.Z)(y*y)?y/x:null;return u&&(v[u]=x),p&&(v[p]=_),s&&(v[s]=A),a&&(v[a]=0===i?1:w),o&&(v[o]=!0===g?A:1/e.length),l&&(v[l]=y/b[1]),h&&(v[h]=i===e.length-1?f?0:v[l]:_/b[1]),d&&(v[d]=0===i?1:x/b[1]),c&&(v[c]=y),v})},_t=(t,e)=>{var i,r;if(!e||0===e.length)return e;let n=t.field,s=null!==(i=t.startAngle)&&void 0!==i?i:0,a=null!==(r=t.endAngle)&&void 0!==r?r:2*Math.PI,{asStartAngle:o,asEndAngle:l,asMiddleAngle:h,asRadian:d,asRatio:u,asQuadrant:c,asK:p}=t,g=e.reduce((t,e)=>Number.parseFloat(e[n])+t,0),f=e.reduce((t,e)=>Math.max(t,Number.parseFloat(e[n])),-Infinity),m=a-s,v=s,y=e.map(t=>{var e;let i=Object.assign({},t),r=Number.parseFloat(i[n])/g,s=r*m;return u&&(i[u]=r),o&&(i[o]=v),l&&(i[l]=v+s),h&&(i[h]=v+s/2),d&&(i[d]=s),c&&(i[c]=(e=function(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}(e=v+s/2))>0&&e<=Math.PI/2?2:e>Math.PI/2&&e<=Math.PI?3:e>Math.PI&&e<=3*Math.PI/2?4:1),p&&(i[p]=Number.parseFloat(i[n])/f),v=i[l],i});return y[y.length-1][l]=a,y},_e=t=>"width"in t?{x0:0,x1:t.width,y0:0,y1:t.height,width:t.width,height:t.height}:{x0:Math.min(t.x0,t.x1),x1:Math.max(t.x0,t.x1),y0:Math.min(t.y0,t.y1),y1:Math.max(t.y0,t.y1),width:Math.abs(t.x1-t.x0),height:Math.abs(t.y1-t.y0)},_i=(t,e)=>{let i,r;let n=r6(e)?e:t=>t;if(t&&t.length){let e=t.length;for(let s=0;s<e;s+=1){let e=n(t[s]);(0,eB.Z)(e)||!(0,iy.Z)(e=+e)||Number.isNaN(e)||((0,eB.Z)(i)?(i=e,r=e):(i=Math.min(i,e),r=Math.max(r,e)))}}return[i,r]},_r=(t,e)=>{var i,r,n,s,a,o,l,h,d,u,c,p,g,f,m;if(!e||0===e.length)return[];let v=_e(t),y=null!==(i=t.startAngle)&&void 0!==i?i:0,b=null!==(r=t.endAngle)&&void 0!==r?r:2*Math.PI,x=Math.max(v.width/2,v.height/2),_=dV(null!==(n=t.innerRadius)&&void 0!==n?n:0,x),A=dV(t.outerRadius,x),w=[(0,iy.Z)(null===(s=t.center)||void 0===s?void 0:s[0])?t.center[0]:v.x0+dV(null!==(o=null===(a=t.center)||void 0===a?void 0:a[0])&&void 0!==o?o:"50%",v.width),(0,iy.Z)(null===(l=t.center)||void 0===l?void 0:l[1])?t.center[1]:v.y0+dV(null!==(d=null===(h=t.center)||void 0===h?void 0:h[1])&&void 0!==d?d:"50%",v.height)],S=l0(t.field),T=e.map(S),[k,B]=_i(T),C=k===B?t=>(_+A)/2:t=>_+(A-_)*(t-k)/(B-k),E=(0,eB.Z)(t.radiusField)?S:l0(t.radiusField),M=null!==(c=null===(u=null==t?void 0:t.radiusRange)||void 0===u?void 0:u[1])&&void 0!==c?c:5,P=t=>M;if(E){let[i,r]=E!==S?_i(e.map(E)):[k,B],n=null!==(g=null===(p=t.radiusRange)||void 0===p?void 0:p[0])&&void 0!==g?g:5,s=null!==(m=null===(f=t.radiusRange)||void 0===f?void 0:f[1])&&void 0!==m?m:5;i!==r&&(P=t=>n+(s-n)*(E(t)-i)/(r-i))}let O=Math.min(y,b),R=Math.max(y,b),I=_n(O,R,e.length),L=[],D=(R-O)/60;return e.forEach((t,e)=>{let i=C(T[e]),r=P(t),n,s,a=I[e];for(let t=0;t<60&&(n=w[0]+i*Math.cos(a),_s({x:n,y:s=w[1]+i*Math.sin(a),radius:r},L)||n-r<v.x0||n+r>v.x1||s-r<v.y0||s+r>v.y1);t++)t<59&&((a+=D)>R?a=O:a<O&&(a=R));L.push({x:n,y:s,radius:r,datum:t})}),L},_n=(t,e,i)=>{let r=0,n=Math.max(Math.ceil(2*(e-t)/Math.PI),2),s=(e-t)/n,a=0,o=1,l=0,h=0,d=[],u=t;for(;l<i;)h<n&&(d.push(u+(h%2?Math.floor(h/2)+Math.floor(n/2):h/2)*s*o),h++),l++,h===n&&(h=0,a+=1,o*=-1,0===r?r=s/2:r/=2,u=-1===o?e-r:t+r,a>=2&&(s/=2,n*=2));return d},_s=(t,e)=>!(!e||!e.length)&&e.some(e=>Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(t.radius+e.radius,2)),_a={min:ew,max:eA,average:function(t){return 0===t.length?0:xJ(t)/t.length},sum:xJ};function _o(t,e,i,r){let n=Math.floor(e.length/t),s=[],a=e.length,o,l,h,d=0,u=0;s[u++]=d;for(let t=1;t<a-1;t+=n){let i=Math.min(t+n,a-1),c=Math.min(t+2*n,a),p=(c+i)/2,g=0;for(let t=i;t<c;t++){let i=e[t][r];Number.isNaN(i)||(g+=i)}g/=c-i;let f=t,m=Math.min(t+n,a),v=t-1,y=e[d][r];o=-1,h=f;for(let t=f;t<m;t++){let i=e[t][r];Number.isNaN(r)||(l=Math.abs((v-p)*(i-y)-(v-t)*(g-y)))>o&&(o=l,h=t)}s[u++]=h,d=h}return s[u-1]!==a-1&&(s[u++]=a-1),s.map(t=>i?e[t].i:t)}function _l(t,e,i,r,n){let s=Math.floor(e.length/t),a=[],o=e.length,l=0,h=[];a.push(l),e[l][n]=e[l][n];for(let t=1;t<o-1;t+=s){s>o-t&&(s=o-t,h.length=s),h=[];for(let i=0;i<s;i++)h.push(e[t+i][n]);let i=_a[r](h);e[l=Math.min(Math.round(t+h.length/2)||0,o-1)][n]=i,a.push(l)}return a.map(t=>i?e[t].i:t)}function _h(t,e,i,r){return _l(t,e,i,"min",r)}function _d(t,e,i,r){return _l(t,e,i,"max",r)}function _u(t,e,i,r){return _l(t,e,i,"average",r)}function _c(t,e,i,r){return _l(t,e,i,"sum",r)}let _p=(t,e)=>{let i=t.size,r=t.factor||1;if(Array.isArray(i)&&(i=Math.floor(i[1]-i[0])),(i*=r)<=0)return[];if(e.length<=i)return e;if(t.skipfirst)return e.slice(0,1);let{mode:n,yfield:s,groupBy:a}=t,o=null!=s?s:"y",l=_o;if("min"===n?l=_h:"max"===n?l=_d:"average"===n?l=_u:"sum"===n&&(l=_c),e.length){let t={};if(a){for(let i=0,r=e.length;i<r;i++){let r=e[i],n=r[a];t[n]||(t[n]=[]),t[n].push({[o]:r[o],i:i})}let r=[];return Object.keys(t).forEach(n=>{let s=t[n];if(s.length<=i){let t=s.map(t=>t.i);r=r.concat(t)}else{let t=l(i,s,!0,o);r=r.concat(t),s.forEach(t=>e[t.i][o]=t[o])}}),r.sort((t,e)=>t-e),r.map(t=>e[t])}return l(i,e,!1,o).map(t=>e[t])}return[]},_g="_mo_hide_",_f=(t,e)=>{if(!e||0===e.length)return;let{radius:i}=t;(0,eB.Z)(i)&&"symbol"===e[0].mark.markType&&(i=!0);let{direction:r,delta:n,deltaMul:s=1,groupBy:a}=t,o=e=>{var a;(a=e).forEach(t=>{t.getGraphicAttribute(_g)&&(t.setGraphicAttribute("visible",!0),t.setGraphicAttribute(_g,!1))});let o=t.sort?e.slice().sort((t,e)=>t.getGraphicAttribute("x")-e.getGraphicAttribute("x")):e;0===r?function(t,e,i,r){if(r){let r=-Infinity,n=-Infinity,s=0,a=0,o=(0,eB.Z)(e),l=e;t.forEach(t=>{if(!1===t.getGraphicAttribute("visible"))return;let e=t.getGraphicAttribute("size")/2,h=t.getGraphicAttribute("x"),d=t.getGraphicAttribute("y");o&&(l=(e+s)*i),(a=(r-h)**2+(n-d)**2)<(l+s+e)**2?t.getGraphicAttribute("forceShow")||(t.setGraphicAttribute(_g,!0),t.setGraphicAttribute("visible",!1)):n=d,s=e})}}(o,n,s,i):1===r?function(t,e,i,r){if(r){let r=-Infinity,n=0,s=(0,eB.Z)(e),a=e;t.forEach(t=>{if(!1===t.getGraphicAttribute("visible"))return;let e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("x");s&&(a=(e+n)*i),Math.abs(o-r)<a+n+e?t.getGraphicAttribute("forceShow")||(t.setGraphicAttribute(_g,!0),t.setGraphicAttribute("visible",!1)):r=o,n=e})}}(o,n,s,i):function(t,e,i,r){if(r){let r=-Infinity,n=0,s=(0,eB.Z)(e),a=e;t.forEach(t=>{if(!1===t.getGraphicAttribute("visible"))return;let e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("y");s&&(a=(e+n)*i),Math.abs(o-r)<a+n+e?t.getGraphicAttribute("forceShow")||(t.setGraphicAttribute(_g,!0),t.setGraphicAttribute("visible",!1)):r=o,n=e})}}(o,n,s,i)};if(a){let t=e.reduce((t,e)=>{let i=e.getDatum()[a];return t[i]?t[i].push(e):t[i]=[e],t},{});Object.keys(t).forEach(e=>{o(t[e])})}else o(e);return e},_m=":vGrammar_identifier:",_v=(t,e,i,r)=>{(0,eB.Z)(r[_m])&&(r[_m]=0);let n=r[_m],s=t.as;return e.forEach(t=>{t&&(0,eB.Z)(t[s])&&(n+=1,t[s]=n)}),r[_m]=n,n},_y=(t,e)=>{var i,r,n;if(!e||0===e.length||!(null===(i=e[0])||void 0===i?void 0:i.mark))return e;let s=e[0].mark,a=Object.values(s.getScales()).find(px);if(!a)return e;let o=s.getScalesByChannel(),l=p_(a),h=(0,eB.Z)(t.dodgeChannel)?o.y===a||o.y1===a||o.x&&!px(o.x)||o.x1&&!px(o.x1)?"y":"x":t.dodgeChannel;if(l>0){let i=null!==(r=t.innerGap)&&void 0!==r?r:0,a=null!==(n=t.categoryGap)&&void 0!==n?n:"20%",o=t=>t.groupKey;if(!(0,eB.Z)(t.dodgeBy)){let e=lK(ex(t.dodgeBy));o=t=>e(t.getDatum())}let d=[];e.forEach(t=>{let e=o(t);d.includes(e)||d.push(e)});let u=d.length;if(u<1)return e;let c=dV(a,l),p=c>=l?l:l-c,g=dV(i,p),f=(p-Math.max(u-1,0)*g)/u;f>t.maxWidth?(p-=(f-t.maxWidth)*u,f=t.maxWidth):f<t.minWidth&&t.minWidth<=l/u&&(p+=(t.minWidth-f)*u,f=t.minWidth);let m={};d.forEach((t,e)=>{m[t]=-p/2+e*(f+g)});let v=s.markType;"rect"===v||"interval"===v||"arc"===v?e.forEach(t=>{let e=m[o(t)],i=t.getItemAttribute();if("x"===h){let r={x:((0,eB.Z)(i.width)&&!(0,eB.Z)(i.x1)?Math.min(i.x,i.x1):i.x)+((0,eB.Z)(i.width)?(0,eB.Z)(i.x1)?l:Math.abs(i.x1-i.x):i.width)/2+e};(0,eB.Z)(i.width)?r.x1=r.x+f:r.width=f,t.setItemAttributes(r)}else if("y"===h){let r={y:((0,eB.Z)(i.height)&&!(0,eB.Z)(i.y1)?Math.min(i.y,i.y1):i.y)+((0,eB.Z)(i.height)?(0,eB.Z)(i.y1)?l:Math.abs(i.y1-i.y):i.height)/2+e};(0,eB.Z)(i.height)?r.y1=r.y+f:r.height=f,t.setItemAttributes(r)}}):e.forEach(t=>{let e=m[o(t)];if("x"===h){let i=t.getItemAttribute("x")+l/2+e+f/2;t.setItemAttributes({x:i}),"rule"===v&&t.setItemAttributes({x1:i})}else if("y"===h){let i=t.getItemAttribute("y")+l/2+e+f/2;t.setItemAttributes({y:i}),"rule"===v&&t.setItemAttributes({y1:i})}})}return e},_b=(t,e,i)=>{var r,n,s,a;let o=e[0].mark,l=null===(r=o.getScalesByChannel())||void 0===r?void 0:r[i],h=null!==(n=t.random)&&void 0!==n?n:Math.random,d=Math.min(null!==(s="x"===i?t.widthRatio:t.heightRatio)&&void 0!==s?s:.4,.5),u=null!==(a="x"===i?t.bandWidth:t.bandHeight)&&void 0!==a?a:p_(l);if((0,eB.Z)(u)){let t=_i(e,t=>t.getItemAttribute(i));if((0,eB.Z)(t[0])||(0,eB.Z)(t[1])||t[0]===t[1]){let e=o.view.getViewBox();t="x"===i?[e.x1,e.x2]:[e.y1,e.y2]}let r=e.length;e.forEach((e,n)=>{e.setItemAttributes({[i]:t[0]+(t[1]-t[0])*h(n,r)})})}else{let t=e.length;e.forEach((e,r)=>{let n=e.getItemAttribute(i),s=[n-d*u,n+d*u];e.setItemAttributes({[i]:s[0]+(s[1]-s[0])*h(r,t)})})}},_x=(t,e)=>{var i;return e&&0!==e.length&&(null===(i=e[0])||void 0===i?void 0:i.mark)?_b(t,e,"y"):e},__=(t,e)=>{var i;return e&&0!==e.length&&(null===(i=e[0])||void 0===i?void 0:i.mark)?_b(t,e,"x"):e},_A=(t,e)=>{var i;return e&&0!==e.length&&(null===(i=e[0])||void 0===i?void 0:i.mark)&&(_b(t,e,"x"),_b(t,e,"y")),e},_w=(t,e,i)=>{let r=`${e}1`,n=t.some(t=>!(0,eB.Z)(t.getItemAttribute(r))),s=n?t.map(t=>(t.getItemAttribute(r)+t.getItemAttribute(e))/2):t.map(t=>t.getItemAttribute(e)),a="min"===i?ew(s):eA(s);return(0,eg.Z)(a)&&t.forEach((t,i)=>{let o=a-s[i];n?t.setItemAttributes({[r]:t.getItemAttribute(r)+o,[e]:t.getItemAttribute(e)+o}):t.setItemAttributes({[e]:t.getItemAttribute(e)+o})}),t},_S=(t,e)=>{var i,r;return e&&0!==e.length&&(null===(i=e[0])||void 0===i?void 0:i.mark)?_w(e,null!==(r=t.channel)&&void 0!==r?r:"y",t.align):e},_T=(t,e,i)=>{var r;let n=t.getGraphicAttribute("clipRangeByDimension",!1),s=null!==(r=t.getGraphicAttribute("clipRange",!1))&&void 0!==r?r:1;return e&&e.clipDimension?{from:{clipRange:0,clipRangeByDimension:e.clipDimension},to:{clipRange:s,clipRangeByDimension:n}}:{from:{clipRange:0},to:{clipRange:s}}},_k=(t,e,i)=>{var r;let n=t.getGraphicAttribute("clipRangeByDimension",!0),s=null!==(r=t.getGraphicAttribute("clipRange",!0))&&void 0!==r?r:1;return e&&e.clipDimension?{from:{clipRange:s,clipRangeByDimension:e.clipDimension},to:{clipRange:0,clipRangeByDimension:n}}:{from:{clipRange:s},to:{clipRange:0}}},_B=(t,e,i)=>{var r,n,s;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(r=t.getGraphicAttribute("opacity",!1))&&void 0!==r?r:1,fillOpacity:null!==(n=t.getGraphicAttribute("fillOpacity",!1))&&void 0!==n?n:1,strokeOpacity:null!==(s=t.getGraphicAttribute("strokeOpacity",!1))&&void 0!==s?s:1}}},_C=(t,e,i)=>{var r,n,s;return{from:{opacity:null!==(r=t.getGraphicAttribute("opacity",!0))&&void 0!==r?r:1,fillOpacity:null!==(n=t.getGraphicAttribute("fillOpacity",!0))&&void 0!==n?n:1,strokeOpacity:null!==(s=t.getGraphicAttribute("strokeOpacity",!0))&&void 0!==s?s:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}},_E=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{let e=t.getGraphicAttribute("x",!1),i=t.getGraphicAttribute("x1",!1),r=t.getGraphicAttribute("width",!1);return{from:eb(r)?{x:e+r/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0},to:{x:e,x1:i,width:r}}}case"y":{let e=t.getGraphicAttribute("y",!1),i=t.getGraphicAttribute("y1",!1),r=t.getGraphicAttribute("height",!1);return{from:eb(r)?{y:e+r/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0},to:{y:e,y1:i,height:r}}}default:{let e=t.getGraphicAttribute("x",!1),i=t.getGraphicAttribute("x1",!1),r=t.getGraphicAttribute("width",!1),n=t.getGraphicAttribute("y",!1),s=t.getGraphicAttribute("y1",!1),a=t.getGraphicAttribute("height",!1),o={};return eb(r)?(o.x=e+r/2,o.width=0,o.x1=void 0):(o.x=(e+i)/2,o.x1=(e+i)/2,o.width=void 0),eb(a)?(o.y=n+a/2,o.height=0,o.y1=void 0):(o.y=(n+s)/2,o.y1=(n+s)/2,o.height=void 0),{from:o,to:{x:e,y:n,x1:i,y1:s,width:r,height:a}}}}},_M=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{let e=t.getGraphicAttribute("x",!1),i=t.getGraphicAttribute("x1",!1),r=t.getGraphicAttribute("width",!1);return{to:eb(r)?{x:e+r/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0}}}case"y":{let e=t.getGraphicAttribute("y",!1),i=t.getGraphicAttribute("y1",!1),r=t.getGraphicAttribute("height",!1);return{to:eb(r)?{y:e+r/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0}}}default:{let e=t.getGraphicAttribute("x",!1),i=t.getGraphicAttribute("y",!1),r=t.getGraphicAttribute("x1",!1),n=t.getGraphicAttribute("y1",!1),s=t.getGraphicAttribute("width",!1),a=t.getGraphicAttribute("height",!1),o={};return eb(s)?(o.x=e+s/2,o.width=0,o.x1=void 0):(o.x=(e+r)/2,o.x1=(e+r)/2,o.width=void 0),eb(a)?(o.y=i+a/2,o.height=0,o.y1=void 0):(o.y=(i+n)/2,o.y1=(i+n)/2,o.height=void 0),{to:o}}}},_P=(t,e,i)=>{var r;return!1!==(null!==(r=null==e?void 0:e.overall)&&void 0!==r&&r)?function(t,e,i){var r;let n;let s=t.getGraphicAttribute("x",!1),a=t.getGraphicAttribute("x1",!1),o=t.getGraphicAttribute("width",!1);return e&&"negative"===e.orient?(0,iy.Z)(e.overall)?n=e.overall:i.group?(n=null!==(r=i.groupWidth)&&void 0!==r?r:i.group.getBounds().width(),i.groupWidth=n):n=i.width:n=(0,iy.Z)(null==e?void 0:e.overall)?null==e?void 0:e.overall:0,{from:{x:n,x1:(0,eB.Z)(a)?void 0:n,width:(0,eB.Z)(o)?void 0:0},to:{x:s,x1:a,width:o}}}(t,e,i):function(t,e,i){let r=t.getGraphicAttribute("x",!1),n=t.getGraphicAttribute("x1",!1),s=t.getGraphicAttribute("width",!1);if(e&&"negative"===e.orient){let t=eb(s)?Math.max(r,r+s):Math.max(r,n);return{from:{x:t,x1:(0,eB.Z)(n)?void 0:t,width:(0,eB.Z)(s)?void 0:0},to:{x:r,x1:n,width:s}}}let a=eb(s)?Math.min(r,r+s):Math.min(r,n);return{from:{x:a,x1:(0,eB.Z)(n)?void 0:a,width:(0,eB.Z)(s)?void 0:0},to:{x:r,x1:n,width:s}}}(t,e,0)},_O=(t,e,i)=>{var r;return!1!==(null!==(r=null==e?void 0:e.overall)&&void 0!==r&&r)?function(t,e,i){var r;let n;let s=t.getGraphicAttribute("x1",!1),a=t.getGraphicAttribute("width",!1);return e&&"negative"===e.orient?(0,iy.Z)(e.overall)?n=e.overall:i.group?(n=null!==(r=i.groupWidth)&&void 0!==r?r:i.group.getBounds().width(),i.groupWidth=n):n=i.width:n=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0,{to:{x:n,x1:(0,eB.Z)(s)?void 0:n,width:(0,eB.Z)(a)?void 0:0}}}(t,e,i):function(t,e,i){let r=t.getGraphicAttribute("x",!1),n=t.getGraphicAttribute("x1",!1),s=t.getGraphicAttribute("width",!1);if(e&&"negative"===e.orient){let t=eb(s)?Math.max(r,r+s):Math.max(r,n);return{to:{x:t,x1:(0,eB.Z)(n)?void 0:t,width:(0,eB.Z)(s)?void 0:0}}}let a=eb(s)?Math.min(r,r+s):Math.min(r,n);return{to:{x:a,x1:(0,eB.Z)(n)?void 0:a,width:(0,eB.Z)(s)?void 0:0}}}(t,e,0)},_R=(t,e,i)=>{var r;return!1!==(null!==(r=null==e?void 0:e.overall)&&void 0!==r&&r)?function(t,e,i){var r;let n;let s=t.getGraphicAttribute("y",!1),a=t.getGraphicAttribute("y1",!1),o=t.getGraphicAttribute("height",!1);return e&&"negative"===e.orient?(0,iy.Z)(e.overall)?n=e.overall:i.group?(n=null!==(r=i.groupHeight)&&void 0!==r?r:i.group.getBounds().height(),i.groupHeight=n):n=i.height:n=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0,{from:{y:n,y1:(0,eB.Z)(a)?void 0:n,height:(0,eB.Z)(o)?void 0:0},to:{y:s,y1:a,height:o}}}(t,e,i):function(t,e,i){let r=t.getGraphicAttribute("y",!1),n=t.getGraphicAttribute("y1",!1),s=t.getGraphicAttribute("height",!1);if(e&&"negative"===e.orient){let t=eb(s)?Math.max(r,r+s):Math.max(r,n);return{from:{y:t,y1:(0,eB.Z)(n)?void 0:t,height:(0,eB.Z)(s)?void 0:0},to:{y:r,y1:n,height:s}}}let a=eb(s)?Math.min(r,r+s):Math.min(r,n);return{from:{y:a,y1:(0,eB.Z)(n)?void 0:a,height:(0,eB.Z)(s)?void 0:0},to:{y:r,y1:n,height:s}}}(t,e,0)},_I=(t,e,i)=>{var r;return!1!==(null!==(r=null==e?void 0:e.overall)&&void 0!==r&&r)?function(t,e,i){var r;let n;let s=t.getGraphicAttribute("y1",!1),a=t.getGraphicAttribute("height",!1);return e&&"negative"===e.orient?(0,iy.Z)(e.overall)?n=e.overall:i.group?(n=null!==(r=i.groupHeight)&&void 0!==r?r:i.group.getBounds().height(),i.groupHeight=n):n=i.height:n=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0,{to:{y:n,y1:(0,eB.Z)(s)?void 0:n,height:(0,eB.Z)(a)?void 0:0}}}(t,e,i):function(t,e,i){let r=t.getGraphicAttribute("y",!1),n=t.getGraphicAttribute("y1",!1),s=t.getGraphicAttribute("height",!1);if(e&&"negative"===e.orient){let t=eb(s)?Math.max(r,r+s):Math.max(r,n);return{to:{y:t,y1:(0,eB.Z)(n)?void 0:t,height:(0,eB.Z)(s)?void 0:0}}}let a=eb(s)?Math.min(r,r+s):Math.min(r,n);return{to:{y:a,y1:(0,eB.Z)(n)?void 0:a,height:(0,eB.Z)(s)?void 0:0}}}(t,e,0)},_L=(t,e,i)=>e&&"anticlockwise"===e.orient?{from:{startAngle:t.getGraphicAttribute("endAngle",!1)},to:{startAngle:t.getGraphicAttribute("startAngle",!1)}}:{from:{endAngle:t.getGraphicAttribute("startAngle",!1)},to:{endAngle:t.getGraphicAttribute("endAngle",!1)}},_D=(t,e,i)=>{if(e&&"anticlockwise"===e.orient){let i=(0,iy.Z)(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:i,endAngle:i},to:{startAngle:t.getGraphicAttribute("startAngle",!1),endAngle:t.getGraphicAttribute("endAngle",!1)}}}let r=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:r,endAngle:r},to:{startAngle:t.getGraphicAttribute("startAngle",!1),endAngle:t.getGraphicAttribute("endAngle",!1)}}},_j=(t,e,i)=>{var r;return!1!==(null!==(r=null==e?void 0:e.overall)&&void 0!==r&&r)?_D(t,e):_L(t,e)},_N=(t,e,i)=>e&&"anticlockwise"===e.orient?{from:{startAngle:t.getGraphicAttribute("startAngle",!0)},to:{startAngle:t.getGraphicAttribute("endAngle",!1)}}:{from:{endAngle:t.getGraphicAttribute("endAngle",!0)},to:{endAngle:t.getGraphicAttribute("startAngle",!1)}},_F=(t,e,i)=>{if(e&&"anticlockwise"===e.orient){let i=(0,iy.Z)(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}}let r=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:r,endAngle:r}}},_G=(t,e,i)=>{var r;return!1!==(null!==(r=null==e?void 0:e.overall)&&void 0!==r&&r)?_F(t,e):_N(t,e)},_z=(t,e,i)=>e&&"inside"===e.orient?{from:{innerRadius:t.getGraphicAttribute("outerRadius",!1)},to:{innerRadius:t.getGraphicAttribute("innerRadius",!1)}}:{from:{outerRadius:t.getGraphicAttribute("innerRadius",!1)},to:{outerRadius:t.getGraphicAttribute("outerRadius",!1)}},_Z=(t,e,i)=>{let r=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:r,outerRadius:r},to:{innerRadius:t.getGraphicAttribute("innerRadius",!1),outerRadius:t.getGraphicAttribute("outerRadius",!1)}}},_H=(t,e,i)=>{var r;return!1!==(null!==(r=null==e?void 0:e.overall)&&void 0!==r&&r)?_Z(t,e):_z(t,e)},_U=(t,e,i)=>e&&"inside"===e.orient?{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0)},to:{innerRadius:t.getGraphicAttribute("outerRadius",!1)}}:{from:{outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{outerRadius:t.getGraphicAttribute("innerRadius",!1)}},_V=(t,e,i)=>{let r=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0),outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{innerRadius:r,outerRadius:r}}},_W=(t,e,i)=>{var r;return!1!==(null!==(r=null==e?void 0:e.overall)&&void 0!==r&&r)?_V(t,e):_U(t,e)},_$=(t,e,i)=>{let r=t.getGraphicAttribute("points",!1),n={x:0,y:0};return r.forEach(t=>{n.x+=t.x,n.y+=t.y}),n.x/=r.length,n.y/=r.length,e&&e.center&&((0,eg.Z)(e.center.x)&&(n.x=e.center.x),(0,eg.Z)(e.center.y)&&(n.y=e.center.y)),"area"===t.mark.markType&&(n.x1=n.x,n.y1=n.y),r.map(()=>Object.assign(n))},_Y=(t,e,i)=>({from:{points:_$(t,e)},to:{points:t.getGraphicAttribute("points",!1)}}),_X=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:_$(t,e)}}),_K=(t,e,i)=>t.getGraphicAttribute("points",!1).map(t=>{var r;if(e&&"negative"===e.orient){let e=i.width;return i.group&&(e=null!==(r=i.groupWidth)&&void 0!==r?r:i.group.getBounds().width(),i.groupWidth=e),{x:e,y:t.y,x1:e,y1:t.y1,defined:!1!==t.defined}}return{x:0,y:t.y,x1:0,y1:t.y1,defined:!1!==t.defined}}),_q=(t,e,i)=>({from:{points:_K(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),_J=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:_K(t,e,i)}}),_Q=(t,e,i)=>t.getGraphicAttribute("points",!1).map(t=>{var r;if(e&&"negative"===e.orient){let e=i.height;return i.group&&(e=null!==(r=i.groupHeight)&&void 0!==r?r:i.group.getBounds().height(),i.groupHeight=e),{x:t.x,y:e,x1:t.x1,y1:e,defined:!1!==t.defined}}return{x:t.x,y:0,x1:t.x1,y1:0,defined:!1!==t.defined}}),_0=(t,e,i)=>({from:{points:_Q(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),_1=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:_Q(t,e,i)}}),_2=(t,e,i)=>{var r,n;let s=null===(n=null===(r=t.mark)||void 0===r?void 0:r.coord)||void 0===n?void 0:n.output(),a=s.isTransposed(),o="polar"===s.type,l={orient:"negative",direction:a&&!o?"x":"y"};return e&&!0!==e.overall?function(t,e,i){if(e&&"x"===e.direction){let i=t.getGraphicAttribute("x",!1),r=t.getGraphicAttribute("x1",!1);return"negative"===e.orient?{from:{x:r,x1:r},to:{x:i,x1:r}}:{from:{x:i,x1:i},to:{x:i,y1:r}}}let r=t.getGraphicAttribute("y",!1),n=t.getGraphicAttribute("y1",!1);return e&&"negative"===e.orient?{from:{y:n,y1:n},to:{y:r,y1:n}}:{from:{y:r,y1:r},to:{y:r,y1:n}}}(t,l,0):function(t,e,i){var r,n;let s;if(e&&"x"===e.direction){let n;let s=t.getGraphicAttribute("x",!1),a=t.getGraphicAttribute("x1",!1);return"negative"===e.orient?(0,iy.Z)(e.overall)?n=e.overall:i.group?(n=null!==(r=i.groupWidth)&&void 0!==r?r:i.group.getBounds().width(),i.groupWidth=n):n=i.width:n=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0,{from:{x:n,x1:n},to:{x:s,y1:a}}}let a=t.getGraphicAttribute("y",!1),o=t.getGraphicAttribute("y1",!1);return e&&"negative"===e.orient?(0,iy.Z)(e.overall)?s=e.overall:i.group?(s=null!==(n=i.groupHeight)&&void 0!==n?n:i.group.getBounds().height(),i.groupHeight=s):s=i.height:s=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0,{from:{y:s,y1:s},to:{y:a,y1:o}}}(t,l,i)},_5=(t,e,i)=>{var r,n;let s=null===(n=null===(r=t.mark)||void 0===r?void 0:r.coord)||void 0===n?void 0:n.output(),a=s.isTransposed(),o="polar"===s.type,l={orient:"negative",direction:a&&!o?"x":"y"};return e&&!0!==e.overall?function(t,e,i){if(e&&"x"===e.direction){let i=t.getGraphicAttribute("x",!1),r=t.getGraphicAttribute("x1",!1),n=t.getGraphicAttribute("x",!0),s=t.getGraphicAttribute("x1",!0);return"negative"===e.orient?{from:{x:n,x1:s},to:{x:r,x1:r}}:{from:{x:n,x1:s},to:{x:i,x1:i}}}let r=t.getGraphicAttribute("y",!1),n=t.getGraphicAttribute("y1",!1),s=t.getGraphicAttribute("y",!0),a=t.getGraphicAttribute("y1",!0);return e&&"negative"===e.orient?{from:{y:s,y1:a},to:{y:n,y1:n}}:{from:{y:s,y1:a},to:{y:r,y1:r}}}(t,l,0):function(t,e,i){var r,n;let s;if(e&&"x"===e.direction){let n;let s=t.getGraphicAttribute("x",!0),a=t.getGraphicAttribute("x1",!0);return"negative"===e.orient?(0,iy.Z)(e.overall)?n=e.overall:i.group?(n=null!==(r=i.groupWidth)&&void 0!==r?r:i.group.getBounds().width(),i.groupWidth=n):n=i.width:n=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0,{from:{x:s,x1:a},to:{x:n,x1:n}}}let a=t.getGraphicAttribute("y",!0),o=t.getGraphicAttribute("y1",!0);return e&&"negative"===e.orient?(0,iy.Z)(e.overall)?s=e.overall:i.group?(s=null!==(n=i.groupHeight)&&void 0!==n?n:i.group.getBounds().height(),i.groupHeight=s):s=i.height:s=(0,iy.Z)(null==e?void 0:e.overall)?e.overall:0,{from:{y:a,y1:o},to:{y:s,y1:s}}}(t,l,i)},_3=(t,e,i)=>{var r,n;let{offset:s=0,orient:a,direction:o,point:l}=null!=e?e:{},h=0,d=0;"negative"===a&&(i.group?(h=null!==(r=i.groupWidth)&&void 0!==r?r:i.group.getBounds().width(),d=null!==(n=i.groupHeight)&&void 0!==n?n:i.group.getBounds().height(),i.groupWidth=h,i.groupHeight=d):(h=i.width,d=i.height)),h+=s,d+=s;let u=r6(l)?l.call(null,t.getDatum(),t,i):l,c=u&&(0,eg.Z)(u.x)?u.x:h,p=u&&(0,eg.Z)(u.y)?u.y:d;switch(o){case"x":return{from:{x:c},to:{x:t.getGraphicAttribute("x",!1)}};case"y":return{from:{y:p},to:{y:t.getGraphicAttribute("y",!1)}};default:return{from:{x:c,y:p},to:{x:t.getGraphicAttribute("x",!1),y:t.getGraphicAttribute("y",!1)}}}},_4=(t,e,i)=>{var r,n;let{offset:s=0,orient:a,direction:o,point:l}=null!=e?e:{},h=i.group?i.group.getBounds():null,d=null!==(r=null==h?void 0:h.width())&&void 0!==r?r:i.width,u=null!==(n=null==h?void 0:h.height())&&void 0!==n?n:i.height,c=r6(l)?l.call(null,t.getDatum(),t,i):l,p=c&&(0,eg.Z)(c.x)?c.x:("negative"===a?d:0)+s,g=c&&(0,eg.Z)(c.y)?c.y:("negative"===a?u:0)+s;switch(o){case"x":return{from:{x:t.getGraphicAttribute("x",!0)},to:{x:p}};case"y":return{from:{y:t.getGraphicAttribute("y",!0)},to:{y:g}};default:return{from:{x:t.getGraphicAttribute("x",!0),y:t.getGraphicAttribute("y",!0)},to:{x:p,y:g}}}},_6=(t,e,i)=>{var r,n,s,a;switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:0},to:{scaleX:null!==(r=t.getGraphicAttribute("scaleX",!1))&&void 0!==r?r:1}};case"y":return{from:{scaleY:0},to:{scaleY:null!==(n=t.getGraphicAttribute("scaleY",!1))&&void 0!==n?n:1}};default:return{from:{scaleX:0,scaleY:0},to:{scaleX:null!==(s=t.getGraphicAttribute("scaleX",!1))&&void 0!==s?s:1,scaleY:null!==(a=t.getGraphicAttribute("scaleY",!1))&&void 0!==a?a:1}}}},_8=(t,e,i)=>{var r,n,s,a;switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:null!==(r=t.getGraphicAttribute("scaleX",!0))&&void 0!==r?r:1},to:{scaleX:0}};case"y":return{from:{scaleY:null!==(n=t.getGraphicAttribute("scaleY",!0))&&void 0!==n?n:1},to:{scaleY:0}};default:return{from:{scaleX:null!==(s=t.getGraphicAttribute("scaleX",!0))&&void 0!==s?s:1,scaleY:null!==(a=t.getGraphicAttribute("scaleY",!0))&&void 0!==a?a:1},to:{scaleX:0,scaleY:0}}}},_7={symbol:["_mo_hide_","visible"]},_9=(t,e,i)=>{let r;let n=Object.assign({},t.getPrevGraphicAttributes()),s=Object.assign({},t.getNextGraphicAttributes());return e&&ex(e.excludeChannels).forEach(t=>{delete n[t],delete s[t]}),t.mark&&t.mark.markType&&(r=_7[t.mark.markType])&&r.forEach(t=>{delete n[t],delete s[t]}),Object.keys(s).forEach(t=>{ds(t,n,s)&&(delete n[t],delete s[t])}),{from:n,to:s}},At=(t,e,i)=>{var r;let n=null!==(r=t.getGraphicAttribute("angle",!1))&&void 0!==r?r:0,s=0;return{from:{angle:s=dq(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:(0,eg.Z)(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2},to:{angle:n}}},Ae=(t,e,i)=>{var r;let n=null!==(r=t.getGraphicAttribute("angle",!0))&&void 0!==r?r:0,s=0;return s=dq(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:(0,eg.Z)(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:n},to:{angle:s}}};class Ai extends yW{constructor(t,e){super(t,e),this.type=Ai.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},Ai.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}start(t){t&&this._marks&&this._marks.includes(t.mark)&&t.addState(this.options.state)}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&t.removeState(this.options.state)}}Ai.type="element-active",Ai.defaultOptions={state:tq.active,trigger:"pointerover",triggerOff:"pointerout"};let Ar=t=>t.filterField?e=>{var i;return null===(i=e.getDatum())||void 0===i?void 0:i[t.filterField]}:e=>e[t.filterType],An=(t,e)=>{if(!e||!t)return null;let i={};return t.forEach(t=>{let r=t&&t.getSpec(),n=r&&r.encode;n&&e.forEach(e=>{e&&n[e]&&(i[e]||(i[e]=[]),i[e].push(t))})}),i};class As extends yW{constructor(t,e){super(t,e),this.type=As.type,this.clearPrevElements=()=>{let{state:t,reverseState:e}=this.options;this._statedElements&&this._statedElements.length&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:this._statedElements,options:this.options}),this._statedElements=[])},this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},As.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=An(this._marks,[this.options.state,this.options.reverseState])}getEvents(){let t=this.options.triggerOff,e=this.options.trigger,i=[{type:e,handler:this.handleStart}],r=t;return"empty"===t?(r=e,this._resetType="view"):"none"===t?(r=null,this._resetType=null):(0,ek.Z)(t)?t.includes("view:")?(r=t.replace("view:",""),this._resetType="view"):(r=t,this._resetType="self"):(0,iy.Z)(t)?(r=null,this._resetType="timeout"):this._resetType=null,r&&r!==e&&i.push({type:r,handler:this.handleReset}),i}start(t){let{state:e,reverseState:i,isMultiple:r}=this.options;t&&this._marks&&this._marks.includes(t.mark)?t.hasState(e)?"self"===this._resetType&&(this._statedElements=this.updateStates(this._statedElements&&this._statedElements.filter(e=>e!==t),this._statedElements,e,i)):(this._timer&&clearTimeout(this._timer),t.addState(e),this._statedElements=this.updateStates(r&&this._statedElements?[...this._statedElements,t]:[t],this._statedElements,e,i),this.dispatchEvent("start",{elements:this._statedElements,options:this.options}),"timeout"===this._resetType&&(this._timer=setTimeout(()=>{this.clearPrevElements()},this.options.triggerOff))):"view"===this._resetType&&this._statedElements&&this._statedElements.length&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;let e=t&&this._marks&&this._marks.includes(t.mark);"view"!==this._resetType||e?"self"===this._resetType&&e&&this.clearPrevElements():this.clearPrevElements()}}As.type="element-select",As.defaultOptions={state:tq.selected,trigger:"click"};class Aa extends yW{constructor(t,e){super(t,e),this.type=Aa.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},Aa.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=An(this._marks,[this.options.highlightState,this.options.blurState])}getEvents(){let t=this.options.triggerOff,e=[{type:this.options.trigger,handler:this.handleStart}],i=t;return(0,ek.Z)(t)&&t.includes("view:")?(i=t.replace("view:",""),this._resetType="view"):this._resetType="self",e.push({type:i,handler:this.handleReset}),e}clearPrevElements(){let{highlightState:t,blurState:e}=this.options;this._lastElement&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:[this._lastElement],options:this.options}),this._lastElement=null,this._statedElements=null)}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){let{highlightState:e,blurState:i}=this.options;this._lastElement!==t&&(this._statedElements=this.updateStates([t],this._statedElements,e,i),this._lastElement=t,this.dispatchEvent("start",{elements:[t],options:this.options}))}else this._lastElement&&"view"===this._resetType&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;let e=t&&this._marks&&this._marks.includes(t.mark);"view"!==this._resetType||e?"self"===this._resetType&&e&&this.clearPrevElements():this.clearPrevElements()}}Aa.type="element-highlight",Aa.defaultOptions={highlightState:tq.highlight,blurState:tq.blur,trigger:"pointerover",triggerOff:"pointerout"};class Ao extends yW{constructor(t,e){super(t,e),this.type=Ao.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{t.element&&this._marks&&this._marks.includes(t.element.mark)&&this.clearPrevElements()},this.options=Object.assign({},Ao.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){this._marks.forEach(t=>{t.elements.forEach(t=>{t.removeState(this.options.highlightState),t.removeState(this.options.blurState)})})}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){let e=t.key;!(0,eB.Z)(e)&&this._marks.forEach(t=>{t.elements.forEach(t=>{t.key===e?(t.removeState(this.options.blurState),t.addState(this.options.highlightState)):(t.removeState(this.options.highlightState),t.addState(this.options.blurState))})})}}reset(t){if(t&&this._marks&&this._marks.includes(t.mark)){let e=t.key;!(0,eB.Z)(e)&&this._marks.forEach(t=>{t.elements.forEach(t=>{t.key===e?(t.removeState(this.options.blurState),t.addState(this.options.highlightState)):(t.removeState(this.options.highlightState),t.addState(this.options.blurState))})})}}}Ao.type="element-highlight-by-key",Ao.defaultOptions={highlightState:tq.highlight,blurState:tq.blur,trigger:"pointerover",triggerOff:"pointerout"};class Al extends yW{constructor(t,e){super(t,e),this.type=Al.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},Al.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){this._marks.forEach(t=>{t.elements.forEach(t=>{t.removeState(this.options.highlightState),t.removeState(this.options.blurState)})})}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){let e=t.groupKey;!(0,eB.Z)(e)&&this._marks.forEach(t=>{t.elements.forEach(t=>{t.groupKey===e?(t.removeState(this.options.blurState),t.addState(this.options.highlightState)):(t.removeState(this.options.highlightState),t.addState(this.options.blurState))})})}}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&this.clearPrevElements()}}Al.type="element-highlight-by-group",Al.defaultOptions={highlightState:tq.highlight,blurState:tq.blur,trigger:"pointerover",triggerOff:"pointerout"};class Ah extends yW{constructor(t,e){super(t,e),this.type=Ah.type,this.handleStart=t=>{var e,i;this.start(null===(i=null===(e=t.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},Ah.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:t6.legendItemHover,handler:this.handleStart},{type:t6.legendItemUnHover,handler:this.handleReset}]}start(t){if((0,eB.Z)(t))return;let e=Ar(this.options);this._marks.forEach(i=>{i.elements.forEach(i=>{e(i)===t?i.addState(this.options.state):i.removeState(this.options.state)})})}reset(){this._marks.forEach(t=>{t.elements.forEach(t=>{t.removeState(this.options.state)})})}}Ah.type="element-active-by-legend",Ah.defaultOptions={state:tq.active,filterType:"groupKey"};class Ad extends yW{constructor(t,e){super(t,e),this.type=Ad.type,this.handleStart=(t,e)=>{var i,r;this.start(null===(r=null===(i=t.detail)||void 0===i?void 0:i.data)||void 0===r?void 0:r.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},Ad.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:t6.legendItemHover,handler:this.handleStart},{type:t6.legendItemUnHover,handler:this.handleReset}]}start(t){if((0,eB.Z)(t))return;let e=Ar(this.options);this._marks.forEach(i=>{i.elements.forEach(i=>{e(i)===t?(i.removeState(this.options.blurState),i.addState(this.options.highlightState)):(i.removeState(this.options.highlightState),i.addState(this.options.blurState))})})}reset(){this._marks.forEach(t=>{t.elements.forEach(t=>{t.removeState(this.options.blurState),t.removeState(this.options.highlightState)})})}}Ad.type="element-highlight-by-legend",Ad.defaultOptions={highlightState:tq.highlight,blurState:tq.blur,filterType:"groupKey"};class Au extends yW{constructor(t,e){super(t,e),this.type=Au.type,this.handleStart=(t,e)=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){let i=this._parseTargetKey(t,e);this.start(i)}},this.handleReset=t=>{(this.options.shouldReset?this.options.shouldReset(t):this._filterByName(t))&&this.reset()},this.options=Object.assign({},Au.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}_filterByName(t){var e;let i=ex(this.options.graphicName);return(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.name)&&i.includes(t.target.name)}_parseTargetKey(t,e){return this.options.parseData?this.options.parseData(t):"text"===t.target.type?t.target.attribute.text:null}start(t){if((0,eB.Z)(t))return;let e=Ar(this.options);this._marks.forEach(i=>{i.elements.forEach(i=>{e(i)===t?(i.removeState(this.options.blurState),i.addState(this.options.highlightState)):(i.removeState(this.options.highlightState),i.addState(this.options.blurState))})})}reset(){this._marks.forEach(t=>{t.elements.forEach(t=>{t.removeState(this.options.blurState),t.removeState(this.options.highlightState)})})}}Au.type="element-highlight-by-name",Au.defaultOptions={trigger:"pointerover",triggerOff:"pointerout",highlightState:tq.highlight,blurState:tq.blur,filterType:"groupKey"};function Ac(t,e,i){let r=0,n=t[0];if(!n)return!1;for(let s=1;s<t.length;s++){let a=t[s];r+=Ap(n.x,n.y,a.x,a.y,e,i),n=a}let s=t[0];return Ag(n.x,s.x)&&Ag(n.y,s.y)||(r+=Ap(n.x,n.y,s.x,s.y,e,i)),0!==r}function Ap(t,e,i,r,n,s){if(s>e&&s>r||s<e&&s<r||r===e)return 0;let a=(s-e)/(r-e),o=r<e?1:-1;1!==a&&0!==a||(o=r<e?.5:-.5);let l=a*(i-t)+t;return l===n?1/0:l>n?o:0}function Ag(t,e){return 1e-8>Math.abs(t-e)}(tA=es||(es={})).drawStart="drawStart",tA.drawEnd="drawEnd",tA.drawing="drawing",tA.moving="moving",tA.moveStart="moveStart",tA.moveEnd="moveEnd",tA.brushClear="brushClear";let Af={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",resetTrigger:"pointerupoutside",hasMask:!0,brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-Infinity,y2:1/0,x1:-Infinity,x2:1/0}},Am={debounce:em,throttle:hK};pC(),gS();class Av extends pB{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},Av.defaultAttributes,t)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-Infinity,1/0],this._operatingMaskMoveRangeY=[-Infinity,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e;if(this._outOfInteractiveRange(t))return;t.stopPropagation();let i=null===(e=this.attribute.brushMoved)||void 0===e||e;this._activeMoveState=i&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||((this._activeDrawState||this._activeMoveState)&&t.stopPropagation(),this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushingWithDelay=0===this.attribute.delayTime?this._onBrushing:Am[this.attribute.delayType](this._onBrushing,this.attribute.delayTime),this._onBrushEnd=t=>{t.preventDefault();let{removeOnClick:e=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&e?(this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={},this._dispatchEvent(es.brushClear,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})):(this._activeDrawState&&this._dispatchEvent(es.drawEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}),this._activeMoveState&&this._dispatchEvent(es.moveEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,this._operatingMask&&this._operatingMask.setAttribute("pickable",!1)}}_bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;let{trigger:t=Af.trigger,updateTrigger:e=Af.updateTrigger,endTrigger:i=Af.endTrigger,resetTrigger:r=Af.resetTrigger}=this.attribute;this.stage.addEventListener(t,this._onBrushStart),this.stage.addEventListener(e,this._onBrushingWithDelay),this.stage.addEventListener(i,this._onBrushEnd),this.stage.addEventListener(r,this._onBrushEnd)}_isPosInBrushMask(t){let e=this.eventPosToStagePos(t),i=this._container.getChildren();for(let t=0;t<i.length;t++){let{points:r=[],dx:n=0,dy:s=0}=i[t].attribute;if(Ac(r.map(t=>({x:t.x+n,y:t.y+s})),e.x,e.y))return this._operatingMask=i[t],!0}return!1}_initDraw(t){let{brushMode:e}=this.attribute,i=this.eventPosToStagePos(t);this._cacheDrawPoints=[i],this._isDrawedBeforeEnd=!1,"single"===e&&(this._brushMaskAABBBoundsDict={},this._container.incrementalClearChild()),this._addBrushMask(),this._dispatchEvent(es.drawStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_initMove(t){var e,i;this._cacheMovePoint=this.eventPosToStagePos(t),this._operatingMaskMoveDx=null!==(e=this._operatingMask.attribute.dx)&&void 0!==e?e:0,this._operatingMaskMoveDy=null!==(i=this._operatingMask.attribute.dy)&&void 0!==i?i:0;let{interactiveRange:r}=this.attribute,{minY:n=-Infinity,maxY:s=1/0,minX:a=-Infinity,maxX:o=1/0}=r,{x1:l,x2:h,y1:d,y2:u}=this._operatingMask.globalAABBBounds;this._operatingMaskMoveRangeX=[a-l,o-h],this._operatingMaskMoveRangeY=[n-d,s-u],this._operatingMask.setAttribute("pickable",!0),this._dispatchEvent(es.moveStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_drawing(t){var e,i;let r=this.eventPosToStagePos(t),{x1:n=0,x2:s=0,y1:a=0,y2:o=0}=null===(e=this._operatingMask)||void 0===e?void 0:e._AABBBounds,{sizeThreshold:l=5,brushType:h}=this.attribute,d=this._cacheDrawPoints.length;if(this._isDrawedBeforeEnd=!!(Math.abs(s-n)>l||Math.abs(a-o)>l),d>0){let t=null!==(i=this._cacheDrawPoints[this._cacheDrawPoints.length-1])&&void 0!==i?i:{};if(r.x===t.x&&r.y===t.y)return}"polygon"===h||d<=1?this._cacheDrawPoints.push(r):this._cacheDrawPoints[d-1]=r;let u=this._computeMaskPoints();this._operatingMask.setAttribute("points",u),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(es.drawing,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_moving(t){let e=this._cacheMovePoint,i=this.eventPosToStagePos(t);if(i.x===(null==e?void 0:e.x)&&i.y===(null==e?void 0:e.y))return;let r=i.x-e.x,n=i.y-e.y,s=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],r))+this._operatingMaskMoveDx,a=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],n))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:s,dy:a}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(es.moving,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_computeMaskPoints(){let{brushType:t,xRange:e=[0,0],yRange:i=[0,0]}=this.attribute,r=[],n=this._cacheDrawPoints[0],s=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return"rect"===t?[n,{x:s.x,y:n.y},s,{x:n.x,y:s.y}]:"x"===t?[{x:n.x,y:i[0]},{x:s.x,y:i[0]},{x:s.x,y:i[1]},{x:n.x,y:i[1]}]:"y"===t?[{x:e[0],y:n.y},{x:e[0],y:s.y},{x:e[1],y:s.y},{x:e[1],y:n.y}]:lb(this._cacheDrawPoints)}_addBrushMask(){var t;let{brushStyle:e,hasMask:i}=this.attribute,r=as.polygon(Object.assign(Object.assign({points:lb(this._cacheDrawPoints),cursor:"move",pickable:!1},e),{opacity:i?null!==(t=e.opacity)&&void 0!==t?t:1:0}));r.name=`brush-${Date.now()}`,this._operatingMask=r,this._container.add(r),this._brushMaskAABBBoundsDict[r.name]=r.AABBBounds}_outOfInteractiveRange(t){let{interactiveRange:e}=this.attribute,{minY:i=-Infinity,maxY:r=1/0,minX:n=-Infinity,maxX:s=1/0}=e,a=this.eventPosToStagePos(t);return a.x>s||a.x<n||a.y>r||a.y<i}eventPosToStagePos(t){var e,i;let{x:r,y:n}=o2.mapToCanvasPoint(t,this.stage.window.getContext().canvas.nativeCanvas);return{x:r-((null===(e=this.stage)||void 0===e?void 0:e.x)||0),y:n-((null===(i=this.stage)||void 0===i?void 0:i.y)||0)}}render(){this._bindBrushEvents();let t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}releaseBrushEvents(){let{delayType:t="throttle",delayTime:e=0,trigger:i=Af.trigger,updateTrigger:r=Af.updateTrigger,endTrigger:n=Af.endTrigger,resetTrigger:s=Af.resetTrigger}=this.attribute;this.stage.removeEventListener(i,this._onBrushStart),this.stage.removeEventListener(r,this._onBrushingWithDelay),this.stage.removeEventListener(n,this._onBrushEnd),this.stage.removeEventListener(s,this._onBrushEnd)}}Av.defaultAttributes=Af;class Ay extends yW{constructor(t,e){super(t,e),this.handleAfterDraw=()=>{var t,e,i,r;let n=this.view.renderer.stage();if(this._brushComp||!n)return;let s=this.view.getViewBox();this._brushComp=new Av({interactiveRange:null!==(t=this.options.interactiveRange)&&void 0!==t?t:{minX:s.x1,maxX:s.x2,minY:s.y1,maxY:s.y2},xRange:null!==(e=this.options.xRange)&&void 0!==e?e:[s.x1,s.x2],yRange:null!==(i=this.options.yRange)&&void 0!==i?i:[s.y1,s.y2],brushMode:null!==(r=this.options.brushMode)&&void 0!==r?r:"single",brushType:this.options.brushType,brushStyle:this.options.brushStyle,brushMoved:this.options.brushMoved,removeOnClick:this.options.removeOnClick,sizeThreshold:this.options.sizeThreshold,delayType:this.options.delayType,delayTime:this.options.delayTime}),this._brushComp.addEventListener(es.brushClear,this.handleBrushUpdate),this._brushComp.addEventListener(es.moveEnd,this.handleBrushUpdate),this._brushComp.addEventListener(es.drawEnd,this.handleBrushUpdate),this._brushComp.addEventListener(es.drawStart,this.handleBrushUpdate),this._brushComp.addEventListener(es.moveStart,this.handleBrushUpdate),this._brushComp.addEventListener(es.drawing,this.handleBrushUpdate),this._brushComp.addEventListener(es.moving,this.handleBrushUpdate),n.defaultLayer.appendChild(this._brushComp)},this.options=e,this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:tX.BEFORE_DO_RENDER,handler:this.handleAfterDraw}]}isPolygonBrushContainGraphicItem(t,e,i){let r=t.attribute.points,{a:n,b:s,c:a,d:o,e:l,f:h}=t.globalTransMatrix,{x:d=0,y:u=0}=null!=i?i:{},c=r.map(t=>({x:n*t.x+a*t.y+l+d,y:s*t.x+o*t.y+h+u})),p=t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+d,t.globalAABBBounds.y1+u,t.globalAABBBounds.x2+d,t.globalAABBBounds.y2+u),g=e.globalTransMatrix.e,f=e.globalTransMatrix.f;if("symbol"===e.type||"circle"===e.type)return p.contains(g,f)&&Ac(c,g,f);if("rect"===e.type){let{width:t=0,height:i=0}=null==e?void 0:e.attribute;return function(t,e){for(let i=0;i<e.length;i++)if(Ac(t,e[i].x,e[i].y)||i>0&&function(t,e,i,r,n){for(let s=0,a=n[n.length-1];s<n.length;s++){let o=n[s];if(e7([t,e],[i,r],[o.x,o.y],[a.x,a.y]))return!0;a=o}return!1}(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0;return!1}(c,[{x:g,y:f},{x:g+t,y:f},{x:g+t,y:f+i},{x:g,y:f+i}])}return t.globalAABBBounds.intersects(e.globalAABBBounds)}isRectBrushContainGraphicItem(t,e,i){let{x:r=0,y:n=0}=null!=i?i:{},s=t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+r,t.globalAABBBounds.y1+n,t.globalAABBBounds.x2+r,t.globalAABBBounds.y2+n),a=e.globalTransMatrix.e,o=e.globalTransMatrix.f;if("symbol"===e.type||"circle"===e.type)return s.contains(a,o);if("rect"===e.type){let{width:t=0,height:i=0}=e.attribute;return it(s,{x1:a,y1:o,x2:a+t,y2:o+i},!1)}return t.globalAABBBounds.intersects(e.globalAABBBounds)}isBrushContainGraphicItem(t,e,i){var r;return!(!((null==t?void 0:t.globalTransMatrix)&&t.globalAABBBounds&&!t.globalAABBBounds.empty()&&e&&(null===(r=null==t?void 0:t.attribute)||void 0===r?void 0:r.points))||t.attribute.points.length<=1)&&("polygon"===this.options.brushType?this.isPolygonBrushContainGraphicItem(t,e,i):this.isRectBrushContainGraphicItem(t,e,i))}unbind(){super.unbind();let t=this.view.renderer.stage();this._brushComp&&t&&(t.defaultLayer.removeChild(this._brushComp),this._brushComp.releaseBrushEvents(),this._brushComp.release(),this._brushComp=null)}_dispatchEvent(t,e){let i={operateType:t.type,operateMask:t.detail.operateMask,activeElements:e};t.type===es.drawStart||t.type===es.moveStart?this.dispatchEvent("start",i):t.type===es.drawing||t.type===es.moving?this.dispatchEvent("update",i):t.type===es.drawEnd||t.type===es.moveEnd?this.dispatchEvent("end",i):this.dispatchEvent("reset",i)}}class Ab extends Ay{constructor(t,e){super(t,Object.assign({},Ab.defaultOptions,e)),this.type=Ab.type,this.handleBrushUpdate=t=>{let e=[];t.type===es.brushClear?this._marks.forEach(t=>{t.elements.forEach(t=>{t.removeState(this.options.blurState),t.removeState(this.options.highlightState)})}):this._marks.forEach(i=>{i.elements.forEach(i=>{this.isBrushContainGraphicItem(t.detail.operateMask,i.getGraphicItem())?(e.push(i),i.removeState(this.options.blurState),i.addState(this.options.highlightState)):(i.removeState(this.options.highlightState),i.addState(this.options.blurState))})}),this._dispatchEvent(t,e)}}}Ab.type="brush-highlight",Ab.defaultOptions={highlightState:tq.highlight,blurState:tq.blur};class Ax extends Ay{constructor(t,e){super(t,Object.assign({},Ax.defaultOptions,e)),this.type=Ax.type,this.handleBrushUpdate=t=>{let e=[];this._marks.forEach(i=>{i.elements.forEach(i=>{this.isBrushContainGraphicItem(t.detail.operateMask,i.getGraphicItem())?(e.push(i),i.addState(this.options.state)):i.removeState(this.options.state)})}),this._dispatchEvent(t,e)}}}Ax.type="brush-active",Ax.defaultOptions={state:tq.active};class A_ extends Ay{constructor(t,e){super(t,Object.assign({},A_.defaultOptions,e)),this.type=A_.type,this.handleBrushUpdate=t=>{let e=[],i=[];this._marks.forEach(r=>{r.elements.forEach(r=>{this.isBrushContainGraphicItem(t.detail.operateMask,r.getGraphicItem())&&(e.push(r),i=i.concat(ex(r.getDatum())))})}),this._data&&(i=Array.from(new Set(i)),this._filterValue&&i.length===this._filterValue.length&&!i.some(t=>!this._filterValue.includes(t))||(this._filterValue=i,this.handleFilter())),this._dispatchEvent(t,e)},this._data=(0,ek.Z)(this.options.target.data)?t.getDataById(this.options.target.data):this.options.target.data}getEvents(){if(!this._data)return[];let t=this.options.target.transform;return this._filterData(this._data,null,tz.brush,null,void 0,(e,i)=>{let r=i||e;return t?t(e,i):r}),super.getEvents()}}A_.type="brush-filter",A_.defaultOptions={};class AA extends Ay{constructor(t,e){super(t,Object.assign({},AA.defaultOptions,e)),this.type=AA.type,this.handleBrushUpdate=t=>{let e=[],i=[];this._marks.forEach(r=>{r.elements.forEach(r=>{this.isBrushContainGraphicItem(t.detail.operateMask,r.getGraphicItem())&&(e.push(r),i=i.concat(ex(r.getDatum())))})}),this._data&&(i=Array.from(new Set(i)),this._filterValue&&i.length===this._filterValue.length&&!i.some(t=>!this._filterValue.includes(t))||(this._filterValue=i,this.handleFilter())),this._dispatchEvent(t,e)},this.handleTrigger=t=>{let e=t.element;if(e&&this._marks&&this._marks.includes(e.mark)){let t=ex(e.getDatum());this._filterValue&&t.length===this._filterValue.length&&!t.some(t=>!this._filterValue.includes(t))||(this._filterValue=t,this.handleFilter())}},this._data=(0,ek.Z)(this.options.target.data)?t.getDataById(this.options.target.data):this.options.target.data}getEvents(){if(!this._data)return[];let t=this.options.target.transform;return this._filterData(this._data,null,tz.drillDown,null,void 0,(e,i)=>{let r=i||e;return t?t(e,i):r}),this.options.brush?super.getEvents():[{type:this.options.trigger,handler:this.handleTrigger}]}}AA.type="drill-down",AA.defaultOptions={brush:!1,trigger:"click"};class Aw extends yY{constructor(t,e){super(t,e),this.type=Aw.type,this._isToggle=!1,this.handleStart=t=>{var e,i;let r=t.element;if(r&&this._marks&&this._marks.includes(r.mark)){let r=null===(i=null===(e=t.element)||void 0===e?void 0:e.getDatum)||void 0===i?void 0:i.call(e);r===this._filterData||(0,ev.Z)(r)&&(0,ev.Z)(this._filterValue)&&r.length===this._filterValue.length&&r.every(t=>!this._filterValue.includes(t))?this._isToggle&&(this._filterValue=null,this.handleFilter(t)):this.handleFilter(t)}},this.handleReset=t=>{this._filterValue&&(this._filterValue=null,this.handleFilter(t))},this.options=Object.assign({},Aw.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.source),this._data=(0,ek.Z)(this.options.target.data)?t.getDataById(this.options.target.data):this.options.target.data}getEvents(){if(!this._marks||0===this._marks.length||!this._data)return[];let t=this.options.target.transform;this._filterData(this._data,null,tz.rollUp,t=>{var e,i;return null===(i=null===(e=null==t?void 0:t.element)||void 0===e?void 0:e.getDatum)||void 0===i?void 0:i.call(e)},void 0,(e,i)=>t(e,i));let e=[{type:this.options.trigger,handler:this.handleStart}],i="empty"===this.options.triggerOff?this.options.trigger:this.options.triggerOff.includes("view:")?this.options.triggerOff.replace("view:",""):this.options.triggerOff;return i!==this.options.trigger?(e.push({type:i,handler:this.handleReset}),this._isToggle=!1):this._isToggle=!0,e}}Aw.type="roll-up",Aw.defaultOptions={trigger:"click",triggerOff:"empty"};let AS=(t,...e)=>{let i=[t.shape,...e.map(t=>null==t?void 0:t.shape)],r=[t.key,...e.map(t=>null==t?void 0:t.key)],n=[t.value,...e.map(t=>null==t?void 0:t.value)];return lT(t,...e,{shape:i.every(eB.Z)?void 0:lT({},...i),key:r.every(eB.Z)?void 0:lT({},...r),value:n.every(eB.Z)?void 0:lT({},...n)})},AT=t=>{let{width:e,height:i,wordBreak:r="break-word",textAlign:n,textBaseline:s,text:a}=t;return Array.isArray(a)?{width:e,height:i,wordBreak:r,textAlign:n,textBaseline:s,singleLine:!1,textConfig:ex(a).map(e=>Object.assign(Object.assign({},t),{text:e}))}:{width:e,height:i,wordBreak:r,textAlign:n,textBaseline:s,singleLine:!1,textConfig:a.text}},Ak={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:fU,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:fU,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:fU,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new il).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},AB=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];pC(),ml(),fD(),mY(),mM();class AC extends pB{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},AC.defaultAttributes,t),e),this.name="tooltip"}render(){var t;let{visible:e,content:i,panel:r,keyWidth:n,valueWidth:s,hasContentShape:a,autoCalculatePosition:o,autoMeasure:l}=this.attribute;if(!e)return void this.hideAll();l&&AC.measureTooltip(this.attribute),o&&AC.calculateTooltipPosition(this.attribute);let h=(0,pT.o)(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},r),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild("tooltip-title",{visible:!0,x:h[3],y:h[0]},"group");let d=AC.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape",lT({symbolType:"circle"},d.shape,{visible:fG(d)&&fG(d.shape)}),"symbol"),"object"!=typeof d.value.text||null===d.value.text||"rich"!==d.value.text.type&&"html"!==d.value.text.type?d.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:fG(d)&&fG(d.value)},AT(d.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({text:null!==(t=d.value.text)&&void 0!==t?t:"",visible:fG(d)&&fG(d.value)},d.value),"text"):"rich"===d.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:fG(d)&&fG(d.value)},AT(d.value)),"richtext"):"html"===d.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({html:Object.assign(Object.assign({dom:d.value.text.text},fW),d.value),visible:fG(d)&&fG(d.value),width:d.value.width,height:d.value.height,wordBreak:d.value.wordBreak,textAlign:d.value.textAlign,textBaseline:d.value.textBaseline,singleLine:!1,textConfig:[]},d.value),"richtext"));let u=fG(d.shape)?d.shape.size+d.shape.spacing:0,{textAlign:c,textBaseline:p}=d.value,g=r.width-h[3]-h[0]-u;"center"===c?this._tooltipTitle.setAttribute("x",u+g/2):"right"===c||"end"===c?this._tooltipTitle.setAttribute("x",u+g):this._tooltipTitle.setAttribute("x",u),"bottom"===p?this._tooltipTitle.setAttribute("y",d.height):"middle"===p?this._tooltipTitle.setAttribute("y",d.height/2):this._tooltipTitle.setAttribute("y",0);let f=fG(d)?d.height+d.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild("tooltip-content",{visible:!0},"group"),this._tooltipContent.removeAllChild(!0),i&&i.length){this._tooltipContent.setAttribute("x",h[3]),this._tooltipContent.setAttribute("y",h[0]+f);let t=0;i.forEach((e,i)=>{var r,o,l;let h=AC.getContentAttr(this.attribute,i);if(!fG(h))return;let d=`tooltip-content-${i}`,u=this._tooltipContent.createOrUpdateChild(d,{visible:!0,x:0,y:t},"group"),c=0;if(fG(h.shape)&&u.createOrUpdateChild(`${d}-shape`,Object.assign({visible:!0,x:h.shape.size/2,y:h.shape.size/2+((null!==(r=n0(h.key.lineHeight,h.key.fontSize))&&void 0!==r?r:h.key.fontSize)-h.shape.size)/2},h.shape),"symbol"),a&&(c+=h.shape.size+h.shape.spacing),fG(h.key)){let t;t=h.key.multiLine?u.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0},AT(h.key)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.key.text||null===h.key.text||"rich"!==h.key.text.type&&"html"!==h.key.text.type?u.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0,text:null!==(o=h.key.text)&&void 0!==o?o:""},h.key),{textBaseline:"top"}),"text"):"rich"===h.key.text.type?u.createOrUpdateChild(`${d}-value`,Object.assign(Object.assign({visible:!0},AT(h.key)),{textBaseline:"top"}),"richtext"):u.createOrUpdateChild(`${d}-value`,{html:Object.assign(Object.assign({dom:h.key.text.text},fW),h.key)},"richtext");let{textAlign:e}=h.key;"center"===e?t.setAttribute("x",c+n/2):"right"===e||"end"===e?t.setAttribute("x",c+n):t.setAttribute("x",c),t.setAttribute("y",0),c+=n+h.key.spacing}if(fG(h.value)){let t;t=h.value.multiLine?u.createOrUpdateChild(`${d}-value`,Object.assign(Object.assign({visible:!0},AT(h.value)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.value.text||null===h.value.text||"rich"!==h.value.text.type&&"html"!==h.value.text.type?u.createOrUpdateChild(`${d}-value`,Object.assign(Object.assign({visible:!0,text:null!==(l=h.value.text)&&void 0!==l?l:""},h.value),{textBaseline:"top"}),"text"):"rich"===h.value.text.type?u.createOrUpdateChild(`${d}-value`,Object.assign(Object.assign({visible:!0},AT(h.value)),{textBaseline:"top"}),"richtext"):u.createOrUpdateChild(`${d}-value`,{html:Object.assign({dom:h.value.text.text,container:"",width:30,height:30,style:{}},h.value)},"richtext");let e="right";eb(h.value.textAlign)?e=h.value.textAlign:fG(h.key)||(e="left"),t.setAttribute("textAlign",e),"center"===e?t.setAttribute("x",c+s/2):"right"===e||"end"===e?t.setAttribute("x",c+s):t.setAttribute("x",c),c+=s,t.setAttribute("y",0),u.add(t)}t+=h.height+h.spaceRow})}}setAttributes(t,e){let i=Object.keys(t);this.attribute.autoCalculatePosition&&i.every(t=>AB.includes(t))?(this._mergeAttributes(t,i),(0,eB.Z)(this.attribute.panel.width)&&this.attribute.autoMeasure&&AC.measureTooltip(this.attribute),AC.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},e)):super.setAttributes(t,e)}static calculateTooltipPosition(t){let{width:e=0,height:i=0}=t.panel,{offsetX:r,offsetY:n,pointerX:s,pointerY:a,positionX:o,positionY:l,parentBounds:h}=t,d=s,u=a;return"left"===o?d-=e+r:"center"===o?d-=e/2:d+=r,"top"===l?u-=i+n:"middle"===l?u-=i/2:u+=n,d+e>h.x2&&(d-=e+r),u+i>h.y2&&(u-=i+n),d<h.x1&&(d=h.x1),u<h.y1&&(u=h.y1),t.x=d,t.y=u,t}static measureTooltip(t){let{content:e,contentStyle:i}=t,r=(0,pT.o)(t.padding),n=AC.getTitleAttr(t),s=0,a=r[0]+r[2],o=0,{value:l,shape:h}=n,{visible:d=!1,symbolType:u=""}=null!=h?h:{};if(eb(l)&&"object"!=typeof n.value.text){let{width:t,height:e}=f$(l).quickMeasure(l.text);s=t,o=e}if(d&&fu[u]&&(s+=h.size+h.spacing,o=Math.max(h.size,o)),t.title&&(t.title.width=s,t.title.height=o),fG(n)&&(a+=o+n.spaceRow),e&&e.length){let r=[];if(e.forEach((e,i)=>{let n=AC.getContentAttr(t,i);(e.key||e.value)&&fG(n)&&r.push([e,n])}),r.length){let n=!1,o=[],l=[],h=[];r.forEach(([t,e],s)=>{var d;let{key:u,value:c,shape:p,spaceRow:g}=e,f=fG(p),m=null!==(d=null==p?void 0:p.symbolType)&&void 0!==d?d:"",v=f$(u),y=f$(c),b=0;if(fG(u)){let{width:t,height:e}=v.quickMeasure(u.text);l.push(t),b=Math.max(b,e)}if(fG(c)){let{width:t,height:e}=y.quickMeasure(c.text);h.push(t),b=Math.max(b,e)}f&&fu[m]&&(n=!0,o.push(p.size),b=Math.max(p.size,b)),t.height=b,a+=b,s<r.length-1&&(a+=null!=g?g:i.spaceRow)});let d=o.length?Math.max(...o):0,u=l.length?Math.max(...l):0,c=h.length?Math.max(...h):0;s=Math.max(u+c+i.key.spacing+i.value.spacing+(n?d+i.shape.spacing:0),s),e.forEach(t=>{t.width=s}),t.hasContentShape=n,t.keyWidth=u,t.valueWidth=c}}return t.panel.width=s+r[1]+r[3],t.panel.height=a,t}static getTitleAttr(t){return AS({},AC.defaultAttributes.titleStyle,AC.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return AS({},AC.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}AC.defaultAttributes=Ak;let AE=(t,e,i,r,n,s)=>{var a;return lT({},null===(a=null==n?void 0:n.components)||void 0===a?void 0:a.tooltip,{visible:!0,pointerX:t.x,pointerY:t.y,title:e,content:i,parentBounds:r},null!=s?s:{})};class AM extends yW{constructor(t,e){super(t,e),this._marks=t.getMarksBySelector(e.selector)}bind(){super.bind();let t=this.view.renderer.stage();!this._tooltipComponent&&t&&(this._tooltipComponent=new AC({}),t.defaultLayer.appendChild(this._tooltipComponent))}unbind(){super.unbind();let t=this.view.renderer.stage();this._tooltipComponent&&t&&(t.defaultLayer.removeChild(this._tooltipComponent),this._tooltipComponent.release(),this._tooltipComponent=null)}_computeTooltipRow(t,e){let i,r,n,s=lt(t.visible,this.parameters(),e);return s=!!(0,eB.Z)(s)||!!s,i=dl(t.key)?l0(t.key.field)(e):lt(t.key,this.parameters(),e),i=(0,eB.Z)(i)?void 0:l_(i)?i:{text:i},r=dl(t.value)?l0(t.value.field)(e):lt(t.value,this.parameters(),e),r=(0,eB.Z)(r)?void 0:l_(r)?r:{text:r},n=dl(t.symbol)?l0(t.symbol.field)(e):lt(t.symbol,this.parameters(),e),{visible:s,key:i,value:r,shape:n=(0,eB.Z)(n)?void 0:l_(n)?n:{symbolType:n}}}_computeTitleContent(t){let e=eb(this.options.title)?r6(this.options.title)?this.options.title.call(null,t,null,{}):this._computeTooltipRow((0,ek.Z)(this.options.title)?{value:this.options.title}:this.options.title,t):void 0,i=eb(this.options.content)?r6(this.options.content)?ex(this.options.content.call(null,t,null,{})):ex(t).reduce((t,e)=>t.concat(ex(this.options.content).map(t=>this._computeTooltipRow(t,e))),[]):void 0;return{title:(0,ev.Z)(e)?e[0]:e,content:i}}}class AP extends AM{constructor(t,e){super(t,e),this.type=AP.type,this.handleTooltipShow=hK(t=>{if(!this._tooltipComponent)return;let e=t.element;if(!this._marks.includes(null==e?void 0:e.mark))return void this._tooltipComponent.hideAll();this._tooltipComponent.showAll();let i=this.view.rootMark.getGroupGraphicItem(),r={x:0,y:0};if(i.globalTransMatrix.transformPoint(t.canvas,r),e===this._lastElement)return void this._tooltipComponent.setAttributes({pointerX:r.x,pointerY:r.y});let n={x:0,y:0};i.globalTransMatrix.transformPoint({x:0,y:0},n);let s={x:0,y:0};i.globalTransMatrix.transformPoint({x:this.view.getSignalById("width").getValue(),y:this.view.getSignalById("height").getValue()},s);let a=(new il).set(n.x,n.y,s.x,s.y),{title:o,content:l}=this._computeTitleContent(e.getDatum()),h=this.view.getCurrentTheme(),d=AE(r,o,l,a,h,lt(this.options.attributes,this.parameters(),e.getDatum()));this._tooltipComponent.setAttributes(d)},10),this.handleTooltipHide=t=>{this._tooltipComponent&&this._tooltipComponent.hideAll()},this.options=Object.assign({},AP.defaultOptions,e)}getEvents(){return[{type:this.options.trigger,handler:this.handleTooltipShow},{type:this.options.triggerOff,handler:this.handleTooltipHide}]}}AP.type="tooltip",AP.defaultOptions={trigger:"pointermove",triggerOff:"pointerleave"};let AO=(t,e)=>{let i=ex(t),r=ex(e);return i.length===r.length&&i.every(t=>r.includes(t))&&r.every(t=>i.includes(t))},AR=(t,e,i,r,n)=>{if("x"===i)return e.invert(t.x);if("y"===i)return e.invert(t.y);if("radius"===i){let i=null!=n?n:{x:r.width/2,y:r.height/2},s=Math.sqrt((i.x-t.x)**2+(i.y-t.y)**2);return e.invert(s)}if("angle"===i){let i=e5(null!=n?n:{x:r.width/2,y:r.height/2},t);return e.invert(i<0?i+2*Math.PI:i)}return e.invert(t.x)};class AI extends AM{constructor(t,e){var i,r,n;super(t,e),this.type=AI.type,this._avoidMarks=[],this._tooltipDataFilter=null,this.handleTooltipShow=hK(t=>{var e,i,r;if(!this._tooltipComponent)return;let n=((0,ek.Z)(this.options.scale)?this.view.getScaleById(this.options.scale):this.options.scale).getScale(),s=this._container.getGroupGraphicItem(),a={x:0,y:0};s.globalTransMatrix.transformPoint(t.canvas,a);let o={width:s.attribute.width,height:s.attribute.height};if(a.x<0||a.x>s.attribute.width||a.y<0||a.y>s.attribute.height)return void this._tooltipComponent.hideAll();let l=null===(i=null===(e=t.target)||void 0===e?void 0:e[l4])||void 0===i?void 0:i.mark;if(this._avoidMarks.includes(l))return void this._tooltipComponent.hideAll();let h=null===(r=this.options.target)||void 0===r?void 0:r.data,d=h?(0,ek.Z)(h)?this.view.getDataById(h):h:null,u=d?d.getValue():[],c=AR(a,n,this.options.tooltipType,o,this.options.center),p=this._tooltipDataFilter?u.filter(t=>this._tooltipDataFilter(t,c)):[];if(this._tooltipComponent.showAll(),AO(p,this._lastDatum))return void this._tooltipComponent.setAttributes({pointerX:a.x,pointerY:a.y});this._lastDatum=p;let g={x:0,y:0};s.globalTransMatrix.transformPoint({x:0,y:0},g);let f={x:0,y:0};s.globalTransMatrix.transformPoint({x:this.view.getSignalById("width").getValue(),y:this.view.getSignalById("height").getValue()},f);let m=(new il).set(g.x,g.y,f.x,f.y),{title:v,content:y}=this._computeTitleContent(p),b=this.view.getCurrentTheme(),x=AE(a,v,y,m,b,lt(this.options.attributes,this.parameters(),{}));this._tooltipComponent.setAttributes(x)},10),this.handleTooltipHide=t=>{this._tooltipComponent&&this._tooltipComponent.hideAll()},this.options=Object.assign({},AI.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._avoidMarks=null!==(i=t.getMarksBySelector(this.options.avoidMark))&&void 0!==i?i:[],this._container=null!==(n=null===(r=t.getMarksBySelector(this.options.container))||void 0===r?void 0:r[0])&&void 0!==n?n:t.rootMark}getEvents(){let t=this.options.target.filter;return this._tooltipDataFilter=(0,ek.Z)(t)?(e,i)=>i===e[t]:t,[{type:this.options.trigger,handler:this.handleTooltipShow},{type:this.options.triggerOff,handler:this.handleTooltipHide}]}}AI.type="dimension-tooltip",AI.defaultOptions={trigger:"pointermove",triggerOff:"pointerleave"};class AL extends pB{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}let AD=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...nR];class Aj extends nF{constructor(t){super(t),this.type="arc",this.numberType=n8}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{startAngle:t,endAngle:e,outerRadius:i,innerRadius:r}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(r)}getParsedCornerRadius(){let t=rQ(this).arc,{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:r=t.outerPadding}=this.attribute,{outerRadius:n=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(n+=r,s-=i,0===e||"0%"===e)return 0;let a=Math.abs(n-s);return Math.min((0,iy.Z)(e,!0)?e:a*parseFloat(e)/100,a/2)}getParsedAngle(){let t=rQ(this).arc,{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute,{cap:r=t.cap}=this.attribute,n=i-e>=0?1:-1,s=i-e;if(i=(e=e1(e))+s,r&&(0,eJ.Wn)(s)<eJ.f7-eJ.Ho){let s=1,a=1;r.length&&(s=Number(r[0]),a=Number(r[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute,{outerPadding:h=t.outerPadding,innerPadding:d=t.innerPadding}=this.attribute;o+=h;let u=Math.abs(o-(l-=d))/2,c=u/o;if(u>eJ.Ho&&o>eJ.Ho)return{startAngle:e-n*c*s,endAngle:i+n*c*a,sc:n*c*s,ec:n*c*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){let i=rQ(this).arc,{innerPadding:r=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:s=i.padAngle}=this.attribute,{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=n,o-=r;let{padRadius:l=(0,eJ._b)(a*a+o*o)}=this.attribute,h=(0,eJ.Wn)(e-t),d=t,u=e,c=t,p=e,g=s/2,f=h,m=h;if(g>eJ.Ho&&l>eJ.Ho){let i=e>t?1:-1,r=(0,eJ.ZR)(Number(l)/o*(0,eJ.O$)(g)),n=(0,eJ.ZR)(Number(l)/a*(0,eJ.O$)(g));return(f-=2*r)>eJ.Ho?(r*=i,c+=r,p-=r):(f=0,c=p=(t+e)/2),(m-=2*n)>eJ.Ho?(n*=i,d+=n,u-=n):(m=0,d=u=(t+e)/2),{outerStartAngle:d,outerEndAngle:u,innerStartAngle:c,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}return{outerStartAngle:d,outerEndAngle:u,innerStartAngle:c,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}doUpdateAABBBounds(t){let e=rQ(this).arc;this._AABBBounds.clear();let i=this.attribute,r=ru.graphicService.updateArcAABBBounds(i,rQ(this).arc,this._AABBBounds,t,this),{boundsPadding:n=e.boundsPadding}=i,s=nH(n);return s&&r.expand(s),this.clearUpdateBoundTag(),r}tryUpdateOBBBounds(){throw Error("暂不支持")}needUpdateTags(t){return super.needUpdateTags(t,AD)}needUpdateTag(t){return super.needUpdateTag(t,AD)}getDefaultAttribute(t){return rQ(this).arc[t]}toCustomPath(){let t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle(),r=t.innerRadius-(t.innerPadding||0),n=t.outerRadius-(t.outerPadding||0),s=(0,eJ.Wn)(i-e),a=i>e;if(n<r){let t=n;n=r,r=t}let o=new iK;if(n<=eJ.Ho)o.moveTo(0,0);else if(s>=eJ.f7-eJ.Ho)o.moveTo(0+n*(0,eJ.mC)(e),0+n*(0,eJ.O$)(e)),o.arc(0,0,n,e,i,!a),r>eJ.Ho&&(o.moveTo(0+r*(0,eJ.mC)(i),0+r*(0,eJ.O$)(i)),o.arc(0,0,r,i,e,a));else{let t=n*(0,eJ.mC)(e),s=n*(0,eJ.O$)(e),l=r*(0,eJ.mC)(i),h=r*(0,eJ.O$)(i);o.moveTo(0+t,0+s),o.arc(0,0,n,e,i,!a),o.lineTo(0+l,0+h),o.arc(0,0,r,i,e,a),o.closePath()}return o}clone(){return new Aj(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Aj.NOWORK_ANIMATE_ATTR}}function AN(t){return new Aj(t)}Aj.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},nN);var AF=i("408345");class AG{static GetCanvas(){try{return AG.canvas||(AG.canvas=ru.global.createCanvas({})),AG.canvas}catch(t){return null}}static GetCtx(){if(!AG.ctx){let t=AG.GetCanvas();AG.ctx=t.getContext("2d")}return AG.ctx}}class Az extends AF.L{static getInstance(){return Az._instance||(Az._instance=new Az),Az._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;let i=AG.GetCanvas(),r=AG.GetCtx();if(i.width=e,i.height=1,!r)return;if(r.translate(0,0),!r)throw Error("获取ctx发生错误");let n=r.createLinearGradient(0,0,e,0);t.forEach(t=>{n.addColorStop(t[0],t[1])}),r.fillStyle=n,r.fillRect(0,0,e,1),this.rgbaSet=r.getImageData(0,0,e,1).data}getColor(t){let e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,r,n=[],s=100){let a=`${t}${e}${i}${r}`;n.forEach(t=>a+=t.join()),a+=s;let o=this.dataMap.get(a);return!o&&(o={data:new Az(n,s),timestamp:[]},this.addLimitedTimestamp(o,Date.now(),{}),this.dataMap.set(a,o)),this.clearCache(this.dataMap,this.cacheParams),o.data}}class AZ{static GetSize(t){for(let e=0;e<AZ.ImageSize.length;e++)if(AZ.ImageSize[e]>=t)return AZ.ImageSize[e];return t}static Get(t,e,i,r,n,s,a){let o=AZ.GenKey(t,e,i,r,n),l=AZ.cache[o];if(!l||0===l.length)return null;for(let t=0;t<l.length;t++)if(l[t].width>=s&&l[t].height>=a)return l[t].pattern;return null}static Set(t,e,i,r,n,s,a,o){let l=AZ.GenKey(t,e,i,r,n);AZ.cache[l]?AZ.cache[l].push({width:a,height:o,pattern:s}):AZ.cache[l]=[{width:a,height:o,pattern:s}]}static GenKey(t,e,i,r,n){return`${e},${i},${r},${n},${t.join()}`}}AZ.cache={},AZ.ImageSize=[20,40,80,160,320,640,1280,2560];let AH=new class t{constructor(){this.time=oF.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,r,n,s,a,o,l,h,d,u){let{outerBorder:c,innerBorder:p}=t.attribute,g=c&&!1!==c.visible,f=p&&!1!==p.visible;if(!g&&!f)return;let{innerPadding:m=l.innerPadding,outerPadding:v=l.outerPadding,startAngle:y=l.startAngle,endAngle:b=l.endAngle,opacity:x=l.opacity,x:_=l.x,y:A=l.y,scaleX:w=l.scaleX,scaleY:S=l.scaleY}=t.attribute,{innerRadius:T=l.innerRadius,outerRadius:k=l.outerRadius}=t.attribute;k+=v,T-=m;let B=!(!c||!c.stroke),C=!(!p||!p.stroke);if(g){let{distance:n=l.outerBorder.distance}=c,s=aM(e,n,e.dpr),a=n/k;if(t.setAttributes({outerRadius:k+s,innerRadius:T-s,startAngle:y-a,endAngle:b+a}),e.beginPath(),aV(t,e,i,r,k+s,T-s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,c,l.outerBorder);else if(B){let n=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,c,(_-i)/w,(A-r)/S,l.outerBorder),l.outerBorder.opacity=n,e.stroke()}}if(f){let{distance:n=l.innerBorder.distance}=p,s=aM(e,n,e.dpr),a=n/k;if(t.setAttributes({outerRadius:k-s,innerRadius:T+s,startAngle:y+a,endAngle:b-a}),e.beginPath(),aV(t,e,i,r,k-s,T+s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(C){let n=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,p,(_-i)/w,(A-r)/S,l.innerBorder),l.innerBorder.opacity=n,e.stroke()}}t.setAttributes({outerRadius:k,innerRadius:T,startAngle:y,endAngle:b})}};var AU=function(t,e){return function(i,r){e(i,r,t)}};let AV=class extends oe{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=n8,this.builtinContributions=[AH,a4,oh],this.init(t)}drawArcTailCapPath(t,e,i,r,n,s,a,o){let l,h,d,u;let c=o-a,p=t.getParsedAngle(),g=p.startAngle,f=p.endAngle;f=o;let m=(0,eJ.Wn)(f-g),v=f>g,y=!1;if(n<s){let t=n;n=s,s=t}let b=t.getParsedCornerRadius(),{outerDeltaAngle:x,innerDeltaAngle:_,outerStartAngle:A,outerEndAngle:w,innerEndAngle:S,innerStartAngle:T}=t.getParsePadAngle(g,f),k=Math.max(b,b),B=Math.max(b,b),C=k,E=B,M=n*(0,eJ.mC)(A),P=n*(0,eJ.O$)(A),O=s*(0,eJ.mC)(S),R=s*(0,eJ.O$)(S);if((B>eJ.Ho||k>eJ.Ho)&&(l=n*(0,eJ.mC)(w),h=n*(0,eJ.O$)(w),d=s*(0,eJ.mC)(T),u=s*(0,eJ.O$)(T),m<eJ.pi)){let t=aH(M,P,d,u,l,h,O,R);if(t){let e=M-t[0],i=P-t[1],r=l-t[0],a=h-t[1],o=1/(0,eJ.O$)((0,eJ.Kh)((e*r+i*a)/((0,eJ._b)(e*e+i*i)*(0,eJ._b)(r*r+a*a)))/2),d=(0,eJ._b)(t[0]*t[0]+t[1]*t[1]);E=(0,eJ.VV)(B,(s-d)/(o-1)),C=(0,eJ.VV)(k,(n-d)/(o+1))}}if(C>eJ.Ho){let t=(0,eJ.VV)(b,C),s=(0,eJ.VV)(b,C),a=aU(d,u,M,P,n,t,Number(v)),o=aU(l,h,O,R,n,s,Number(v));if(C<k&&t===s)e.moveTo(i+a.cx+a.x01,r+a.cy+a.y01),e.arc(i+a.cx,r+a.cy,C,(0,eJ.fv)(a.y01,a.x01),(0,eJ.fv)(o.y01,o.x01),!v);else{let t=f-c-.03,a=(0,eJ.fv)(o.y11,o.x11);e.arc(i,r,n,t,a,!v),s>0&&e.arc(i+o.cx,r+o.cy,s,(0,eJ.fv)(o.y11,o.x11),(0,eJ.fv)(o.y01,o.x01),!v)}}else e.moveTo(i+M,r+P);if(!(s>eJ.Ho)||_<.001)e.lineTo(i+O,r+R),y=!0;else if(E>eJ.Ho){let t=(0,eJ.VV)(b,E),n=(0,eJ.VV)(b,E),a=aU(O,R,l,h,s,-n,Number(v)),o=aU(M,P,d,u,s,-t,Number(v));if(e.lineTo(i+a.cx+a.x01,r+a.cy+a.y01),E<B&&t===n){let t=(0,eJ.fv)(o.y01,o.x01);e.arc(i+a.cx,r+a.cy,E,(0,eJ.fv)(a.y01,a.x01),t,!v)}else{n>0&&e.arc(i+a.cx,r+a.cy,n,(0,eJ.fv)(a.y01,a.x01),(0,eJ.fv)(a.y11,a.x11),!v);let t=(0,eJ.fv)(a.cy+a.y11,a.cx+a.x11),o=f-c-.03;e.arc(i,r,s,t,o,v)}}else e.lineTo(i+s*(0,eJ.mC)(T),r+s*(0,eJ.O$)(T));return y}drawShape(t,e,i,r,n,s,a,o){let l=rQ(t,null==s?void 0:s.theme).arc,{fill:h=l.fill,stroke:d=l.stroke,x:u=l.x,y:c=l.y}=t.attribute,p=this.valid(t,l,a,o);if(!p)return;let{fVisible:g,sVisible:f,doFill:m,doStroke:v}=p,{outerPadding:y=l.outerPadding,innerPadding:b=l.innerPadding,cap:x=l.cap,forceShowCap:_=l.forceShowCap}=t.attribute,{outerRadius:A=l.outerRadius,innerRadius:w=l.innerRadius}=t.attribute;A+=y,w-=b;let S=0,T=(r4(x)&&x||x[0])&&"conical"===h.gradient;if(T){let{sc:e,startAngle:i,endAngle:r}=t.getParsedAngle();(0,eJ.Wn)(r-i)<eJ.f7-eJ.Ho&&(S=e||0,h.startAngle-=S,h.endAngle-=S)}let k=!1,{isFullStroke:B,stroke:C}=nz(d);if((m||B)&&(e.beginPath(),aV(t,e,i,r,A,w),k=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,r,m,v,g,f,l,n,a,o),m&&(a?a(e,t.attribute,l):g&&(e.setCommonStyle(t,t.attribute,u-i,c-r,l),e.fill())),v&&B&&(o?o(e,t.attribute,l):f&&(e.setStrokeStyle(t,t.attribute,u-i,c-r,l),e.stroke()))),!B&&v&&(e.beginPath(),aV(t,e,i,r,A,w,C),k||this.beforeRenderStep(t,e,i,r,m,v,g,f,l,n,a,o),o?o(e,t.attribute,l):f&&(e.setStrokeStyle(t,t.attribute,i,r,l),e.stroke())),(r4(x)&&x||x[1])&&_){let{startAngle:s,endAngle:h}=t.getParsedAngle();if((0,eJ.Wn)(h-s)>=eJ.f7-eJ.Ho){e.beginPath();let s=Math.abs(A-w)/2/A,{endAngle:h=l.endAngle,fill:d=l.fill}=t.attribute;if(this.drawArcTailCapPath(t,e,i,r,A,w,h,h+s),k||this.beforeRenderStep(t,e,i,r,m,v,g,f,l,n,a,o),m&&"conical"===d.gradient){let n=function(t,e,i,r){let{stops:n,startAngle:s,endAngle:a}=r;for(;i<0;)i+=eJ.f7;for(;i>eJ.f7;)i-=eJ.f7;if(i<s||i>a)return n[0].color;let o,l,h=(i-s)/(a-s);for(let t=0;t<n.length;t++)if(n[t].offset>=h){o=n[t-1],l=n[t];break}return h=(h-o.offset)/(l.offset-o.offset),nT(o.color,l.color,h,!1)}(0,0,h,d);a||aF&&(e.setCommonStyle(t,t.attribute,i,r,l),e.fillStyle=n,e.fill())}v&&(o||f&&(e.setStrokeStyle(t,t.attribute,i,r,l),e.stroke()))}}this.afterRenderStep(t,e,i,r,m,v,g,f,l,n,a,o),T&&(h.startAngle+=S,h.endAngle+=S)}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).arc;this._draw(t,n,!1,i,r)}};AV=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),AU(0,ez(eH)),AU(0,eZ(aW)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],AV);let AW=!1,A$=new eM(t=>{AW||(AW=!0,t(AV).toSelf().inSingletonScope(),t(sE).to(AV).inSingletonScope(),t(sR).toService(sE),t(aW).toService(a6),eV(t,aW))}),AY=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=n8}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).arc;r.highPerformanceSave();let{x:s=n.x,y:a=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,i,r)=>!!o||(o=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(o)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=aM(r,s+a,r.dpr),o=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),o}};AY=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tw=0,tS=ez(sE),function(t,e){tS(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],AY);let AX=!1,AK=new eM((t,e,i,r)=>{AX||(AX=!0,t(p$).to(AY).inSingletonScope(),t(p9).toService(p$))}),Aq=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=n8}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).arc;r.highPerformanceSave();let{x:s=n.x,y:a=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(n);s+=e.x,a+=e.y,r.setTransformForCurrent()}else s=0,a=0,r.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,i,r)=>!!o||(o=t.isPointInPath(e.x,e.y)),(t,i,n)=>{if(o)return!0;let s=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=s+a,o=t.isPointInStroke(e.x,e.y)}),r.highPerformanceRestore(),o}};Aq=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tT=0,tk=ez(sE),function(t,e){tk(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Aq);let AJ=!1,AQ=new eM((t,e,i,r)=>{AJ||(AJ=!0,t(pD).to(Aq).inSingletonScope(),t(pL).toService(pD))});function A0(){A0.__loaded||(A0.__loaded=!0,as.RegisterGraphicCreator("arc",AN),rR.load(A$),rR.load(pI?AK:AQ))}A0.__loaded=!1;pC(),go();class A1 extends AL{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},A1.defaultAttributes,t))}renderCrosshair(t){let{start:e,end:i,lineStyle:r}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},r),"line")}setLocation(t){let{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}A1.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},pC(),ml();class A2 extends AL{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},A2.defaultAttributes,t))}renderCrosshair(t){let{start:e,end:i,rectStyle:r}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y},r),"rect")}setLocation(t){let{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}A2.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}},pC(),A0();class A5 extends AL{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},A5.defaultAttributes,t))}renderCrosshair(t){let{center:e,radius:i,innerRadius:r=0,sectorStyle:n}=this.attribute,{startAngle:s,endAngle:a}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:r,startAngle:s,endAngle:a}),n),"arc")}setLocation(t){let{center:e,startAngle:i=fZ,endAngle:r=fH}=this.attribute,n=r-i,s=e0(e5(e,t));this.setAttributes({startAngle:s-n/2,endAngle:s+n/2})}}A5.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}},pC(),A0();class A3 extends AL{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},A3.defaultAttributes,t))}renderCrosshair(t){let{center:e,radius:i,lineStyle:r}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),r),"arc")}setLocation(t){let{center:e}=this.attribute,i=ix.distancePP(t,e);this.setAttribute("radius",i)}}A3.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}},pC(),vE();class A4 extends AL{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:lT({},A4.defaultAttributes,t))}renderCrosshair(t){let e;let{center:i,radius:r,sides:n=6,lineStyle:s}=this.attribute,{startAngle:a,endAngle:o}=this.attribute,l=(o-a)%(2*Math.PI)==0,h=(o-a)/n;for(let t=0;t<=n;t++){let s=e2(i,r,a+h*t);0===t?e=`M${s.x},${s.y}`:e+=`L${s.x},${s.y}`,t===n&&l&&(e+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:e},s),"path")}setLocation(t){let{center:e}=this.attribute,i=ix.distancePP(t,e);this.setAttribute("radius",i)}}A4.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};let A6=(t,e,i,r,n,s=0)=>{var a,o;let l={x:0,y:0},h={x:0,y:0},d="angle"===i?null!==(a=null==n?void 0:n.radius)&&void 0!==a?a:Math.min(r.width,r.height)/2:null,u="angle"===i?null!==(o=null==n?void 0:n.center)&&void 0!==o?o:{x:r.width/2,y:r.height/2}:null,c=0;if(uN(e.type)){if("x"===i)c=e.scale(e.invert(t.x));else if("y"===i)c=e.scale(e.invert(t.y));else if("angle"===i){let i=e1(e5(u,t)+2*Math.PI);c=e.scale(e.invert(i))}}else uj(e.type)&&("x"===i?c=t.x:"y"===i?c=t.y:"angle"===i&&(c=e5(u,t)));switch(c+=s,i){case"x":l.x=c,l.y=0,h.x=c,h.y=r.height;break;case"y":l.x=0,l.y=c,h.x=r.width,h.y=c;break;case"angle":l.x=u.x,l.y=u.y,h.x=u.x+d*Math.cos(c),h.y=u.y+d*Math.sin(c)}return{start:l,end:h}},A8=(t,e,i,r,n,s)=>{var a,o,l;let h=null!==(o=null!==(a=null==s?void 0:s.center)&&void 0!==a?a:null==n?void 0:n.center)&&void 0!==o?o:{x:r.width/2,y:r.height/2},d=0;if(uN(e.type)){let i="band"===e.type?e.bandwidth()/2:0,r=Math.sqrt((t.x-h.x)**2+(t.y-h.y)**2);d=e.scale(e.invert(r))+i}else uj(e.type)&&(d=Math.min(null!==(l=null==n?void 0:n.radius)&&void 0!==l?l:Math.min(r.width,r.height)/2,Math.sqrt((t.x-h.x)**2+(t.y-h.y)**2)));return{radius:d,center:h}},A7=(t,e,i,r,n,s,a)=>{var o,l,h;let d=null===(o=null==s?void 0:s.components)||void 0===o?void 0:o.lineCrosshair,u="band"===e.type?e.bandwidth()/2:0;return lT({},d,A6(t,e,i,r,{radius:null!==(l=null==a?void 0:a.radius)&&void 0!==l?l:null==n?void 0:n.radius,center:null!==(h=null==a?void 0:a.center)&&void 0!==h?h:null==n?void 0:n.center},u),null!=a?a:{})},A9=(t,e,i,r,n,s,a)=>{var o,l,h;let d=null===(o=null==s?void 0:s.components)||void 0===o?void 0:o.rectCrosshair,u="band"===e.type||"point"===e.type?e.step():void 0,c=null==a?void 0:a.rectStyle,p=null!=u?u:"y"===i?null!==(l=null==c?void 0:c.width)&&void 0!==l?l:d.rectStyle.width:null!==(h=null==c?void 0:c.height)&&void 0!==h?h:d.rectStyle.height,g=A6(t,e,i,r,n,"band"===e.type?0:-p/2),f={};"x"===i?f.width=p:f.height=p;let m=lT({},d,{start:g.start,end:g.end,rectStyle:f},null!=a?a:{});return"x"===i?m.rectStyle.height=m.end.y-m.start.y:m.rectStyle.width=m.end.x-m.start.x,m},wt=(t,e,i,r,n,s,a)=>{var o;let l=null===(o=null==s?void 0:s.components)||void 0===o?void 0:o.circleCrosshair,{center:h,radius:d}=A8(t,e,0,r,n,a),u=l.startAngle,c=l.endAngle,p="band"===e.type||"point"===e.type?e.step():0;return lT({},l,{center:h,innerRadius:d-p/2,radius:d+p/2,startAngle:u,endAngle:c},null!=a?a:{})},we=(t,e,i,r,n,s,a)=>{var o,l,h,d,u;let c=null===(o=null==s?void 0:s.components)||void 0===o?void 0:o.sectorCrosshair,p=null!==(h=null!==(l=null==a?void 0:a.radius)&&void 0!==l?l:null==n?void 0:n.radius)&&void 0!==h?h:Math.min(r.width,r.height)/2,g=null!==(u=null!==(d=null==a?void 0:a.center)&&void 0!==d?d:null==n?void 0:n.center)&&void 0!==u?u:{x:r.width/2,y:r.height/2},f=c.endAngle-c.startAngle,m="band"===e.type||"point"===e.type?e.step():f,v=0;if(uN(e.type)){let i=e1(e5(g,t)+2*Math.PI);v=e.scale(e.invert(i))+("band"===e.type?e.bandwidth()/2:0)}else uj(e.type)&&(v=e5(g,t));return lT({},c,{center:g,radius:p,startAngle:v-m/2,endAngle:v+m/2},null!=a?a:{})},wi=(t,e,i,r,n,s,a)=>{var o;let l=null===(o=null==s?void 0:s.components)||void 0===o?void 0:o.circleCrosshair,{center:h,radius:d}=A8(t,e,0,r,n,a),u=l.startAngle,c=l.endAngle;return lT({},l,{center:h,radius:d,startAngle:u,endAngle:c},null!=a?a:{})},wr=(t,e,i,r,n,s,a)=>{var o;let l=null===(o=null==s?void 0:s.components)||void 0===o?void 0:o.circleCrosshair,{center:h,radius:d}=A8(t,e,0,r,n,a),u=l.startAngle,c=l.endAngle;return lT({},l,{center:h,radius:d,startAngle:u,endAngle:c},null!=a?a:{})};class wn extends yW{constructor(t,e){var i,r;super(t,e),this.type=wn.type,this.handleCrosshairShow=t=>{var e;if(!this._crosshairComponent)return;let i=this._container.getGroupGraphicItem(),r={x:0,y:0},n=i.globalTransMatrix,s={x:n.e,y:n.f};if(n.transformPoint(t.canvas,r),r.x<0||r.x>i.attribute.width||r.y<0||r.y>i.attribute.height)return void this._crosshairComponent.hideAll();let a=null!==(e=this.options.crosshairType)&&void 0!==e?e:"x",o={width:i.attribute.width,height:i.attribute.height},l=((0,ek.Z)(this.options.scale)?this.view.getScaleById(this.options.scale):this.options.scale).getScale(),h={center:this.options.center,radius:this.options.radius},d=this.view.getCurrentTheme(),u=lt(this.options.attributes,this.parameters(),{},{}),c={};switch(this.getCrosshairComponentType()){case tV.lineCrosshair:c=A7(r,l,a,o,h,d,u);break;case tV.rectCrosshair:c=A9(r,l,a,o,h,d,u);break;case tV.sectorCrosshair:c=we(r,l,0,o,h,d,u);break;case tV.circleCrosshair:c=wi(r,l,0,o,h,d,u);break;case tV.polygonCrosshair:c=wr(r,l,0,o,h,d,u);break;case tV.ringCrosshair:c=wt(r,l,0,o,h,d,u)}this.getCrosshairComponentType()!==tV.circleCrosshair&&(c.x=s.x,c.y=s.y),this._crosshairComponent.showAll(),this._crosshairComponent.setAttributes(c)},this.handleCrosshairHide=()=>{this._crosshairComponent&&this._crosshairComponent.hideAll()},this.options=Object.assign({},wn.defaultOptions,e),this._container=null!==(r=null===(i=t.getMarksBySelector(this.options.container))||void 0===i?void 0:i[0])&&void 0!==r?r:t.rootMark}getEvents(){return[{type:this.options.trigger,handler:this.handleCrosshairShow},{type:this.options.triggerOff,handler:this.handleCrosshairHide}]}getCrosshairComponentType(){var t,e;if(this._crosshairComponentType)return this._crosshairComponentType;let i=null!==(t=this.options.crosshairShape)&&void 0!==t?t:"line",r=null!==(e=this.options.crosshairType)&&void 0!==e?e:"x";return this._crosshairComponentType="rect"===i?"angle"===r?tV.sectorCrosshair:"radius"===r?tV.ringCrosshair:"radius-polygon"===r?tV.polygonCrosshair:tV.rectCrosshair:"radius"===r?tV.circleCrosshair:"radius-polygon"===r?tV.polygonCrosshair:tV.lineCrosshair,this._crosshairComponentType}getDefaultCrosshairAttribute(){var t;let e=null!==(t=this.options.crosshairType)&&void 0!==t?t:"x";return"radius"===e||"radius-polygon"===e?{center:{x:0,y:0},zIndex:-1}:{start:{x:0,y:0},end:{x:0,y:0},zIndex:-1}}bind(){super.bind();let t=this.view.renderer.stage();if(!this._crosshairComponent&&t){switch(this.getCrosshairComponentType()){case tV.lineCrosshair:this._crosshairComponent=new A1(this.getDefaultCrosshairAttribute());break;case tV.rectCrosshair:this._crosshairComponent=new A2(this.getDefaultCrosshairAttribute());break;case tV.sectorCrosshair:this._crosshairComponent=new A5(this.getDefaultCrosshairAttribute());break;case tV.circleCrosshair:this._crosshairComponent=new A3(this.getDefaultCrosshairAttribute());break;case tV.polygonCrosshair:this._crosshairComponent=new A4(this.getDefaultCrosshairAttribute());break;case tV.ringCrosshair:this._crosshairComponent=new A5(this.getDefaultCrosshairAttribute())}t.defaultLayer.appendChild(this._crosshairComponent)}}unbind(){super.unbind();let t=this.view.renderer.stage();this._crosshairComponent&&t&&(t.defaultLayer.removeChild(this._crosshairComponent),this._crosshairComponent.release(),this._crosshairComponent=null)}}wn.type="crosshair",wn.defaultOptions={trigger:"pointermove",triggerOff:"pointerleave",crosshairType:"x",crosshairShape:"line"};class ws extends yW{constructor(t,e){super(t,e),this.options=e}_parseLinkedComponent(t){if(!t)return null;let e=(0,ek.Z)(t)?this.view.getMarkById(t):t;return e&&e.markType===tF.component&&(e.componentType===tG.datazoom||e.componentType===tG.scrollbar)?e:null}_initStateByDim(t,e,i,r,n){let s=this._parseLinkedComponent(e);if(s)return void(this._state[t]={linkedComponent:s});let a=(0,eB.Z)(i)?null:(0,ek.Z)(i)?this.view.getScaleById(i):i,o=(0,eB.Z)(null==r?void 0:r.data)?null:(0,ek.Z)(r.data)?this.view.getDataById(r.data):r.data;if(!a||!o)return this._state[t]={data:o,scale:a},void((0,ev.Z)(n)?(this._state[t].rangeFactor=n,this._state[t].initRangeFactor=n):r6(n)?this._state[t].getCurrentRange=n:a&&a.getRangeFactor()&&(this._state[t].rangeFactor=a.getRangeFactor(),this._state[t].initRangeFactor=a.getRangeFactor()));o.attach(a);let l=(0,ek.Z)(r.filter)?(t,e)=>{let i=pA(a.getScale(),t[r.filter]);return i>=e[0]&&i<=e[1]}:r.filter,h={source:`${a.uid}`,rank:tz.normal,filter:e=>{var i,n,s,a;let o="x"===t?null===(n=null===(i=this._state)||void 0===i?void 0:i.x)||void 0===n?void 0:n.filterValue:null===(a=null===(s=this._state)||void 0===s?void 0:s.y)||void 0===a?void 0:a.filterValue;if(!o)return e;let h=e.filter(t=>l(t,o));return r.transform?r.transform(h,o):h}};"x"===t?this._dataFilterX=h:this._dataFilterY=h,o.addDataFilter(h),this._state[t]={data:o,scale:a}}_initGrammars(){let{enableX:t,enableY:e,scaleX:i,scaleY:r,dataTargetX:n,dataTargetY:s,linkedComponentX:a,linkedComponentY:o,rangeX:l,rangeY:h}=this.options;this._state={},!1!==t&&this._initStateByDim("x",a,i,n,l),!1!==e&&this._initStateByDim("y",o,r,s,h),this._inited=!0}_updateLinkedComponent(t,e){t.componentType===tG.datazoom?t.setStartEndValue(e[0],e[1]):t.setScrollStart(e[0])}updateView(t,e,i,r){var n,s,a,o;e&&e.x&&(null===(s=null===(n=this._state)||void 0===n?void 0:n.x)||void 0===s?void 0:s.linkedComponent)&&this._updateLinkedComponent(this._state.x.linkedComponent,e.x),e&&e.y&&(null===(o=null===(a=this._state)||void 0===a?void 0:a.y)||void 0===o?void 0:o.linkedComponent)&&this._updateLinkedComponent(this._state.y.linkedComponent,e.y),e&&e.needUpdate&&this.view.run(),this.dispatchEvent(t,{viewRange:e,event:r,eventType:i})}unbind(){super.unbind(),this._state&&Object.keys(this._state).forEach(t=>{let{data:e,scale:i}=this._state[t];e&&i?(e.detach(i),e.removeDataFilter("x"===t?this._dataFilterX:this._dataFilterY)):i&&(i.setRangeFactor(null),i.commit())}),this._state=null}}class wa extends ws{constructor(t,e){super(t,Object.assign({},wa.defaultOptions,e)),this.type=wa.type,this.handleStartInner=t=>{this.formatZoomEvent(t),t&&(!this.options.shouldStart||this.options.shouldStart(t))&&(this._inited||this._initGrammars(),this._isStarted=!0,this.updateView("start",this.handleZoomStart(t,this._state,{rate:this.options.rate,focus:this.options.focus}),"zoom",t))},this.handleEnd=t=>{this._isStarted&&(this.formatZoomEvent(t),t&&(!this.options.shouldEnd||this.options.shouldEnd(t))&&this.updateView("end",this.handleZoomEnd(t,this._state,{rate:this.options.rate,focus:this.options.focus}),"zoom",t))},this.handleReset=t=>{this._isStarted&&t&&(!this.options.shouldReset||this.options.shouldReset(t))&&(this.updateView("reset",this.handleZoomReset(t,this._state,{rate:this.options.rate,focus:this.options.focus}),"zoom",t),this._isStarted=!1)},this.handleStart=hK(this.handleStartInner,this.options.throttle)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.endTrigger,handler:this.handleEnd},{type:this.options.triggerOff,handler:this.handleReset}]}}wa.type="view-zoom",wa.defaultOptions={realtime:!0,focus:!0,trigger:"wheel",endTrigger:"pointerup",triggerOff:"dblclick",rate:1,throttle:100};class wo extends ws{constructor(t,e){super(t,Object.assign({},wo.defaultOptions,e)),this.type=wo.type,this.handleStartInner=t=>{this.formatScrollEvent(t),t&&(!this.options.shouldStart||this.options.shouldStart(t))&&(this._isStarted=!0,this._inited||this._initGrammars(),this.updateView("start",this.handleScrollStart(t,this._state,this.options),"scroll",t))},this.handleEnd=t=>{this._isStarted&&(this.formatScrollEvent(t),t&&(!this.options.shouldEnd||this.options.shouldEnd(t))&&(this.updateView("end",this.handleScrollEnd(t,this._state,this.options),"scroll",t),this._isStarted=!1))},this.handleStart=hK(this.handleStartInner,this.options.throttle)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.endTrigger,handler:this.handleEnd}]}}wo.type="view-scroll",wo.defaultOptions={realtime:!0,reversed:!1,trigger:"wheel",endTrigger:"pointerup",throttle:100};class wl extends ws{constructor(t,e){super(t,Object.assign({},wl.defaultOptions,e)),this.type=wl.type,this.handleStart=t=>{t&&(!this.options.shouldStart||this.options.shouldStart(t))&&(this._isStarted=!0,this._inited||this._initGrammars(),this.updateView("start",this.handleDragStart(t,this._state,{reversed:this.options.reversed}),"drag",t))},this.handleUpdateInner=t=>{this._isStarted&&t&&(!this.options.shouldUpdate||this.options.shouldUpdate(t))&&this.updateView("update",this.handleDragUpdate(t,this._state,{reversed:this.options.reversed}),"drag",t)},this.handleEnd=t=>{this._isStarted&&t&&(!this.options.shouldEnd||this.options.shouldEnd(t))&&(this.updateView("end",this.handleDragEnd(t,this._state,{reversed:this.options.reversed}),"drag",t),this._isStarted=!1)},this.handleUpdate=hK(this.handleUpdateInner,this.options.throttle)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.endTrigger,handler:this.handleEnd},{type:this.options.updateTrigger,handler:this.handleUpdate}]}}wl.type="view-drag",wl.defaultOptions={realtime:!0,reversed:!1,trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",throttle:100};let wh=t=>{if(t.componentType===tG.datazoom){let e=t.getStartEndValue();return e?[e.start,e.end]:null}return t.getScrollRange()},wd=(t,e)=>{let i=t.getBounds();if(i&&!i.empty())return"y"===e?[i.y1,i.y2]:[i.x1,i.x2]},wu=(t=[0,1],e,i=0,r)=>{if(.001>Math.abs(i)||Math.abs(t[1]-t[0])>=1)return;let n=Math.abs(e[e.length-1]-e[0]);if(n<=0||Number.isNaN(n))return;let s=(r.reversed?-1:1)*i;if(s>0&&t[1]<1){let e=Math.min(1-t[1],s/n);return[t[0]+e,t[1]+e]}if(s<0&&t[0]>0){let e=Math.max(-t[0],s/n);return[t[0]+e,t[1]+e]}},wc=(t,e,i)=>{let r={needUpdate:!1};return e&&Object.keys(e).forEach(n=>{let{scale:s,data:a,linkedComponent:o,rangeFactor:l,getCurrentRange:h}=e[n];if(o)r[n]=wu(wh(o),wd(o,n),t[n],i);else if(s){let o=s.getScale(),h=wu(s.getRangeFactor()||l,o.range(),t[n],i);h&&(e[n].rangeFactor=h,a?(e[n].filterValue=h,a.commit()):(s.setRangeFactor(h),s.commit()),r.needUpdate=!0,r[n]=h)}else{let e=(h?h():l)||[0,1],s=wu(e,[0,1],t[n],i);r[n]=s||e}}),r};class wp{_formatPinchZoom(t){let e=t.scale;if((0,eB.Z)(this._lastScale))return this._lastScale=e,t;let i=e/this._lastScale;this._lastScale=e;let r=t.center;return t.zoomDelta=i,t.zoomX=r.x,t.zoomY=r.y,t}_formatWheelZoom(t){if(!t.ctrlKey)return t.zoomDelta=null,t.zoomX=null,t.zoomY=null,t;let e=Math.pow(1.0005,-t.deltaY*Math.pow(16,t.deltaMode));return t.zoomDelta=e,t.zoomX=t.canvasX,t.zoomY=t.canvasY,t}formatZoomEvent(t){return t?"pinch"===t.type?this._formatPinchZoom(t):this._formatWheelZoom(t):t}updateZoomRange(t=[0,1],e,i,r){var n;let{zoomDelta:s}=i,a=Math.abs(t[1]-t[0]);if(a>=1&&s>=1||a<=.001&&s<=1)return;let o=a*(s-1)*(null!==(n=r.rate)&&void 0!==n?n:1)/2,l=nd(t[0]-o,0,1),h=nd(t[1]+o,0,1);return[Math.min(l,h),Math.max(l,h)]}_handleZooming(t,e,i){let r={needUpdate:!1};return e&&Object.keys(e).forEach(n=>{let{scale:s,data:a,linkedComponent:o,rangeFactor:l,getCurrentRange:h}=e[n];if(o)r[n]=this.updateZoomRange(wh(o),null,t,i);else if(s){let o=s.getScale(),h=this.updateZoomRange(l,o,t,i);h&&(e[n].rangeFactor=h,a?(e[n].filterValue=h,a.commit()):(s.setRangeFactor(h),s.commit()),r.needUpdate=!0,r[n]=h)}else{let e=(h?h():l)||[0,1],s=this.updateZoomRange(e,null,t,i);r[n]=s||e}}),r}handleZoomStart(t,e,i){if(!(0,eB.Z)(t.zoomDelta))return t.stopPropagation(),t.preventDefault(),i&&i.realtime?this._handleZooming(t,e,i):((0,eB.Z)(this._zoomPos)?this._zoomPos={zoomDelta:t.zoomDelta,zoomX:t.zoomX,zoomY:t.zoomY}:this._zoomPos.zoomDelta*=t.zoomDelta,null)}handleZoomEnd(t,e,i){this._lastScale=null;let r=i&&!1===i.realtime&&this._zoomPos?this._handleZooming(this._zoomPos,e,i):null;return this._zoomPos=null,r}handleZoomReset(t,e,i){let r={needUpdate:!1};return e&&Object.keys(e).forEach(t=>{let{scale:i,data:n,linkedComponent:s}=e[t],a=[0,1];s?r[t]=a:i?(e[t].rangeFactor=null,n?(e[t].filterValue=null,n.commit()):(i.setRangeFactor(a),i.commit()),r.needUpdate=!0,r[t]=a):(e[t].rangeFactor=e[t].initRangeFactor,r[t]=e[t].initRangeFactor)}),r}}class wg{formatPanScroll(t){return t}formatWheelScroll(t){return t.ctrlKey||0===t.deltaY&&0===t.deltaX||(t.scrollX=t.deltaX,t.scrollY=t.deltaY),t}formatScrollEvent(t){return t?"pan"===t.type?this.formatPanScroll(t):"wheel"===t.type?this.formatWheelScroll(t):t:t}handleScrollStart(t,e,i){if(t.stopPropagation(),t.preventDefault(),!(0,eB.Z)(t.scrollX)||!(0,eB.Z)(t.scrollY)){if(i&&i.realtime)return wc({x:t.scrollX,y:t.scrollY},e,i);(0,eB.Z)(t.scrollX)||(this._scrollX=(0,eB.Z)(this._scrollX)?t.scrollX:this._scrollX+t.scrollX),(0,eB.Z)(t.scrollY)||(this._scrollY=(0,eB.Z)(this._scrollY)?t.scrollY:this._scrollY+t.scrollY)}}handleScrollEnd(t,e,i){if(!1===(null==i?void 0:i.realtime)&&((0,eB.Z)(this._scrollX)||(0,eB.Z)(this._scrollY))){let t=wc({x:this._scrollX,y:this._scrollY},e,i);return this._scrollX=null,this._scrollY=null,t}return null}}class wf{_shouldTriggerDragByPointer(t){if(!(0,eB.Z)(t.pointerId)){let e=(0,eB.Z)(this._pointerId)||this._pointerId===t.pointerId;return this._pointerId=t.pointerId,e}return!0}_shouldStart(t){return this._shouldTriggerDragByPointer(t)}_shouldUpdate(t){return this._shouldTriggerDragByPointer(t)}handleDragStart(t,e,i){if(this._shouldStart(t))return this._dragStart={x:t.canvasX,y:t.canvasY},null}handleDragUpdate(t,e,i){if(this._dragStart&&this._shouldUpdate(t)){if(null==i?void 0:i.realtime){let r=t.canvasX-this._dragStart.x;return wc({x:r,y:t.canvasY-this._dragStart.y},e,i)}return null}}handleDragEnd(t,e,i){if(!this._dragStart)return;let r=!1===(null==i?void 0:i.realtime)?wc({x:t.canvasX-this._dragStart.x,y:t.canvasY-this._dragStart.y},e,i):null;return this._pointerId=null,this._dragStart=null,r}}class wm extends ws{constructor(t,e){super(t,lT({},wm.defaultOptions,e)),this.type=wm.type,this.handleRoamZoomStartInner=t=>{this.formatZoomEvent(t),t&&(!this.options.shouldStart||this.options.shouldStart(t))&&(this._inited||this._initGrammars(),this._isZoomStarted=!0,this.updateView("start",this.handleZoomStart(t,this._state,this.options.zoom),"zoom",t))},this.handleRoamZoomEnd=t=>{this._isZoomStarted&&(this.formatZoomEvent(t),t&&(!this.options.shouldEnd||this.options.shouldEnd(t))&&(this.updateView("end",this.handleZoomEnd(t,this._state,this.options.zoom),"zoom",t),this._isZoomStarted=!1))},this.handleRoamZoomReset=t=>{this._isZoomStarted&&t&&(!this.options.shouldReset||this.options.shouldReset(t))&&(this.updateView("reset",this.handleZoomReset(t,this._state,this.options.zoom),"zoom",t),this._isZoomStarted=!1)},this.handleRoamDragStart=t=>{t&&(!this.options.shouldStart||this.options.shouldStart(t))&&(this._inited||this._initGrammars(),this._isDragStarted=!0,this.updateView("start",this.handleDragStart(t,this._state,this.options.drag),"drag",t))},this.handleRoamDragUpdateInner=t=>{this._isDragStarted&&t&&(!this.options.shouldUpdate||this.options.shouldUpdate(t))&&this.updateView("update",this.handleDragUpdate(t,this._state,this.options.drag),"drag",t)},this.handleRoamDragEnd=t=>{this._isDragStarted&&t&&(!this.options.shouldEnd||this.options.shouldEnd(t))&&(this.updateView("end",this.handleDragEnd(t,this._state,this.options.drag),"drag",t),this._isDragStarted=!1)},this.handleRoamScrollStartInner=t=>{this.formatScrollEvent(t),t&&(!this.options.shouldStart||this.options.shouldStart(t))&&(this._inited||this._initGrammars(),this._isScrollStarted=!0,this.updateView("start",this.handleScrollStart(t,this._state,this.options.scroll),"scroll",t))},this.handleRoamScrollEnd=t=>{this._isScrollStarted&&(this.formatScrollEvent(t),t&&(!this.options.shouldEnd||this.options.shouldEnd(t))&&(this.updateView("end",this.handleScrollEnd(t,this._state,this.options.scroll),"scroll",t),this._isScrollStarted=!0))},this.handleRoamZoomStart=hK(this.handleRoamZoomStartInner,this.options.throttle),this.handleRoamDragUpdate=hK(this.handleRoamDragUpdateInner,this.options.throttle),this.handleRoamScrollStart=hK(this.handleRoamScrollStartInner,this.options.throttle)}getEvents(){var t,e,i;let r=[];return(null===(t=this.options.zoom)||void 0===t?void 0:t.enable)&&(this.options.zoom.trigger&&r.push({type:this.options.zoom.trigger,handler:this.handleRoamZoomStart}),this.options.zoom.endTrigger&&r.push({type:this.options.zoom.endTrigger,handler:this.handleRoamZoomEnd}),this.options.zoom.triggerOff&&r.push({type:this.options.zoom.triggerOff,handler:this.handleRoamZoomReset})),(null===(e=this.options.scroll)||void 0===e?void 0:e.enable)&&(this.options.scroll.trigger&&r.push({type:this.options.scroll.trigger,handler:this.handleRoamScrollStart}),this.options.scroll.trigger&&r.push({type:this.options.scroll.endTrigger,handler:this.handleRoamScrollEnd})),(null===(i=this.options.drag)||void 0===i?void 0:i.enable)&&(this.options.drag.trigger&&r.push({type:this.options.drag.trigger,handler:this.handleRoamDragStart}),this.options.drag.updateTrigger&&r.push({type:this.options.drag.updateTrigger,handler:this.handleRoamDragUpdate}),this.options.drag.endTrigger&&r.push({type:this.options.drag.endTrigger,handler:this.handleRoamDragEnd})),r}}wm.type="view-roam",wm.defaultOptions={zoom:{realtime:!0,enable:!0,focus:!0,trigger:"wheel",endTrigger:"pointerup",triggerOff:"dblclick",rate:1},scroll:{realtime:!0,enable:!1,reversed:!1,trigger:"wheel",endTrigger:"pointerup"},drag:{realtime:!0,enable:!0,reversed:!1,trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup"},throttle:100};class wv extends yW{constructor(t,e){super(t,e),this.type=wv.type,this.handleStart=t=>{t&&(this.options.shouldStart?this.options.shouldStart(t):this.shouldHandle(t))&&(this._inited||this._initGrammars(),this._isActive||(this._isActive=!0,this.updateView({x:t.canvasX,y:t.canvasY},t)))},this.handleUpdateInner=t=>{t&&(this.options.shouldUpdate?this.options.shouldUpdate(t):this.shouldUpdate(t))&&this._isActive&&this.updateView({x:t.canvasX,y:t.canvasY},t)},this.handleEnd=t=>{t&&(this.options.shouldEnd?this.options.shouldEnd(t):this.shouldHandle(t))&&!this.options.triggerOff&&this._isActive&&(this._isActive=!1,this.updateView(null,t))},this.handleReset=t=>{t&&(this.options.shouldReset?this.options.shouldReset(t):this.shouldHandle(t))&&this._isActive&&(this.updateView(null,t),this._isActive=!1)},this.options=Object.assign({},wv.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this.handleUpdate=hK(this.handleUpdateInner,this.options.throttle)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.updateTrigger,handler:this.handleUpdate},{type:this.options.endTrigger,handler:this.handleEnd},{type:this.options.triggerOff,handler:this.handleReset}]}_initStateByDim(t,e,i,r,n){let s=(0,eB.Z)(i)?null:(0,ek.Z)(i)?this.view.getScaleById(i):i;this._state[t]={scale:s,distortion:e,radius:r,radiusRatio:n}}_initGrammars(){let{enableX:t,enableY:e,scaleX:i,scaleY:r,distortionX:n,distortionY:s,radiusRatioX:a,radiusRatioY:o,radiusX:l,radiusY:h}=this.options;this._state={},!1!==t&&this._initStateByDim("x",n,i,l,a),!1!==e&&this._initStateByDim("y",s,r,h,o),this._inited=!0}updateView(t,e){let i=!1;t?Object.keys(this._state).forEach(e=>{let r=this._state[e];r.scale&&r.focus!==t[e]&&(i=!0,r.focus=t[e],r.scale.setFishEye({distortion:r.distortion,radius:r.radius,radiusRatio:r.radiusRatio,focus:t[e]}),r.scale.commit())}):Object.keys(this._state).forEach(t=>{let e=this._state[t];e.scale&&!(0,eB.Z)(e.focus)&&(i=!0,e.focus=null,e.scale.setFishEye(null),e.scale.commit())}),i&&this.view.run()}shouldHandle(t){var e,i,r;return this._marks?t.element&&this._marks&&this._marks.includes(t.element.mark):t.target===(null===(r=null===(i=null===(e=this.view)||void 0===e?void 0:e.renderer)||void 0===i?void 0:i.stage)||void 0===r?void 0:r.call(i))}shouldUpdate(t){if(this._marks)return t.element&&this._marks&&this._marks.includes(t.element.mark);let e=this.view.getViewBox();return t.canvasX>=e.x1&&t.canvasX<=e.x2&&t.canvasY>=e.y1&&t.canvasY<=e.y2}unbind(){super.unbind(),this._state&&Object.keys(this._state).forEach(t=>{let{scale:e}=this._state[t];e&&(e.setRangeFactor(null),e.commit())}),this._state=null}}wv.type="fish-eye",wv.defaultOptions={trigger:"pointerenter",updateTrigger:"pointermove",endTrigger:"pointerleave",distortionX:2,distortionY:2,throttle:100};class wy{updateStates(t,e,i,r){return t&&t.length?(i&&r?e&&e.length?(this.toggleReverseStateOfElements(t,e,r),this.toggleStateOfElements(t,e,i)):this.addBothStateOfElements(t,i,r):i&&(e&&e.length?this.toggleStateOfElements(t,e,i):this.addStateOfElements(t,i)),t):null}toggleReverseStateOfElements(t,e,i){e.forEach(t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)}),t.forEach(t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)})}toggleStateOfElements(t,e,i){e.forEach(t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)}),t.forEach(t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)})}addBothStateOfElements(t,e,i){this._marks.forEach(r=>{let n=i&&this._stateMarks[i]&&this._stateMarks[i].includes(r),s=e&&this._stateMarks[e]&&this._stateMarks[e].includes(r);(n||s)&&r.elements.forEach(r=>{t&&t.includes(r)?s&&r.addState(e):n&&r.addState(i)})})}addStateOfElements(t,e){this._marks.forEach(i=>{let r=e&&this._stateMarks[e]&&this._stateMarks[e].includes(i);r&&i.elements.forEach(i=>{t&&t.includes(i)&&r&&i.addState(e)})})}clearAllStates(t,e){this._statedElements&&this._statedElements.length&&this._marks.forEach(i=>{e&&this._stateMarks[e]&&this._stateMarks[e].includes(i)&&i.elements.forEach(t=>{t.removeState(e)}),t&&this._stateMarks[t]&&this._stateMarks[t].includes(i)&&i.elements.forEach(e=>{this._statedElements.includes(e)&&e.removeState(t)})})}}class wb extends sv{constructor(t){super(t),this.attribute=t,this.onSetStage(()=>{this.render()})}render(){var t;let e,i,r,n;let s=this.createOrUpdateChild("large-path",{},"path"),a=this.attribute.points,o=null!==(t=s.attribute.path)&&void 0!==t?t:new iK;o.clear();for(let t=0,s=a.length;t<s;t+=4)e=a[t],i=a[t+1],r=a[t+2],n=a[t+3],o.rect(e,i,r,n);let l=Object.assign({},this.attribute,{path:o,points:null});this.attribute={},s.setAttributes(l)}}class wx extends sv{constructor(t){super(t),this.attribute=t,this.onSetStage(()=>{this.render()})}render(){var t,e;let i,r;let n=this.createOrUpdateChild("large-path",{},"path"),s=this.attribute.points,a=null!==(t=this.attribute.size)&&void 0!==t?t:ra.size,o=null!==(e=n.attribute.path)&&void 0!==e?e:new iK;o.clear();let l=(0,iy.Z)(a)?a:(0,eJ.Fp)(a[0],a[1]);for(let t=0,e=s.length;t<e;t+=4)i=s[t],r=s[t+1],o.arc(i,r,l/2,0,2*Math.PI),o.closePath();let h=Object.assign({},this.attribute,{path:o,points:null,size:null});this.attribute={},n.setAttributes(h)}}class w_ extends sv{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){let e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){let t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function wA(t){return new w_(t)}function ww(){ww.__loaded||(ww.__loaded=!0,as.RegisterGraphicCreator("shadowRoot",wA))}ww.__loaded=!1;class wS extends Aj{constructor(t){super(t),this.type="arc3d",this.numberType=n7}doUpdateAABBBounds(){let t=rQ(this).arc;this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updateArc3dAABBBounds(e,rQ(this).polygon,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=e,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return wS.NOWORK_ANIMATE_ATTR}}function wT(t){return new wS(t)}wS.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},nN);let wk=class extends oe{constructor(){super(...arguments),this.numberType=n7}drawShape(t,e,i,r,n,s,a,o){var l;let h=rQ(t,null==s?void 0:s.theme).arc,{fill:d=h.fill}=t.attribute,u=this.valid(t,h,a,o);if(!u)return;let{fVisible:c,sVisible:p,doFill:g,doStroke:f}=u,m=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:v=h.outerPadding,innerPadding:y=h.innerPadding,height:b=10}=t.attribute,{outerRadius:x=h.outerRadius,innerRadius:_=h.innerRadius}=t.attribute;x+=v,_-=y;let A=nw.Get(d,oz.Color255),{light:w}=n.stage||{},S=n.hack_pieFace,T={top:m,bottom:m+b},k={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===S||"top"===S?(e.beginPath(),function(t,e,i,r,n,s,a){let{startAngle:o,endAngle:l}=t.getParsedAngle(),h=(0,eJ.Wn)(l-o),d=l>o,u=!1;if(s<a){let t=s;s=a,a=t}if(s<=eJ.Ho)e.moveTo(i,r,n);else if(h>=eJ.f7-eJ.Ho)e.moveTo(i+s*(0,eJ.mC)(o),r+s*(0,eJ.O$)(o),n),e.arc(i,r,s,o,l,!d,n),a>eJ.Ho&&(e.moveTo(i+a*(0,eJ.mC)(l),r+a*(0,eJ.O$)(l),n),e.arc(i,r,a,l,o,d,n));else{let{outerDeltaAngle:h,innerDeltaAngle:c,outerStartAngle:p,outerEndAngle:g,innerEndAngle:f,innerStartAngle:m}=t.getParsePadAngle(o,l),v=s*(0,eJ.mC)(p),y=s*(0,eJ.O$)(p),b=a*(0,eJ.mC)(f),x=a*(0,eJ.O$)(f);h<.001?u=!0:(e.moveTo(i+v,r+y,n),e.arc(i,r,s,p,g,!d,n)),!(a>eJ.Ho)||c<.001?(e.lineTo(i+b,r+x,n),u=!0):(e.lineTo(i+b,r+x,n),e.arc(i,r,a,f,m,d,n))}e.closePath()}(t,e,i,r,T[S],x,_),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):c&&(e.setCommonStyle(t,t.attribute,i,r,h),e.fillStyle=w?w.computeColor(k[S],A):d,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,r,h),e.stroke()))):"outside"!==S&&"inside"!==S||("inside"===S&&(e.save(),e.beginPath(),e.arc(i,r,_,0,eJ.f7,!0,T.top),e.clip()),e.beginPath(),function(t,e,i,r,n,s,a,o){let{startAngle:l,endAngle:h}=t.getParsedAngle(),d=(0,eJ.Wn)(h-l),u=h>l,c=!1;if(a<=eJ.Ho)e.moveTo(i,r,n);else if(d>=eJ.f7-eJ.Ho)e.moveTo(i+a*(0,eJ.mC)(l),r+a*(0,eJ.O$)(l),n),e.arc(i,r,a,l,h,!u,n),e.lineTo(i+a*(0,eJ.mC)(h),r+a*(0,eJ.O$)(h),s),e.arc(i,r,a,h,l,u,s);else{let{innerouterDeltaAngle:t,innerouterStartAngle:d,innerouterEndAngle:p}=o(l,h),g=a*(0,eJ.mC)(d),f=a*(0,eJ.O$)(d),m=a*(0,eJ.mC)(p),v=a*(0,eJ.O$)(p);t<.001?c=!0:(e.moveTo(i+g,r+f,n),e.arc(i,r,a,d,p,!u,n),e.lineTo(i+m,r+v,s),e.arc(i,r,a,p,d,u,s))}e.closePath()}(t,e,i,r,T.top,T.bottom,"outside"===S?x:_,(e,i)=>{let{outerDeltaAngle:r,innerDeltaAngle:n,outerStartAngle:s,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===S?{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:s}:{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:l}}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):c&&(e.setCommonStyle(t,t.attribute,i,r,h),e.fillStyle=w?w.computeColor(k[S],A):d,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,r,h),e.stroke())),"inside"===S&&e.restore())}draw(t,e,i,r){let n=rQ(t,null==r?void 0:r.theme).arc;this._draw(t,n,!1,i,r)}};wk=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],wk);let wB=!1,wC=new eM(t=>{wB||(wB=!0,t(sM).to(wk).inSingletonScope(),t(sR).toService(sM))}),wE=class extends gt{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=n7}contains(t,e,i){let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).arc;r.highPerformanceSave();let{x:s,y:a,z:o,lastModelMatrix:l}=this.transform(t,n,r),h=e;if(r.camera){h=e.clone();let i=t.parent.globalTransMatrix;h.x=i.a*e.x+i.c*e.y+i.e,h.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=o;let d=!1;return this.canvasRenderer.drawShape(t,r,s,a,i,null,(t,e,i)=>!!d||(d=t.isPointInPath(h.x,h.y))),this.canvasRenderer.z=0,r.modelMatrix!==l&&s1.free(r.modelMatrix),r.modelMatrix=l,r.highPerformanceRestore(),d}};wE=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tB=0,tC=ez(sM),function(t,e){tC(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],wE);let wM=!1,wP=new eM((t,e,i,r)=>{wM||(wM=!0,t(pY).to(wE).inSingletonScope(),t(p9).toService(pY))});function wO(){wO.__loaded||(wO.__loaded=!0,as.RegisterGraphicCreator("arc3d",wT),rR.load(wC),rR.load(wP))}wO.__loaded=!1;class wR extends gh{constructor(t){super(t),this.type="pyramid3d",this.numberType=so}doUpdateAABBBounds(){let t=rQ(this).polygon;this._AABBBounds.clear();let e=this.attribute,i=ru.graphicService.updatePyramid3dAABBBounds(e,rQ(this).polygon,this._AABBBounds,this),{boundsPadding:r=t.boundsPadding}=e,n=nH(r);return n&&i.expand(n),this.clearUpdateBoundTag(),this._AABBBounds}findFace(){let{points:t}=this.attribute,e=t.map((e,i)=>{let r=3===i?t[0]:t[i+1],n=e.x-r.x;return 0===n?0:(e.y-r.y)/n}),i=t.map(t=>({p:t,d:0})),r=!1,n=0;for(let t=0;t<e.length-1;t++){for(let s=t+1;s<e.length;s++){if(e[t]===e[s]){r=!0;let e=ix.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,n=(0,eJ.Fp)(n,e);let a=ix.distancePP(i[s].p,i[s+1].p);i[s].d=a,i[s+1].d=a,n=(0,eJ.Fp)(n,a)}if(r)break}if(r)break}for(let e=t.length-1;e>=0;e--){let r=t[e];i.unshift({p:r,d:0})}for(let e=0;e<t.length;e++){let r=(n-i[e+t.length].d)/2;i[e].d+=r,i[e+t.length].d+=r}let s={polygons:[],vertices:[],edges:[]};return i.forEach(t=>{s.vertices.push([t.p.x,t.p.y,t.d])}),s.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),s.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),s.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),s.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),s.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),s.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),s.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],s}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return wR.NOWORK_ANIMATE_ATTR}}function wI(t){return new wR(t)}wR.NOWORK_ANIMATE_ATTR=nN;let wL=class extends oe{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=so}drawShape(t,e,i,r,n,s,a,o){var l;let h=rQ(t,null==s?void 0:s.theme).polygon,{fill:d=h.fill,stroke:u=h.stroke,face:c=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;let{light:g,camera:f}=n.stage||{},m=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,i,r,h);let n=d;"string"!=typeof n&&(n="black"),this.fill(i,r,p,m,c,n,e,g,f,t,h,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,r,h),this.stroke(i,r,p,m,e))}stroke(t,e,i,r,n){let s=r.vertices;r.edges.forEach(r=>{let a=s[r[0]],o=s[r[1]],l={x:t+a[0],y:e+a[1],z:i+a[2]},h={x:t+o[0],y:e+o[1],z:i+o[2]};n.beginPath(),n.moveTo(l.x,l.y,l.z),n.lineTo(h.x,h.y,h.z),n.stroke()})}fill(t,e,i,r,n,s,a,o,l,h,d,u){let c=nw.Get(s,oz.Color255),p=r.vertices,g=p.map(t=>a.view(t[0],t[1],t[2])[2]),f=[];r.polygons.forEach((t,e)=>{if(!n[e])return;f.push({faceIdx:e,polygon:t});let{polygon:i,normal:r}=t,s=g[i[0]],a=g[i[1]],o=g[i[2]],l=g[i[3]];t.ave_z=s+a+o+l}),f.sort((t,e)=>e.polygon.ave_z-t.polygon.ave_z),f.forEach(r=>{let{polygon:n,normal:l}=r.polygon,g=p[n[0]],f=p[n[1]],m=p[n[2]],v=p[n[3]],y={x:t+g[0],y:e+g[1],z:i+g[2]},b={x:t+f[0],y:e+f[1],z:i+f[2]},x={x:t+m[0],y:e+m[1],z:i+m[2]},_={x:t+v[0],y:e+v[1],z:i+v[2]};a.beginPath(),a.moveTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.lineTo(_.x,_.y,_.z),a.closePath(),u?u(a,h.attribute,d):(a.fillStyle=o?o.computeColor(l,c):s,a.fill())})}draw(t,e,i){let r=rQ(t).polygon;this._draw(t,r,!1,i)}};wL=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],wL);let wD=!1,wj=new eM(t=>{wD||(wD=!0,t(sH).to(wL).inSingletonScope(),t(sR).toService(sH))}),wN=class extends gt{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=so}contains(t,e,i){let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).polygon;r.highPerformanceSave();let{x:s,y:a,z:o,lastModelMatrix:l}=this.transform(t,n,r),h=e;if(r.camera){h=e.clone();let i=t.parent.globalTransMatrix;h.x=i.a*e.x+i.c*e.y+i.e,h.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=o;let d=!1;return this.canvasRenderer.drawShape(t,r,s,a,{},null,(t,e,i)=>!!d||(d=t.isPointInPath(h.x,h.y)),(t,e,i)=>!1),this.canvasRenderer.z=0,r.modelMatrix!==l&&s1.free(r.modelMatrix),r.modelMatrix=l,r.highPerformanceRestore(),d}};wN=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tE=0,tM=ez(sH),function(t,e){tM(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],wN);let wF=!1,wG=new eM((t,e,i,r)=>{wF||(wF=!0,t(p4).to(wN).inSingletonScope(),t(p9).toService(p4))});function wz(){wz.__loaded||(wz.__loaded=!0,as.RegisterGraphicCreator("pyramid3d",wI),rR.load(wj),rR.load(wG))}wz.__loaded=!1;let wZ=new class t extends a3{constructor(){super(...arguments),this.time=oF.beforeFillStroke}drawShape(t,e,i,r,n,s,a,o,l,h,d,u){let{background:c,backgroundMode:p=l.backgroundMode,backgroundFit:g=l.backgroundFit}=t.attribute;if(c){if(t.backgroundImg){let i=t.resources.get(c);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){let i=rQ(t.parent).group,{scrollX:r=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(r,n)}let r=t.AABBBounds;this.doDrawImage(e,i.data,r,p,g),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if((0,ep.Z)(c)){let{stroke:i,fill:r,lineWidth:n=1,cornerRadius:s=0,expandX:a=0,expandY:o=0}=c;if(!i&&!r)return;e.beginPath();let{x:l,y:h,width:d,height:u}=function(t){let e=nH(t.attribute.boundsPadding),i=t.AABBBounds,r=i.x1,n=i.y1,s=i.width(),a=i.height();return(0,iy.Z)(e)?(r+=e,n+=e,s-=2*e,a-=2*e):(r+=e[3],n+=e[0],s-=e[1]+e[3],a-=e[0]+e[2]),{x:r,y:n,width:s,height:a}}(t);s?aD(e,l-a,h-o,d+2*a,u+2*o,s):e.rect(l-a,h-o,d+2*a,u+2*o),e.globalAlpha=1,r&&(e.fillStyle=r,e.fill()),i&&n>0&&(e.lineWidth=n,e.strokeStyle=i,e.stroke())}else{e.beginPath();let n=t.AABBBounds;e.rect(i,r,n.width(),n.height()),e.fillStyle=c,e.globalAlpha=1,e.fill()}}}};var wH=function(t,e){return function(i,r){e(i,r,t)}};let wU=["","repeat-x","repeat-y","repeat"],wV=class extends oe{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=sr,this.builtinContributions=[wZ],this.init(t)}drawShape(t,e,i,r,n,s,a){let o=rQ(t).image,{width:l=o.width,height:h=o.height,repeatX:d=o.repeatX,repeatY:u=o.repeatY,cornerRadius:c=o.cornerRadius,image:p}=t.attribute,g=this.valid(t,o,a);if(!g)return;let{fVisible:f,sVisible:m,doFill:v,doStroke:y}=g;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,o),this.beforeRenderStep(t,e,i,r,v,!1,f,!1,o,n,a),v){if(a)a(e,t.attribute,o);else if(f){if(!p||!t.resources)return;let n=t.resources.get(p);if("success"!==n.state)return;let s=!1;0===c||(0,ev.Z)(c)&&c.every(t=>0===t)||(e.beginPath(),aD(e,i,r,l,h,c),e.save(),e.clip(),s=!0),e.setCommonStyle(t,t.attribute,i,r,o);let a=0;if("repeat"===d&&(a|=1),"repeat"===u&&(a|=2),a){let t=e.createPattern(n.data,wU[a]);e.fillStyle=t,e.translate(i,r,!0),e.fillRect(0,0,l,h),e.translate(-i,-r,!0)}else e.drawImage(n.data,i,r,l,h);s&&e.restore()}}this.afterRenderStep(t,e,i,r,v,!1,f,!1,o,n,a)}draw(t,e,i){let{image:r}=t.attribute;if(!r||!t.resources)return;let n=t.resources.get(r);if("loading"===n.state&&(0,ek.Z)(r))return void nE.improveImageLoading(r);if("success"!==n.state)return;let{context:s}=e.drawParams;if(!s)return;let a=rQ(t).image;this._draw(t,a,!1,i)}};wV=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),wH(0,ez(eH)),wH(0,eZ(aK)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],wV);let wW=!1,w$=new eM(t=>{wW||(wW=!0,t(sV).to(wV).inSingletonScope(),t(sR).toService(sV),t(aK).toService(a6),eV(t,aK))}),wY=class{constructor(){this.type="image",this.numberType=sr}contains(t,e,i){let{pickContext:r}=null!=i?i:{};return!!r&&!!t.AABBBounds.containsPoint(e)}};wY=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],wY);let wX=!1,wK=new eM((t,e,i,r)=>{wX||(wX=!0,t(pq).to(wY).inSingletonScope(),t(p9).toService(pq))}),wq=!1,wJ=new eM((t,e,i,r)=>{wq||(wq=!0,t(pF).to(mB).inSingletonScope(),t(mB).toService(pF))});function wQ(){wQ.__loaded||(wQ.__loaded=!0,as.RegisterGraphicCreator("image",mp),rR.load(w$),rR.load(pI?wK:wJ))}wQ.__loaded=!1;let w0=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class w1 extends f0{constructor(t){super(t),this.type="rect3d",this.numberType=sh}findFace(){let t={polygons:[],vertices:[],edges:[]},e=rQ(this).rect3d,{x1:i,y1:r,x:n,y:s,length:a=(0,eJ.VV)(e.width,e.height)}=this.attribute,{width:o,height:l}=this.attribute;o=null!=o?o:i-n,l=null!=l?l:r-s;for(let e=0;e<w0.length;e++){let i=w0[e];t.vertices.push([i[0]*o,i[1]*l,i[2]*a])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return w1.NOWORK_ANIMATE_ATTR}}function w2(t){return new w1(t)}w1.NOWORK_ANIMATE_ATTR=nN;let w5=class extends oe{constructor(){super(...arguments),this.type="rect3d",this.numberType=sh}drawShape(t,e,i,r,n,s,a,o){var l,h;let d=rQ(t,null==s?void 0:s.theme).rect3d,{fill:u=d.fill,stroke:c=d.stroke,x1:p,y1:g,x:f,y:m,opacity:v=d.opacity,fillOpacity:y=d.fillOpacity,lineWidth:b=d.lineWidth,strokeOpacity:x=d.strokeOpacity,visible:_=d.visible}=t.attribute,{width:A,height:w}=t.attribute;A=(null!=A?A:p-f)||0,w=(null!=w?w:g-m)||0;let S=null!==(l=this.z)&&void 0!==l?l:0,T=aG(v,y,A,w,u),k=aZ(v,x,A,w),B=!!u,C=aN(c,b);if(!t.valid||!_||!B&&!C||!(T||k||a||o))return;let{light:E,camera:M}=n.stage||{},P=t.findFace();if(!1!==u){e.setCommonStyle(t,t.attribute,i,r,d);let n=u;"string"!=typeof n&&(n="black"),this.fill(i,r,S,P,n,e,E,a)}!1!==c&&(e.setStrokeStyle(t,t.attribute,i,r,d),this.stroke(i,r,S,P,e))}stroke(t,e,i,r,n){let s=r.vertices;r.edges.forEach(r=>{let a=s[r[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=s[r[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};n.beginPath(),n.moveTo(o.x,o.y,o.z),n.lineTo(h.x,h.y,h.z),n.stroke()})}fill(t,e,i,r,n,s,a,o){let l=nw.Get(n,oz.Color255),h=r.vertices,d=h.map(t=>s.view(t[0],t[1],t[2])[2]),u=[];r.polygons.forEach((t,e)=>{u.push({faceIdx:e,polygon:t});let{polygon:i,normal:r}=t,n=d[i[0]],s=d[i[1]],a=d[i[2]],o=d[i[3]];t.ave_z=n+s+a+o}),u.sort((t,e)=>e.polygon.ave_z-t.polygon.ave_z),u.forEach(r=>{let{polygon:d,normal:u}=r.polygon,c=h[d[0]],p=h[d[1]],g=h[d[2]],f=h[d[3]],m={x:t+c[0],y:e+c[1],z:i+c[2]},v={x:t+p[0],y:e+p[1],z:i+p[2]},y={x:t+g[0],y:e+g[1],z:i+g[2]},b={x:t+f[0],y:e+f[1],z:i+f[2]};s.beginPath(),s.moveTo(m.x,m.y,m.z),s.lineTo(v.x,v.y,v.z),s.lineTo(y.x,y.y,y.z),s.lineTo(b.x,b.y,b.z),s.closePath(),o?o(s,null,null):(s.fillStyle=a?a.computeColor(u,l):n,s.fill())})}draw(t,e,i){let r=rQ(t).rect;this._draw(t,r,!1,i)}};w5=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],w5);let w3=!1,w4=new eM(t=>{w3||(w3=!0,t(sF).to(w5).inSingletonScope(),t(sR).toService(sF))});new il;let w6=class extends gt{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=sh}contains(t,e,i){let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=rQ(t).rect;r.highPerformanceSave();let{x:s,y:a,z:o,lastModelMatrix:l}=this.transform(t,n,r),h=e;if(r.camera){h=e.clone();let i=t.parent.globalTransMatrix;h.x=i.a*e.x+i.c*e.y+i.e,h.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=o;let d=!1;return this.canvasRenderer.drawShape(t,r,s,a,i,null,(t,e,i)=>!!d||(d=t.isPointInPath(h.x,h.y))),this.canvasRenderer.z=0,r.modelMatrix!==l&&s1.free(r.modelMatrix),r.modelMatrix=l,r.highPerformanceRestore(),d}};w6=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tP=0,tO=ez(sF),function(t,e){tO(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],w6);let w8=!1,w7=new eM((t,e,i,r)=>{w8||(w8=!0,t(p1).to(w6).inSingletonScope(),t(p9).toService(p1))});function w9(){w9.__loaded||(w9.__loaded=!0,as.RegisterGraphicCreator("rect3d",w2),rR.load(w4),rR.load(w7))}w9.__loaded=!1;class St extends nF{constructor(t){super(t),this.type="glyph",this.numberType=se,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach(t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)}),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach(t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})})}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,r){super.setAttribute(t,e,i,r),this.subGraphic.forEach(t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()})}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach(t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()})}translate(t,e){return super.translate(t,e),this.subGraphic.forEach(t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()}),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach(t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()}),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach(t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()}),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach(t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()}),this}rotate(t){return super.rotate(t),this.subGraphic.forEach(t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()}),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach(t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()}),this}doUpdateAABBBounds(){this._AABBBounds.clear();let t=ru.graphicService.updateGlyphAABBBounds(this.attribute,rQ(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some((t,e)=>this.currentStates[e]!==t)))return;let r={},n=this.subGraphic.map(()=>({}));t.forEach(e=>{var i;let s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(r,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&n.forEach((t,e)=>{Object.assign(t,s.subAttributes[e])}))}),this.subGraphic.forEach((i,r)=>{i.updateNormalAttrs(n[r]),i.applyStateAttrs(n[r],t,e)}),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}clearStates(t){this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach(e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null}),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){let t=new St(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map(t=>t.clone())),t}getNoWorkAnimateAttr(){return St.NOWORK_ANIMATE_ATTR}}function Se(t){return new St(t)}St.NOWORK_ANIMATE_ATTR=nN;let Si=class{constructor(){this.numberType=se}drawShape(t,e,i,r,n,s,a,o){n.drawContribution&&t.getSubGraphic().forEach(t=>{let l=n.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,i,r,n,s,a,o)})}draw(t,e,i,r){let{context:n}=i;if(!n||(n.highPerformanceSave(),!i.drawContribution))return;let s=rQ(t),a=t.getSubGraphic();a.length&&a.forEach(t=>{i.drawContribution.renderItem(t,i,{theme:s})}),n.highPerformanceRestore()}};Si=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],Si);let Sr=!1,Sn=new eM(t=>{Sr||(Sr=!0,t(sU).to(Si).inSingletonScope(),t(sR).toService(sU))}),Ss=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=se}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=null==i?void 0:i.pickerService;if(n){let r=!1;return t.getSubGraphic().forEach(t=>{if(r)return;let s=n.pickItem(t,e,null,i);r=!(!s||!s.graphic)}),r}return!1}};Ss=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tR=0,tI=ez(sU),function(t,e){tI(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ss);let Sa=!1,So=new eM((t,e,i,r)=>{Sa||(Sa=!0,t(p8).to(Ss).inSingletonScope(),t(p9).toService(p8))}),Sl=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=se}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:r}=null!=i?i:{};if(!r)return!1;let n=null==i?void 0:i.pickerService;if(n){let r=!1;return t.getSubGraphic().forEach(t=>{r||(r=!!n.pickItem(t,e,null,i))}),r}return!1}};Sl=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(tL=0,tD=ez(sU),function(t,e){tD(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Sl);let Sh=!1,Sd=new eM((t,e,i,r)=>{Sh||(Sh=!0,t(pW).to(Sl).inSingletonScope(),t(Sl).toService(pW))});function Su(){Su.__loaded||(Su.__loaded=!0,as.RegisterGraphicCreator("glyph",Se),rR.load(Sn),rR.load(pI?So:Sd))}Su.__loaded=!1;let Sc=500,Sp=500,Sg=1,Sf=class{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;let{nativeCanvas:i,width:r=Sc,height:n=Sp,dpr:s=Sg,x:a,y:o,id:l,canvasControled:h=!0}=t;this._x=null!=a?a:0,this._y=null!=o?o:0,this._pixelWidth=r*s,this._pixelHeight=n*s,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=r,this._displayHeight=n,this._dpr=s,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:l,l&&(i.id=l),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,r){return this._context.getImageData(t,e,i,r)}convertToBlob(t){throw Error("暂未实现")}transferToImageBitmap(){throw Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}};Sf.env="browser",Sf=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Sf);let Sm=[0,0,0],Sv=(t,e,i,r,n,s,a,o)=>{if(o)for(;i>e;)i-=eJ.f7;else for(;i<e;)i+=eJ.f7;let l=eJ.pi/3*(i>e?1:-1),h=e,d=h;for(;d!==i;){let e=4*Math.tan(Math.abs((d=l>0?Math.min(d+l,i):Math.max(d+l,i))-h)/4)/3,o=d<h?-1:1,u=Math.cos(h),c=Math.sin(h),p=Math.cos(d),g=Math.sin(d),f=u*s+r,m=c*a+n,v=p*s+r,y=g*a+n,b=s*e*o,x=a*e*o;t.push([f-b*c,m+x*u,v+b*g,y-x*p,v,y]),h=d}},Sy=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){!!this._inuse!==t&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},iQ),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},i1),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},i2),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;let i=t.nativeCanvas.getContext("2d");if(!i)throw Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new e3(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new e3(1,0,0,1,0,0),this._clearMatrix=new e3(1,0,0,1,0,0)}reset(){this.stack.length&&eC.Y.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new e3(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return s0.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(s0.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(s0.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){let t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){let t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,r,n=!0){this.translate(i,r,!1),this.scale(t,e,!1),this.translate(-i,-r,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,r,n,s,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*r,o*n,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,r,n,s,a=!0){this.matrix.multiply(t,e,i,r,n,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){let i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,r=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),r&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,r=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),r&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,r,n,s,a){if(a=a||0,this.camera){let o=[];Sv(o,r,n,t,e,i,i,s);for(let t=0;t<o.length;++t){let e=o[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],a)}}else this.nativeContext.arc(t,e,i,r,n,s)}arcTo(t,e,i,r,n){this.nativeContext.arcTo(t,e,i,r,n)}bezierCurveTo(t,e,i,r,n,s,a){if(a=a||0,this.camera){let o=a,l=a;this.modelMatrix&&(hB(Sm,[t,e,a],this.modelMatrix),t=Sm[0],e=Sm[1],o=Sm[2],hB(Sm,[i,r,a],this.modelMatrix),i=Sm[0],r=Sm[1],l=Sm[2],hB(Sm,[n,s,a],this.modelMatrix),n=Sm[0],s=Sm[1],a=Sm[2]);let h=this.camera.vp(n,s,a);n=h.x,s=h.y,t=(h=this.camera.vp(t,e,o)).x,e=h.y,i=(h=this.camera.vp(i,r,l)).x,r=h.y}this.nativeContext.bezierCurveTo(t,e,i,r,n,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,r,n,s,a,o){null==o?this.nativeContext.ellipse(t,e,i,r,n,s,a):this.nativeContext.ellipse(t,e,i,r,n,s,a,o)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(hB(Sm,[t,e,i],this.modelMatrix),t=Sm[0],e=Sm[1],i=Sm[2]);let r=this.camera.vp(t,e,i);t=r.x,e=r.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(hB(Sm,[t,e,i],this.modelMatrix),t=Sm[0],e=Sm[1],i=Sm[2]);let r=this.camera.vp(t,e,i);t=r.x,e=r.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,r,n){if(n=n||0,this.camera){let s=n;this.modelMatrix&&(hB(Sm,[t,e,n],this.modelMatrix),t=Sm[0],e=Sm[1],s=Sm[2],hB(Sm,[i,r,n],this.modelMatrix),i=Sm[0],r=Sm[1],n=Sm[2]);let a=this.camera.vp(i,r,n);i=a.x,r=a.y,t=(a=this.camera.vp(t,e,s)).x,e=a.y}this.nativeContext.quadraticCurveTo(t,e,i,r)}rect(t,e,i,r,n){n=n||0,this.camera?(this.moveTo(t,e,n),this.lineTo(t+i,e,n),this.lineTo(t+i,e+r,n),this.lineTo(t,e+r,n),this.closePath()):this.nativeContext.rect(t,e,i,r)}createImageData(){let t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,r){return this.nativeContext.createLinearGradient(t,e,i,r)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,r,n,s){return this.nativeContext.createRadialGradient(t,e,i,r,n,s)}createConicGradient(t,e,i,r){let n,s=!1,a=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(o,l,h){return s&&(h||(h=r-i),n=function(t,e,i,r,n,s,a,o,l){let h=Math.floor(180*n/Math.PI),d=AG.GetCanvas(),u=AG.GetCtx();if(!u)return null;let c=AZ.GetSize(o),p=AZ.GetSize(l),g=AZ.Get(e,i,r,s,a,c,p);if(g)return g;let f=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(r,2),Math.pow(c-i,2)+Math.pow(r,2)),Math.max(Math.pow(c-i,2)+Math.pow(p-r,2),Math.pow(i,2)+Math.pow(p-r,2)))),m=h+1,v=n/Math.max(1,m-1),y=Az.getInstance().GetOrCreate(i,r,c,p,e,m),b=2*Math.PI*f/360;d.width=c,d.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,c,p),u.translate(i,r),u.rotate(s);for(let t=0,e=m-1;t<e&&!(s+t*v>a);t++){let e=y.getColor(t);u.beginPath(),u.rotate(v),u.moveTo(0,0),u.lineTo(f,-2*b),u.lineTo(f,0),u.fillStyle=e,u.closePath(),u.fill()}let x=u.getImageData(0,0,c,p);return d.width=x.width,d.height=x.height,u.putImageData(x,0,0),(g=t.createPattern(d,"no-repeat"))&&AZ.Set(e,i,r,s,a,g,c,p),g}(a,this.stops,t,e,h,i,r,o,l),s=!1),n}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,r){this.nativeContext.fillRect(t,e,i,r)}clearRect(t,e,i,r){this.nativeContext.clearRect(t,e,i,r)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(hB(Sm,[t,e,i],this.modelMatrix),t=Sm[0],e=Sm[1],i=Sm[2]);let r=this.camera.vp(t,e,i);t=r.x,e=r.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(hB(Sm,[t,e,i],this.modelMatrix),t=Sm[0],e=Sm[1],i=Sm[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,r){if(r=r||0,this.camera){this.modelMatrix&&(hB(Sm,[e,i,r],this.modelMatrix),e=Sm[0],i=Sm[1],r=Sm[2]);let t=this.camera.vp(e,i,r);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,r){return this.nativeContext.getImageData(t,e,i,r)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t,e=ru.global.measureTextMethod){var i,r;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=ru.graphicUtil.createTextMeasureInstance({},{},()=>this.canvas.nativeCanvas));let n=null!==(i=this.fontFamily)&&void 0!==i?i:i2.fontFamily,s=null!==(r=this.fontSize)&&void 0!==r?r:i2.fontSize;return this.mathTextMeasure.textSpec.fontFamily===n&&this.mathTextMeasure.textSpec.fontSize===s||(this.mathTextMeasure.textSpec.fontFamily=n,this.mathTextMeasure.textSpec.fontSize=s,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){let e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,r){this.nativeContext.strokeRect(t,e,i,r)}strokeText(t,e,i,r){if(r=r||0,this.camera){this.modelMatrix&&(hB(Sm,[e,i,r],this.modelMatrix),e=Sm[0],i=Sm[1],r=Sm[2]);let t=this.camera.vp(e,i,r);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){let t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,r,n){if(Array.isArray(n)){if(n.length<=1)return this._setCommonStyle(t,e,i,r,n[0]);let s=Object.create(n[0]);return n.forEach((t,e)=>{0!==e&&Object.assign(s,t)}),this._setCommonStyle(t,e,i,r,s)}return this._setCommonStyle(t,e,i,r,n)}_setCommonStyle(t,e,i,r,n){let s=this.nativeContext;n||(n=this.fillAttributes);let{fillOpacity:a=n.fillOpacity,opacity:o=n.opacity,fill:l=n.fill}=e;a>1e-12&&o>1e-12?(s.globalAlpha=a*o,s.fillStyle=aP(this,l,t,i,r)):s.globalAlpha=a*o}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);let r=Object.create(i[0]);return i.forEach((t,e)=>{0!==e&&Object.assign(r,t)}),this._setShadowBlendStyle(t,e,r)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){let r=this.nativeContext;i||(i=this.fillAttributes);let{opacity:n=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:a=i.shadowColor,shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:l=i.shadowOffsetY,blur:h=i.blur,globalCompositeOperation:d=i.globalCompositeOperation}=e;n<=1e-12||(s||o||l?(r.shadowBlur=s*this.dpr,r.shadowColor=a,r.shadowOffsetX=o*this.dpr,r.shadowOffsetY=l*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(r.shadowBlur=0,r.shadowOffsetX=0,r.shadowOffsetY=0),h?(r.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(r.filter="blur(0px)",this._clearFilterStyle=!1),d?(r.globalCompositeOperation=d,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(r.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,r,n){if(Array.isArray(n)){if(n.length<=1)return this._setStrokeStyle(t,e,i,r,n[0]);let s=Object.create(n[0]);return n.forEach((t,e)=>{0!==e&&Object.assign(s,t)}),this._setStrokeStyle(t,e,i,r,s)}return this._setStrokeStyle(t,e,i,r,n)}_setStrokeStyle(t,e,i,r,n){let s=this.nativeContext;n||(n=this.strokeAttributes);let{strokeOpacity:a=n.strokeOpacity,opacity:o=n.opacity}=e;if(a>1e-12&&o>1e-12){let{lineWidth:l=n.lineWidth,stroke:h=n.stroke,lineJoin:d=n.lineJoin,lineDash:u=n.lineDash,lineCap:c=n.lineCap,miterLimit:p=n.miterLimit}=e;s.globalAlpha=a*o,s.lineWidth=aM(this,l,this.dpr),s.strokeStyle=aP(this,h,t,i,r),s.lineJoin=d,s.setLineDash(u),s.lineCap=c,s.miterLimit=p}}setTextStyleWithoutAlignBaseline(t,e,i){let r=this.nativeContext;e||(e=this.textAttributes);let{scaleIn3d:n=e.scaleIn3d}=t;t.font?r.font=t.font:r.font=mP(t,e,n&&this.camera&&this.camera.getProjectionScale(i));let{fontFamily:s=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=s,this.fontSize=a,r.textAlign="left",r.textBaseline="alphabetic"}setTextStyle(t,e,i){var r,n;let s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=mP(t,e,this.camera&&this.camera.getProjectionScale(i));let{fontFamily:a=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=a,this.fontSize=o,s.textAlign=null!==(r=t.textAlign)&&void 0!==r?r:e.textAlign,s.textBaseline=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,r,n,s){this._clearMatrix.setValue(t,e,i,r,n,s)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach(t=>s0.free(t)),this.stack.length=0}};Sy.env="browser",Sy=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],Sy);let Sb=class extends Sf{constructor(t){super(t)}init(t){let{container:e}=t;if("string"==typeof e){let t=ru.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new Sy(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;let{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,t.style&&this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){let t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;let{width:e=this._displayWidth,height:i=this._displayHeight,dpr:r=this._dpr,x:n=this._x,y:s=this._y}=t,{nativeCanvas:a}=this;a.width=e*r,a.height=i*r,a.style&&this.setCanvasStyle(a,n,s,e,i),t.id&&(a.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,r,n){this.controled&&(t.style.width=`${r}px`,t.style.height=`${n}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function Sx(t,e){return new eM(i=>{i(rI).toDynamicValue(()=>e=>new t(e)).whenTargetNamed(t.env),i(rL).toDynamicValue(()=>(t,i)=>new e(t,i)).whenTargetNamed(e.env)})}Sb.env="browser";let S_=Sx(Sb=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Sb),Sy);var SA=function(t,e){return function(i,r){e(i,r,t)}};let Sw=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=ru.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((t,e)=>t.order-e.order)}pick(t,e,i){let r,n={graphic:null,group:null};i.pickerService=this;let s=i.bounds.width(),a=i.bounds.height();if(!(new il).setValue(0,0,s,a).containsPoint(e))return n;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);let o=new e3(1,0,0,1,0,0);for(let s=t.length-1;s>=0&&!(n=t[s].isContainer?this.pickGroup(t[s],e,o,i):this.pickItem(t[s],e,o,i)).graphic;s--)r||(r=n.group);if(n.graphic||(n.group=r),this.pickContext&&(this.pickContext.inuse=!1),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){var r;return!!(null===(r=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===r?void 0:r.graphic)}pickGroup(t,e,i,r){let n={group:null,graphic:null};if(!1===t.attribute.visibleAll)return n;let s=r.pickContext,a=s.modelMatrix;if(s.camera){let e=t.transMatrix,i=s1.allocate();if(ae(i,e),a){if(i){let t=s1.allocate();s.modelMatrix=ai(t,a,i),s1.free(i)}}else ae(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){let o=this.InterceptorContributions[n];if(o.beforePickItem){let n=o.beforePickItem(t,this,e,r,{parentMatrix:i});if(n)return s.modelMatrix!==a&&s1.free(s.modelMatrix),s.modelMatrix=a,n}}let o=t.transMatrix,l=s0.allocateByObj(i),h=new ib(e.x,e.y);l.transformPoint(h,h);let d=t.AABBBounds.containsPoint(h);if(!d&&!t.stage.camera)return n;let u=this.pickItem(t,h.clone(),i,r);u&&u.graphic&&(n.graphic=u.graphic,n.params=u.params);let c=!1!==t.attribute.pickable&&d;return l.multiply(o.a,o.b,o.c,o.d,o.e,o.f),!1===t.attribute.childrenPickable||u&&u.graphic||ab(t,i4.zIndex,s=>{if(s.isContainer){let i=new ib(e.x,e.y),a=rQ(t).group,{scrollX:o=a.scrollX,scrollY:h=a.scrollY}=t.attribute;i.x-=o,i.y-=h,n=this.pickGroup(s,i,l,r)}else{let a=new ib(e.x,e.y);l.transformPoint(a,a);let o=rQ(t).group,{scrollX:h=o.scrollX,scrollY:d=o.scrollY}=t.attribute;a.x-=h,a.y-=d;let u=this.pickItem(s,a,i,r);u&&u.graphic&&(n.graphic=u.graphic,n.params=u.params)}return!!n.graphic||!!n.group},!0,!!s.camera),s.modelMatrix!==a&&s1.free(s.modelMatrix),s.modelMatrix=a,n.graphic||n.group||!c||t.stage.camera||(n.group=t),s0.free(l),n}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};Sw=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),SA(0,ez(eH)),SA(0,eZ(s5)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Sw);var SS=function(t,e){return function(i,r){e(i,r,t)}};let ST=class extends Sw{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",(t,e,i)=>{this.configure(i,e)}),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach(t=>{this.pickerMap.set(t.numberType,t)}),super._init()}configure(t,e){this.pickCanvas=rj.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,r){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){let s=this.InterceptorContributions[n];if(s.beforePickItem){let n=s.beforePickItem(t,this,e,r,{parentMatrix:i});if(n)return n}}let n=this.pickerMap.get(t.numberType);if(!n)return null;let s=n.contains(t,e,r)?t:null,a={graphic:s};if(s)return a;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){let s=this.InterceptorContributions[n];if(s.afterPickItem){let n=s.afterPickItem(t,this,e,r,{parentMatrix:i});if(n)return n}}return a}};ST=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),SS(0,ez(eH)),SS(0,eZ(p9)),SS(1,ez(sW)),SS(2,ez(eH)),SS(2,eZ(s5)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Object,Object])],ST);let Sk=class{constructor(){this.type="group",this.numberType=si}contains(t,e,i){return!1}};Sk=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],Sk);let SB=new eM((t,e,i,r)=>{SB.__vloaded||(SB.__vloaded=!0,t(p7).to(Sk).inSingletonScope(),t(p9).toService(p7),eV(t,p9))});SB.__vloaded=!1;let SC=new eM((t,e,i,r)=>{i(ST)||t(ST).toSelf().inSingletonScope(),i(sK)?r(sK).toService(ST):t(sK).toService(ST)}),SE=class{constructor(){this._uid=eE.GenAutoIncrementId(),this.viewBox=new il,this.modelMatrix=new e3(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,r,n,s){this.modelMatrix.setValue(t,e,i,r,n,s)}getViewBoxTransform(){return this.modelMatrix}};SE=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],SE);let SM=ea=class extends SE{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${ea.idprefix}_${ea.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=ru.global,this.viewBox=new il,this.modelMatrix=new e3(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){let e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>r)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);let t=new IntersectionObserver((t,e)=>{t.forEach(t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting})});t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){let e;let i=this.global.createCanvas({width:t.width,height:t.height});if(!(e="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement()))throw Error("发生错误,containerId可能传入有误");t.offscreen?e=null:e.appendChild(i);let r={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,container:e,id:ea.GenerateCanvasId(),canvasControled:!0};this.canvas=new Sb(r)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(!(i=this.global.getElementById(t.canvas)))throw Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw Error("发生错误,传入的canvas不正确");let r=t.width,n=t.height;if(null==r||null==n||!t.canvasControled){let t=i.getBoundingClientRect();r=t.width,n=t.height}let s=t.dpr;null==s&&(s=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/r),this.canvas=new Sb({width:r,height:n,dpr:s,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){return this.canvas.nativeCanvas.style}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){let t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){let e=this.viewBox,i=this.getContext(),r=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(r,0,0,r,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};SM.env="browser",SM.idprefix="visactor_window",SM.prefix_count=0,SM=ea=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],SM);let SP=new eM(t=>{t(SM).toSelf(),t(rF).toDynamicValue(t=>t.container.get(SM)).whenTargetNamed(SM.env)}),SO=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new il}removeDom(t){return!1}createDom(t){return null}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){let e=fetch(t).then(t=>t.json());return e.then(t=>({data:t,state:"success"})).catch(()=>({data:null,state:"fail"})),e}loadArrayBuffer(t){return fetch(t).then(t=>t.arrayBuffer()).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadBlob(t){return fetch(t).then(t=>t.blob()).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}};SO=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],SO);class SR{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function SI(t,e=!1){let i=document.createElement("img");if(i.crossOrigin="anonymous",e){let e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return(i.src=t,i.complete)?Promise.resolve(i):new Promise((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(Error("加载失败"))}})}let SL=class extends SO{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i;if(e){let r,n;let{clientX:s,clientY:a}=t,o=e.getBoundingClientRect(),l=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;return l&&(r=o.width/l.offsetWidth,n=o.height/l.offsetHeight),{x:(s-o.left)/((0,eg.Z)(r)?r:1),y:(a-o.top)/((0,eg.Z)(n)?n:1)}}return{x:t.offsetX,y:t.offsetY}}getNativeAABBBounds(t){let e=t;return("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild).lastChild&&(e=e.lastChild.firstChild),e.getBoundingClientRect)?new SR(e.getBoundingClientRect()):new il}removeDom(t){return t.parentElement.removeChild(t),!0}createDom(t){let{tagName:e="div",width:i,height:r,style:n,parent:s}=t,a=document.createElement(e);if(n&&((0,ek.Z)(n)?a.setAttribute("style",n):Object.keys(n).forEach(t=>{a.setAttribute(t,n[t])})),null!=i&&(a.style.width=`${i}px`),null!=r&&(a.style.height=`${r}px`),s){let t=(0,ek.Z)(s)?this.getElementById(s):s;t&&t.appendChild&&t.appendChild(a)}return a}loadImage(t){return SI(t,!1).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadSvg(t){return SI(t,!0).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}createCanvas(t){var e,i;let r=document.createElement("canvas");t.id&&(r.id=null!==(e=t.id)&&void 0!==e?e:eE.GenAutoIncrementId().toString());let n=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.width=t.width*n,r.height=t.height*n),r}createOffscreenCanvas(t){var e;let i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;(e="string"==typeof t?document.getElementById(t):t)&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}getElementTop(t,e){let i=t.offsetTop,r=t.offsetParent;for(;null!==r;)i+=r.offsetTop,r=r.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,r=t.offsetParent;for(;null!==r;)i+=r.offsetLeft,r=r.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,r=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,r+=n.offsetLeft,n=n.offsetParent;return{top:i,left:r}}};SL=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],SL);let SD=new eM(t=>{SD.isBrowserBound||(SD.isBrowserBound=!0,t(SL).toSelf().inSingletonScope(),t(eY).toService(SL))});function Sj(t,e=!0){var i;Sj.__loaded||(Sj.__loaded=!0,t.load(SD),t.load(S_),t.load(SP),e&&((i=t).load(SB),i.load(SC)))}SD.isBrowserBound=!1,Sj.__loaded=!1;let SN=class extends Sy{constructor(t,e){super(t,e);let i=t.nativeCanvas.getContext("2d");if(!i)throw Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new e3(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(...t){}};SN.env="node",SN=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],SN);let SF=class extends Sf{constructor(t){super(t)}init(){this._context=new SN(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(...t){this._nativeCanvas.release&&r6(this._nativeCanvas.release)&&this._nativeCanvas.release()}};SF.env="node";let SG=Sx(SF=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],SF),SN),Sz=class extends SE{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){let e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:eE.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new SF(i)}createWindowByCanvas(t){let e=t.canvas,i=t.width,r=t.height;null!=i&&null!=r&&t.canvasControled||(i=e.width,r=e.height),this.canvas=new SF({width:i,height:r,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(t="image/png"){return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};Sz.env="node",Sz=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej(),(eo=0,el=ez(eX),function(t,e){el(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Sz);let SZ=new eM(t=>{t(Sz).toSelf(),t(rF).toDynamicValue(t=>t.container.get(Sz)).whenTargetNamed(Sz.env)}),SH=class extends SO{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){let e=fetch(t).then(t=>t.json());return e.then(t=>({data:t,state:"success"})).catch(()=>({data:null,state:"fail"})),e}loadArrayBuffer(t){return fetch(t).then(t=>t.arrayBuffer()).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadImage(t){let{loadImage:e}=this.pkg;return e?e(t).then(t=>({loadState:t?"success":"fail",data:t})).catch(()=>({loadState:"fail",data:null})):Promise.reject(Error("node-canvas loadImage could not be found!"))}loadSvg(t){let e=this.pkg.Resvg;if(!e)return Promise.reject(Error("@resvg/resvg-js svgParser could not be found!"));let i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return nQ.call(t)}}getCancelAnimationFrame(){return t=>{nQ.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};SH=function(t,e,i,r){var n,s=arguments.length,a=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}([ej()],SH);let SU=new eM(t=>{SU.isNodeBound||(SU.isNodeBound=!0,t(SH).toSelf().inSingletonScope(),t(eY).toService(SH))});function SV(t,e=!0){SV.__loaded||(SV.__loaded=!0,t.load(SU),t.load(SG),t.load(SZ))}SU.isNodeBound=!1,SV.__loaded=!1;uL.useRegisters([()=>{ld.registerGrammar("scale",pg,"scales")},()=>{ld.registerGrammar("coordinate",pb,"coordinates")},()=>{ld.registerMark(tF.cell,pw)},()=>{ld.registerMark(tF.interval,pS)},()=>{ld.registerGraphicComponent(tZ.lineAxis,(t,e)=>new vO(t,e)),ld.registerGraphicComponent(tZ.circleAxis,t=>new vL(t)),ld.registerComponent(tG.axis,vG)},()=>{ld.registerGraphicComponent(tU.discreteLegend,t=>new vQ(t)),ld.registerGraphicComponent(tU.colorLegend,t=>new yU(t)),ld.registerGraphicComponent(tU.sizeLegend,t=>new yV(t)),ld.registerComponent(tG.legend,yQ),cI(yY,y$),ld.registerInteraction(yX.type,yX)},()=>{ld.registerGraphicComponent(tG.slider,t=>new yH(t)),ld.registerComponent(tG.slider,y2),cI(yY,y$),ld.registerInteraction(y0.type,y0)},()=>{ld.registerGraphicComponent(tG.label,t=>new bB(t)),ld.registerComponent(tG.label,bE)},()=>{ld.registerGraphicComponent(tG.datazoom,t=>new bW(t)),ld.registerComponent(tG.datazoom,bX),cI(yY,y$),ld.registerInteraction(b$.type,b$)},()=>{ld.registerGraphicComponent(t$.continuousPlayer,t=>new xt(t)),ld.registerGraphicComponent(t$.discretePlayer,t=>new xe(t)),ld.registerComponent(tG.player,xs),cI(yY,y$),ld.registerInteraction(xi.type,xi)},()=>{ld.registerGraphicComponent(tG.title,t=>new xd(t)),ld.registerComponent(tG.title,xc)},()=>{ld.registerGraphicComponent(tH.lineAxisGrid,(t,e)=>new xm(t,e)),ld.registerGraphicComponent(tH.circleAxisGrid,(t,e)=>new xy(t,e)),ld.registerComponent(tG.grid,x_)},()=>{ld.registerGraphicComponent(tG.scrollbar,t=>new vK(t)),ld.registerComponent(tG.scrollbar,xC),cI(yY,y$),ld.registerInteraction(xA.type,xA)},()=>{ld.registerTransform("bin",{transform:xE,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("contour",{transform:xR,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("sort",{transform:xN,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("filter",{transform:xF,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("join",{transform:xq,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("kde",{transform:xK,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("map",{transform:xG,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("pick",{transform:xQ,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("range",{transform:x0,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("stack",{transform:x4,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("funnel",{transform:x9,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("pie",{transform:_t,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("circularRelation",{transform:_r,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("fold",{transform:x6,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("unfold",{transform:x7,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("identifier",{transform:_v,markPhase:"beforeJoin"},!0)},()=>{ld.registerTransform("sampling",{transform:_p,markPhase:"afterEncode"},!0)},()=>{ld.registerTransform("markoverlap",{transform:_f,markPhase:"afterEncode"},!0)},()=>{ld.registerTransform("dodge",{transform:_y,markPhase:"afterEncodeItems"},!0)},()=>{ld.registerTransform("jitter",{transform:_A,markPhase:"afterEncodeItems"},!0)},()=>{ld.registerTransform("jitterX",{transform:__,markPhase:"afterEncodeItems"},!0)},()=>{ld.registerTransform("jitterY",{transform:_x,markPhase:"afterEncodeItems"},!0)},()=>{ld.registerTransform("symmetry",{transform:_S,markPhase:"afterEncodeItems"},!0)},()=>{ld.registerAnimationType("clipIn",_T)},()=>{ld.registerAnimationType("clipOut",_k)},()=>{ld.registerAnimationType("fadeIn",_B)},()=>{ld.registerAnimationType("fadeOut",_C)},()=>{ld.registerAnimationType("growAngleIn",_j)},()=>{ld.registerAnimationType("growAngleOut",_G)},()=>{ld.registerAnimationType("growCenterIn",_E)},()=>{ld.registerAnimationType("growCenterOut",_M)},()=>{ld.registerAnimationType("growHeightIn",_R)},()=>{ld.registerAnimationType("growHeightOut",_I)},()=>{ld.registerAnimationType("growIntervalIn",_2)},()=>{ld.registerAnimationType("growIntervalOut",_5)},()=>{ld.registerAnimationType("growPointsIn",_Y)},()=>{ld.registerAnimationType("growPointsOut",_X)},()=>{ld.registerAnimationType("growPointsXIn",_q)},()=>{ld.registerAnimationType("growPointsXOut",_J)},()=>{ld.registerAnimationType("growPointsYIn",_0)},()=>{ld.registerAnimationType("growPointsYOut",_1)},()=>{ld.registerAnimationType("growRadiusIn",_H)},()=>{ld.registerAnimationType("growRadiusOut",_W)},()=>{ld.registerAnimationType("growWidthIn",_P)},()=>{ld.registerAnimationType("growWidthOut",_O)},()=>{ld.registerAnimationType("moveIn",_3)},()=>{ld.registerAnimationType("moveOut",_4)},()=>{ld.registerAnimationType("rotateIn",At)},()=>{ld.registerAnimationType("rotateOut",Ae)},()=>{ld.registerAnimationType("scaleIn",_6)},()=>{ld.registerAnimationType("scaleOut",_8)},()=>{ld.registerAnimationType("update",_9)},()=>{ld.registerInteraction(Ai.type,Ai)},()=>{cI(As,wy),ld.registerInteraction(As.type,As)},()=>{cI(Aa,wy),ld.registerInteraction(Aa.type,Aa)},()=>{ld.registerInteraction(Ao.type,Ao)},()=>{ld.registerInteraction(Al.type,Al)},()=>{ld.registerInteraction(Ah.type,Ah)},()=>{ld.registerInteraction(Ad.type,Ad)},()=>{ld.registerInteraction(Au.type,Au)},()=>{ld.registerInteraction(Ab.type,Ab)},()=>{ld.registerInteraction(Ax.type,Ax)},()=>{cI(A_,y$),ld.registerInteraction(A_.type,A_)},()=>{cI(AA,y$),ld.registerInteraction(AA.type,AA)},()=>{ld.registerInteraction(Aw.type,Aw)},()=>{ld.registerInteraction(AP.type,AP)},()=>{ld.registerInteraction(AI.type,AI)},()=>{ld.registerInteraction(wn.type,wn)},()=>{cI(wa,wp),ld.registerInteraction(wa.type,wa)},()=>{cI(wo,wg),ld.registerInteraction(wo.type,wo)},()=>{cI(wl,wf),ld.registerInteraction(wl.type,wl)},()=>{cI(wm,wp),cI(wm,wf),cI(wm,wg),ld.registerInteraction(wm.type,wm)},()=>{ld.registerInteraction(wv.type,wv)},()=>{ww(),vf(),ld.registerGraphic(tF.circle,vr)},()=>{ww(),A0(),ld.registerGraphic(tF.arc,AN)},()=>{ww(),wO(),ld.registerGraphic(tF.arc3d,wT)},()=>{ww(),wz(),ld.registerGraphic(tF.pyramid3d,wI)},()=>{ww(),bH(),ld.registerGraphic(tF.area,bI)},()=>{ww(),pC(),ld.registerGraphic(tF.group,sy)},()=>{ww(),wQ(),ld.registerGraphic(tF.image,mp)},()=>{ww(),w9(),ld.registerGraphic(tF.rect3d,w2)},()=>{ww(),go(),ld.registerGraphic(tF.line,pP)},()=>{ww(),vE(),ld.registerGraphic(tF.path,vy)},()=>{ww(),ml(),ld.registerGraphic(tF.rect,f1)},()=>{ww(),go(),ld.registerGraphic(tF.rule,pP)},()=>{ww(),vE(),ld.registerGraphic(tF.shape,vy)},()=>{ww(),fD(),ld.registerGraphic(tF.symbol,fS)},()=>{ww(),mY(),mM(),ld.registerGraphic(tF.text,mj)},()=>{ww(),gS(),ld.registerGraphic(tF.polygon,gd)},()=>{ww(),mM(),ld.registerGraphic(tF.richtext,mb)},()=>{ww(),fD(),ld.registerGraphic(tF.cell,fS)},()=>{ww(),ml(),A0(),ld.registerGraphic(tF.interval,f1)},()=>{ww(),Su(),ld.registerGraphic(tF.glyph,Se)},()=>{ww(),vE(),ld.registerGraphic(tF.largeRects,t=>new wb(t))},()=>{ww(),vE(),ld.registerGraphic(tF.largeSymbols,t=>new wx(t))}]),hM()?Sj(rR):function(){hE();let t=ru.global&&ru.global.env;return t?"node"===t:!l}()&&SV(rR)},464283:function(t,e,i){var r=i(876058);e.Z=t=>Array.isArray?Array.isArray(t):(0,r.Z)(t,"Array")},843020:function(t,e){e.Z=t=>null==t},131045:function(t,e,i){var r=i(876058);e.Z=(t,e=!1)=>{let i=typeof t;return e?"number"===i:"number"===i||(0,r.Z)(t,"Number")}},200007:function(t,e){e.Z=t=>{let e=typeof t;return null!==t&&"object"===e||"function"===e}},681747:function(t,e,i){var r=i(876058);e.Z=(t,e=!1)=>{let i=typeof t;return e?"string"===i:"string"===i||(0,r.Z)(t,"String")}},876058:function(t,e){e.Z=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`},269658:function(t,e,i){var r=i(131045);e.Z=t=>(0,r.Z)(t)&&Number.isFinite(t)},906324:function(t,e){let i=(t,e=0)=>{let i="",r=e-1;for(;r>=0;)i=`${i}${t}`,r-=1;return i};e.Z=(t,e,r=" ",n="right")=>{let s=t+"",a=e-s.length;return a<=0?s:"left"===n?i(r,a)+s:"center"===n?i(r,Math.floor(a/2))+s+i(r,Math.ceil(a/2)):s+i(r,a)}},824100:function(t,e,i){i.d(e,{Z:function(){return a}});var r=i(843020),n=i(681747);let s=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function a(t){if(t instanceof Date)return t;if((0,n.Z)(t)){let e=s.exec(t);if(!e)return new Date(NaN);if(!e[8])return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0);let i=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(i-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,i,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return new Date((0,r.Z)(t)?NaN:Math.round(t))}}}]);
|